:root {
  --bg: #111514; --panel: #171C1B; --app: #141918; --surface: #1D2321; --surface-2: #272E2C; --line: #343D3A;
  --fg: #F3F1EC; --muted: #A0A8A5; --accent: #00A862; --accent-ink: #04150F; --mint: #8EEBC8; --coral: #FF8A7A;
  --lilac: #B3A6FF; --gold: #E6C878; --warn: #FF8A7A;
  --font-display: "Unbounded", "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
a { color: var(--mint); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
.phone { max-width: 460px; min-height: 100vh; margin: 0 auto; background: var(--app); display: flex; flex-direction: column; position: relative; }
@media (min-width: 520px) { body { padding: 24px 0; } .phone { min-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 32px; overflow: hidden; } }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.logo { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; border: 3px dotted var(--accent-ink); outline: 3px solid var(--accent); outline-offset: -1px; }
.top .nm { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.top .sub { color: var(--muted); font-size: 13px; }
.avatar { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; }
.screen { flex: 1; padding: 8px 20px 96px; display: flex; flex-direction: column; gap: 14px; }
.tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; color: var(--muted); text-decoration: none; font-size: 11.5px; border-radius: 12px; }
.tabs a[aria-current="page"] { color: var(--fg); background: var(--surface); }
.tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.label { color: var(--muted); font-size: 15px; }
.big { font-family: var(--font-display); font-size: 54px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.card { background: var(--surface); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.nudge { background: linear-gradient(160deg, #0f2a21, #14201c); border: 1px solid #1c5a43; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-h h3 { font-size: 16px; }
.meta { color: var(--muted); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--fg); width: fit-content; }
.pill.ok { background: #0f3a29; color: var(--mint); } .pill.warn { background: #43211d; color: var(--coral); }
.pill.gold { background: #3d3517; color: var(--gold); } .pill.biz { background: #2a2447; color: var(--lilac); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.btn { appearance: none; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); font: 700 15px var(--font-body); padding: 13px 18px; border-radius: 14px; text-decoration: none; text-align: center; display: inline-block; }
.btn.ghost { background: var(--surface-2); color: var(--fg); } .btn.danger { background: #43211d; color: var(--coral); }
.btn.sm { padding: 9px 14px; font-size: 13.5px; border-radius: 11px; } .btn.block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
form.inline { display: inline; }
.flash { padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.flash.ok { background: #0f3a29; color: var(--mint); } .flash.error { background: #43211d; color: var(--coral); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, legend { color: var(--muted); font-size: 13px; }
input, select, textarea { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 15px var(--font-body); width: 100%; }
input[type="radio"], input[type="checkbox"] { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.help { color: var(--muted); font-size: 12.5px; }
.bud, .inv, .txn, .row { display: grid; gap: 6px; }
.bud-top, .bud-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bud-bar, .meter { height: 8px; background: var(--surface-2); border-radius: 99px; position: relative; overflow: hidden; }
.bud-bar i, .meter i { display: block; height: 100%; border-radius: 99px; }
.bud-bar b { position: absolute; top: -2px; width: 2px; height: 12px; background: var(--fg); }
.adj button { background: var(--surface-2); color: var(--fg); border: 0; width: 30px; height: 30px; border-radius: 9px; font-size: 16px; cursor: pointer; }
.meter i { background: var(--lilac); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .trio small { display: block; color: var(--muted); font-size: 12px; }
.trio b { font-family: var(--font-data); font-size: 16px; } .amt.in { color: var(--mint); }
.donut-row { display: flex; gap: 16px; align-items: center; } .donut-row svg { width: 150px; flex: none; }
.legend { flex: 1; display: grid; gap: 6px; font-size: 13.5px; } .legend div { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 4px; } .legend span:last-child { font-family: var(--font-data); }
.chart { width: 100%; } .chart text { fill: var(--muted); font-size: 10px; } .chart .val { fill: var(--fg); font-family: var(--font-data); }
.txn { grid-template-columns: 40px 1fr auto; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.txn .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }
.txn .ct { color: var(--muted); font-size: 12.5px; } .tag-biz { color: var(--lilac); } .tag-q { color: var(--gold); }
.day { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; padding-top: 10px; }
.seg { display: flex; background: var(--surface); border-radius: 12px; padding: 3px; } .seg a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--muted); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--surface-2); color: var(--fg); }
.list a.item, .list .item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; gap: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .timeline li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--line); }
.chat { display: flex; flex-direction: column; gap: 10px; } .msg { padding: 11px 14px; border-radius: 16px; max-width: 88%; } .msg.bot { background: var(--surface); } .msg.you { background: var(--accent); color: var(--accent-ink); align-self: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chips button { background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; cursor: pointer; font: 13.5px var(--font-body); }
.ask-form { display: flex; gap: 8px; }
.plan { border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 8px; } .plan.current { border-color: var(--accent); }
.login { margin: auto; width: 100%; padding: 28px 20px; display: grid; gap: 18px; }
.login h1 { font-size: 40px; } .login h1 span { color: var(--accent); }
.empty { text-align: center; padding: 28px 10px; display: grid; gap: 12px; justify-items: center; }
.sr { position: absolute; left: -9999px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; } table.t th { color: var(--muted); font-weight: 500; text-align: left; padding: 6px 4px; } table.t td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }

/* ---------- Desktop layout (screens >= 900px). The phone layout above stays as is. ----------
   Switch back to the phone look any time with "Phone view" (cookie), or just narrow the window. */
.viewtoggle { display: none; }
@media (min-width: 900px) {
  body.desk { padding: 0; }
  body.desk .phone {
    max-width: none; width: 100%; min-height: 100vh; border: 0; border-radius: 0; overflow: visible;
    display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-items: start;
  }
  body.desk .phone::before { content: ""; grid-column: 1; grid-row: 1 / -1; align-self: stretch; background: var(--panel); border-right: 1px solid var(--line); }
  body.desk .phone.guest { display: flex; }
  body.desk .phone.guest::before { display: none; }
  body.desk .top { grid-column: 1; grid-row: 1; padding: 28px 24px 12px; }
  body.desk .avatar { display: none; }
  body.desk .tabs {
    grid-column: 1; grid-row: 2; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px;
    border: 0; background: transparent; padding: 8px 16px;
  }
  body.desk .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 12px 14px; border-radius: 14px; }
  body.desk .tabs a:hover { background: var(--surface); color: var(--fg); }
  body.desk .viewtoggle { display: block; grid-column: 1; grid-row: 3; align-self: end; padding: 16px 24px 24px; font-size: 13px; position: sticky; bottom: 0; }
  body.desk .screen { grid-column: 2; grid-row: 1 / -1; padding: 40px 48px 72px; width: 100%; max-width: 820px; margin: 0 auto; gap: 18px; }
  body.desk .phone.guest .screen { max-width: 440px; }
  body.desk .screen.wide { max-width: 1180px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
  body.desk .screen.wide > .hero, body.desk .screen.wide > .pill, body.desk .screen.wide > .flash,
  body.desk .screen.wide > .nudge, body.desk .screen.wide > .full { grid-column: 1 / -1; }
  body.desk .big { font-size: 76px; }
  body.desk .hero { padding-top: 0; }
  body.desk h2 { font-size: 26px; }
  body.desk .donut-row svg { width: 190px; }
  body.desk .card { padding: 22px; }
}
@media (min-width: 900px) and (max-width: 1099px) {
  body.desk .screen.wide { grid-template-columns: minmax(0, 1fr); }
}
