/* BudSplit -- base styles (served from ui/build via the asset manifest) */
/* Colours come from the logo: navy tile, royal-blue stem, green bowl */
:root { --brand: #0056c7; --brand-dark: #00439c; --brand-deep: #011e51; --brand-tint: #e8f0fc;
        --ink: #1f2933; --muted: #616e7c; --line: #dde3ec;
        --bg: #f3f6fa; --card: #fff; --danger: #c0392b; --danger-bg: #fdecea; --ok-bg: #e4f7ee; --info-bg: #eef4fb; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-dark); }
.topbar { background: var(--brand-deep); color: #fff; padding: 14px 16px; border-radius: 0 0 20px 20px; }
.topbar-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { flex: none; }
.page { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.card { background: var(--card); border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.06); padding: 24px 20px; }
h1 { font-size: 24px; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search] { width: 100%; font-size: 16px; padding: 12px 14px;
        border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input.has-error { border-color: var(--danger); }
input[readonly] { background: var(--bg); color: var(--muted); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none;
        color: var(--brand-dark); font-weight: 600; cursor: pointer; padding: 8px; }
.btn { display: block; width: 100%; margin-top: 22px; padding: 14px; border: 0; border-radius: 999px; font-size: 16px;
        font-weight: 700; background: var(--brand); color: #fff; cursor: pointer; text-align: center; text-decoration: none; }
.btn:hover { background: var(--brand-dark); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-outline { background: #fff; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }
.link-btn { border: 0; background: none; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.links { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.links p { margin: 8px 0; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--ok-bg); color: #0b6b45; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: #24496e; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- error page */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.error-page main { max-width: 560px; width: 100%; background: var(--card); border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 32px; text-align: center; }
.error-page .code { margin: 0 0 8px; font-size: 48px; color: var(--brand); }
.error-page h2 { margin: 0 0 12px; font-size: 20px; }
.error-page p { margin: 0 0 20px; color: var(--muted); }
.error-page .btn { display: inline-block; width: auto; padding: 12px 24px; margin: 0; }
.error-page pre { text-align: left; white-space: pre-wrap; word-break: break-word; font-size: 12px;
        background: #fff4f4; border-radius: 8px; padding: 12px; margin-top: 20px; color: #7a1f1f; }

/* ---------------------------------------------------------------- dynamic lists (Handlebars) */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.section-head h2 { font-size: 18px; margin: 0; }
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,.06); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line);
        color: inherit; text-decoration: none; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--bg); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title, .list-item .sub { display: block; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
:where(.list-item) .meta { color: var(--muted); font-size: 13px; text-align: right; }
.avatar { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark);
        display: flex; align-items: center; justify-content: center; font-weight: 700; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--brand-tint);
        color: var(--brand-dark); margin-left: 6px; vertical-align: middle; }
.state { padding: 24px 16px; text-align: center; color: var(--muted); background: var(--card); border-radius: 16px; }
.state .btn { width: auto; display: inline-block; margin-top: 12px; padding: 10px 20px; }
.state-error { color: var(--danger); }
.is-loading { opacity: .6; }
.hidden { display: none !important; }
.btn-small { width: auto; display: inline-block; margin: 0; padding: 8px 14px; font-size: 14px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a93226; }
select { width: 100%; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tabs { display: flex; background: var(--line); border-radius: 999px; padding: 4px; margin: 16px 0; }
.tabs a { flex: 1; text-align: center; padding: 8px 4px; font-size: 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.tabs a.active { background: #fff; color: var(--ink); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions .btn { white-space: nowrap; }
.row-actions form { margin: 0; }

/* ---------------------------------------------------------------- expenses */
.date-cell { flex: 0 0 44px; color: var(--muted); font-size: 13px; text-align: center; }
.position-label { display: block; font-size: 12px; }
.position-amount { display: block; font-weight: 700; }
.position-lent { color: #1e8e5a; }
.position-borrowed { color: var(--danger); }
.position-none, .position-even { color: var(--muted); }
.is-deleted { opacity: .6; }

/* ---------------------------------------------------------------- balances */
.section-head h3 { font-size: 15px; margin: 0; color: var(--muted); }
.balance-owed { color: #1e8e5a; }
.balance-owes { color: var(--danger); }
.balance-settled, .balance-none { color: var(--muted); }
.row-footer { display: flex; justify-content: flex-end; padding: 0 16px 12px 68px; margin-top: -6px; font-size: 13px; font-weight: 600; }
.row-footer a { text-decoration: none; }
.row-footer a:hover { text-decoration: underline; }
.list-item .owes-line { display: block; font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-type { border: 0; padding: 0; margin: 16px 0 0; }
.split-type legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 6px 12px 6px 0; }
.split-rows { margin-top: 8px; }
.split-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.split-row > label { flex: 1; margin: 0; font-weight: 400; }
.split-row input[type=text] { flex: 0 0 120px; width: 120px; }
.plain-list { list-style: none; padding: 0; margin: 0 0 16px; }
.plain-list li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- header account menu */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.user-menu { position: relative; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
        border-radius: 50%; color: #fff; }
.bell:hover { background: rgba(255,255,255,.15); }
.bell:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
        background: #f2b705; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.notification-list .title { white-space: normal; font-weight: 400; }
.notification-list .is-unread .title { font-weight: 600; }
.user-avatar { list-style: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--brand-dark);
        display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; cursor: pointer;
        box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
.user-avatar::-webkit-details-marker { display: none; }
.user-avatar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.user-menu-panel { position: absolute; right: 0; top: 46px; z-index: 10; min-width: 220px; background: var(--card); color: var(--ink);
        border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 14px 16px; }
.user-menu-name { font-weight: 700; }
.user-menu-email { font-size: 13px; margin: 2px 0 12px; overflow-wrap: anywhere; }
.user-menu-panel .btn { width: 100%; }

/* ---------------------------------------------------------------- dashboard */
/* The top bar flows into a full-width teal band that ends halfway down the balance card (ai/dashboard.jpeg) */
/* Also used at the top of the group page (.hero-band-short: its card is shorter) */
body:has(.hero-band) .topbar { border-radius: 0; }
.hero-band { position: relative; isolation: isolate; }
/* Widened with a clipped box-shadow, not 100vw: 100vw includes the scrollbar and scrolls sideways */
.hero-band::before { content: ""; position: absolute; z-index: -1; top: -21px; bottom: 72px; left: 0; right: 0;
        background: var(--brand-deep); box-shadow: 0 0 0 100vmax var(--brand-deep); clip-path: inset(0 -100vmax); }
.hero-band-short::before { bottom: 52px; }
@media (max-width: 512px) {
    .hero-band::before { left: -16px; right: -16px; box-shadow: none; clip-path: none; border-radius: 0 0 28px 28px; }
}
.hero-band h1 { color: #fff; margin: 0; padding: 2px 0 4px; }
.hero-sub { color: rgba(255,255,255,.88); font-size: 14px; }
.balance-card { position: relative; overflow: hidden; margin: 12px 0 8px; padding: 20px; border-radius: 20px; color: #fff;
        background: linear-gradient(135deg, #0a6fe0 0%, #0056c7 45%, #013a8f 100%); box-shadow: 0 10px 24px rgba(1,30,81,.35); }
.balance-card-amount, .balance-card-value, .position-amount { font-variant-numeric: tabular-nums; }
.balance-card-flow { display: flex; align-items: center; gap: 10px; }
.balance-card-flow:last-child { flex-direction: row-reverse; }
.balance-card-arrow { flex: 0 0 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.14);
        display: flex; align-items: center; justify-content: center; font-weight: 700; }
/* Dashboard rows float as separate cards, as in the mockup */
.dashboard .list { background: none; box-shadow: none; border-radius: 0; overflow: visible; display: grid; gap: 10px; }
.dashboard .list > li { background: var(--card); border-radius: 16px; box-shadow: 0 2px 10px rgba(31,41,51,.06); overflow: hidden; }
.dashboard .list-item { border-top: 0; }
.dashboard .section-head { margin-top: 26px; }
.dashboard .position-lent .position-amount::before { content: "+"; }
.dashboard .position-borrowed .position-amount::before { content: "−"; }
.activity-expense { background: #fdf1dc; color: #8a5a00; }

/* ---------------------------------------------------------------- group page */
.position-card { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 14px 0 8px;
        padding: 18px 20px; background: var(--card); border-radius: 20px; box-shadow: 0 10px 24px rgba(31,41,51,.12); }
.position-card-main { flex: 1 0 auto; max-width: 100%; }   /* never shrinks under the buttons: they wrap instead */
.position-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.position-card-label { font-size: 14px; color: var(--muted); }
.position-card-amount { font-size: 30px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.position-card-amount.balance-settled, .position-card-amount.balance-none, .position-card-amount.balance-uninvolved { font-size: 22px; }
.btn-settle { background: var(--ink); }
.btn-settle:hover { background: #000; }
/* UPI pay links (upi://) only open an app on phones: hidden where there is a mouse */
.btn-upi { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-upi:hover, .row-footer .btn-upi:hover { text-decoration: none; }
.row-footer { align-items: center; gap: 10px; flex-wrap: wrap; }
.row-footer .btn-upi { padding: 6px 12px; font-size: 13px; }
@media (hover: hover) and (pointer: fine) { .btn-upi { display: none; } }
/* Trip tools: equal icon tiles across the bottom of the position card */
.trip-tools { flex-basis: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
        margin: 8px 0 -6px; padding-top: 12px; border-top: 1px solid var(--line); }   /* no side margins: it must always wrap to its own row */
.trip-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px;
        color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; }
.trip-tool:hover { background: var(--bg); }
.trip-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.trip-tool-icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
        background: var(--brand-tint); color: var(--brand); }
.trip-tool-ai .trip-tool-icon { background: linear-gradient(135deg, #e8f0fc, #efe7fc); color: #5b3cc4; }
.trip-tool-sub { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.trip-tool-count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
        background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
        box-shadow: 0 0 0 2px var(--card); }
/* Expense rows as in the mockup: bold date column, larger title and amount */
[data-component="timeline"] .date-cell { font-weight: 600; }
[data-component="timeline"] .list-item .title { font-size: 16px; }
[data-component="timeline"] .position-amount { font-size: 16px; }

/* ---------------------------------------------------------------- expense form */
/* The band holds only the title here; the form card that follows overlaps its bottom */
/* Title-only band (expense form, detail pages, trip summary): it ends below the title, unless a
   card follows directly, which then overlaps the band's bottom */
.hero-band-title { padding-bottom: 22px; margin-bottom: 16px; }
.hero-band-title::before { bottom: 0; }
.hero-band-title:has(+ .card) { padding-bottom: 0; margin-bottom: 0; }
.hero-band-title:has(+ .card)::before { bottom: -56px; }
.hero-band-title + .card { position: relative; margin-top: 16px; }
.hero-amount { color: #fff; font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.amount-field { display: flex; align-items: stretch; gap: 10px; }
.amount-symbol { flex: none; min-width: 54px; padding: 0 10px; display: flex; align-items: center; justify-content: center;
        border-radius: 12px; background: var(--brand-tint); color: var(--brand-dark); font-size: 22px; font-weight: 700; }
.amount-field input { font-size: 30px; font-weight: 700; padding: 8px 14px; font-variant-numeric: tabular-nums; }
.split-sentence { margin: 22px 0 6px; font-size: 17px; line-height: 2.3; }
.split-sentence label { display: inline; margin: 0; font-size: inherit; font-weight: 400; }
.inline-select { width: auto; display: inline-block; vertical-align: baseline; font-size: 16px; font-weight: 700;
        padding: 4px 10px; border-radius: 999px; border-color: transparent; background-color: var(--brand-tint); color: var(--brand-dark); cursor: pointer;
        field-sizing: content; }
select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.expense-card .split-row { min-height: 48px; }
.split-rows-head { font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
.split-rows-head .hint { font-weight: 400; }
.balance-card::before, .balance-card::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.balance-card::before { width: 180px; height: 180px; right: -50px; top: -60px; }
.balance-card::after { width: 140px; height: 140px; left: -40px; bottom: -70px; }
.balance-card-total { position: relative; }
.balance-card-total + .balance-card-total { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); }
.balance-card-label { display: block; font-size: 13px; opacity: .85; }
.balance-card-amount { font-size: 34px; font-weight: 800; margin: 4px 0 2px; letter-spacing: -.5px; }
.balance-card-note { font-size: 13px; opacity: .85; }
.balance-card-split { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.balance-card-split > div:last-child { text-align: right; }
.balance-card-value { display: block; font-size: 17px; font-weight: 700; }
.activity-payment { background: var(--info-bg); color: #24496e; }
.position-paid, .position-received { color: var(--ink); }

/* ---------------------------------------------------------------- trip summary */
section.card { margin-top: 16px; }
.card h2 { font-size: 18px; margin: 0 0 8px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 4px; text-align: right; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.table th:first-child, .table td:first-child, .table .text-left { text-align: left; }
.table thead th { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.table tbody th { font-weight: 600; white-space: normal; }
.table tbody th .muted { font-weight: 400; font-size: 12px; }
.table tfoot th, .table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.print-only { display: none; }

@media print {
    body { background: #fff; }
    .topbar, .no-print, noscript, .fab, .install-bar, .install-help { display: none !important; }
    .page { max-width: none; padding: 0; }
    .hero-band { padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--ink); }
    .hero-band::before, .hero-banner, .hero-band-photo::after { display: none; }
    .hero-band-photo { padding-top: 0; }
    .hero-band h1, .hero-sub, .hero-amount { color: var(--ink); text-shadow: none; }
    .card { box-shadow: none; padding: 12px 0; break-inside: avoid; }
    .table th, .table td { white-space: normal; }
    .balance-owed, .balance-owes { color: var(--ink); font-weight: 700; }
    .print-only { display: block; }
}

/* ---------------------------------------------------------------- connection bar (offline) */
.connection-bar { position: sticky; top: 0; z-index: 20; padding: 10px 16px; text-align: center; font-size: 14px;
        font-weight: 600; color: #fff; background: #3e4c59; }
.connection-bar[data-state="online"] { background: #1e8e5a; }
/* Beta notice at the top of the Terms page */
.beta-notice { margin: 16px 0 20px; padding: 12px 14px; color: #5c4400; background: #fff3cd; border: 1px solid #f0d78c;
        border-left: 4px solid #a86b00; border-radius: 12px; }
.beta-notice p { margin: 6px 0 0; }
.beta-tag { display: inline-block; margin-right: 4px; padding: 0 7px; font-size: 11px; font-weight: 700; color: #fff;
        background: #a86b00; border-radius: 999px; }
.beta-notice a { color: #5c4400; font-weight: 600; }
/* Install offers (core/pwa.js): top-bar button, dashboard/landing banner, iOS steps sheet */
.install-nav { border: 1px solid rgba(255,255,255,.6); background: none; color: #fff; border-radius: 999px;
        padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.install-nav:hover { background: rgba(255,255,255,.15); }
.install-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.install-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 16px 0; padding: 12px 14px;
        font-size: 14px; background: var(--brand-tint); border: 1px solid #cddcf5; border-radius: 14px; }
.install-bar-icon { flex: none; border-radius: 10px; }
.install-bar-text { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; }
.install-bar-text span { color: #3e4c59; }
.install-bar-dismiss { border: 0; background: none; padding: 8px 4px; font-size: 14px; color: #3e4c59;
        text-decoration: underline; cursor: pointer; }
.install-help { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 0 12px max(12px, env(safe-area-inset-bottom)); }
.install-help-inner { max-width: 456px; margin: 0 auto; background: var(--card); border-radius: 18px; padding: 18px 20px;
        box-shadow: 0 -4px 24px rgba(0,0,0,.18); font-size: 15px; }
.install-help h2 { font-size: 17px; margin: 0 0 8px; }
.install-help ol { margin: 0 0 14px; padding-left: 20px; line-height: 1.5; }
.install-share-icon { vertical-align: -3px; color: var(--brand); }
.is-offline button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- mobile app */
/* Taps act immediately: no double-tap-to-zoom delay on controls */
a, button, .btn, summary, label, select, input { touch-action: manipulation; }
/* Notched phones in full-screen (installed) mode */
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
.page { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.offline-card { text-align: center; margin-top: 24px; }
.offline-icon { display: block; margin: 0 auto 16px; border-radius: 22px; }

/* ---------------------------------------------------------------- profile photos */
img.avatar { object-fit: cover; background: var(--brand-tint); }
.user-avatar img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block; }
.user-menu-link { width: 100%; margin-bottom: 8px; }
.profile-photo { display: flex; align-items: center; gap: 16px; margin: 8px 0 4px; }
.avatar-large { flex: 0 0 96px; width: 96px; height: 96px; font-size: 32px; }
.avatar-wrap { position: relative; flex: none; }
.avatar-remove { position: absolute; right: -4px; bottom: -4px; margin: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
        color: var(--danger); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
        box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.icon-btn:hover { background: var(--danger-bg); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.profile-notifications { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.profile-notifications h2 { font-size: 17px; margin: 0 0 8px; }
input[type=file] { width: 100%; font-size: 15px; }

/* ---------------------------------------------------------------- account menu, help and legal pages */
.account-head { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; padding: 16px;
        background: var(--card); border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.account-head .btn { flex: none; }
.account-head .grow { flex: 1; min-width: 0; }
.account-head .title { display: block; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.account-head .sub { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.avatar-medium { flex: 0 0 64px; width: 64px; height: 64px; font-size: 22px; }
.menu-list .list-item { padding: 16px; }
.menu-icon { flex: none; color: var(--ink); }
.menu-chevron { flex: none; color: var(--muted); }
.account-logout { margin-top: 8px; }
.legal-footer { margin-top: 28px; text-align: center; font-size: 13px; color: var(--muted); }
.legal-footer p { margin: 6px 0; }
.prose h2 { font-size: 18px; margin: 24px 0 8px; }
.prose h3 { font-size: 15px; margin: 16px 0 4px; }
.prose p, .prose li { line-height: 1.55; }
.prose ul { padding-left: 20px; }
.prose code { font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- floating "Add expense" */
/* Bottom right of the 480px column (of the screen on phones); the page leaves room below its last row */
.fab { position: fixed; z-index: 10; right: max(16px, calc(50% - 224px)); bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
        display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px 14px 18px; border-radius: 999px;
        background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; text-decoration: none;
        box-shadow: 0 8px 20px rgba(31,41,51,.25); }
.fab::before { content: "+"; font-size: 24px; line-height: 16px; font-weight: 400; }
.fab:hover { background: var(--brand-dark); }
.fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.page:has(.fab) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.settled-toggle { text-align: center; margin-top: 16px; }
.settled-toggle .hint { margin: 0 0 10px; }

/* ---------------------------------------------------------------- group photo and settings */
.group-thumb { border-radius: 10px; }
.group-photo { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--brand-tint);
        color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.group-photo-large { flex-basis: 96px; width: 96px; height: 96px; border-radius: 22px; font-size: 32px; }
.hero-title { display: flex; align-items: center; gap: 12px; }
/* Group page with a photo (ai/split-1.jpeg): the photo replaces the teal band and the card overlaps
   its bottom. Darkened towards the bottom so the white name stays readable on any photo. */
.hero-band-photo { padding-top: 150px; }
.hero-band-photo::before { display: none; }
.hero-banner, .hero-band-photo::after { position: absolute; z-index: -1; top: 0; left: 0; width: 100%;
        height: calc(100% - 52px); border-radius: 20px; }
.hero-banner { object-fit: cover; background: var(--brand-deep); }
.hero-band-photo::after { content: ""; background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.65)); }
.hero-band-photo .hero-title, .hero-band-photo .hero-sub { padding: 0 20px; }
.hero-band-photo .hero-sub { padding-bottom: 4px; }
.hero-band-photo h1 { font-size: 30px; line-height: 1.15; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hero-band-photo .hero-sub { color: rgba(255,255,255,.92); text-shadow: 0 1px 6px rgba(0,0,0,.45); }
body:has(.hero-band-photo) .topbar { border-radius: 0 0 20px 20px; }
/* Scrolling down slides the banner up into a strip under the name; back at the top it opens
   again (hero-collapse in group-page.js). The browser must not re-anchor the scroll while it
   resizes, or the banner would open and shut in a loop. */
:root:has(.hero-band-photo) { overflow-anchor: none; }
.hero-band-photo { transition: padding-top .35s cubic-bezier(.2, .7, .2, 1); }
.hero-band-photo h1 { transition: font-size .35s cubic-bezier(.2, .7, .2, 1); }
.hero-band-photo.is-collapsed { padding-top: 48px; }
.hero-band-photo.is-collapsed h1 { font-size: 22px; }
@media (prefers-reduced-motion: reduce) {
    .hero-band-photo, .hero-band-photo h1 { transition: none; }
}
/* Phones: edge to edge from the top of the screen, under a see-through top bar */
@media (max-width: 512px) {
    body:has(.hero-band-photo) { overflow-x: clip; }
    body:has(.hero-band-photo) .topbar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; background: none;
            border-radius: 0; }
    .hero-band-photo { padding-top: calc(190px + env(safe-area-inset-top)); }
    .hero-banner, .hero-band-photo::after { top: -20px; left: calc(50% - 50vw); width: 100vw; height: calc(100% - 32px);
            border-radius: 0; }
    .hero-band-photo::after { background: linear-gradient(to bottom, rgba(0,0,0,.4), rgba(0,0,0,0) 30%,
            rgba(0,0,0,0) 45%, rgba(0,0,0,.65)); }
    .hero-band-photo .hero-title, .hero-band-photo .hero-sub { padding: 0; }
    .hero-band-photo.is-collapsed { padding-top: calc(72px + env(safe-area-inset-top)); }
}
.group-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.group-card .grow { flex: 1; min-width: 0; }
.group-card .title { display: block; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-card .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.invite-card { margin-bottom: 12px; }
.invite-card summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); }
.invite-card summary::before { content: "+ "; }
.invite-link { display: block; font-weight: 600; color: var(--brand-dark); text-decoration: none; }
.invite-link::before { content: "+ "; }
/* Add people (after creating a group): friends list with an Invite button per row */
.add-people #friend-search { margin-bottom: 16px; }
.add-people .invite-card { margin: 0; }
.friend-invite { margin: 0; flex: none; text-align: right; }
.friend-invite .field-error { max-width: 160px; }
.add-people-done { margin-top: 20px; }
.alone-card { margin-bottom: 16px; }
.alone-card p { margin: 0; color: var(--ink); }
.alone-card .btn { margin-top: 12px; }
.member-row { flex-wrap: wrap; }
.member-row .row-actions { flex-basis: 100%; padding-left: 52px; }
.settings-card h3 { font-size: 16px; margin: 0; }
.settings-card .hint { margin: 4px 0 10px; }
.settings-card form + form { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }

/* ---------------------------------------------------------------- simplify debts switch */
.setting-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { flex: none; position: relative; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px;
        background: #c4ccd1; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
        background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { left: 23px; }
.switch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch[disabled] { opacity: .5; cursor: not-allowed; }
.timeline-setting .title { font-weight: 400; font-style: italic; color: var(--muted); }

/* ---------------------------------------------------------------- landing page (logged out) */
/* Same navy band as the dashboard; the example balance card overlaps its bottom edge */
.hero-band-landing { padding-top: 8px; }
.hero-band-landing::before { bottom: 96px; }
.hero-band-landing h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.3px; }
.hero-band-landing .hero-sub { font-size: 16px; line-height: 1.45; margin: 10px 0 0; }
.landing-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 22px; }
.landing-actions .btn { margin: 0; display: flex; align-items: center; justify-content: center; }   /* labels centred when one wraps */
.btn-light { background: #fff; color: var(--brand-deep); }
.btn-light:hover { background: var(--brand-tint); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.landing-sample { margin: 0; }
.landing-sample-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 12px; }
.landing-sample-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
        padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.18); }
.landing-sample-rows { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.2);
        display: grid; gap: 8px; font-size: 14px; }
.landing-sample-rows li { display: flex; justify-content: space-between; }
.landing-sample-rows strong { font-variant-numeric: tabular-nums; }
.landing-section { margin-top: 32px; }
.landing-section h2 { font-size: 20px; margin: 0 0 14px; }
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feature { background: var(--card); border-radius: 16px; box-shadow: 0 2px 10px rgba(31,41,51,.06); padding: 16px 14px;
        display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.feature strong { color: var(--ink); font-size: 15px; line-height: 1.3; }
.feature-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-tint); color: var(--brand);
        display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; min-height: 34px;
        display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
        background: var(--brand-deep); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps strong { color: var(--ink); font-size: 16px; }
.landing .install-bar { margin-top: 28px; }
.landing-cta { margin-top: 28px; text-align: center; }
.landing-cta h2 { margin: 0 0 4px; font-size: 20px; }
.landing-cta .lead { margin-bottom: 0; }
@media (max-width: 360px) {
    .landing-actions, .feature-grid { grid-template-columns: 1fr; }
}

/* AI trip planner (views/groups/trip-plan.tpl.php) */
.trip-form textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); resize: vertical; }
.trip-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.trip-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.trip-interests { border: 0; padding: 0; margin: 12px 0 4px; }
.trip-interests legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.trip-form .btn { margin-top: 12px; }
.card.trip-plan, .card.trip-day, .trip-plan ~ .card { margin-top: 12px; }
.trip-activities { list-style: none; padding: 0; margin: 0; }
/* Day header: the day number leads; theme and area on their own lines */
.trip-day-head { font-size: 22px; margin: 0; }
.trip-day-date { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.trip-day-theme { font-size: 16px; font-weight: 700; margin-top: 4px; }
.trip-day-area { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
/* The day as a timeline: an icon per time of day, joined by a line down the left */
.trip-activities li { position: relative; display: flex; gap: 12px; padding: 14px 0 6px; }
/* From under this stop's label to the next stop's icon (14px padding-top) */
.trip-activities li:not(:last-child)::after { content: ""; position: absolute; top: 70px; bottom: -10px; left: 27px; width: 2px;
    border-radius: 1px; background: var(--line); }
.trip-when { flex: 0 0 56px; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trip-when-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.trip-when-label { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.trip-when-morning .trip-when-icon { background: #fdf1dc; color: #a86400; }
.trip-when-afternoon .trip-when-icon { background: var(--brand-tint); color: var(--brand); }
.trip-when-evening .trip-when-icon { background: #ece8fb; color: #4b3aa8; }
.trip-what { flex: 1; min-width: 0; }
.trip-what p { margin: 6px 0; }
.trip-title { font-weight: 600; }
.trip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.trip-eat { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; font-size: 14px; }
.trip-eat ul, .trip-list { margin: 6px 0 0; padding-left: 20px; }
.trip-list li { margin: 4px 0; }
.trip-total { font-weight: 700; }
.trip-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 16px;
    background: rgba(1, 30, 81, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: trip-fade .2s ease-out; }
.trip-overlay:focus { outline: none; }
html.trip-blocking { overflow: hidden; }
.trip-overlay-card { width: min(340px, 100%); padding: 28px 24px 22px; border-radius: 20px; background: var(--card); text-align: center;
    box-shadow: 0 20px 50px rgba(1, 30, 81, .35); animation: trip-rise .3s cubic-bezier(.2, .7, .2, 1); }
.trip-overlay-title { font-size: 18px; font-weight: 700; margin-top: 16px; }
.trip-overlay-step { min-height: 20px; margin-top: 6px; color: var(--brand-dark); font-weight: 600; font-size: 14px; }
.trip-overlay-card .hint { margin-top: 12px; }
/* The AI sparkle with a dot circling it */
.trip-orbit { position: relative; width: 84px; height: 84px; margin: 0 auto; display: grid; place-items: center; color: #5b3cc4; }
.trip-orbit-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed #d9cff7; }
.trip-orbit::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: linear-gradient(135deg, #e8f0fc, #efe7fc);
    animation: trip-pulse 1.6s ease-in-out infinite; }
.trip-orbit-icon { position: relative; animation: trip-twinkle 1.6s ease-in-out infinite; }
.trip-orbit-dot { position: absolute; inset: 0; animation: trip-spin 2.4s linear infinite; }
.trip-orbit-dot::after { content: ""; position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%;
    background: var(--brand); box-shadow: 0 0 0 3px var(--card); }
/* Indeterminate bar: a highlight sliding across */
.trip-overlay-bar { position: relative; height: 4px; margin: 16px auto 0; width: 70%; border-radius: 2px; background: var(--brand-tint); overflow: hidden; }
.trip-overlay-bar span { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 2px;
    background: linear-gradient(90deg, var(--brand), #7b5ce0); animation: trip-slide 1.4s ease-in-out infinite; }
@keyframes trip-spin { to { transform: rotate(360deg); } }
@keyframes trip-pulse { 50% { transform: scale(1.08); } }
@keyframes trip-twinkle { 50% { transform: scale(.9) rotate(-8deg); opacity: .75; } }
@keyframes trip-slide { from { left: -40%; } to { left: 100%; } }
@keyframes trip-fade { from { opacity: 0; } }
@keyframes trip-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
    .trip-overlay, .trip-overlay-card, .trip-orbit::before, .trip-orbit-icon, .trip-orbit-dot { animation: none; }
    .trip-overlay-bar span { animation: none; left: 0; width: 100%; opacity: .5; }
}
@media print { .trip-day, .trip-plan ~ .card { break-inside: avoid; box-shadow: none; } }
/* Ways out of the trip planner pages: buttons, not footnote links */
/* Saved trip plans (views/groups/trip-plans.tpl.php): the AI planner on top, plans as tickets */
.plan-cta { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none; }
.plan-cta:hover { box-shadow: 0 6px 20px rgba(1, 30, 81, .12); }
.plan-cta:focus-visible, .ticket:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.plan-cta-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #e8f0fc, #efe7fc); color: #5b3cc4; }
.plan-cta-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-cta-title { font-size: 16px; font-weight: 700; }
.plan-cta-sub { font-size: 13px; color: var(--muted); }
.plan-cta-go { flex: none; color: var(--brand); }
.tickets { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
/* A ticket: navy stub with the trip length, a perforated edge with notches, then the details */
.ticket { position: relative; display: flex; min-height: 116px; overflow: hidden; border-radius: 16px; background: var(--card);
    box-shadow: 0 2px 10px rgba(31, 41, 51, .07); color: var(--ink); text-decoration: none; }
.ticket:hover { box-shadow: 0 6px 20px rgba(1, 30, 81, .14); }
.ticket-stub { position: relative; flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--brand-deep); color: #fff; }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; right: -9px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--bg); }
.ticket-stub::before { top: -9px; }
.ticket-stub::after { bottom: -9px; }
.ticket-days { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ticket-days-label { margin-top: 3px; font-size: 12px; color: rgba(255, 255, 255, .78); }
.ticket-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 12px 18px;
    border-left: 2px dashed var(--line); }
.ticket-title { font-size: 16px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; }
.ticket-place { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.ticket-price { color: var(--brand-dark); }
.ticket-saved { margin-top: 4px; font-size: 12px; color: var(--muted); }
.tickets-full { text-align: center; }
.tickets-empty { margin-top: 16px; text-align: center; }
.tickets-empty h2 { margin: 0 0 6px; }
.tickets-empty p { margin: 0; }

/* ---------------------------------------------------------------- one trip plan (trip-plan-show) */
/* Gradient hero that runs up behind a see-through top bar (ai/budsplit-trip-planner.webp) */
body:has(.hero-band-plan) { overflow-x: clip; }
body:has(.hero-band-plan) .topbar { position: relative; z-index: 1; background: transparent; }
.hero-band-plan::before { top: -120px; left: calc(50% - 50vw); right: calc(50% - 50vw); box-shadow: none; clip-path: none;
    border-radius: 0 0 28px 28px;
    background: radial-gradient(circle at 100% 0%, rgba(20, 184, 166, .55), rgba(20, 184, 166, 0) 45%),
                radial-gradient(circle at 0% 100%, rgba(139, 92, 246, .6), rgba(139, 92, 246, 0) 50%),
                linear-gradient(160deg, #011e51 0%, #0a3a9e 55%, #0b5bd3 100%); }
.hero-band-title.hero-band-plan, .hero-band-title.hero-band-plan:has(+ .card) { padding-bottom: 22px; }
.hero-band-plan h1 { font-size: 30px; line-height: 1.15; margin-top: 12px; }
.hero-band-plan .hero-sub { margin-top: 4px; font-size: 15px; }
.plan-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; color: #fff;
    font-size: 14px; font-weight: 700; background: linear-gradient(90deg, #f59e0b, #ec4899);
    box-shadow: 0 4px 14px rgba(236, 72, 153, .35); }
.plan-stats { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 18px 0 0; padding: 0; }
.plan-stats li { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; text-align: center;
    color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .24); }
.plan-stat-value { font-size: 17px; font-weight: 800; line-height: 1.2; }
.plan-stat-label { font-size: 12px; color: rgba(255, 255, 255, .85); }
.plan-save-text { margin: 0 0 12px; }
/* Each day card opens with the planner's colours */
.card.trip-day { position: relative; overflow: hidden; }
.card.trip-day::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #14b8a6, #8b5cf6, #f59e0b); }
@media print {
    .plan-badge { padding: 0; color: var(--ink); background: none; box-shadow: none; }
    .plan-stats li { color: var(--ink); background: none; border-color: var(--line); }
    .plan-stat-label { color: var(--muted); }
}
.plan-save .row-actions .btn { flex: 1 1 140px; width: auto; margin: 0; }
/* Expense categories (models/Category.php) */
.cat-pick { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
/* No grey square flash on tap (phones): the pill's own colours show the choice */
.cat-option { position: relative; margin: 0; font-weight: 400; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
.cat-chip { -webkit-tap-highlight-color: transparent; }
.cat-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cat-option span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line);
    border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.cat-option span svg { color: var(--muted); flex: none; }
.cat-option input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }
.cat-option input:checked + span svg { color: var(--brand-dark); }
.cat-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cat-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 0 4px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
    background: #fff; color: var(--ink); font-size: 14px; text-decoration: none; white-space: nowrap; }
.cat-chip svg { color: var(--muted); }
.cat-chip[aria-current="page"] { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; font-weight: 600; }
.cat-chip[aria-current="page"] svg { color: #fff; }
.cat-icon { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--muted); }
.hero-cat { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
    background: rgba(255,255,255,.14); color: #fff; font-size: 14px; text-decoration: none; }
.hero-cat:hover { background: rgba(255,255,255,.24); }
.cat-spend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cat-spend a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; color: inherit; text-decoration: none; border-radius: 10px; }
.cat-spend a:hover { background: var(--bg); }
.cat-spend-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark); }
.cat-spend-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.cat-spend-top { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.cat-spend-name { font-weight: 600; }
.cat-spend-total { white-space: nowrap; font-weight: 600; }
.cat-spend-mine { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-spend-bar { display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--line); -webkit-appearance: none; appearance: none; }
.cat-spend-bar::-webkit-meter-bar { height: 8px; border: 0; border-radius: 4px; background: var(--line); }
.cat-spend-bar::-webkit-meter-optimum-value { border-radius: 4px; background: var(--brand); }
.cat-spend-bar::-moz-meter-bar { border-radius: 4px; background: var(--brand); }
@media print { .cat-chips, .hero-cat { display: none; } .cat-spend-bar::-webkit-meter-optimum-value { background: #555; } }
