/* ==========================================================================
   Budgie design system
   Mobile first. Dark by default, light available. System fonts so it feels
   native everywhere (SF on Apple, Segoe on Windows, Roboto on Android).
   ========================================================================== */

:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, Inter, system-ui, sans-serif;

    --gold: #F5B83D;
    --gold-strong: #FFA928;
    --gold-soft: rgba(245, 184, 61, .14);
    --gold-gradient: linear-gradient(135deg, #FFD36E 0%, #F5B83D 45%, #FF8A3D 100%);
    --mint: #3DDC97;
    --mint-soft: rgba(61, 220, 151, .14);
    --coral: #FF6B6B;
    --coral-soft: rgba(255, 107, 107, .14);
    --sky: #6CB4FF;
    --sky-soft: rgba(108, 180, 255, .14);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    --tab-height: 64px;
    --sidebar-width: 248px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);

    color-scheme: dark;
    --bg: #0B0C10;
    --bg-glow: radial-gradient(1200px 600px at 80% -10%, rgba(245, 184, 61, .10), transparent 60%),
               radial-gradient(900px 500px at -10% 10%, rgba(108, 180, 255, .06), transparent 60%);
    --surface: #14161C;
    --surface-2: #1B1E26;
    --surface-3: #242833;
    --glass: rgba(20, 22, 28, .72);
    --border: rgba(255, 255, 255, .07);
    --border-strong: rgba(255, 255, 255, .14);
    --text: #F4F5F7;
    --text-2: #A3A8B4;
    --text-3: #6B7180;
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px rgba(0, 0, 0, .35);
    --chart-fill-top: rgba(245, 184, 61, .28);
    --chart-fill-bottom: rgba(245, 184, 61, 0);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: #F6F5F2;
        --bg-glow: radial-gradient(1200px 600px at 80% -10%, rgba(245, 184, 61, .16), transparent 60%);
        --surface: #FFFFFF;
        --surface-2: #F3F2EE;
        --surface-3: #E9E7E1;
        --glass: rgba(255, 255, 255, .78);
        --border: rgba(20, 22, 28, .08);
        --border-strong: rgba(20, 22, 28, .16);
        --text: #14161C;
        --text-2: #5A606C;
        --text-3: #8C919C;
        --shadow: 0 1px 2px rgba(20, 22, 28, .04), 0 8px 24px rgba(20, 22, 28, .06);
        --gold: #E09A12;
        --mint: #12A86B;
        --coral: #E5484D;
        --chart-fill-top: rgba(224, 154, 18, .22);
        --chart-fill-bottom: rgba(224, 154, 18, 0);
    }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #F6F5F2;
    --bg-glow: radial-gradient(1200px 600px at 80% -10%, rgba(245, 184, 61, .16), transparent 60%);
    --surface: #FFFFFF;
    --surface-2: #F3F2EE;
    --surface-3: #E9E7E1;
    --glass: rgba(255, 255, 255, .78);
    --border: rgba(20, 22, 28, .08);
    --border-strong: rgba(20, 22, 28, .16);
    --text: #14161C;
    --text-2: #5A606C;
    --text-3: #8C919C;
    --shadow: 0 1px 2px rgba(20, 22, 28, .04), 0 8px 24px rgba(20, 22, 28, .06);
    --gold: #E09A12;
    --mint: #12A86B;
    --coral: #E5484D;
    --chart-fill-top: rgba(224, 154, 18, .22);
    --chart-fill-bottom: rgba(224, 154, 18, 0);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-glow);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.pos { color: var(--mint); }
.neg { color: var(--coral); }
.gold { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- App shell ---------- */

.shell { min-height: 100dvh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: calc(env(safe-area-inset-top) + 10px) var(--space-4) 10px;
    background: var(--glass);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title small { display: block; font-size: 12px; color: var(--text-3); }
.topbar-title strong { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; }

.main {
    padding: var(--space-4) var(--space-4) calc(var(--tab-height) + env(safe-area-inset-bottom) + var(--space-6));
    max-width: 1180px;
    margin: 0 auto;
    view-transition-name: main;
}

.sidebar { display: none; }

.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: calc(var(--tab-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-top: 1px solid var(--border);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 550;
    color: var(--text-3);
    transition: color .2s var(--ease);
}

.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .icon { stroke: var(--gold); }

.tab-fab {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-top: -22px;
    border: 0;
    border-radius: 18px;
    background: var(--gold-gradient);
    color: #1A1204;
    box-shadow: 0 8px 24px rgba(245, 160, 40, .35), 0 0 0 4px var(--bg);
    cursor: pointer;
    transition: transform .25s var(--spring);
}

.tab-fab:active { transform: scale(.92); }
.tab-fab .icon { stroke-width: 2.2; }

@media (min-width: 960px) {
    .shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; }
    .tabbar, .topbar .brand { display: none; }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        padding: var(--space-5) var(--space-4);
        border-right: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface) 55%, transparent);
    }

    .sidebar .brand { padding: 0 var(--space-2) var(--space-5); }

    .nav-link {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: 10px 12px;
        border-radius: 12px;
        color: var(--text-2);
        font-weight: 550;
        transition: background .2s var(--ease), color .2s var(--ease);
    }

    .nav-link:hover { background: var(--surface-2); color: var(--text); }
    .nav-link[aria-current="page"] { background: var(--surface-2); color: var(--text); }
    .nav-link[aria-current="page"] .icon { stroke: var(--gold); }

    .sidebar-cta { margin-top: var(--space-4); }
    .sidebar-foot { margin-top: auto; font-size: 13px; color: var(--text-3); padding: 0 var(--space-2); }

    .main { padding: var(--space-6) var(--space-6) var(--space-7); }
}

/* ---------- Cards & layout ---------- */

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.grid-today { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }

@media (min-width: 1100px) {
    .grid-today { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
    .grid-today > .span-all { grid-column: 1 / -1; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-5);
}

.card-tight { padding: var(--space-4); }
.card-flush { padding: 0; overflow: hidden; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card-head h2 { font-size: 17px; }

.section-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) 0 var(--space-5); }
.page-head p { margin-top: 4px; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding: var(--space-5) var(--space-5) 0; }

.hero::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 70%;
    aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(245, 184, 61, .18), transparent);
    pointer-events: none;
}

.hero-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }

.hero-value {
    margin: 6px 0 4px;
    font-family: var(--font-display);
    font-size: clamp(44px, 11vw, 64px);
    font-weight: 750;
    letter-spacing: -.045em;
    line-height: 1;
}

.hero-value .cents { font-size: .45em; letter-spacing: -.01em; color: var(--text-2); font-weight: 650; }
.hero-sub { color: var(--text-2); font-size: 14px; }

.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 550;
    color: var(--text-2);
    white-space: nowrap;
}

.chip strong { color: var(--text); font-weight: 650; }
.chip-gold { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.chip-gold strong { color: var(--gold); }
.chip-coral { background: var(--coral-soft); border-color: transparent; color: var(--coral); }
.chip-coral strong { color: var(--coral); }

/* ---------- Runway chart ---------- */

.runway { position: relative; height: 210px; margin: var(--space-4) calc(var(--space-5) * -1) 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
@media (min-width: 960px) { .runway { height: 250px; } }
.runway svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.runway .area { fill: url(#runway-fill); }
.runway .line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.runway .ghost { fill: none; stroke: var(--coral); stroke-width: 2; stroke-dasharray: 6 5; opacity: 0; transition: opacity .35s var(--ease); }
.runway.has-ghost .ghost { opacity: 1; }
.runway .zero { stroke: var(--coral); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.runway .grid { stroke: var(--border); stroke-width: 1; }
.runway .scrub-line { stroke: var(--text-3); stroke-width: 1; opacity: 0; }
.runway.scrubbing .scrub-line { opacity: 1; }

.runway-label { position: absolute; font-size: 11px; font-weight: 600; color: var(--text-3); pointer-events: none; white-space: nowrap; }
.runway-month { bottom: 6px; transform: translateX(-50%); }
.runway-grid-label { left: var(--space-5); transform: translateY(-120%); }
.runway-low { margin-top: 12px; color: var(--text-2); }
.runway-low.above { margin-top: -30px; }
.runway-low strong { color: var(--text); }
.runway-low-middle { transform: translateX(-50%); }
.runway-low-end { transform: translateX(-100%); }
.runway-low-start { transform: translateX(-10px); }
.runway.scrubbing .runway-low { opacity: 0; }

.runway-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--bg); border: 2.5px solid var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); pointer-events: none; }
.runway-scrub-dot { opacity: 0; background: var(--gold); transition: opacity .15s; }
.runway.scrubbing .runway-scrub-dot { opacity: 1; }

.runway-tip {
    position: absolute;
    top: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity .15s;
}

.runway.scrubbing .runway-tip { opacity: 1; }
.runway-tip strong { display: block; font-size: 15px; color: var(--text); }
.runway-range { display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-2); }
.runway-range a { padding: 5px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: var(--text-3); }
.runway-range a[aria-current="true"] { background: var(--surface-3); color: var(--text); }

/* ---------- What if ---------- */

.whatif { position: relative; overflow: hidden; }

.whatif::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(245, 184, 61, .55), transparent 40%, transparent 70%, rgba(255, 138, 61, .35));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.whatif-title { display: flex; align-items: center; gap: 8px; }
.whatif-title .icon { stroke: var(--gold); }

.money-input {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: var(--space-4) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--border-strong);
    transition: border-color .2s var(--ease);
}

.money-input:focus-within { border-color: var(--gold); }
.money-input span { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--text-3); }

.money-input input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 750;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.money-input input::placeholder { color: var(--text-3); }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
    display: block;
    padding: 8px 4px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    transition: all .2s var(--ease);
}

.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.segmented input:focus-visible + span { outline: 2px solid var(--gold); }

.impact { display: grid; gap: var(--space-3); margin-top: var(--space-5); }

.impact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: 14px;
    background: var(--surface-2);
    opacity: 0;
    transform: translateY(8px);
    animation: rise .45s var(--ease) forwards;
}

.impact-row:nth-child(2) { animation-delay: .06s; }
.impact-row:nth-child(3) { animation-delay: .12s; }
.impact-row:nth-child(4) { animation-delay: .18s; }

.impact-row .label { font-size: 13px; color: var(--text-2); }
.impact-row .value { font-weight: 650; text-align: right; }
.impact-row .value small { display: block; font-size: 12px; font-weight: 550; }

.truecost {
    padding: var(--space-4);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(245, 184, 61, .16), rgba(255, 138, 61, .08));
    border: 1px solid rgba(245, 184, 61, .28);
    opacity: 0;
    transform: translateY(8px);
    animation: rise .5s var(--ease) .24s forwards;
}

.truecost-value { font-family: var(--font-display); font-size: 32px; font-weight: 750; letter-spacing: -.03em; color: var(--gold); margin: 2px 0 6px; }
.truecost p { color: var(--text-2); font-size: 13px; }

@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Lists ---------- */

.list { display: flex; flex-direction: column; }
.list-day { padding: var(--space-4) var(--space-5) var(--space-2); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

.item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px var(--space-5);
    border-top: 1px solid var(--border);
    transition: background .15s;
}

.list-day + .item { border-top: 0; }
.item:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    color: var(--avatar-fg, var(--text));
    background: var(--avatar-bg, var(--surface-3));
}

.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item-amount { text-align: right; font-weight: 650; white-space: nowrap; }
.item-amount small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.tag-overdue { background: var(--coral-soft); color: var(--coral); }
.tag-confirmed { background: var(--sky-soft); color: var(--sky); }
.tag-auto { background: var(--surface-3); color: var(--text-2); }
.tag-income { background: var(--mint-soft); color: var(--mint); }

.item-actions { display: flex; gap: 4px; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: background .15s, color .15s, transform .2s var(--spring);
}

.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.ok:hover { color: var(--mint); }
.icon-btn.skip:hover { color: var(--coral); }

.item.leaving { animation: leave .35s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(24px); height: 0; padding-block: 0; } }

.month { position: sticky; top: calc(env(safe-area-inset-top) + 58px); z-index: 5; display: flex; justify-content: space-between; padding: 10px var(--space-5); background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-weight: 650; }
@media (min-width: 960px) { .month { top: 0; } }

