/* ═══════════════════════════════════════════════════════════════════════
   PayMate — "Golden Wattle" design system
   Eucalyptus green + wattle gold. Light & dark, mobile-first.
   Chart palettes validated for CVD separation & contrast on both surfaces.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand */
    --green-deepest: #0D2B1F;
    --green-deep: #123B2A;
    --green: #14563A;
    --gold: #FFC72C;
    --gold-deep: #E8A712;

    /* Light surfaces & ink */
    --bg: #F7F2E7;
    --surface: #FFFFFF;
    --surface-2: #FDFAF2;
    --border: #E4DCC8;
    --border-strong: #CFC5A9;
    --ink: #1C2A22;
    --ink-2: #52604F;
    --ink-3: #7A8676;
    --ink-on-brand: #F4F8F1;
    --gold-ink: #8A5A00;

    /* Chart palette (validated, light) — order: take-home, income tax,
       medicare, MLS, HELP, super */
    --c-net: #177A4C;
    --c-tax: #B45309;
    --c-medicare: #2563EB;
    --c-mls: #DC2626;
    --c-help: #7C3AED;
    --c-super: #0891B2;

    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--gold) 55%, transparent);
    --shadow-card: 0 1px 2px rgba(28, 42, 34, .05), 0 8px 24px -12px rgba(28, 42, 34, .18);
    --radius: 18px;
    --radius-sm: 11px;

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;

    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0A1B13;
    --surface: #11271B;
    --surface-2: #0D2117;
    --border: #23402F;
    --border-strong: #35543F;
    --ink: #EAF2E8;
    --ink-2: #A9BCA9;
    --ink-3: #7E937F;
    --gold-ink: #FFC72C;

    /* Chart palette (validated, dark) */
    --c-net: #2E9E63;
    --c-tax: #BA8800;
    --c-medicare: #4C8DF0;
    --c-mls: #E45B5B;
    --c-help: #9678E8;
    --c-super: #189DB8;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -12px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

.wrap {
    width: min(1120px, 100% - 2.5rem);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--gold);
    color: #1C2A22;
    padding: .55rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    z-index: 100;
}
.skip-link:focus { left: 8px; }

:is(button, input, select, summary, a):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
    background: var(--green-deepest);
    color: var(--ink-on-brand);
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(255, 199, 44, .18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: .7rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-decoration: none;
    color: inherit;
}

.brand-star {
    width: 26px;
    height: 26px;
    fill: var(--gold);
    filter: drop-shadow(0 0 6px rgba(255, 199, 44, .45));
}

.brand-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: .01em;
}
.brand-word em { font-style: normal; color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: .6rem; }

.country-switch {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}
.country-switch a {
    display: grid;
    place-items: center;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-decoration: none;
    color: rgba(244, 248, 241, .75);
    transition: background .15s, color .15s;
}
.country-switch a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.country-switch a.active { background: var(--gold); color: #1C2A22; }

.fy-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: .35rem .8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 199, 44, .45);
    color: var(--gold);
    white-space: nowrap;
}

.fy-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .45; transform: scale(.8); }
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .06);
    color: var(--ink-on-brand);
    cursor: pointer;
    transition: background .2s;
    padding: 0;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .14); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: none; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    background:
        radial-gradient(80rem 30rem at 85% -10%, rgba(255, 199, 44, .14), transparent 55%),
        radial-gradient(50rem 26rem at -10% 110%, rgba(23, 122, 76, .5), transparent 60%),
        var(--green-deepest);
    color: var(--ink-on-brand);
    padding: clamp(2.6rem, 7vw, 4.8rem) 0 clamp(3.2rem, 8vw, 5.4rem);
    overflow: hidden;
}

.southern-cross {
    position: absolute;
    right: clamp(.5rem, 6vw, 6rem);
    top: 50%;
    translate: 0 -50%;
    width: clamp(120px, 18vw, 210px);
    fill: var(--gold);
    opacity: .85;
}
.cross-star { filter: drop-shadow(0 0 5px rgba(255, 199, 44, .6)); }

.hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2rem, 5.4vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -.01em;
    margin: 0 0 .9rem;
    max-width: 15em;
}
.hero-title .gold { color: var(--gold); }

.hero-sub {
    margin: 0;
    max-width: 44ch;
    font-size: clamp(.98rem, 2vw, 1.12rem);
    color: rgba(244, 248, 241, .82);
}
.hero-sub strong { color: var(--gold); font-weight: 600; }

