:root {
    color-scheme: dark;
    --bg: #050505;
    --surface: #0c0c0c;
    --panel: #141414;
    --panel-strong: #1b1b1b;
    --text: #ffffff;
    --text-muted: #a8a8a8;
    --border: #2b2b2b;
    --brand: #0096ff;
    --brand-strong: #45b6ff;
    --green: #22c55e;
    --amber: #f59e0b;
    --red: #ef4444;
    --radius: 8px;
    --shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html {
    margin: 0;
    padding: 0;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(0, 150, 255, 0.08) 0, rgba(0, 150, 255, 0) 360px),
        linear-gradient(180deg, #000 0%, #070707 100%);
}

a {
    color: var(--brand-strong);
    text-underline-offset: 3px;
}

a:hover { color: #7cccff; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.table-wrap:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 10px;
    z-index: 10;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #00131f;
    font-weight: 800;
    text-decoration: none;
}

.skip-link:focus {
    left: 10px;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding: 18px 0 16px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: #ffffff;
    font-size: 1.04rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.nav-brand img {
    width: 30px;
    height: 30px;
    border-radius: 24%;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-brand:hover {
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
    background: rgba(20, 20, 20, 0.72);
    color: #e8e8e8;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.pill-link:hover {
    border-color: rgba(0, 150, 255, 0.56);
    color: #ffffff;
    background: rgba(0, 150, 255, 0.18);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 28px;
    align-items: center;
    min-height: 440px;
    padding: 30px 0 46px;
}

.hero-copy {
    max-width: 620px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2.25rem, 7vw, 4.25rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.hero-lede {
    margin: 20px 0 0;
    max-width: 680px;
    color: #d1d1d1;
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.tool-shell {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
    background: rgba(16, 16, 16, 0.9);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    background: #101010;
}

.tool-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.segmented {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #090909;
}

.segmented:focus-within {
    border-color: rgba(0, 150, 255, 0.7);
}

.segmented button {
    min-width: 78px;
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.segmented button[aria-pressed="true"] {
    background: var(--brand);
    color: #00131f;
}

.tool-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.72fr);
    gap: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.field {
    display: grid;
    gap: 7px;
}

.field.full { grid-column: 1 / -1; }

label,
.label {
    color: #ededed;
    font-size: 0.84rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #070707;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    padding: 10px 12px;
}

select {
    appearance: auto;
}

input::placeholder { color: #707070; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hint {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.results-panel {
    display: grid;
    align-content: center;
    gap: 14px;
    min-height: 100%;
    padding: 18px;
    border-left: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(0, 150, 255, 0.13), rgba(0, 150, 255, 0.02)),
        #0b0b0b;
}

.result-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.result-main {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.2rem, 8vw, 4.2rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: 0;
}

.result-sub {
    margin: 0;
    color: #d6d6d6;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin-top: 2px;
    padding: 10px 16px;
    border: 1px solid rgba(0, 150, 255, 0.45);
    border-radius: var(--radius);
    background: rgba(0, 150, 255, 0.14);
    color: #cfe8ff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.share-btn:hover {
    border-color: rgba(0, 150, 255, 0.7);
    background: rgba(0, 150, 255, 0.22);
    color: #ffffff;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    padding: 11px;
}

.metric-card strong {
    display: block;
    color: #ffffff;
    font-size: 1.08rem;
}

.metric-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Divider that demarcates the primary tool from the supporting reference content. */
.section-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-divider span {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.section-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent);
}

.content-band {
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* The reference content reads as secondary, so the first band tucks in under
   the divider without a competing second rule. */
.section-divider + .content-band {
    border-top: 0;
    padding-top: 18px;
}

.band-header {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(260px, 1fr);
    gap: 26px;
    align-items: start;
    margin-bottom: 18px;
}

.band-header h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2.6vw, 1.65rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.band-header p {
    font-size: 0.95rem;
}

.band-header p,
.copy p,
.copy li {
    color: #c9c9c9;
}

.copy {
    max-width: 820px;
}

.copy h2,
.copy h3 {
    margin: 24px 0 10px;
    letter-spacing: 0;
}

.copy p {
    margin: 0 0 14px;
}

.copy ul {
    margin: 0 0 18px;
    padding-left: 22px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.info-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 16px;
}

.info-card h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
}

.info-card p {
    margin: 0;
    color: var(--text-muted);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    background: #070707;
    scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
}

.table-wrap::-webkit-scrollbar {
    height: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.36);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    border: 1px solid #242424;
    padding: 11px 12px;
    text-align: right;
    vertical-align: middle;
}

th {
    background: #151515;
    color: #ffffff;
    font-size: 0.82rem;
    text-transform: uppercase;
}

tbody th {
    text-transform: none;
}

th:first-child,
td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    background: #101010;
    font-weight: 800;
}

td {
    color: #e7e7e7;
    font-variant-numeric: tabular-nums;
}

.standard-cell {
    display: grid;
    gap: 2px;
}

.standard-cell strong {
    color: #ffffff;
    font-size: 1rem;
}

.standard-cell span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.level-beginner { border-top: 3px solid #7dd3fc; }
.level-intermediate { border-top: 3px solid var(--green); }
.level-advanced { border-top: 3px solid var(--amber); }
.level-pro { border-top: 3px solid #f97316; }
.level-elite { border-top: 3px solid var(--red); }

.quick-answer {
    margin-top: 14px;
    border: 1px solid rgba(0, 150, 255, 0.28);
    border-radius: var(--radius);
    background: rgba(0, 150, 255, 0.09);
    padding: 14px;
    color: #ddecff;
}

.quick-answer strong {
    color: #ffffff;
}

.faq-list details {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(16, 16, 16, 0.72);
    padding: 14px 16px;
    margin: 0 0 10px;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 700;
    color: #ffffff;
    list-style: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
    content: "+";
    float: right;
    color: var(--brand-strong);
    font-weight: 800;
}

.faq-list details[open] summary::after { content: "−"; }

.faq-list details p {
    margin: 12px 0 0;
    color: #b8b8b8;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.example-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 16px;
}

.example-card h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
}

.example-card p {
    margin: 0;
    color: var(--text-muted);
}

.example-card .calc-result {
    display: block;
    margin-top: 10px;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
    background: rgba(20, 20, 20, 0.72);
    color: #e8e8e8;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.related-links a:hover {
    border-color: rgba(0, 150, 255, 0.56);
    color: #ffffff;
    background: rgba(0, 150, 255, 0.18);
}

.volume-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.volume-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.volume-badge.is-losing { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.14); }
.volume-badge.is-maintaining { color: #fcd34d; border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.14); }
.volume-badge.is-growing { color: #7cccff; border-color: rgba(0, 150, 255, 0.5); background: rgba(0, 150, 255, 0.16); }
.volume-badge.is-optimal { color: #86efac; border-color: rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.16); }
.volume-badge.is-junk { color: #d8b4fe; border-color: rgba(168, 85, 247, 0.5); background: rgba(168, 85, 247, 0.16); }

.volume-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.volume-legend li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.volume-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.volume-legend .dot.is-losing { background: #ef4444; }
.volume-legend .dot.is-maintaining { background: #f59e0b; }
.volume-legend .dot.is-growing { background: #0096ff; }
.volume-legend .dot.is-optimal { background: #22c55e; }
.volume-legend .dot.is-junk { background: #a855f7; }

.comparison-table-wrap table {
    min-width: 640px;
}

.comparison-table-wrap th:first-child,
.comparison-table-wrap td:first-child {
    position: static;
    min-width: 140px;
}

.footer {
    padding: 28px 0 42px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 860px) {
    .hero,
    .tool-body,
    .band-header {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 0;
        padding-top: 18px;
    }

    .results-panel {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .info-grid,
    .example-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .top-nav {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .nav-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar { display: none; }

    h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .tool-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .segmented {
        width: 100%;
    }

    .segmented button {
        min-width: 0;
    }
}


/* === Grouped site navigation === */
.site-nav{display:flex;align-items:center;justify-content:space-between;gap:10px 18px;flex-wrap:wrap;margin-bottom:18px;position:relative;z-index:50;}
.site-nav .brand{display:inline-flex;align-items:center;gap:9px;text-decoration:none;color:#e6edf8;font-weight:700;font-size:1.02rem;}
.site-nav .brand img{border-radius:7px;display:block;}
.site-nav .menu{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.site-nav .nav-item{display:inline-flex;align-items:center;min-height:40px;padding:8px 14px;border-radius:999px;color:#5ea3ff;background:rgba(20,31,52,.72);border:1px solid rgba(94,163,255,.26);font-size:.92rem;text-decoration:none;cursor:pointer;white-space:nowrap;list-style:none;transition:background-color .2s ease,color .2s ease;}
.site-nav .nav-item:hover{color:#fff;background:#5ea3ff;}
.site-nav summary.nav-item{list-style:none;}
.site-nav summary.nav-item::-webkit-details-marker{display:none;}
.site-nav summary.nav-item::after{content:"";width:6px;height:6px;margin-left:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-1px);transition:transform .2s ease;}
.site-nav .nav-group{position:relative;}
.site-nav .nav-group[open]>summary.nav-item::after{transform:rotate(-135deg) translateY(1px);}
.site-nav .nav-drop{position:absolute;top:calc(100% + 6px);left:0;min-width:210px;display:flex;flex-direction:column;gap:2px;padding:8px;background:#0f1728;border:1px solid #2b3a57;border-radius:12px;box-shadow:0 18px 44px rgba(0,0,0,.42);z-index:60;}
.site-nav .nav-drop a{padding:9px 12px;border-radius:8px;color:#e6edf8;text-decoration:none;font-size:.92rem;white-space:nowrap;}
.site-nav .nav-drop a:hover{background:rgba(94,163,255,.16);color:#fff;}
@media (max-width:640px){
.site-nav{gap:10px;}
.site-nav .menu{width:100%;}
.site-nav .nav-group{position:static;}
.site-nav .nav-drop{position:static;min-width:0;width:100%;margin-top:4px;box-shadow:none;background:rgba(94,163,255,.06);border-color:rgba(94,163,255,.18);}
}