/* ---------- Forms & buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-2);
    font-weight: 650;
    cursor: pointer;
    transition: transform .2s var(--spring), background .2s, border-color .2s;
}

.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--gold-gradient); border-color: transparent; color: #1A1204; box-shadow: 0 6px 18px rgba(245, 160, 40, .25); }
.btn-primary:hover { background: var(--gold-gradient); filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); }
.field-error { font-size: 12.5px; color: var(--coral); }

.input, select.input, textarea.input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-2);
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
}

.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }

/* Date pickers have a built-in minimum width (wide on iOS) that pushes them past their column; let them fit it. */
input.input[type="date"] { min-width: 0; -webkit-appearance: none; appearance: none; text-align: left; }
input.input[type="date"]::-webkit-date-and-time-value { text-align: left; }

.form-grid { display: grid; gap: var(--space-4); }
.form-grid > * { min-width: 0; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 0; }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.toggle input:checked { background: var(--mint); }
.toggle input:checked::after { transform: translateX(18px); }

/* ---------- Alerts, stats, empty ---------- */

.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius); font-size: 14px; }
.alert .icon { margin-top: 1px; }
.alert-coral { background: var(--coral-soft); color: var(--coral); }
.alert-gold { background: var(--gold-soft); color: var(--gold); }
.alert strong { color: inherit; }
.alert p { color: var(--text-2); margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }

.empty { text-align: center; padding: var(--space-7) var(--space-5); color: var(--text-2); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto var(--space-3); stroke: var(--gold); }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gold-gradient); }

/* ---------- Sheet (bottom on mobile, dialog on desktop) ---------- */

dialog.sheet {
    width: 100%;
    max-width: 560px;
    max-height: 92dvh;
    margin: auto auto 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 28px 28px 0 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .4);
    overflow: auto;
}

dialog.sheet::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); }
dialog.sheet[open] { animation: sheet-in .4s var(--ease); }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 10px auto 0; }
.sheet-body { padding: var(--space-4) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom)); }

@media (min-width: 640px) {
    dialog.sheet { margin: auto; border-radius: 28px; }
    .sheet-grip { display: none; }
}

@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + 16px);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    font-weight: 600;
    transform: translate(-50%, 20px);
    opacity: 0;
    transition: all .3s var(--ease);
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast button { border: 0; background: none; color: var(--gold); font-weight: 700; cursor: pointer; }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* ---------- Auth ---------- */

.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-5); }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); text-align: center; }
.auth-brand .brand-mark { width: 64px; height: 64px; }
.auth-brand h1 { font-size: 30px; }
.auth-foot { text-align: center; margin-top: var(--space-5); color: var(--text-2); font-size: 14px; }
.auth-foot a { color: var(--gold); font-weight: 650; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@view-transition { navigation: auto; }
::view-transition-old(main) { animation: .18s var(--ease) both fade-out; }
::view-transition-new(main) { animation: .28s var(--ease) both fade-in; }
@keyframes fade-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Plan history ---------- */

.history-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.history-bars span { flex: 1; min-height: 4px; border-radius: 5px 5px 2px 2px; background: var(--gold-gradient); opacity: .85; }
.history-bars span:last-child { opacity: 1; box-shadow: 0 0 0 2px var(--gold-soft); }

/* ---------- Standalone (installed) tweaks ---------- */

.standalone .topbar { padding-top: calc(env(safe-area-inset-top) + 6px); }

/* ---------- Compact rows on phones ---------- */

.item-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.item-meta > * { flex-shrink: 0; }
.item-meta > span:last-child:not(.tag) { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 520px) {
    .item { padding: 11px var(--space-4); gap: 10px; }
    .list-day { padding-inline: var(--space-4); }
    .avatar { width: 36px; height: 36px; border-radius: 12px; font-size: 14px; }
    .item-amount { font-size: 14px; }
    .item-amount small { font-size: 11.5px; }
    .item > .icon-sm.faint { display: none; }
    .item-actions .icon-btn { width: 30px; height: 30px; }
    .card:not(.card-flush) { padding: var(--space-4); }
    .card { border-radius: 20px; }
    .hero { padding: var(--space-5) var(--space-4) 0; }
    .runway { margin-inline: calc(var(--space-4) * -1); }
    .month { padding-inline: var(--space-4); font-size: 14px; }
}

/* ---------- Loan outlook ---------- */

.parity {
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(245, 184, 61, .16), rgba(61, 220, 151, .08));
    border: 1px solid rgba(245, 184, 61, .26);
}

.parity-label { font-size: 13px; font-weight: 650; color: var(--gold); }
.parity-value { font-family: var(--font-display); font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin: 2px 0 4px; }

.loan-chart { position: relative; height: 170px; margin-top: var(--space-4); }
.loan-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loan-chart path { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.loan-chart .balance { stroke: var(--text); stroke-width: 2.2; }
.loan-chart .offset { stroke: var(--gold); stroke-width: 2.4; }
.loan-chart .flat { stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 5 5; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: var(--space-3); font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.swatch.balance { background: var(--text); }
.swatch.offset { background: var(--gold); }
.swatch.flat { background: repeating-linear-gradient(90deg, var(--text-3) 0 4px, transparent 4px 7px); }

/* ---------- Rate history ---------- */

.rate-history { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.rate-history h3 { font-size: 15px; }
.rate-history .list { margin-top: var(--space-2); }
.rate-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--border); }
.rate-row:first-child { border-top: 0; }
.rate-row strong { font-size: 15px; margin-right: 6px; }
.rate-row form { margin: 0; }

/* ---------- Statement (Timeline) ----------
   Phone: description + red/green amount, date + running balance underneath.
   Wider: Date | Description | Debit | Credit | Balance columns, like a bank statement. */

.statement { font-variant-numeric: tabular-nums; }
.st-head { display: none; }
.st-num { text-align: right; }

.st-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "desc amount act" "date balance act";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: 2px;
    padding: 11px var(--space-4);
    border-top: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}