.hero-wave {
    position: absolute;
    inset: auto 0 -1px;
    height: 26px;
    background: var(--bg);
    border-radius: 100% 100% 0 0 / 200% 200% 0 0;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
.main-grid {
    display: grid;
    grid-template-columns: minmax(320px, 400px) 1fr;
    gap: 1.4rem;
    align-items: start;
    margin-top: -1.2rem;
    position: relative;
    z-index: 2;
    padding-bottom: 2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: clamp(1.1rem, 2.5vw, 1.5rem);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0 0 1rem;
    display: flex;
    align-items: baseline;
    gap: .6rem;
    flex-wrap: wrap;
}

.title-hint {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: .8rem;
    color: var(--ink-3);
}

.csv-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
    font: inherit;
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1.5px solid var(--border-strong);
    border-radius: 999px;
    padding: .3rem .8rem;
    cursor: pointer;
    transition: all .15s;
}
.csv-btn:hover { border-color: var(--green); color: var(--green); }
[data-theme="dark"] .csv-btn:hover { border-color: var(--gold); color: var(--gold); }
.csv-btn svg { width: 13px; height: 13px; }

.field.is-disabled { opacity: .45; pointer-events: none; }

.results { display: grid; gap: 1.4rem; min-width: 0; }

/* Grid/flex items must be allowed to shrink below their content width,
   otherwise the breakdown table blows out the column on small screens. */
.main-grid > *, .results > .card { min-width: 0; }

/* ── Form controls ────────────────────────────────────────────────────── */
.field { margin-bottom: 1.05rem; min-width: 0; }
.field-grow { flex: 1; }

.field-row { display: flex; gap: .8rem; }

.field-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--ink-2);
    margin-bottom: .4rem;
}

.hint-inline { font-weight: 500; color: var(--ink-3); }

input[type="number"], select {
    width: 100%;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface-2);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: .62rem .8rem;
    transition: border-color .15s;
}
input[type="number"]:hover, select:hover,
input[type="number"]:focus, select:focus { border-color: var(--green); }
[data-theme="dark"] input[type="number"]:hover,
[data-theme="dark"] select:hover,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] select:focus { border-color: var(--gold); }

select { cursor: pointer; }

.money-input { position: relative; display: flex; align-items: center; }
.money-prefix, .money-suffix {
    position: absolute;
    font-weight: 700;
    color: var(--ink-3);
    pointer-events: none;
}
.money-prefix { left: .8rem; }
.money-suffix { right: .8rem; }
.money-input:has(.money-prefix) input { padding-left: 1.7rem; }
.money-input:has(.money-suffix) input { padding-right: 1.9rem; }

#income { font-size: 1.15rem; }

/* Segmented control (columns adapt to the number of options) */
.seg-group {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--surface-2);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
    display: grid;
    place-items: center;
    padding: .48rem .25rem;
    border-radius: calc(var(--radius-sm) - 4px);
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-2);
    text-align: center;
    transition: all .15s;
    line-height: 1.2;
}
.seg input:checked + span { background: var(--green); color: #fff; }
.seg input:focus-visible + span { box-shadow: var(--focus-ring); }

/* Switches */
.switch-list {
    display: grid;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.05rem;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .68rem .85rem;
    cursor: pointer;
    background: var(--surface);
    transition: background .15s, opacity .2s;
}
.switch-row + .switch-row { border-top: 1px solid var(--border); }
.switch-row:hover { background: var(--surface-2); }
.switch-row.is-disabled { opacity: .45; pointer-events: none; }

.switch-title { display: block; font-weight: 600; font-size: .88rem; }
.switch-desc { display: block; font-size: .75rem; color: var(--ink-3); }

.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; }
.switch-track {
    display: block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: var(--border-strong);
    transition: background .2s;
    position: relative;
}
.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: translate .2s;
}
.switch input:checked + .switch-track { background: var(--green); }
[data-theme="dark"] .switch input:checked + .switch-track { background: var(--c-net); }
.switch input:checked + .switch-track::after { translate: 18px 0; }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus-ring); }

/* Advanced details */
.advanced {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    margin-bottom: 1.05rem;
}
.advanced summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .88rem;
    color: var(--ink-2);
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--gold-ink);
    border-bottom: 2px solid var(--gold-ink);
    rotate: -45deg;
    transition: rotate .2s;
    flex-shrink: 0;
}
.advanced[open] summary::before { rotate: 45deg; }
.advanced-body { margin-top: .9rem; }
.advanced-body .field { margin-bottom: .2rem; }

