/* The Silo — household finance app */
:root {
    --green-900: #1e3a2f;
    --green-700: #2d5c46;
    --green-600: #3a7257;
    --green-100: #e3efe8;
    --wheat-100: #faf6ee;
    --wheat-200: #f1e9d9;
    --ink: #24292e;
    --ink-soft: #5b6570;
    --line: #e2ded4;
    --card: #ffffff;
    --danger: #b3402f;
    --danger-soft: #fbeae7;
    --amber: #b07d24;
    --amber-soft: #f7ecd8;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(30, 58, 47, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--wheat-100);
}

a { color: var(--green-700); }

/* ---- Top bar ---- */
.topbar {
    background: var(--green-900);
    color: #fff;
}
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    min-height: 56px;
}
.brand {
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    text-decoration: none;
    white-space: nowrap;
}
.mainnav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}
.nav-link {
    color: #cfe0d6;
    text-decoration: none;
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 14px;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-link.is-active { background: var(--green-600); color: #fff; }
.notif-bell {
    position: relative;
    text-decoration: none;
    font-size: 17px;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}
.notif-bell:hover { background: rgba(255, 255, 255, 0.1); }
.notif-badge {
    position: absolute;
    top: -3px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    min-width: 10px;
    text-align: center;
}
.notif-row { display: flex; gap: 12px; align-items: flex-start; }
.notif-icon { font-size: 20px; line-height: 1.3; }
.notif-text { flex: 1; min-width: 0; }
.notif-meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }
.card.notif { padding: 14px 20px; margin-bottom: 10px; }
.card.notif-unread { border-left: 3px solid var(--green-600); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-name { color: #cfe0d6; font-size: 14px; text-decoration: none; padding: 4px 9px; border-radius: 6px; }
.user-name:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.user-name.is-active { background: var(--green-600); color: #fff; }

/* ---- Layout ---- */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}
.footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 13px;
    padding: 20px 0 40px;
}
.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 24px; }
/* One-line horizon picker under a page title; scrolls sideways on
   phones instead of wrapping mid-label. */
.horizon-switch {
    flex-basis: 100%;
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 14.5px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.horizon-switch::-webkit-scrollbar { display: none; }
.horizon-switch strong { color: var(--ink); }
.card .horizon-switch { margin: 2px 0 12px; }
.icon-key {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    justify-content: center;
    font-size: 12.5px;
    margin: 14px 0 0;
}
.icon-key-item { white-space: nowrap; }
.card.table-card .horizon-switch { padding: 6px 20px 10px; margin: 0; }
.page-head .actions { display: flex; gap: 8px; }

/* ---- Cards & grids ---- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 17px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* Grid items default to min-width:auto, letting one long unbreakable
   line stretch its column past the page edge; cap them so columns
   honor the grid and inner tables scroll instead. */
.grid-2 > *, .grid-3 > * { min-width: 0; }
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.stat .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    margin-bottom: 4px;
}
.stat .value { font-size: 22px; font-weight: 700; }
.stat .value.positive { color: var(--green-700); }
.stat .value.negative { color: var(--danger); }
.stat .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
}
th, td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    background: var(--wheat-200);
}
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions-cell { text-align: right; white-space: nowrap; }
.amount-income { color: var(--green-700); font-weight: 600; }
.amount-expense { color: var(--danger); font-weight: 600; }
.amount-transfer { color: var(--ink-soft); font-weight: 600; }
.paid-check { color: var(--green-600); font-weight: 700; margin-left: 4px; }
.table-card { padding: 0; overflow: hidden; overflow-x: auto; }
.table-card h2 { padding: 16px 20px 0; }
/* Tables with many columns (e.g. the avalanche plan) scroll sideways
   inside their card instead of squeezing or spilling off the page. */
.wide-table th, .wide-table td { white-space: nowrap; }