.st-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.st-row.leaving { animation: leave .35s var(--ease) forwards; }
.st-date { grid-area: date; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.st-desc { grid-area: desc; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-desc strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-desc .item-meta:empty { display: none; }
.st-debit, .st-credit { display: none; }
.st-amount { grid-area: amount; text-align: right; font-weight: 650; white-space: nowrap; }
.st-balance { grid-area: balance; text-align: right; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.st-act { grid-area: act; }
.st-card .st-desc strong { color: var(--text-2); font-weight: 500; }
.st-opening { cursor: default; background: var(--gold-soft); }
.st-opening .st-balance { color: var(--text); font-weight: 700; font-size: 14px; }

.st-month {
    position: sticky;
    top: calc(env(safe-area-inset-top) + 58px);
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    padding: 12px var(--space-4) 8px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.st-month span { font-size: 12.5px; }

.st-total {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 10px var(--space-4) 14px;
    border-top: 1px dashed var(--border-strong);
    font-size: 13px;
    color: var(--text-2);
}

.st-total .st-balance { font-size: 13px; font-weight: 700; color: var(--text); }
.st-totals-mobile { margin-left: auto; }
.statement .st-balance.neg { color: var(--coral); }

@media (min-width: 720px) {
    .st-head, .st-row, .st-total {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr) 120px 120px 132px 40px;
        grid-template-areas: none;
        column-gap: var(--space-4);
        align-items: center;
        padding-inline: var(--space-5);
    }

    .st-head {
        padding-block: 12px;
        font-size: 12px;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--text-3);
    }

    .st-row > *, .st-total > * { grid-area: auto; }
    .st-date { font-size: 13px; color: var(--text-2); }
    .st-debit, .st-credit { display: block; text-align: right; }
    .st-debit { color: var(--coral); }
    .st-credit { color: var(--mint); }
    .st-amount, .st-totals-mobile { display: none; }
    .st-balance { font-size: 14px; color: var(--text); font-weight: 600; }
    .st-month { padding-inline: var(--space-5); }
    .st-total > span:first-child { grid-column: 1 / 3; }
    .st-total .st-debit, .st-total .st-credit { font-weight: 650; }
    .st-total .st-balance { font-size: 14px; }
}

@media (max-width: 600px) {
    .page-head { flex-wrap: wrap; align-items: flex-start; }
    .page-head > .runway-range { width: 100%; }
    .page-head > .runway-range a { flex: 1; text-align: center; white-space: nowrap; }
}

.st-recent { cursor: default; }
.st-recent .st-act { grid-row: 1 / 3; }
@media (min-width: 720px) { .st-recent .st-act { grid-row: auto; } .st-head + .st-row, .recent .st-act .btn { white-space: nowrap; } }
.page-head > .row { margin-left: auto; }

.statement .st-not-in-balance .st-debit,
.statement .st-not-in-balance .st-credit { color: var(--text-3); }
.statement .st-skipped .st-desc strong,
.statement .st-skipped .st-amount,
.statement .st-skipped .st-debit,
.statement .st-skipped .st-credit { text-decoration: line-through; color: var(--text-3); }

/* ---------- Bill lifecycle ---------- */

.lifecycle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); }
.lifecycle span { display: flex; align-items: center; gap: 6px; }
.lifecycle span + span::before { content: ""; width: 18px; height: 1px; background: var(--border-strong); }
.lifecycle span.current { color: var(--gold); }

/* ---------- Sheet close button ---------- */

dialog.sheet { position: fixed; }
.sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s, color .15s, transform .2s var(--spring);
}

.sheet-close:hover { background: var(--surface-3); color: var(--text); }
.sheet-close:active { transform: scale(.9); }
dialog.sheet .sheet-body > :first-child { padding-right: 40px; }

/* ---------- Timeline what-if ---------- */

:root { --amber: #F5A524; --amber-soft: rgba(245, 165, 36, .15); }
.warn { color: var(--amber); }
.statement .st-balance.warn { color: var(--amber); }

.tag-whatif { background: var(--gold-soft); color: var(--gold); }

.statement .st-whatif {
    cursor: default;
    background: linear-gradient(90deg, rgba(245, 184, 61, .12), rgba(245, 184, 61, .03));
    box-shadow: inset 3px 0 0 var(--gold);
}

.statement .st-whatif .st-desc strong { color: var(--gold); }
.st-was { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); }
.statement .st-balance .st-was { color: var(--text-3); }

.whatif-panel .whatif-add { margin-top: var(--space-4); display: grid; gap: var(--space-3); }
.whatif-direction { max-width: 280px; }
.whatif-fields { display: grid; gap: var(--space-3); grid-template-columns: 1fr 1fr; align-items: end; }
.whatif-fields .field:nth-child(2) { grid-column: 1 / -1; }
.whatif-fields .btn { grid-column: 1 / -1; }

@media (min-width: 900px) {
    .whatif-fields { grid-template-columns: 140px minmax(0, 1fr) 160px 150px auto; }
    .whatif-fields .field:nth-child(2), .whatif-fields .btn { grid-column: auto; }
}

.whatif-items { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.whatif-item { display: flex; align-items: center; gap: var(--space-3); padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.whatif-item .item-meta { display: block; margin-top: 2px; }

.whatif-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-top: var(--space-4); }
@media (min-width: 900px) { .whatif-summary { grid-template-columns: repeat(4, 1fr); } }
.whatif-summary .stat { background: var(--surface-2); }
.whatif-summary .stat-value.warn { color: var(--amber); }

.floor-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.floor-form label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.floor-form .field-hint { flex-basis: 100%; }

.whatif-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: 10px var(--space-4);
    border-radius: var(--radius);
    background: var(--gold-soft);
    border: 1px solid rgba(245, 184, 61, .3);
    font-size: 13.5px;
}

.whatif-bar .icon { stroke: var(--gold); }
.whatif-bar strong { color: var(--gold); }

/* ---------- Phones: no quick-pay tick; tap the row instead (more room for names and amounts) ---------- */

@media (max-width: 719px) {
    .item-actions:has([data-quick]) { display: none; }

    .statement .st-row:has([data-quick]) {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "desc amount" "date balance";
    }

    .statement .st-row:has([data-quick]) .st-act { display: none; }
}

@media (max-width: 719px) {
    .st-opening .st-desc .item-meta { white-space: normal; }
}

.st-further { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); background: var(--surface-2); }
.st-further .icon { stroke: var(--gold); margin-top: 2px; }
.st-further .item-meta { gap: 8px; margin-top: 4px; }
@media (max-width: 719px) { .st-further { padding-inline: var(--space-4); } }

/* ---------- Spending breakdown ---------- */