/* A headline option worth noticing — solid border, gold summary */
.advanced--feature {
    border-style: solid;
    border-color: color-mix(in srgb, var(--gold) 55%, var(--border-strong));
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}
.advanced--feature > summary { color: var(--gold-ink); }
.advanced--feature .advanced-body > .field-row { margin-bottom: .75rem; }
.advanced--feature .advanced-body > .field { margin-bottom: .9rem; }

.advanced-intro {
    margin: 0 0 1rem;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--ink-2);
}

/* Grouped sub-inputs inside a panel */
.subfields {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .7rem .8rem .1rem;
    margin: 0 0 .9rem;
    min-width: 0;
}
.subfields legend {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding-inline: .35rem;
}
.subfields .field-row { margin-bottom: .7rem; }
.subfields-note {
    margin: 0 0 .7rem;
    font-size: .76rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font: inherit;
    font-weight: 600;
    font-size: .85rem;
    color: var(--green);
    background: transparent;
    border: 1.5px solid var(--green);
    border-radius: 999px;
    padding: .5rem 1rem;
    cursor: pointer;
    transition: all .15s;
}
[data-theme="dark"] .share-btn { color: var(--gold); border-color: var(--gold); }
.share-btn:hover { background: var(--green); color: #fff; }
[data-theme="dark"] .share-btn:hover { background: var(--gold); color: #1C2A22; }
.share-btn svg { width: 15px; height: 15px; }

.fine-print { margin: 0; font-size: .72rem; color: var(--ink-3); }

/* ── Take-home hero card ──────────────────────────────────────────────── */
.takehome-card {
    background:
        radial-gradient(40rem 16rem at 110% -30%, rgba(255, 199, 44, .16), transparent 60%),
        linear-gradient(135deg, var(--green-deep), var(--green-deepest));
    border-color: color-mix(in srgb, var(--gold) 30%, transparent);
    color: var(--ink-on-brand);
}

.takehome-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
}

.takehome-label {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(244, 248, 241, .75);
}

.takehome-fy {
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(255, 199, 44, .4);
    border-radius: 999px;
    padding: .22rem .7rem;
    white-space: nowrap;
}

.takehome-figure {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    margin: .35rem 0 .15rem;
    flex-wrap: wrap;
}

#takeHomeBig {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6.5vw, 3.6rem);
    line-height: 1.05;
    color: var(--gold);
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

.takehome-per { font-size: 1rem; color: rgba(244, 248, 241, .7); font-weight: 500; }

.takehome-alt {
    font-size: .92rem;
    color: rgba(244, 248, 241, .85);
    margin-bottom: 1.1rem;
    font-variant-numeric: tabular-nums;
}
.takehome-alt b { color: #fff; font-weight: 600; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .6rem;
}

.stat {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-sm);
    padding: .55rem .7rem;
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.stat-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(244, 248, 241, .65);
    white-space: nowrap;
}

.stat-value {
    font-weight: 700;
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
}

.savings-note {
    margin-top: .9rem;
    font-size: .84rem;
    background: rgba(255, 199, 44, .13);
    border: 1px solid rgba(255, 199, 44, .35);
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    color: #FFE9A8;
}
.savings-note b { color: var(--gold); }

.savings-note.warn {
    background: rgba(228, 91, 91, .12);
    border-color: rgba(228, 91, 91, .4);
    color: #F5C6C6;
}
.savings-note.warn b { color: #FF9E9E; }

.savings-note + .savings-note { margin-top: .5rem; }

/* ── Donut ────────────────────────────────────────────────────────────── */
.donut-layout {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 4vw, 2.4rem);
    flex-wrap: wrap;
}

.donut-box {
    position: relative;
    width: min(230px, 62vw);
    flex-shrink: 0;
    margin-inline: auto;
}

#donutSvg circle.seg {
    fill: none;
    stroke-width: 26;
    stroke-linecap: butt;
    transition: stroke-dasharray .5s ease, stroke-dashoffset .5s ease;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
}

.donut-rate {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.9rem;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.donut-rate-label {
    font-size: .72rem;
    color: var(--ink-3);
    line-height: 1.25;
    font-weight: 500;
}

.legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .45rem;
    flex: 1;
    min-width: 220px;
}

.legend li {
    display: grid;
    grid-template-columns: 12px 1fr auto auto;
    align-items: center;
    gap: .6rem;
    font-size: .88rem;
    padding: .32rem .5rem;
    border-radius: 8px;
}
.legend li:hover { background: var(--surface-2); }