/* ---- Badges & progress ---- */
.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--green-100);
    color: var(--green-700);
    font-weight: 600;
    white-space: nowrap;
}
.badge.expense { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: var(--wheat-200); color: var(--ink-soft); }
.progress {
    height: 10px;
    background: var(--wheat-200);
    border-radius: 999px;
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    background: var(--green-600);
    border-radius: 999px;
}
.progress.debt > span { background: var(--amber); }
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* ---- Forms ---- */
form .input, form .select, form .textarea { margin-bottom: 14px; }
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}
/* Every text-like control — enumerate NOTHING: a listed-types selector
   is how the tel field ended up unstyled. Checkboxes, radios, buttons,
   and file pickers opt out; everything else opts in. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]),
select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c9c4b8;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
/* One height for every single-line control so they line up when they
   sit side by side. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]),
select {
    height: 38px;
}
input[type="file"] { font-size: 14px; font-family: inherit; color: var(--ink); }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--green-600);
    outline-offset: 0;
    border-color: var(--green-600);
}
textarea { min-height: 80px; resize: vertical; }
.error-message {
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 3px;
}
form .error input, form .error select, form .error textarea { border-color: var(--danger); }
.form-narrow { max-width: 460px; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { margin-bottom: 0; }
/* One consistent control height so inputs, selects, dates, and the
   button line up on the shared baseline. */
.inline-form input:not([type="checkbox"]),
.inline-form select,
.inline-form button,
.inline-form .btn {
    height: 38px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}
.inline-form label { white-space: nowrap; }
.help-text { font-size: 12.5px; color: var(--ink-soft); margin-top: -8px; margin-bottom: 14px; }