:root { --bar: #F5B83D; --bar-hatch: rgba(245, 184, 61, .35); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --bar: #B87B05; --bar-hatch: rgba(184, 123, 5, .3); } }
:root[data-theme="light"] { --bar: #B87B05; --bar-hatch: rgba(184, 123, 5, .3); }

.breakdown { padding: var(--space-3) 0 var(--space-2); }
.breakdown-row { border-top: 1px solid var(--border); }
.breakdown-row:first-child { border-top: 0; }

.breakdown-row summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    grid-template-areas: "name amount share" "track track track";
    align-items: center;
    gap: 6px var(--space-3);
    padding: 12px var(--space-5);
    cursor: pointer;
    list-style: none;
    transition: background .15s;
}

.breakdown-row summary::-webkit-details-marker { display: none; }
.breakdown-row summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.breakdown-name { grid-area: name; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.breakdown-amount { grid-area: amount; font-weight: 650; }
.breakdown-share { grid-area: share; text-align: right; font-size: 13px; color: var(--text-3); }
.breakdown-track { grid-area: track; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.breakdown-bar { display: block; height: 100%; border-radius: 99px; background: var(--bar); }
.breakdown-row.estimate .breakdown-bar { background: repeating-linear-gradient(135deg, var(--bar) 0 4px, var(--bar-hatch) 4px 8px); }

.breakdown-items { padding: 0 var(--space-5) var(--space-4); display: grid; gap: 6px; }
.breakdown-item { display: flex; align-items: center; gap: var(--space-3); font-size: 14px; color: var(--text-2); padding: 6px 12px; border-radius: 10px; background: var(--surface-2); }
.breakdown-item .num { color: var(--text); font-weight: 600; }

@media (min-width: 900px) {
    .breakdown-row summary { grid-template-columns: 220px minmax(0, 1fr) 110px 52px; grid-template-areas: "name track amount share"; }
    .breakdown-amount { text-align: right; }
}

@media (max-width: 719px) {
    .breakdown-row summary, .breakdown-items { padding-inline: var(--space-4); }
}

/* ---------- Reports ---------- */

.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6, 28px); display: grid; gap: var(--space-6, 28px); }
.report-head { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding-bottom: var(--space-4); border-bottom: 2px solid var(--text); }
.report-head h2 { font-size: 22px; }
.report-head p { color: var(--text-2); margin-top: 2px; }
.report-head dl { display: grid; gap: 4px; margin: 0; font-size: 13.5px; }
.report-head dl div { display: flex; gap: var(--space-3); justify-content: space-between; }
.report-head dt { color: var(--text-3); }
.report-head dd { margin: 0; font-weight: 600; }

.report-totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 720px) { .report-totals { grid-template-columns: repeat(4, 1fr); } }
.report-totals div { display: grid; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--surface-2); }
.report-totals span { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.report-totals strong { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; }
.report-totals small { font-size: 12px; color: var(--text-3); }

.report-section h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: var(--space-2); }
.report-scroll { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th, .report-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.report-table td:first-child, .report-table th:first-child { white-space: normal; padding-left: 0; }
.report-table thead th { font-size: 12px; font-weight: 600; color: var(--text-3); border-bottom-color: var(--border-strong); }
.report-table .r { text-align: right; }
.report-table tbody tr:last-child td { border-bottom-color: var(--border-strong); }
.report-table tfoot th, .report-table tfoot td { font-weight: 700; border-bottom: 0; }
.report-table tfoot .sub th, .report-table tfoot .sub td { font-weight: 500; color: var(--text-2); padding-top: 0; }
.report-note { font-size: 12.5px; color: var(--text-3); margin-top: var(--space-2); }

@media (max-width: 719px) {
    .report { padding: var(--space-4); border-radius: var(--radius); }
    .report-table { font-size: 13px; }
}

@media print {
    :root, :root[data-theme] {
        color-scheme: light;
        --bg: #fff; --bg-glow: none; --surface: #fff; --surface-2: #F3F2EE; --border: #DDD; --border-strong: #999;
        --text: #000; --text-2: #333; --text-3: #555; --shadow: none;
    }
    @page { size: A4; margin: 14mm; }
    body { background: #fff !important; }
    .sidebar, .topbar, .tabbar, .no-print, .toast, dialog { display: none !important; }
    .shell { display: block !important; }
    .main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
    .report { border: 0; padding: 0; gap: 18px; }
    .report-totals { grid-template-columns: repeat(4, 1fr); }
    .report-section { break-inside: avoid; }
    .report-table { font-size: 11pt; }
    .report-scroll { overflow: visible; }
}
.report-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin-bottom: 4px; }
.page-head .btn, .page-head .runway-range a { white-space: nowrap; }
.report > * { min-width: 0; }
.page-head > .row { flex-wrap: wrap; }
@media (max-width: 719px) {
    .page-head > .row { width: 100%; margin-left: 0; }
    .report-head dl div { justify-content: flex-start; flex-wrap: wrap; }
}
.report-table tr.excluded td { color: var(--text-3); }

/* ---------- Today ---------- */

.coming-summary { padding: 4px var(--space-5) 0; font-size: 13.5px; color: var(--text-2); }

@media (max-width: 719px) {
    .stats-compact { gap: var(--space-2); }
    .stats-compact .stat { padding: 10px 12px; }
    .stats-compact .stat-value { font-size: 18px; margin-top: 2px; }
    .stats-compact .stat-label { font-size: 11.5px; }
    .coming-summary { padding-inline: var(--space-4); }
}

/* ---------- Toolbar (view tabs + filters above a list) ---------- */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin: calc(var(--space-2) * -1) 0 var(--space-4); }
.tabs { display: flex; gap: var(--space-1, 4px); }
.tabs a { padding: 7px 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--text-2); }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.toolbar-filters { display: flex; gap: var(--space-2); margin-left: auto; }
.input-sm, select.input-sm { min-height: 0; height: 34px; padding: 0 8px 0 10px; font-size: 13.5px; border-radius: 10px; width: auto; }

@media (max-width: 719px) {
    .toolbar-filters { margin-left: 0; width: 100%; }
    .toolbar-filters select { flex: 1; min-width: 0; }
}

/* The top bar already shows the title on phones. */
@media (max-width: 719px) {
    .page-head-compact { margin-bottom: var(--space-3); }
    .page-head-compact > div:first-child { display: none; }
    .page-head-compact > .row { margin-left: 0; width: 100%; }
    .page-head-compact > .row .btn { flex: 1; justify-content: center; }
}

