/* ── Subnet Calculator – Bit Bar ────────────────────────────────────────── */
.subnet-bit-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    line-height: 1;
}
.subnet-bit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 28px;
    border-radius: 3px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.subnet-bit:hover {
    transform: scale(1.15);
    z-index: 1;
}
.subnet-bit.network-bit {
    background: rgba(99, 102, 241, 0.25);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.4);
}
.subnet-bit.host-bit {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.subnet-bit.octet-sep {
    margin-left: 6px;
}
.legend-swatch {
    width: 20px;
    height: 20px;
    font-size: 9px;
}

/* ── Result value ──────────────────────────────────────────────────────── */
.subnet-result-value {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ── Split bar visualization ───────────────────────────────────────────── */
.subnet-split-bar {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    min-height: 52px;
}
.subnet-split-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease;
}
.subnet-split-segment:last-child {
    border-right: none;
}
.subnet-split-segment:nth-child(4n+1) { background: rgba(99, 102, 241, 0.2); }
.subnet-split-segment:nth-child(4n+2) { background: rgba(16, 185, 129, 0.2); }
.subnet-split-segment:nth-child(4n+3) { background: rgba(139, 92, 246, 0.2); }
.subnet-split-segment:nth-child(4n)   { background: rgba(245, 158, 11, 0.2); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .subnet-bit {
        width: 16px;
        height: 22px;
        font-size: 9px;
    }
    .subnet-bit.octet-sep {
        margin-left: 3px;
    }
    .subnet-split-segment {
        font-size: 10px;
    }
    .subnet-table {
        font-size: 12px;
    }
}

/* ── Table styling ─────────────────────────────────────────────────────── */
.subnet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.subnet-table th,
.subnet-table td {
    padding: 8px 12px;
    text-align: start;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}
.subnet-table th {
    font-size: 12px;
    font-weight: 600;
    color: rgba(128, 128, 128, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.subnet-table tr:last-child td {
    border-bottom: none;
}
.subnet-table code {
    font-size: inherit;
}
.subnet-results-table,
.subnet-split-table {
    overflow-x: auto;
}