.legend-dot { width: 12px; height: 12px; border-radius: 4px; }
.legend-name { font-weight: 500; color: var(--ink-2); }
.legend-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-pct {
    font-size: .78rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
    min-width: 3.2em;
    text-align: right;
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; margin-inline: -.3rem; padding-inline: .3rem; }

table { border-collapse: collapse; width: 100%; font-size: .88rem; }

.breakdown th, .breakdown td,
.brackets th, .brackets td {
    text-align: right;
    padding: .55rem .65rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.breakdown th:first-child, .breakdown td:first-child,
.brackets th:first-child, .brackets td:first-child { text-align: left; }

thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-3);
    border-bottom: 2px solid var(--border);
}

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }

.breakdown .row-label { font-weight: 600; color: var(--ink-2); }
.breakdown .neg { color: var(--c-tax); }
.breakdown .pos { color: var(--c-net); }
.breakdown tr.total-row td {
    font-weight: 700;
    color: var(--ink);
    border-top: 2px solid var(--border-strong);
    background: color-mix(in srgb, var(--c-net) 7%, transparent);
}
.breakdown tr.total-row .row-label { color: var(--c-net); }
.breakdown tr.super-row td { color: var(--c-super); }
.breakdown tr.muted td { color: var(--ink-3); }

/* Bracket table */
.brackets td { padding-block: .62rem; }

.rate-bar-track {
    display: inline-block;
    vertical-align: middle;
    width: clamp(60px, 12vw, 130px);
    height: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-left: .6rem;
}
.rate-bar-fill { height: 100%; background: var(--border-strong); border-radius: 999px; }

tr.you-row { background: color-mix(in srgb, var(--gold) 13%, transparent); }
tr.you-row td:first-child { font-weight: 700; }
tr.you-row .rate-bar-fill { background: var(--gold-deep); }

.you-badge {
    display: inline-block;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--gold);
    color: #3A2C00;
    border-radius: 999px;
    padding: .1rem .5rem;
    margin-left: .5rem;
    vertical-align: 1px;
}

.chart-note { font-size: .78rem; color: var(--ink-3); margin: .8rem 0 0; }

/* ── Contract ↔ permanent ─────────────────────────────────────────────── */
.equiv { margin-bottom: 1.1rem; }

.equiv-row {
    display: flex;
    align-items: center;
    gap: clamp(.7rem, 3vw, 1.6rem);
    flex-wrap: wrap;
}

.equiv-side { display: grid; gap: .1rem; min-width: 0; }

.equiv-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.equiv-figure {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.35rem, 5vw, 1.9rem);
    line-height: 1.15;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.equiv-figure small { font-size: .6em; font-weight: 600; color: var(--ink-3); }
.equiv-side--to .equiv-figure { color: var(--c-net); }

.equiv-eq {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-deep);
    flex-shrink: 0;
}

.equiv-sub {
    margin: .7rem 0 0;
    font-size: .84rem;
    color: var(--ink-2);
    line-height: 1.5;
}
.equiv-sub b { color: var(--ink); }

/* Contract card's notes sit on the light surface, not the green hero card */
#contractCard .savings-note {
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    border-color: color-mix(in srgb, var(--gold) 45%, transparent);
    color: var(--ink);
}
#contractCard .savings-note b { color: var(--gold-ink); }

.compare .diff {
    color: var(--ink-3);
    font-weight: 600;
}
.compare tr.total-row .diff { color: var(--ink-2); }
.compare .diff.pos { color: var(--c-net); }
.compare .diff.neg { color: var(--c-tax); }

.th-hint {
    display: block;
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
    color: var(--ink-3);
}

/* ── Year comparison bars ─────────────────────────────────────────────── */
.yearbars { display: grid; gap: .55rem; }

.yearbar {
    display: grid;
    grid-template-columns: 4.6em 1fr;
    align-items: center;
    gap: .8rem;
}

.yearbar-label {
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}
.yearbar.is-selected .yearbar-label { color: var(--gold-ink); }

.yearbar-track {
    position: relative;
    height: 26px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}

.yearbar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 4px;
    background: color-mix(in srgb, var(--c-net) 45%, var(--surface));
    transition: width .5s ease;
    min-width: 2px;
}
.yearbar.is-selected .yearbar-fill { background: var(--c-net); }