/* Segmented controls on a toolbar match the small buttons beside them. */
.toolbar .runway-range a { padding: 5px 13px; font-size: 13px; line-height: 18px; }
@media (max-width: 719px) {
    .toolbar > .runway-range, .toolbar-filters { width: 100%; }
    .toolbar .runway-range { flex: 1; }
    .toolbar .runway-range a { flex: 1; text-align: center; white-space: nowrap; padding-inline: 8px; }
}

/* A link sitting in a segmented control's frame (e.g. a report beside a period toggle). */
.runway-range a.runway-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.runway-range a.runway-link:hover { color: var(--text); background: var(--surface-3); }
.toolbar-end { justify-content: flex-end; gap: var(--space-2); }
.toolbar-label { font-size: 13px; font-weight: 600; color: var(--text-3); }
@media (max-width: 719px) {
    .toolbar-end { justify-content: flex-start; }
    .toolbar-label { width: 100%; }
    .toolbar-end > .runway-range { width: 100%; }
    .toolbar-end > .runway-range a { flex: 1; text-align: center; }
}
.report-controls { display: flex; justify-content: flex-end; margin-bottom: calc(var(--space-6, 28px) * -1 + var(--space-3)); }
@media (max-width: 719px) {
    .report-controls .runway-range { width: 100%; }
    .report-controls .runway-range a { flex: 1; text-align: center; }
}

/* ---------- Report on phones ---------- */

.show-mobile, .stack-sub { display: none; }
.report-head dl { grid-template-columns: auto auto; column-gap: var(--space-3); }
.report-head dl div { display: contents; }
.report-head dd { text-align: right; }

@media screen and (max-width: 719px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: inline; }
    .report-head dl { grid-template-columns: auto 1fr; width: 100%; }
    .report-head dd { text-align: left; }
    .report-table td.wrap-mobile { white-space: normal; }

    /* Wide tables become one small block per row: the name, then label / value pairs. */
    .stack-mobile thead { display: none; }
    .stack-mobile tr { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .stack-mobile tbody tr:last-child { border-bottom-color: var(--border-strong); }
    .stack-mobile td, .stack-mobile th { display: flex; justify-content: space-between; gap: var(--space-3); padding: 0; border: 0; white-space: normal; text-align: right; }
    .stack-mobile td::before { content: attr(data-label); color: var(--text-3); font-weight: 500; text-align: left; }
    .stack-mobile .stack-title { font-weight: 650; justify-content: flex-start; align-items: baseline; gap: 8px; }
    .stack-mobile .stack-title::before { content: none; }
    .stack-mobile .stack-sub { display: inline; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
    .stack-mobile .empty { display: none; }
}

@media print { .show-mobile, .stack-sub { display: none !important; } .hide-mobile { display: revert !important; } }

/* ---------- Guided setup ---------- */

.setup { min-height: 100dvh; background: var(--bg-glow), var(--bg); }
.setup-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--space-4); padding: 12px var(--space-5); padding-top: max(12px, env(safe-area-inset-top)); background: var(--glass); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.setup-top .brand { margin: 0; padding: 0; }
.setup-later { margin-left: auto; font-size: 14px; font-weight: 600; }
.setup-later:hover { color: var(--text); }

.setup-steps { display: flex; gap: 6px; list-style: none; margin: 0 auto; padding: 0; }
.setup-steps a { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text-3); }
.setup-steps a:hover { background: var(--surface-2); color: var(--text-2); }
.setup-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 12px; }
.setup-steps .done a { color: var(--text-2); }
.setup-steps .done .setup-dot { background: var(--mint); border-color: transparent; color: #0B0C10; }
.setup-steps .current a { color: var(--text); background: var(--surface-2); }
.setup-steps .current .setup-dot { background: var(--gold); border-color: transparent; color: #0B0C10; }

.setup-main { max-width: 720px; margin: 0 auto; padding: var(--space-6, 28px) var(--space-5) calc(var(--space-6, 28px) * 2); display: grid; gap: var(--space-4); }
.setup-intro h1 { font-size: 30px; letter-spacing: -.02em; }
.setup-intro p { margin-top: 6px; max-width: 60ch; }
.setup-kicker { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }

.setup-list { padding: 4px 0; }
.setup-item { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-4); border-top: 1px solid var(--border); }
.setup-item:first-child { border-top: 0; }
.setup-item .grow { display: grid; gap: 2px; }
.setup-item .muted { font-size: 13px; }
.setup-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); flex: none; }
.setup-icon.pos { color: var(--mint); }

.setup-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-2); }
.setup-actions .btn-primary { margin-left: auto; }
.setup-count { font-size: 14px; }

/* Account type picker */
.kind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.kind-option { position: relative; cursor: pointer; }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-option span { display: grid; gap: 2px; height: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); transition: border-color .15s, background .15s; }
.kind-option small { font-size: 12px; color: var(--text-3); }
.kind-option:hover span { border-color: var(--text-3); }
.kind-option input:checked + span { border-color: var(--gold); background: var(--gold-soft); }
.kind-option input:focus-visible + span { box-shadow: 0 0 0 4px var(--gold-soft); }

/* Show only the fields that fit the account type picked. */
.setup-account-form:not(:has([value="Everyday"]:checked, [value="Savings"]:checked, [value="Offset"]:checked)) [data-show="cash"],
.setup-account-form:not(:has([value="CreditCard"]:checked, [value="HomeLoan"]:checked, [value="Loan"]:checked)) [data-show="debt"],
.setup-account-form:not(:has([value="HomeLoan"]:checked, [value="Loan"]:checked)) [data-show="loan"],
.setup-account-form:not(:has([value="CreditCard"]:checked)) [data-show="card"],
.setup-account-form:not(:has([value="HomeLoan"]:checked)) [data-show="homeloan"] { display: none; }