/* One-time 2FA recovery codes. */
.recovery-codes { background: #fdf6e3; border: 1px solid #e5d9b0; border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.recovery-codes ul { columns: 2; margin: 8px 0 0; padding-left: 18px; }
.recovery-codes code { font-size: 14px; letter-spacing: 1px; }

/* Dashboard overdraft early warning. */
.alert-banner {
    background: #fbeaea;
    border: 1px solid #e5b6b0;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
    color: #7c2418;
}
.alert-banner a { color: #7c2418; font-weight: 600; }

/* Coming-up tree: collapsible year/month/item tiers. */
.group-row { cursor: pointer; }
.group-row:hover td { background: rgba(0, 0, 0, 0.03); }
.group-row .caret { display: inline-block; transition: transform 0.15s ease; color: var(--ink-soft); }
.group-row.open .caret { transform: rotate(90deg); }
.group-row td.tier-2 { padding-left: 28px; }
.item-row td { background: rgba(0, 0, 0, 0.02); font-size: 13px; }
.item-row td.tier-3 { padding-left: 48px; }

/* Upcoming: payments projected to overdraw their account. */
.overdraft-tip td { background: #fbeaea; }
.overdraft-tip td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
.overdraft-deep td { background: #fdf3f2; }
.overdraft-note { font-size: 12px; color: #c0392b; white-space: nowrap; }

/* Invite-by-email card: the field takes the row, the note breathes. */
.invite-form .input { flex: 1 1 220px; }
.invite-form input[type="email"] { width: 100%; }
/* Help text after a whole form clears the submit button instead of
   tucking under an input like the in-form variant does. */
form + .help-text { margin-top: 12px; margin-bottom: 0; }

/* ---- Buttons ---- */
.btn, button, input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    box-sizing: border-box;
    background: var(--green-700);
    color: #fff;
    /* Reserve the border so filled and outlined buttons share a height. */
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}
/* Compact and text buttons opt out of the shared control height. */
.btn-sm { min-height: 32px; }
.btn-link { min-height: 0; }
.btn:hover, button:hover, input[type="submit"]:hover { background: var(--green-600); }
.btn-secondary {
    background: transparent;
    color: var(--green-700);
    border: 1px solid var(--green-700);
}
.btn-secondary:hover { background: var(--green-100); }
.btn-danger { background: transparent; color: var(--danger); border: none; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; color: #cfe0d6; border: 1px solid rgba(255,255,255,0.3); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--green-700); padding: 0; font-weight: 400; text-decoration: underline; }
.btn-link:hover { background: none; color: var(--green-600); }

/* ---- Flash messages ---- */
.message {
    padding: 11px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    background: var(--green-100);
    color: var(--green-900);
    border: 1px solid #c4dccf;
}
.message.error { background: var(--danger-soft); color: var(--danger); border-color: #ecc8c1; }

/* ---- Pagination ---- */
.paginator { margin-top: 16px; }
.paginator ul { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 6px; }
.paginator li a, .paginator li.active a, .paginator li.active span {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 13.5px;
}
.paginator li.active a, .paginator li.active span {
    background: var(--green-700); color: #fff; border-color: var(--green-700);
    pointer-events: none; font-weight: 600;
}
.paginator li.disabled { display: none; }
.paginator p { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

/* ---- Filter bar ---- */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-bar .input, .filter-bar .select { margin-bottom: 0; min-width: 150px; }

/* ---- Login ---- */
.login-page {
    background: var(--green-900);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrap { width: 380px; max-width: 92vw; padding: 24px 0; }
.login-brand {
    text-align: center;
    color: #fff;
    font-size: 26px;
    margin-bottom: 20px;
}
.login-wrap .card { padding: 26px; }
.login-wrap .card h1 { margin: 0 0 16px; font-size: 19px; }
.login-foot {
    text-align: center;
    color: #9dbcab;
    font-size: 12.5px;
}
.login-alt { margin-top: 14px; font-size: 13.5px; text-align: center; }

/* ---- Misc ---- */
.empty-state {
    text-align: center;
    color: var(--ink-soft);
    padding: 34px 20px;
}
.empty-state .btn { margin-top: 10px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.strategy-list { margin: 0; padding-left: 20px; }
.strategy-list li { margin-bottom: 6px; }
.danger-zone { border-color: #ecc8c1; }

@media (max-width: 760px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }

    /* Compact pairs (two dates, two short selects) keep sitting side
       by side on phones instead of stacking. */
    .form-row.form-row-pair { flex-direction: row; gap: 12px; }
    .form-row.form-row-pair > * { flex: 1 1 0; min-width: 0; }
    .form-row.form-row-pair input, .form-row.form-row-pair select { width: 100%; }

    /* A table inside a plain card (the admin profile pages) scrolls
       within the card on phones instead of stretching it off-screen.
       Not .table-card — those scroll via the card itself, and a
       block-display table would shrink to content width. */
    .card:not(.table-card) > table { display: block; overflow-x: auto; }

    /* Top bar: brand + account on the first row, nav on its own
       full-width strip below that scrolls sideways instead of wrapping
       into a ragged block. */
    .topbar-inner {
        padding: 10px 14px;
        gap: 8px 12px;
        align-items: center;
        min-height: 0;
    }
    .brand { order: 1; }
    .notif-bell { order: 2; margin-left: auto; }
    .user-menu { order: 2; }
    .mainnav {
        order: 3;
        flex: 0 0 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 2px;
        margin: 0 -14px;
        padding: 2px 14px 0;
        scrollbar-width: none;
    }
    .mainnav::-webkit-scrollbar { display: none; }
    .nav-link { flex: 0 0 auto; white-space: nowrap; }
    .user-dropdown summary { padding: 4px 6px; }
    .page-head .actions { width: 100%; flex-wrap: wrap; }
    .page-head .actions .btn { flex: 1; text-align: center; white-space: nowrap; }
}

/* ---- Admin ---- */
/* The admin sections strip: lives under the top bar on every /admin
   page. Wraps on desktop; on phones it becomes a single-row rail that
   scrolls sideways, same pattern as the main nav. */
.adminnav {
    background: var(--green-700);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.adminnav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 5px 20px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.adminnav .nav-link { font-size: 13.5px; padding: 5px 10px; }
.adminnav .nav-link.is-active { background: var(--green-900); }
@media (max-width: 760px) {
    .adminnav-inner {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 5px 14px;
        scrollbar-width: none;
    }
    .adminnav-inner::-webkit-scrollbar { display: none; }
    .adminnav .nav-link { flex: 0 0 auto; white-space: nowrap; }
}
.pagination-links {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin: 18px 0;
    font-size: 13.5px;
    color: var(--ink-soft);
}
.paid-col { width: 30px; text-align: center; color: var(--ink-soft); }
td.paid-col .paid-check { margin: 0; }
.btn-secondary.is-active { background: var(--green-100); font-weight: 600; }

/* ---- User dropdown (topbar) ---- */
.user-dropdown { position: relative; }
.user-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
    padding: 4px 10px;
    border-radius: 8px;
}
.user-dropdown summary::-webkit-details-marker { display: none; }
.user-dropdown summary:hover, .user-dropdown[open] summary { background: rgba(255,255,255,0.12); }
.user-dropdown .user-name { color: #fff; font-weight: 600; white-space: nowrap; }
.user-dropdown .caret-down { font-size: 10px; opacity: 0.7; }
.user-dropdown .user-household {
    color: #cfe0d6;
    font-size: 11.5px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--line, #e3ddd2);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    min-width: 160px;
    padding: 6px;
    z-index: 50;
}
.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--ink, #2b2b2b);
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.dropdown-item:hover { background: var(--green-100, #e8f0ea); }
.dropdown-logout { color: var(--danger, #b3402f); }

/* Guided setup wizard */
.setup-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--muted, #777);
}
.setup-step { display: inline-flex; align-items: center; gap: 7px; }
.setup-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    font-size: 12px;
}
.setup-step.current { color: var(--ink, #2b2b2b); font-weight: 600; }
.setup-step.done { color: var(--green-600, #3a7d44); }
.setup-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.setup-kind {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1.5px solid var(--line, #ddd);
    border-radius: 9px;
    cursor: pointer;
    font-weight: 400;
}
.setup-kind:has(input:checked) { border-color: var(--green-600, #3a7d44); background: var(--green-100, #e8f0ea); }
.setup-kind input { margin-top: 4px; }
.setup-kind-body { display: block; }
.setup-kind-body strong { display: block; margin-bottom: 2px; }
.setup-recurring-list { margin: 0 0 16px; padding-left: 20px; }
.setup-recurring-list li { margin-bottom: 4px; }
.setup-review { margin: 0 0 16px; padding-left: 20px; }
.setup-review li { margin-bottom: 5px; }
.setup-continue {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}
.setup-continue .btn { margin: 0; }
@media (max-width: 640px) { .setup-kinds { grid-template-columns: 1fr; } }

/* Floating feedback widget */
.feedback-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
}
.feedback-fab > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--green-700, #274e33);
    color: #f6efdf;
    font-size: 24px;
    font-weight: 700;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease;
    user-select: none;
}
.feedback-fab > summary::-webkit-details-marker { display: none; }
.feedback-fab > summary:hover { transform: scale(1.08); }
.feedback-fab[open] > summary { transform: rotate(12deg); }
.feedback-panel {
    position: absolute;
    right: 0;
    bottom: 56px;
    width: min(320px, calc(100vw - 44px));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}
.feedback-panel h2 { margin-top: 0; font-size: 17px; }
.feedback-panel textarea { resize: vertical; }

/* Login tagline under the brand */
.login-tagline {
    text-align: center;
    color: #cfe0d6;
    font-size: 15px;
    line-height: 1.5;
    margin: -6px auto 18px;
    max-width: 340px;
}

/* Share-with-a-friend dialog */
.share-dialog {
    border: none;
    border-radius: var(--radius, 10px);
    padding: 0;
    max-width: 420px;
    width: calc(100vw - 44px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.share-dialog::backdrop { background: rgba(30, 58, 47, 0.45); }
.share-dialog-card { padding: 22px; }
.share-dialog-card h2 { margin: 0 0 10px; font-size: 18px; }

/* Admin: lower-only price control sits under the current price */
.price-lower { margin-top: 6px; gap: 6px; }
.price-lower input[type="number"] { width: 92px; }

/* A tidy row of buttons with breathing room, and space above when it
   follows a form. */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* Stat boxes whose numbers line up along the bottom, so labels that
   wrap to two lines don't leave the figures staggered. */
.stats-baseline .stat { display: flex; flex-direction: column; }
.stats-baseline .stat .label { min-height: 2.4em; }
.stats-baseline .stat .value { margin-top: auto; }

/* Subscription plan picker */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px; }
.plan-card { margin-bottom: 0; }
.plan-card.is-current { border-color: var(--green-600); box-shadow: 0 0 0 2px var(--green-100); }
.plan-card h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.plan-price { font-size: 15px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.plan-features { margin: 0 0 16px; padding-left: 18px; font-size: 14px; }
.plan-features li { margin-bottom: 4px; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; } }

/* Help centre / FAQ */
.faq-search { display: flex; gap: 10px; align-items: center; }
.faq-search input[type="text"] { flex: 1; }
.faq-item { padding: 0; }
.faq-item > summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15.5px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { content: '＋'; color: var(--green-600); margin-right: 10px; font-weight: 700; }
.faq-item[open] > summary::before { content: '－'; }
.faq-item[open] > summary { border-bottom: 1px solid var(--line); }
.faq-answer { padding: 14px 20px 4px; }
.faq-answer p { margin-top: 0; }
.faq-tags { padding: 0 20px 16px; }

/* Waiting-list card on the login screen */
.waitlist-card { margin-top: 6px; }
.waitlist-card h2 { margin-top: 0; }

/* Everyday spending breakdown under the Outlook */
.everyday-note { margin: 12px 0; font-size: 14px; }
.everyday-note > summary { cursor: pointer; color: var(--ink-soft); }
.everyday-list { margin: 10px 0; padding-left: 20px; }
.everyday-list li { margin-bottom: 3px; }

/* ---- Public marketing pages ---- */
.public-header { background: var(--green-900); }
.public-header-inner {
    max-width: 1000px; margin: 0 auto; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.public-brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.public-nav { display: flex; align-items: center; gap: 16px; }
.public-nav-link { color: #cfe0d6; text-decoration: none; font-size: 15px; }
.public-nav-link:hover { color: #fff; }
.btn-public { background: #f6efdf; color: var(--green-900); border-color: #f6efdf; }
.btn-public:hover { background: #fff; color: var(--green-900); }
.public-main { max-width: 1000px; margin: 0 auto; padding: 20px; }
.public-footer {
    max-width: 1000px; margin: 40px auto 0; padding: 24px 20px 48px;
    border-top: 1px solid var(--line); text-align: center; font-size: 14px;
}
.public-footer .muted { margin-top: 8px; }

.hero { text-align: center; padding: 56px 12px 40px; }
.hero h1 { font-size: 42px; margin: 0 0 16px; color: var(--green-900); line-height: 1.1; }
.hero-sub { font-size: 18px; color: var(--ink-soft); max-width: 620px; margin: 0 auto 26px; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg { font-size: 16px; padding: 12px 26px; min-height: 48px; }
.hero-note { color: var(--ink-soft); font-size: 14px; margin-top: 16px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0 8px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.feature h3 { margin: 0 0 8px; font-size: 17px; color: var(--green-900); }
.feature p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.section-title { text-align: center; color: var(--green-900); font-size: 24px; margin: 44px 0 4px; }
/* Landing story: The Average Family walkthrough. */
.story { padding: 40px 0 8px; }
.story-head { max-width: 640px; margin: 0 0 22px; }
.story-head h2 { color: var(--green-900); font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; margin: 6px 0 0; }
.story-head p { color: var(--ink-soft); font-size: 16.5px; margin: 12px 0 0; }
.story-head p strong { color: var(--ink); }
.story-eyebrow { text-transform: uppercase; letter-spacing: 0.13em; font-size: 12px; font-weight: 700; color: var(--green-600); }
.shot-frame { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.shot-frame .shot-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--wheat-200); }
.shot-frame .shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shot-frame img { display: block; width: 100%; height: auto; }
.shot-caption { font-size: 14px; color: var(--ink-soft); margin: 10px 4px 0; }
.shot-caption strong { color: var(--ink); }
.story-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .story-duo { grid-template-columns: 1fr; } }
.story-tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.story-tag.before { background: var(--wheat-200); color: var(--amber); }
.story-tag.after { background: var(--green-100); color: var(--green-600); }
.story-verdict { margin: 40px auto 0; max-width: 720px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 30px 28px; }
.story-verdict .headline { font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: var(--green-900); line-height: 1.2; }
.story-verdict .headline em { color: var(--green-600); font-style: normal; }
.story-verdict p { color: var(--ink-soft); margin: 10px 0 0; font-size: 15px; }
.plan-card.coming-soon { opacity: 0.6; }
.plan-card.coming-soon:hover { opacity: 0.85; }
/* Two debt tools side by side; each column stacks its own form + results. */
.tool-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.tool-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tool-col .card, .tool-col .stat-row { margin: 0; }
.tool-col .form-narrow { max-width: none; }
@media (max-width: 980px) {
    .tool-columns { grid-template-columns: 1fr; }
}
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; margin-right: 8px;
    background: var(--green-900); color: #fff; font-size: 14px; vertical-align: -4px;
}

.waitlist-section {
    background: var(--green-100); border-radius: var(--radius);
    padding: 36px 24px; margin: 36px 0 8px; text-align: center;
}
.waitlist-section h2 { margin: 0 0 8px; color: var(--green-900); }
.waitlist-section > p { color: var(--ink-soft); max-width: 520px; margin: 0 auto 18px; }
.waitlist-form { max-width: 440px; margin: 0 auto; }

.about { max-width: 720px; margin: 12px auto; }
.about h1 { color: var(--green-900); }
.about h2 { color: var(--green-900); font-size: 20px; margin-top: 28px; }
.about p { color: var(--ink); line-height: 1.65; }

@media (max-width: 760px) {
    .features { grid-template-columns: 1fr; }
    .hero h1 { font-size: 32px; }
}

/* Reconcile-balance card on the per-account view */
.reconcile-card { margin-top: 24px; }
.reconcile-card h2 { margin-top: 0; }

/* Reconcile card: the site's current recorded balance */
.reconcile-current { font-size: 14.5px; margin: 0 0 6px; color: var(--ink); }

/* Overdraft warnings are links to the day-projection interstitial */
.overdraft-link { display: inline-block; text-decoration: none; }
.overdraft-link:hover { text-decoration: underline; }

/* Build version in the footers — quiet but findable. */
.app-version { opacity: .55; font-size: .78rem; letter-spacing: .03em; }

/* ---- Dashboard long-view charts ---- */
.stack-2 { display: grid; gap: 20px; align-content: start; }
.line-chart { margin: 0 0 14px; }
.line-chart:last-of-type { margin-bottom: 0; }
.line-chart figcaption {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px; color: var(--ink-soft); margin-bottom: 4px;
}
.line-chart-value { font-variant-numeric: tabular-nums; color: var(--ink); }
.line-chart svg { display: block; width: 100%; height: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-zero { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.chart-tick { fill: var(--ink-soft); font-size: 10px; }
.chart-cursor { stroke: var(--ink-soft); stroke-width: 1; opacity: .5; }
.chart-range {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--ink-soft); margin-top: 2px;
}

/* Recurring edit: the year-at-a-glance card. */
.yearly-cost { font-size: 26px; font-weight: 700; margin: 0 0 2px; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.schedule-table th {
    text-align: left; padding: 10px 0 4px; border-bottom: 1px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
}
.schedule-table td { padding: 5px 0; border-bottom: 1px solid var(--wheat-200); }
.schedule-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.schedule-table td.muted { text-align: right; font-size: 12px; }
.schedule-table tr:last-child td { border-bottom: none; }

/* Dashboard debt card: cards vs loans grouped separately. */
.debt-group {
    margin: 18px 0 10px; font-size: 12px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--ink-soft);
    border-bottom: 1px solid var(--line); padding-bottom: 4px;
    display: flex; justify-content: space-between; align-items: baseline;
}
.debt-group:first-of-type { margin-top: 0; }
.debt-group .muted { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* Debt form: two columns so the page isn't a mile long. */
.form-wide { max-width: 960px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; align-items: start; }
.form-columns .form-col { min-width: 0; }
.form-section-title {
    margin: 16px 0 8px; font-size: 12px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--ink-soft);
    border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.form-section-title span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.form-col > :first-child .form-section-title, .form-col > .form-section-title:first-child { margin-top: 0; }
/* Uneven label wrapping used to leave paired inputs at different
   heights — anchor the controls to the shared bottom edge instead. */
.form-row { align-items: flex-end; }
@media (max-width: 860px) {
    .form-columns { grid-template-columns: 1fr; }
}

/* Day page date picker + brokerage section row. */
.day-picker { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; }
/* Inherit the site-wide date-input look; only un-stretch the width. */
.day-picker input[type="date"] { width: auto; }
th.section-row { padding-top: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
th.section-row .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Plan pages: the projected-surplus suggestion. */
.suggest-extra {
    margin-top: 10px; padding: 10px 12px; border-radius: 8px;
    background: var(--green-100); color: var(--green-900); font-size: 14px;
}
.suggest-extra a { font-weight: 600; }

/* Billing plan tabs: one card, Standard/Business switched client-side. */
.plan-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.plan-tab { appearance: none; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.plan-tab.is-active { color: var(--ink); border-bottom-color: var(--green-600); }
.plan-tab.coming-soon { opacity: 0.65; }
.plan-pane.coming-soon { opacity: 0.65; }

/* Record-a-payment: a single stacked column — Date above Paid from,
   every control left-aligned at the same width. */
.payment-form .input, .payment-form .select { margin-bottom: 12px; max-width: 320px; }
.payment-form .input input:not([type="checkbox"]), .payment-form .select select { width: 100%; box-sizing: border-box; }
.payment-form label { display: block; margin-bottom: 4px; }
