/* =================================================================
   tools/ipv6-subnet.css
   Auto-extracted from math.css (2026-05-11).
   Loaded via config/js-manifest.php → templates/partials/head-styles.php.
   ================================================================= */

/* =================================================================
   IPv6 SUBNET CALCULATOR — visualizations
   ================================================================= */

.math-ipv6-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--math-primary-soft), transparent);
    border: 1px solid var(--math-border);
    border-radius: var(--math-radius-md);
    margin-bottom: 6px;
}

.math-ipv6-summary-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.math-ipv6-summary-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
}

.math-ipv6-summary-value {
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 18px;
    font-weight: 800;
    color: var(--math-text);
    letter-spacing: 0.01em;
    word-break: break-all;
}

.math-ipv6-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1.5px solid;
    background: var(--math-surface);
    white-space: nowrap;
}

.math-ipv6-type-badge[data-type="global"] {
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.3);
    background: rgba(2, 132, 199, 0.08);
}
.math-ipv6-type-badge[data-type="linklocal"] {
    color: #ea580c;
    border-color: rgba(234, 88, 12, 0.3);
    background: rgba(234, 88, 12, 0.08);
}
.math-ipv6-type-badge[data-type="ula"] {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(22, 163, 74, 0.08);
}
.math-ipv6-type-badge[data-type="multicast"] {
    color: #db2777;
    border-color: rgba(219, 39, 119, 0.3);
    background: rgba(219, 39, 119, 0.08);
}
.math-ipv6-type-badge[data-type="loopback"] {
    color: #9333ea;
    border-color: rgba(147, 51, 234, 0.3);
    background: rgba(147, 51, 234, 0.08);
}
.math-ipv6-type-badge[data-type="unspecified"],
.math-ipv6-type-badge[data-type="reserved"],
.math-ipv6-type-badge[data-type="other"] {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.3);
    background: rgba(100, 116, 139, 0.08);
}

.math-ipv6-type-note {
    margin: 10px 0 4px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--math-text-soft);
    background: var(--math-surface-alt);
    border-left: 3px solid var(--math-primary);
    border-radius: 0 8px 8px 0;
}

.math-ipv6-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--math-border-light);
    text-align: left;
}

.math-ipv6-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--math-text-soft);
    margin-bottom: 12px;
}

.math-ipv6-section-title i {
    color: var(--math-primary);
    font-size: 14px;
}

/* ─── Hextet grid ─────────── */
.math-ipv6-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--math-text-soft);
    margin-bottom: 10px;
}

.math-ipv6-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.math-ipv6-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1.5px solid;
}

.math-ipv6-legend-swatch.is-network {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--math-primary);
}

.math-ipv6-legend-swatch.is-host {
    background: rgba(16, 185, 129, 0.22);
    border-color: var(--math-success);
}

.math-ipv6-legend-swatch.is-boundary {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 50%, rgba(16, 185, 129, 0.22) 50%);
    border-color: var(--math-primary);
}

.math-ipv6-hextet-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    padding: 12px 4px;
    background: var(--math-surface-alt);
    border-radius: 10px;
    border: 1px solid var(--math-border-light);
}

.math-ipv6-hextet {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 6px;
    min-width: 68px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    background: var(--math-surface);
    transition: all 0.18s ease;
}

.math-ipv6-hextet.is-network {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.35);
}

.math-ipv6-hextet.is-host {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

.math-ipv6-hextet.is-boundary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(16, 185, 129, 0.18));
    border-color: var(--math-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.math-ipv6-hextet-idx {
    font-family: 'SF Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    color: var(--math-text-muted);
    line-height: 1;
}

.math-ipv6-hextet-val {
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--math-text);
    line-height: 1;
}

.math-ipv6-hextet.is-network .math-ipv6-hextet-val { color: var(--math-primary); }
.math-ipv6-hextet.is-host .math-ipv6-hextet-val { color: var(--math-success); }

.math-ipv6-hextet-role {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--math-surface);
    color: var(--math-text-muted);
    border: 1px solid var(--math-border);
}

.math-ipv6-hextet.is-network .math-ipv6-hextet-role { color: var(--math-primary); border-color: rgba(99, 102, 241, 0.3); }
.math-ipv6-hextet.is-host .math-ipv6-hextet-role { color: var(--math-success); border-color: rgba(16, 185, 129, 0.3); }
.math-ipv6-hextet.is-boundary .math-ipv6-hextet-role { color: var(--math-primary); border-color: var(--math-primary); }

.math-ipv6-hextet-sep {
    align-self: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--math-text-muted);
    padding: 0 1px;
}

/* ─── Boundary hextet detail ─────────── */
.math-ipv6-boundary-detail {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--math-primary-soft);
    border-radius: 10px;
    border: 1px dashed var(--math-primary);
}

.math-ipv6-boundary-detail:empty {
    display: none;
}

.math-ipv6-boundary-title {
    font-size: 12.5px;
    color: var(--math-text);
    margin-bottom: 10px;
}

.math-ipv6-boundary-title i {
    color: var(--math-primary);
    margin-right: 4px;
}

.math-ipv6-boundary-title code {
    background: var(--math-surface);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.math-ipv6-boundary-bits {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
}

.math-ipv6-bbit {
    width: 22px;
    height: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 1.5px solid transparent;
    border-radius: 4px;
    background: var(--math-surface);
}

.math-ipv6-bbit.is-network {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.45);
}

.math-ipv6-bbit.is-host {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.45);
}