/* Bills checklist */
.bill-group { padding: 4px 0; }
.bill-group-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: var(--space-4) var(--space-4) var(--space-2); }
.bill-row { border-top: 1px solid var(--border); }
.bill-head { display: flex; align-items: center; gap: var(--space-3); padding: 12px var(--space-4); cursor: pointer; font-weight: 600; }
.bill-row.added .bill-head { cursor: default; color: var(--text-2); }
.bill-check { position: absolute; opacity: 0; pointer-events: none; }
.bill-tick { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; border: 1.5px solid var(--border-strong); color: transparent; transition: background .15s, border-color .15s; }
.bill-check:checked + .bill-tick, .bill-tick.done { background: var(--gold); border-color: var(--gold); color: #0B0C10; }
.bill-check:focus-visible + .bill-tick { box-shadow: 0 0 0 4px var(--gold-soft); }
.bill-head:hover .bill-tick { border-color: var(--text-3); }
.bill-fields { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); padding: 0 var(--space-4) var(--space-4) calc(var(--space-4) + 24px + var(--space-3)); }
.bill-row:has(.bill-check:checked) .bill-fields { display: grid; }
.bill-row:has(.bill-check:checked) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.bill-fields .field label { font-size: 12.5px; }
.bill-fields .input { min-height: 40px; }
.bill-auto { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.bill-fields > .field-error { grid-column: 1 / -1; }

/* Everyday spending */
.everyday-row { display: flex; align-items: center; gap: var(--space-3); }
.everyday-row .grow { display: grid; gap: 2px; }
.everyday-row .muted { font-size: 13px; }
.everyday-amount { width: 140px; margin: 0; flex: none; }

/* The reveal */
.setup-reveal { display: grid; gap: var(--space-5); padding: var(--space-6, 28px); text-align: center; }
.setup-reveal h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -.02em; line-height: 1.15; }
.setup-reveal > p { max-width: 52ch; margin: -8px auto 0; }
.setup-reveal .stats { text-align: left; }
.setup-reveal .alert { text-align: left; }
.setup-next { display: grid; gap: var(--space-3); max-width: 360px; width: 100%; margin: 0 auto; }

.setup-reminder { color: inherit; text-decoration: none; align-items: center; }
.setup-reminder:hover { filter: brightness(1.08); }

@media (max-width: 719px) {
    .setup-top { padding-inline: var(--space-4); gap: var(--space-2); }
    .setup-top .brand { font-size: 0; gap: 0; }
    .setup-step-label { display: none; }
    .setup-steps a { padding: 4px; }
    .setup-main { padding: var(--space-5) var(--space-4) calc(var(--space-6, 28px) * 2); }
    .setup-intro h1 { font-size: 26px; }
    .kind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bill-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: var(--space-4); }
    .everyday-row { flex-wrap: wrap; }
    .everyday-amount { width: 100%; }
    .setup-reveal { padding: var(--space-5) var(--space-4); }
}

