/* מיליון או דולר — "calm": sage and cream, soft surfaces, no alarming reds. Money news should feel manageable, not scary.
   Tokens first; dark mode is its own selected steps. */
:root {
  color-scheme: light;
  --page: #f5f6f1;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --ink: #26332f;
  --ink-2: #56645f;
  --muted: #84918c;
  --line: #e3e8e2;
  --line-2: #cbd3cc;
  --brand: #3f7a6c;
  --brand-ink: #ffffff;
  --brand-soft: #e2efea;
  --hero: #e4efe9;
  --hero-ink: #23332d;
  --hero-ink-2: #5a6b64;
  --hero-bad: #fbeee6;
  --hero-bad-ink: #4a2e24;
  --hero-bad-ink-2: #7d5a4c;
  --logo-ink: #ffffff;
  --s1: #4f93a8;
  --s1-soft: #d6e9ef;
  --s2: #e39a74;
  --good: #5fae84;
  --good-text: #2f7553;
  --good-soft: #e3f2e9;
  --warn: #e8b85c;
  --warn-text: #85601c;
  --warn-soft: #fbf1dc;
  --serious: #e59b7a;
  --crit: #d97c6a;
  --crit-text: #a14e3d;
  --crit-soft: #fbe9e4;
  --neg-zone: rgba(217, 124, 106, 0.09);
  --shadow: 0 1px 2px rgba(38, 51, 47, 0.03), 0 4px 16px rgba(38, 51, 47, 0.04);
  --r: 20px;
  --r-s: 12px;
  --font: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Varela Round', 'Heebo', system-ui, sans-serif;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121816; --surface: #1a2220; --surface-2: #222c29; --ink: #e4ece8; --ink-2: #b5c2bc; --muted: #8a9893;
    --line: #26302d; --line-2: #34403c; --brand: #7fc1b0; --brand-ink: #0f1a17; --brand-soft: #1d2e29;
    --hero: #1e2b27; --hero-ink: #e4ece8; --hero-ink-2: #a9b8b2; --hero-bad: #2b211d; --hero-bad-ink: #f1e3dc; --hero-bad-ink-2: #c5a99c; --logo-ink: #0f1a17;
    --s1: #64a9bf; --s1-soft: #1e3640; --s2: #e0a07f; --good-text: #7fcb9f; --good-soft: #18291f;
    --warn-text: #e8c27a; --warn-soft: #2c2617; --crit: #e08f7d; --crit-text: #f0a493; --crit-soft: #321e1a; --neg-zone: rgba(224, 143, 125, 0.10);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121816; --surface: #1a2220; --surface-2: #222c29; --ink: #e4ece8; --ink-2: #b5c2bc; --muted: #8a9893;
  --line: #26302d; --line-2: #34403c; --brand: #7fc1b0; --brand-ink: #0f1a17; --brand-soft: #1d2e29;
  --hero: #1e2b27; --hero-ink: #e4ece8; --hero-ink-2: #a9b8b2; --hero-bad: #2b211d; --hero-bad-ink: #f1e3dc; --hero-bad-ink-2: #c5a99c; --logo-ink: #0f1a17;
  --s1: #64a9bf; --s1-soft: #1e3640; --s2: #e0a07f; --good-text: #7fcb9f; --good-soft: #18291f;
  --warn-text: #e8c27a; --warn-soft: #2c2617; --crit: #e08f7d; --crit-text: #f0a493; --crit-soft: #321e1a; --neg-zone: rgba(224, 143, 125, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 500; }
p { margin: 0; }
.num, .tile-v, .row-amt, .hero-v, .big-num { font-variant-numeric: tabular-nums; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--ink); }
.brand svg { width: 32px; height: 32px; border-radius: 10px; }
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  cursor: pointer; position: relative; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.bell-n {
  position: absolute; top: 4px; inset-inline-end: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--crit); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }
.wrap > * + * { margin-top: 14px; }
.nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); max-width: 120px; }
.nav a .ic { width: 22px; height: 22px; }
.nav a.on { color: var(--ink); font-weight: 600; }
.nav a.on .ic { color: var(--brand); stroke-width: 2.1; }
@media (min-width: 900px) {
  body { padding-bottom: 32px; }
  .nav { position: sticky; top: 60px; bottom: auto; height: auto; max-width: 760px; margin: 0 auto 4px; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
  .nav a { flex-direction: row; gap: 8px; padding: 9px 0; font-size: 14px; border-radius: 10px; max-width: none; }
  .nav a.on { background: var(--surface-2); }
  .top { max-width: 792px; margin: 0 auto; }
}

.page-h { font-family: var(--font-display); font-size: 26px; font-weight: 400; margin-top: 6px; }
.page-h small { font-size: 15px; font-weight: 400; }
.sec-h { font-size: 18px; margin-top: 24px !important; }

/* ---------- surfaces ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card.slim { padding: 12px 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { font-size: 16px; }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.card > summary::after { content: '+'; color: var(--muted); font-weight: 400; }
details.card[open] > summary::after { content: '–'; }
details.card[open] > summary { margin-bottom: 10px; }

.hero { background: var(--hero); color: var(--hero-ink); border-radius: 24px; padding: 22px 22px 20px; position: relative; overflow: hidden; }
.hero.bad { background: var(--hero-bad); color: var(--hero-bad-ink); --hero-ink: var(--hero-bad-ink); --hero-ink-2: var(--hero-bad-ink-2); }
.hero-l { color: var(--hero-ink-2); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.hero-v { font-family: var(--font-display); font-size: clamp(38px, 11vw, 50px); font-weight: 400; letter-spacing: -0.5px; line-height: 1.15; margin: 6px 0 8px; font-variant-numeric: normal; }
.hero-s { color: var(--hero-ink-2); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero-s b { color: var(--hero-ink); font-weight: 500; }
.hero .btn { margin-top: 10px; }
.hero.bad .hero-s .ic { color: var(--crit-text); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: block; }
a.tile:hover { border-color: var(--line-2); }
.tile-l { font-size: 13px; color: var(--ink-2); }
.tile-v { font-family: var(--font-display); font-size: 22px; font-weight: 400; margin-top: 2px; font-variant-numeric: normal; }
.tile-v.neg { color: var(--crit-text); }
.tile-s { font-size: 12px; color: var(--muted); }

.month-switch { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px !important; }
.month-switch h2 { font-size: 18px; min-width: 150px; text-align: center; }

.demo-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); font-size: 14px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; font-size: 13px; color: var(--ink-2); }
.note.warn { background: var(--warn-soft); color: var(--ink); }
.note .ic { width: 18px; height: 18px; margin-top: 1px; }
.note.warn .ic { color: var(--warn-text); }

.empty { text-align: center; padding: 28px 16px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); display: grid; justify-items: center; gap: 12px; }
.empty > .ic { width: 34px; height: 34px; color: var(--muted); }
.empty.big { padding: 48px 20px; margin-top: 30px !important; }
.empty.big h2 { font-size: 22px; color: var(--ink); }
.empty p { max-width: 46ch; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--crit-text); }
.btn.big { min-height: 50px; font-size: 16px; padding: 0 22px; }
.btn.tiny { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.tiny .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--brand); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link.muted { color: var(--muted); font-weight: 400; }
.link.inv { color: var(--hero-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.link .ic { width: 16px; height: 16px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.chip .ic { width: 15px; height: 15px; }
.chip.good { background: var(--good-soft); color: var(--good-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.crit { background: var(--crit-soft); color: var(--crit-text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.btn-chip { border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; padding: 6px 12px; color: var(--ink); white-space: normal; text-align: start; }
.btn-chip:hover { border-color: var(--line-2); }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.badge .ic { width: 13px; height: 13px; }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }

/* ---------- tabs, segmented ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 8px 10px; border-radius: 9px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.tabs a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

/* ---------- rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.card > .rows { margin: -4px -16px -16px; }
.card > .card-h + .rows, .card > p + .rows { margin-top: 0; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; background: none; border: 0; text-align: start; cursor: pointer; }
button.row:hover { background: var(--surface-2); }
.row.static { cursor: default; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.row-s { font-size: 12.5px; color: var(--muted); }
.row-d { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.row-amt { font-weight: 600; white-space: nowrap; }
.row-amt.pos { color: var(--good-text); }
.row.done .row-t { text-decoration: line-through; color: var(--muted); }
.row.late .row-s { color: var(--crit-text); }
.date-pill { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--surface-2); line-height: 1.05; flex: none; }
.date-pill b { font-size: 16px; }
.date-pill small { font-size: 10.5px; color: var(--muted); }
.tick { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; }
.tick .ic { width: 17px; height: 17px; stroke-width: 2.4; }
.tick.on { background: var(--good-text); border-color: var(--good-text); color: #fff; }

/* ---------- insights ---------- */
.insights { display: grid; gap: 10px; }
.insight { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; border-inline-start: 4px solid var(--line-2); }
.insight-ic .ic { width: 22px; height: 22px; }
.insight h3 { font-size: 15px; font-weight: 500; }
.insight p { font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.insight-main { flex: 1; min-width: 0; }
.insight-act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.insight-act:empty { display: none; }
.lv-critical { border-inline-start-color: var(--crit); }
.lv-critical .insight-ic { color: var(--crit-text); }
.lv-serious { border-inline-start-color: var(--serious); }
.lv-serious .insight-ic { color: var(--serious); }
.lv-warning { border-inline-start-color: var(--warn); }
.lv-warning .insight-ic { color: var(--warn-text); }
.lv-info .insight-ic { color: var(--s1); }
.lv-good { border-inline-start-color: var(--good); }
.lv-good .insight-ic { color: var(--good-text); }
.more { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px; color: var(--brand); font-weight: 500; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; direction: ltr; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .zero { stroke: var(--ink-2); stroke-width: 1; }
.chart .limit { stroke: var(--crit); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .limit-t { fill: var(--crit-text); }
.chart .dir-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.chart .s1 { fill: var(--s1); }
.chart .s2 { fill: var(--s2); }
.chart path.line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .neg-zone { fill: var(--neg-zone); }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.s1 { fill: var(--s1); }
.chart .dot.crit { fill: var(--crit); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: color-mix(in srgb, var(--ink) 4%, transparent); }
.chart .overlay { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.chart .cross-l { stroke: var(--line-2); stroke-width: 1; }
.chart-wrap { position: relative; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; }
.sw.s1 { background: var(--s1); }
.sw.s2 { background: var(--s2); }
.legend-inline { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.avg-key { width: 2px; height: 12px; background: var(--ink-2); display: inline-block; }
.chart-tip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--page); padding: 8px 10px; border-radius: 10px;
  font-size: 13px; line-height: 1.45; max-width: 260px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.chart-tip .muted { color: color-mix(in srgb, var(--page) 65%, transparent); }
.tip-ev { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; opacity: .9; }

.hbars { display: grid; gap: 2px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
a.hbar:hover { background: var(--surface-2); }
.hbar-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; height: 12px; }
.hbar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--s1); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.hbar-avg { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); border-radius: 1px; transform: translateX(50%); }
.hbar-val { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; text-align: end; }

.meter { margin: 10px 0 14px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.meter-flag { font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 5px; margin-inline-start: 4px; }
.meter-track { height: 10px; border-radius: 5px; background: var(--s1-soft); overflow: hidden; }
.meter-fill { height: 100%; background: var(--s1); border-radius: 5px; }
.meter.warn .meter-track { background: var(--warn-soft); }
.meter.warn .meter-fill { background: var(--warn); }
.meter.warn .meter-flag { background: var(--warn-soft); color: var(--warn-text); }
.meter.crit .meter-track { background: var(--crit-soft); }
.meter.crit .meter-fill { background: var(--crit); }
.meter.crit .meter-flag { background: var(--crit-soft); color: var(--crit-text); }
.big-num { font-family: var(--font-display); font-size: 38px; font-weight: 400; letter-spacing: -.3px; font-variant-numeric: normal; }

/* ---------- switch / fields ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(-16px); }
[dir="ltr"] .switch input:checked::after { transform: translateX(16px); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field-l { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); font-size: 16px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 0; border-color: var(--brand); }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 12px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 8px; }

/* ---------- filters / tx ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { width: auto; flex: 1 1 140px; min-height: 40px; font-size: 14px; }
.search { position: relative; flex: 1 1 100%; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 12px; color: var(--muted); }
.search input { padding-inline-start: 40px !important; }
.tx-sum { font-size: 14px; color: var(--ink-2); }
.tx-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tx-day { display: flex; justify-content: space-between; padding: 8px 16px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.tx-list .rows > li { border-top: 1px solid var(--line); }
.cat-chip { color: var(--ink-2); }
.cat-chip.unk { color: var(--warn-text); }
.cat-chip.transfer { color: var(--muted); font-style: italic; }
.fab {
  position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); inset-inline-start: 16px; z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); cursor: pointer;
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
@media (min-width: 900px) { .fab { bottom: 24px; inset-inline-start: max(16px, calc(50% - 380px - 72px)); } }

/* ---------- cards lists (insurance / savings) ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards .card { width: 100%; text-align: start; cursor: pointer; display: grid; gap: 6px; }
.cards .card:hover { border-color: var(--line-2); }
.ins-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.ins-top small { font-weight: 400; color: var(--muted); font-size: 12px; }
.ins-type { display: inline-flex; align-items: center; gap: 6px; }
.ins-co { color: var(--ink-2); font-size: 14px; }
.cards .chip { justify-self: start; white-space: normal; }
.cards .meter { margin: 4px 0; }

/* ---------- plan ---------- */
.plan .step { padding: 12px 0; border-top: 1px solid var(--line); }
.plan .step:first-of-type { border-top: 0; padding-top: 0; }
.step-h { display: flex; gap: 10px; align-items: flex-start; }
.step-h > div { flex: 1; }
.step-h h3 { font-size: 15px; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.step-tot { font-weight: 600; white-space: nowrap; }
.step-tot small, .step-r small { font-weight: 400; color: var(--muted); font-size: 11px; }
.step-items { list-style: none; margin: 8px 0 0; padding: 0 36px 0 0; display: grid; gap: 8px; }
[dir="ltr"] .step-items { padding: 0 0 0 36px; }
.step-items li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; }
.step-items li > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.step-items li.opt b { font-weight: 500; }
.step-r { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- chat ---------- */
.chat-log { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; }
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 6px; }
.msg ul { margin: 4px 0; padding-inline-start: 18px; }
.msg.user { align-self: flex-start; background: var(--brand); color: var(--brand-ink); border-end-start-radius: 4px; }
.msg.assistant { align-self: flex-end; background: var(--surface-2); border-end-end-radius: 4px; }
.msg-src { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }
.icon-btn.btn { width: 44px; padding: 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- import / docs ---------- */
.drop { display: grid; justify-items: center; gap: 6px; padding: 22px; border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: center; }
.drop.big { padding: 40px 20px; }
.drop .ic { width: 30px; height: 30px; color: var(--brand); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.howto { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.howto b { color: var(--ink); }
.mini-wrap { overflow-x: auto; margin-bottom: 12px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 14px; }
.mini td, .mini th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.mini th { color: var(--muted); font-weight: 400; }
.upload .drop { margin-top: 2px; }
dl.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
dl.facts div { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
dl.facts dt { font-size: 12px; color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.guide details p { color: var(--ink-2); font-size: 14.5px; }
.guide { display: grid; gap: 8px; }

/* ---------- sheet ---------- */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); }
.sheet.wide { max-width: 720px; }
.sheet::backdrop { background: rgba(0, 0, 0, .42); }
.sheet[open] { animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-inner { display: flex; flex-direction: column; max-height: 92vh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 8px; }
.sheet-title { font-size: 18px; overflow-wrap: anywhere; }
.sheet-body { padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sheet-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sheet-actions .btn.primary { flex: 1; min-width: 140px; }
.sheet-actions.stack { flex-direction: column; }
.sheet-actions.stack .btn { width: 100%; justify-content: flex-start; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 22px; } }

.toast {
  position: fixed; z-index: 200; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ---------- welcome ---------- */
.welcome { max-width: 520px; margin: 24px auto 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
.logo-big svg { width: 76px; height: 76px; border-radius: 22px; }
.welcome h1 { font-family: var(--font-display); font-size: 34px; font-weight: 400; }
.lead { font-size: 17px; color: var(--ink-2); }
.welcome-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 10px; text-align: start; width: 100%; }
.welcome-list li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; color: var(--ink-2); }
.welcome-list b { color: var(--ink); }
.welcome-list .ic { color: var(--brand); margin-top: 2px; }
.welcome-cta { display: grid; gap: 8px; width: 100%; }

/* ---------- money habits: purchase brake, weekly budget, alerts, bank costs ---------- */
.brake-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: var(--r); cursor: pointer; text-align: start;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
}
.brake-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.brake-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--crit-soft); color: var(--crit-text); flex: none; }
.brake-ic .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.brake-t { flex: 1; display: flex; flex-direction: column; }
.brake-t b { font-size: 16px; font-weight: 500; }
.brake-t small { font-size: 13px; color: var(--ink-2); }
.brake-btn > .ic { color: var(--muted); }
.brake-btn.nudge { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.brake-btn.nudge .brake-ic { background: var(--brand-soft); color: var(--brand); }

.goal { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); font-size: 14px; margin-bottom: 12px; }
.goal .ic { color: var(--brand); }
.field.amt input { font-size: 28px; font-weight: 600; min-height: 58px; text-align: center; }
.seg.wrap { flex-wrap: wrap; margin-bottom: 12px; }
.seg.wrap label { flex: 1 1 auto; }
.seg.wrap span { padding: 7px 10px; font-size: 14px; }
.verdict { margin: 4px 0 12px; }
.verdict-h { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; }
.verdict-h .ic { width: 24px; height: 24px; margin-top: 1px; }
.verdict-h b { display: block; font-size: 17px; font-weight: 500; }
.verdict-h span { font-size: 14px; color: var(--ink-2); }
.v-stop { background: var(--crit-soft); } .v-stop .ic { color: var(--crit-text); }
.v-wait { background: var(--warn-soft); } .v-wait .ic { color: var(--warn-text); }
.v-ok { background: var(--good-soft); } .v-ok .ic { color: var(--good-text); }
.v-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.v-lines li { display: flex; gap: 8px; align-items: baseline; }
.v-lines li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; transform: translateY(-1px); }
.v-lines .v-crit::before { background: var(--crit); }
.v-lines .v-warn::before { background: var(--warn); }
.v-lines .v-ok::before { background: var(--good); }
.v-lines .v-info::before { background: var(--s1); }
.brake-q { margin: 0 0 14px; padding: 10px 12px 10px 12px; padding-inline-start: 30px; background: var(--surface-2); border-radius: 12px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.brake-acts { display: grid; gap: 8px; }
.brake-acts .btn { width: 100%; }
.buy-anyway { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.buy-anyway summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.buy-anyway[open] summary { margin-bottom: 10px; }
.buy-anyway .btn { margin-bottom: 8px; }

.week-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-num.neg { color: var(--hero-bad-ink-2); }
.big-num small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.week .chip { margin: 6px 0 4px; white-space: normal; border-radius: 12px; padding: 6px 12px; line-height: 1.45; align-items: flex-start; }
.week .chip .ic { margin-top: 2px; }
.week > p + p { margin-top: 6px; }
.saved { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--good-text); }

.row-t.wrap { white-space: normal; display: block; }
.alerts .rows, .payoff .rows { margin-bottom: 4px; }
.payoff > p { margin-top: 12px; }
.alerts .row { align-items: flex-start; }
.al .date-pill { color: var(--ink-2); }
.al-critical .date-pill { background: var(--crit-soft); color: var(--crit-text); }
.al-critical .date-pill small { color: var(--crit-text); }
.al-serious .date-pill { background: var(--crit-soft); color: var(--crit-text); }
.al-good .date-pill { background: var(--good-soft); color: var(--good-text); }
.al .date-pill .ic { width: 20px; height: 20px; }
.alerts .note { margin: 14px 0 10px; }
.alerts .row-actions { margin-top: 12px; }
a.card.take:hover { border-color: var(--line-2); }

.copybox { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; margin: 12px 0; font-size: 14px; }
.copybox p { flex: 1; }
.guide-h { font-size: 15px; margin: 14px 0 6px; }
ol.howto { padding-inline-start: 20px; }

@media (forced-colors: active) {
  .hbar-fill, .meter-fill { background: CanvasText; }
  .insight { border-inline-start-width: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