.yearbar-value {
    position: absolute;
    right: .55rem;
    top: 50%;
    translate: 0 -50%;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}
.yearbar.is-selected .yearbar-value { color: var(--ink); font-weight: 700; }

/* ── Explainers ───────────────────────────────────────────────────────── */
.explain { padding: 1rem 0 3rem; }

.explain-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    margin: 0 0 1.2rem;
}

.explain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: .8rem;
}

.explain-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .9rem 1.1rem;
}

.explain-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .95rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
}
.explain-item summary::-webkit-details-marker { display: none; }
.explain-item summary::after {
    content: "+";
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gold-ink);
    transition: rotate .2s;
    flex-shrink: 0;
}
.explain-item[open] summary::after { rotate: 45deg; }

.explain-item p {
    margin: .7rem 0 0;
    font-size: .88rem;
    color: var(--ink-2);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--green-deepest);
    color: rgba(244, 248, 241, .75);
    padding: 2.2rem 0 3rem;
    font-size: .85rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .9rem;
    color: var(--ink-on-brand);
}
.footer-brand .brand-star { width: 20px; height: 20px; }
.footer-brand .brand-word { font-size: 1.1rem; }

.site-footer p { max-width: 70ch; margin: 0 0 .6rem; }
.site-footer a { color: var(--gold); text-underline-offset: 2px; }
.footer-fine { font-size: .75rem; color: rgba(244, 248, 241, .5); }

/* ── Sticky mobile bar ────────────────────────────────────────────────── */
.sticky-bar {
    position: fixed;
    left: .8rem;
    right: .8rem;
    bottom: calc(.8rem + env(safe-area-inset-bottom));
    z-index: 50;
    display: none;
    align-items: baseline;
    gap: .5rem;
    background: var(--green-deepest);
    color: var(--ink-on-brand);
    border: 1px solid rgba(255, 199, 44, .4);
    border-radius: 999px;
    padding: .65rem 1.2rem;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .45);
    translate: 0 120%;
    opacity: 0;
    transition: translate .3s ease, opacity .3s ease;
}
.sticky-bar.is-visible { translate: 0 0; opacity: 1; }

.sticky-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(244, 248, 241, .7);
}
.sticky-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}
.sticky-per { font-size: .78rem; color: rgba(244, 248, 241, .7); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .southern-cross { opacity: .3; }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .sticky-bar { display: flex; }
    .site-footer { padding-bottom: 6.5rem; }
}

@media (max-width: 480px) {
    .fy-chip { display: none; }
    .field-row { flex-wrap: wrap; }
    .field-row .field { flex: 1 1 100%; }
    .seg span { font-size: .72rem; padding-inline: .1rem; }
    .donut-layout { flex-direction: column; }
    .legend { width: 100%; min-width: 0; }
}

/* ── Motion & print ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
}

@media print {
    .site-header, .hero, .sticky-bar, .theme-toggle, .share-btn,
    .explain, .site-footer, .hero-wave { display: none !important; }
    body { background: #fff; }
    .main-grid { grid-template-columns: 1fr; margin-top: 0; }
    .card { box-shadow: none; break-inside: avoid; }
    .takehome-card { background: #fff; color: #000; border: 2px solid #000; }
    #takeHomeBig, .takehome-fy { color: #000; }
}

/* ── link grids on the calculator pages ──────────────────────────────── */

.salary-links { padding: 0 0 3rem; }

.salary-links-intro {
    color: var(--ink-2);
    font-size: .92rem;
    line-height: 1.6;
    margin: -.5rem 0 1.1rem;
    max-width: 60ch;
}

.salary-links-grid {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .5rem;
}

.salary-links-grid a {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    text-decoration: none;
    color: var(--ink-2);
    font-size: .88rem;
    transition: border-color .12s ease;
}

.salary-links-grid a:hover { border-color: var(--gold); }
.salary-links-grid strong { color: var(--ink); font-weight: 600; }
.salary-links-value { color: var(--ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; }

.salary-links-more { font-size: .9rem; font-weight: 600; margin: 0; }
.salary-links-more a { color: var(--gold-ink); text-decoration: none; }
.salary-links-more a:hover { text-decoration: underline; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .35rem;
    margin: 0 0 1rem;
}

.footer-links a {
    font-size: .8rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ink-on-brand) 22%, transparent);
    color: var(--ink-on-brand);
    text-decoration: none;
    transition: border-color .12s ease, color .12s ease;
}

.footer-links a:hover { border-color: var(--gold); color: var(--gold); }