/* A normal-sized money box for forms (the big .money-input is for hero entry). */
.input.money-field { display: flex; align-items: center; gap: 4px; padding-block: 0; cursor: text; }
.money-field span { color: var(--text-3); font-weight: 600; }
.money-field input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.money-field input::placeholder { color: var(--text-3); }
.input.money-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.link-btn { border: 0; background: none; padding: 0; margin-left: 6px; color: var(--gold); font: inherit; font-weight: 650; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Money models */
.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.model-option { position: relative; cursor: pointer; }
.model-option input { position: absolute; opacity: 0; pointer-events: none; }
.model-card { display: grid; gap: var(--space-3); align-content: start; height: 100%; padding: var(--space-4); border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.model-option:hover .model-card { border-color: var(--text-3); }
.model-option input:checked + .model-card { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.model-option input:focus-visible + .model-card { box-shadow: 0 0 0 4px var(--gold-soft); }
.model-head { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.model-radio { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong); }
.model-option input:checked + .model-card .model-radio { border: 5px solid var(--gold); }
.model-summary { font-size: 14px; color: var(--text-2); }
.model-why { display: flex; gap: 6px; font-size: 13px; color: var(--text-3); }
.model-why .icon { color: var(--gold); flex: none; margin-top: 2px; }
.model-custom { grid-column: 1 / -1; }

.model-flow { display: grid; gap: 6px; padding: var(--space-3); border-radius: 12px; background: var(--surface-2); }
.flow-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-arrow { color: var(--text-3); font-size: 13px; }
.flow-box { padding: 3px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.flow-in { background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint); }
.flow-account { background: var(--gold-soft); color: var(--gold); }
.flow-out { color: var(--text-2); border: 1px dashed var(--border-strong); }
.flow-loan { background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--coral); }
.flow-card { background: color-mix(in srgb, #6CB4FF 16%, transparent); color: #6CB4FF; }

.model-banner { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 10px var(--space-4); border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.model-banner a { font-weight: 650; }

.fixed-rate:not(:has(input[type="checkbox"]:checked)) .fixed-fields { display: none; }
.fixed-fields { margin-top: var(--space-3); }

@media (max-width: 719px) {
    .model-grid { grid-template-columns: 1fr; }
}

/* Result-screen stories */
.story-group { display: grid; gap: var(--space-2); text-align: left; }
.story-group h2 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.story { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--surface-2); text-align: left; }
.story > .icon { color: var(--gold); flex: none; margin-top: 2px; }
.story strong { display: block; font-size: 15.5px; }
.story p { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.setup-main:has(.model-grid) { max-width: 920px; }

/* Parity hero: the day the offset can pay the loan out */
.parity-hero { display: grid; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius); text-align: left;
    background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface-2)), var(--surface-2) 70%); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.parity-hero-label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.parity-hero-date { font-family: var(--font-display); font-size: clamp(30px, 6vw, 44px); font-weight: 750; letter-spacing: -.03em; line-height: 1.05; }
.parity-hero-until { color: var(--text-2); font-weight: 600; margin-top: -6px; }
.parity-meter { height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.parity-meter-fill { display: block; height: 100%; border-radius: 99px; background: var(--gold); min-width: 6px; }
.parity-meter-labels { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.parity-meter-labels strong { color: var(--text); }
.parity-hero-text { font-size: 15px; line-height: 1.5; color: var(--text); max-width: 64ch; }
.parity-hero-aside { font-size: 13.5px; color: var(--text-2); }
.parity-hero-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 14px; color: var(--gold); }
.parity-hero-link:hover { text-decoration: underline; }

/* ---------- Home loan page ---------- */

.loan-dates { display: grid; gap: var(--space-5); }
.dates-track { position: relative; height: 54px; margin: 6px 12px 0; }
.dates-line { position: absolute; left: 0; right: 0; top: 34px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 30%, var(--surface-3)) 45%, var(--surface-3)); }
.dates-marker { position: absolute; top: 28px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text-3); }
.dates-marker > span { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.dates-marker.at-today { border-color: var(--text-2); }
.dates-marker.at-today > span { left: 0; transform: none; font-weight: 600; color: var(--text-3); }
.dates-marker.at-parity { border-color: var(--gold); box-shadow: 0 0 0 5px var(--gold-soft); }
.dates-marker.at-parity > span { color: var(--gold); }
.dates-marker.at-repay { border-color: var(--text); }
.dates-marker.at-repay > span { color: var(--text); }
.dates-marker.at-standard > span { right: 0; left: auto; transform: none; }

.dates-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.date-card { display: grid; gap: 4px; align-content: start; padding: var(--space-4); border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.date-card p { font-size: 14px; color: var(--text-2); margin-top: 6px; line-height: 1.45; }
.date-card p strong { color: var(--text); }
.date-step { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.date-value { font-family: var(--font-display); font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.date-until { font-size: 13px; font-weight: 600; color: var(--text-2); }
.date-foot { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.date-card.is-parity { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface-2)), var(--surface-2) 75%); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.date-card.is-parity .date-step, .date-card.is-parity .date-value { color: var(--gold); }
.date-card.is-standard .date-value { color: var(--text-2); }

.dates-saving { display: flex; align-items: center; gap: 10px; padding: 12px var(--space-4); border-radius: 12px; background: var(--surface-2); font-size: 15px; }
.dates-saving .icon { color: var(--gold); flex: none; }

.loan-plan-chart { height: 220px; }
.plan-flag { position: absolute; transform: translate(-50%, -150%); padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #0B0C10; font-size: 11.5px; font-weight: 700; white-space: nowrap; pointer-events: none; }

.whatif-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.whatif-result > div { display: grid; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--surface-2); }
.whatif-result strong { font-family: var(--font-display); font-size: 20px; }
.whatif-result span:last-child { font-size: 13px; font-weight: 600; }

@media (max-width: 719px) {
    .dates-grid, .whatif-result { grid-template-columns: 1fr; }
    .dates-track { margin-inline: 8px; }
    .dates-marker > span { font-size: 11px; }
}
/* The standard end sits below the line so it never collides with the offset payoff above it. */
.dates-track { height: 74px; }
.dates-marker.at-standard > span { bottom: auto; top: 20px; color: var(--text-3); }

/* Daily interest */
.formula { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 10px; padding: var(--space-4); border-radius: 14px; background: var(--surface-2); }
.formula-part { display: grid; gap: 2px; }
.formula-part small { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.formula-part strong { font-family: var(--font-display); font-size: 18px; }
.formula-part.gold strong, .formula-part.result strong { color: var(--gold); }
.formula-part.result { padding-left: 10px; border-left: 2px solid var(--gold); }
.formula-op { font-size: 18px; font-weight: 600; color: var(--text-3); padding-bottom: 2px; }
.interest-how p strong { color: var(--text); }

.interest-table td { vertical-align: top; }
.interest-table td small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.interest-table td small.pos { color: var(--mint); }
.interest-table tr.month-end td { background: var(--gold-soft); font-weight: 650; }
.interest-table tr.covered td:nth-child(4) { color: var(--mint); font-weight: 650; }
.interest-table .gold { color: var(--gold); }
.interest-table thead th { position: sticky; top: 0; background: var(--surface); }

.daily-link { display: flex; align-items: center; gap: var(--space-3); color: inherit; }
.daily-link .grow { display: grid; gap: 2px; }
.daily-link .muted { font-size: 13.5px; }
.daily-link:hover { border-color: var(--text-3); }
.daily-link > .icon:first-child { color: var(--gold); }
@media screen and (max-width: 719px) {
    .interest-table th:nth-child(4), .interest-table td:nth-child(4),
    .interest-table th:nth-child(7), .interest-table td:nth-child(7) { display: none; }
    .interest-table th, .interest-table td { padding-inline: 6px; font-size: 12.5px; }
    .formula-part strong { font-size: 15px; }
}
@media screen and (max-width: 719px) {
    .interest-table th, .interest-table td { padding-inline: 4px; font-size: 12px; }
    .interest-table th:first-child, .interest-table td:first-child { padding-left: 10px; }
    .interest-table td small { font-size: 10.5px; }
    .interest-table thead th { white-space: normal; }
}
@media screen and (max-width: 719px) { .interest-table td small { white-space: normal; } }

/* Daily interest: room between the explainer and the month tabs, and the table inset from the card edge. */
.interest-how { margin-bottom: calc(var(--space-5) + var(--space-2)); }
.interest-table th:first-child, .interest-table td:first-child { padding-left: var(--space-5); }
.interest-table th:last-child, .interest-table td:last-child { padding-right: var(--space-5); }
@media screen and (max-width: 719px) {
    .interest-table th:first-child, .interest-table td:first-child { padding-left: var(--space-4); }
    .interest-table th:last-child, .interest-table td:last-child { padding-right: var(--space-4); }
}
.loan-link { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.is-updating { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* ---------- People ---------- */

.runway-range button { padding: 5px 11px; border: 0; border-radius: var(--radius-pill); background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-3); cursor: pointer; }
.runway-range button[aria-current="true"] { background: var(--surface-3); color: var(--text); }
.runway-range button:hover { color: var(--text); }
.contributions { display: grid; gap: var(--space-2); }
.contribution { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--surface-2); }
.contribution .grow { display: grid; gap: 2px; }
.contribution .muted { font-size: 13px; }
.contribution strong { font-size: 15.5px; }
.person > summary { list-style: none; cursor: pointer; }
.person > summary::-webkit-details-marker { display: none; }
.person[open] > summary { background: var(--surface-2); }
.person-form { padding: var(--space-4) var(--space-5) var(--space-5); border-bottom: 1px solid var(--border); }
.copy-row { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.copy-row .input { flex: 1; min-width: 0; }
.invite-result .grow { display: grid; gap: 2px; }
@media (max-width: 719px) {
    .contribution { align-items: flex-start; flex-wrap: wrap; }
    .person-form { padding-inline: var(--space-4); }
}
.stat-people { display: grid; gap: 2px; margin-top: 4px; font-size: 15px; }
.stat-people > span { display: flex; justify-content: space-between; gap: 8px; }
.stat-people strong { font-family: var(--font-display); }