.math-ipv6-bbit.is-boundary {
    box-shadow: 3px 0 0 0 var(--math-primary);
}

.math-ipv6-bbit-val {
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--math-text);
    line-height: 1;
}

.math-ipv6-bbit.is-network .math-ipv6-bbit-val { color: var(--math-primary); }
.math-ipv6-bbit.is-host .math-ipv6-bbit-val { color: var(--math-success); }

.math-ipv6-bbit-pos {
    font-family: 'SF Mono', monospace;
    font-size: 7px;
    color: var(--math-text-muted);
    line-height: 1;
}

.math-ipv6-prefix-note {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--math-text-soft);
    background: var(--math-surface-alt);
    border-radius: 8px;
    border-left: 3px solid var(--math-primary);
    text-align: center;
}

/* ─── Notation compare (compressed vs expanded) ─────────── */
.math-ipv6-notation-compare {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--math-surface-alt);
    border-radius: 10px;
    border: 1px solid var(--math-border-light);
}

.math-ipv6-nota-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.math-ipv6-nota-label {
    flex: 0 0 auto;
    min-width: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--math-text-soft);
}

.math-ipv6-nota-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
}

.math-ipv6-nota-cell {
    padding: 3px 7px;
    background: var(--math-surface);
    color: var(--math-text);
    border: 1px solid var(--math-border);
    border-radius: 4px;
}

.math-ipv6-nota-cell.is-zero {
    color: var(--math-text-muted);
    background: color-mix(in srgb, var(--math-text-muted) 10%, var(--math-surface));
}

.math-ipv6-nota-sep {
    color: var(--math-text-muted);
    font-weight: 600;
}

.math-ipv6-nota-compress {
    padding: 3px 10px;
    background: var(--math-primary);
    color: #fff;
    border-radius: 4px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    margin: 0 2px;
}

.math-ipv6-nota-hint {
    margin-top: 4px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--math-text-soft);
    background: var(--math-primary-soft);
    border-radius: 8px;
}

.math-ipv6-nota-hint code {
    background: var(--math-surface);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--math-primary);
}

/* ─── Range block ─────────── */
.math-ipv6-range {
    padding: 14px;
    background: var(--math-surface-alt);
    border-radius: 10px;
    border: 1px solid var(--math-border-light);
}

.math-ipv6-range-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--math-text-soft);
    margin-top: 12px;
    margin-bottom: 6px;
}

.math-ipv6-range-label:first-child {
    margin-top: 0;
}

.math-ipv6-range-label i {
    font-size: 11px;
    color: var(--math-primary);
}

.math-ipv6-range-sub {
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--math-text);
    text-transform: none;
    letter-spacing: 0;
    background: var(--math-surface);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--math-border);
    margin-left: auto;
}

.math-ipv6-range-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    background: var(--math-surface);
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
}

.math-ipv6-range-hex {
    padding: 2px 5px;
    border-radius: 3px;
}

.math-ipv6-range-hex.is-network {
    background: rgba(99, 102, 241, 0.14);
    color: var(--math-primary);
}

.math-ipv6-range-hex.is-host {
    background: rgba(16, 185, 129, 0.14);
    color: var(--math-success);
}

.math-ipv6-range-hex.is-boundary {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(16, 185, 129, 0.2));
    color: var(--math-text);
    font-weight: 800;
}

.math-ipv6-range-sep {
    color: var(--math-text-muted);
}

.math-ipv6-range-math {
    margin-top: 12px;
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
    color: var(--math-text-soft);
    background: var(--math-primary-soft);
    border-radius: 8px;
}

.math-ipv6-range-math code {
    background: var(--math-surface);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--math-primary);
    word-break: break-all;
}

.math-ipv6-range-scale {
    margin-top: 6px;
    font-size: 11px;
    color: var(--math-text-muted);
    text-align: center;
    font-style: italic;
}

/* ─── Facts grid ─────────── */
.math-ipv6-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}

.math-ipv6-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--math-surface-alt);
    border: 1px solid var(--math-border-light);
    border-radius: 8px;
}

.math-ipv6-fact-key {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--math-text-muted);
}

.math-ipv6-fact-val {
    font-family: 'SF Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--math-text);
    word-break: break-all;
}

.math-ipv6-fact-val.math-ipv6-fact-mono {
    font-size: 11px;
}

/* Mobile */
@media (max-width: 640px) {
    .math-ipv6-summary-value {
        font-size: 15px;
    }
    .math-ipv6-hextet {
        min-width: 56px;
        padding: 8px 4px;
    }
    .math-ipv6-hextet-val {
        font-size: 12px;
    }
    .math-ipv6-hextet-idx {
        font-size: 8px;
    }
    .math-ipv6-hextet-role {
        font-size: 8px;
        padding: 1px 4px;
    }
    .math-ipv6-hextet-sep {
        font-size: 14px;
    }
    .math-ipv6-bbit {
        width: 18px;
        height: 24px;
    }
    .math-ipv6-bbit-val {
        font-size: 11px;
    }
    .math-ipv6-bbit-pos {
        font-size: 6px;
    }
    .math-ipv6-nota-label {
        min-width: 0;
        flex: 1 1 100%;
    }
    .math-ipv6-nota-body {
        font-size: 13px;
    }
    .math-ipv6-nota-cell {
        padding: 2px 5px;
    }
    .math-ipv6-range-line {
        font-size: 11px;
    }
    .math-ipv6-range-sub {
        margin-left: 0;
        font-size: 10px;
    }
}

