:root {
  --bg: #F4F2EC; --surface: #FFFFFF; --surface-2: #FAF8F4; --surface-3: #F0EDE6;
  --ink: #15171B; --ink-2: #3B3F46; --muted: #6E727A; --faint: #A3A6AC; --line: #E6E2D9; --line-2: #EFECE5;
  --brand: #16211C; --brand-ink: #F4F2EC; --accent: #1E8E5A; --accent-soft: #E3F3EA;
  --warn: #C98100; --warn-soft: #FBF0D9; --danger: #D14545; --danger-soft: #FBE5E2;
  --c-inst: #6466E9; --c-fixed: #0E9F8E; --c-var: #E5A23A; --c-new: #B9B4F5; --c-oneoff: #A7AEB8; --c-target: #D14545;
  --shadow: 0 1px 2px rgba(20,22,26,.04), 0 8px 24px -12px rgba(20,22,26,.10);
  --shadow-lg: 0 24px 64px -16px rgba(20,22,26,.28);
  --r: 16px; --r-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1012; --surface: #17191C; --surface-2: #1C1E22; --surface-3: #23262A;
    --ink: #F0EFEC; --ink-2: #CFCDC8; --muted: #9A9DA3; --faint: #6A6D73; --line: #2A2D32; --line-2: #222428;
    --brand: #7BE0A6; --brand-ink: #0F1012; --accent: #4FD08A; --accent-soft: #15301F;
    --warn: #F0B341; --warn-soft: #33270F; --danger: #F07272; --danger-soft: #3A1A1A;
    --c-inst: #8486F5; --c-fixed: #2CC3B0; --c-var: #F0B455; --c-new: #5E5A9E; --c-oneoff: #6B7280;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1012; --surface: #17191C; --surface-2: #1C1E22; --surface-3: #23262A;
  --ink: #F0EFEC; --ink-2: #CFCDC8; --muted: #9A9DA3; --faint: #6A6D73; --line: #2A2D32; --line-2: #222428;
  --brand: #7BE0A6; --brand-ink: #0F1012; --accent: #4FD08A; --accent-soft: #15301F;
  --warn: #F0B341; --warn-soft: #33270F; --danger: #F07272; --danger-soft: #3A1A1A;
  --c-inst: #8486F5; --c-fixed: #2CC3B0; --c-var: #F0B455; --c-new: #5E5A9E; --c-oneoff: #6B7280;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num, .money { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 17px; }
h3 { font-size: 14px; font-family: var(--font); letter-spacing: 0; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.hide-mobile { }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); background: var(--surface-2); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.logo img { width: 30px; height: 30px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-3); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; font-size: 11px; background: var(--warn-soft); color: var(--warn); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.side .add-btn { margin: 14px 0 6px; }
.side-foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--muted); display: grid; gap: 6px; }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.sync-dot.off { background: var(--warn); }
.main { min-width: 0; padding: 28px 36px 64px; max-width: 1380px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 640px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 11px; font-weight: 600; font-size: 13px; transition: transform .08s ease, background .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn.lg { padding: 13px 18px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.add-btn svg { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.hero-main { padding: 24px 26px; }
.hero-side { padding: 24px 26px; background: var(--surface-2); border-left: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.big { font-family: var(--display); font-size: 52px; line-height: 1; letter-spacing: -.035em; font-weight: 700; font-variant-numeric: tabular-nums; }
.big small { font-size: 22px; color: var(--muted); font-weight: 500; margin-right: 4px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12.5px; padding: 3px 9px; border-radius: 99px; }
.delta.up { background: var(--danger-soft); color: var(--danger); }
.delta.down { background: var(--accent-soft); color: var(--accent); }
.delta.neutral { background: var(--surface-3); color: var(--muted); }
.stack-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin: 18px 0 10px; }
.stack-bar > span { height: 100%; transition: width .4s ease; }
.stack-bar > span + span { border-left: 2px solid var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.metric { display: grid; gap: 2px; }
.metric .v { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric .l { font-size: 12px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; }
.status.ok { background: var(--accent-soft); color: var(--accent); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 10px 12px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow-lg); min-width: 170px; z-index: 5; transform: translate(-50%, -100%); white-space: nowrap; }
.tip .kv { gap: 18px; }
.tip .kv + .kv { margin-top: 3px; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.tip hr { border: 0; border-top: 1px solid rgba(127,127,127,.35); margin: 6px 0; }
.seg { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- budgets ---------- */
.budgets { display: grid; gap: 12px; }
.bud { display: grid; grid-template-columns: 28px 1fr auto; gap: 4px 10px; align-items: center; }
.bud .ic { font-size: 17px; grid-row: span 2; text-align: center; }
.bud .name { font-weight: 500; font-size: 13px; }
.bud .val { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.bud .val b { color: var(--ink); font-weight: 600; }
.bar { grid-column: 2 / 4; height: 7px; border-radius: 99px; background: var(--surface-3); position: relative; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .4s ease; }
.bar > .pace { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .35; }

/* ---------- insights ---------- */
.insights { display: grid; gap: 10px; }
.insight { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line-2); text-align: left; width: 100%; }
.insight .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--surface); border: 1px solid var(--line); }
.insight h3 { font-size: 13.5px; }
.insight p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.insight .save { color: var(--accent); font-weight: 600; font-size: 12px; margin-top: 6px; display: inline-block; }
button.insight:hover { border-color: var(--line); background: var(--surface-3); }

/* ---------- transactions ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.input, .select { border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 9px 12px; min-height: 38px; outline: none; }
.input:focus, .select:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.search { position: relative; flex: 1; min-width: 200px; }
.search input { width: 100%; padding-left: 36px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip:hover { background: var(--surface-3); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { opacity: .6; font-size: 11px; }
.day { margin-top: 18px; }
.day-head { display: flex; justify-content: space-between; padding: 0 6px 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.txs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tx { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; border: 0; background: transparent; width: 100%; text-align: left; }
.tx + .tx { border-top: 1px solid var(--line-2); }
.tx:hover { background: var(--surface-2); }
.tx .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; }
.tx .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .s { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 1px; }
.tx .amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tx .amt small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.tx .amt.neg { color: var(--accent); }
.tag { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); letter-spacing: .01em; }
.tag.inst { background: color-mix(in srgb, var(--c-inst) 15%, transparent); color: var(--c-inst); }
.tag.fixed { background: color-mix(in srgb, var(--c-fixed) 15%, transparent); color: var(--c-fixed); }
.tag.one { background: var(--surface-3); color: var(--muted); }
.tag.manual { background: var(--warn-soft); color: var(--warn); }
.tag.pending { background: var(--warn-soft); color: var(--warn); }
.summary-strip { display: flex; gap: 24px; flex-wrap: wrap; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; }

/* ---------- sheet / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,12,14,.42); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; animation: fade .18s ease; }
.sheet { background: var(--surface); width: min(520px, 100%); max-height: 92vh; overflow: auto; border-radius: 22px; box-shadow: var(--shadow-lg); animation: rise .22s cubic-bezier(.2,.9,.3,1.1); }
.sheet.wide { width: min(820px, 100%); }
.sheet-head { position: sticky; top: 0; background: var(--surface); padding: 18px 20px 10px; display: flex; align-items: center; justify-content: space-between; z-index: 2; }
.sheet-body { padding: 4px 20px 20px; display: grid; gap: 16px; }
.sheet-foot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); display: flex; gap: 10px; }
.x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-3); display: grid; place-items: center; font-size: 18px; }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { transform: translateY(24px); opacity: 0 } }
.amount-field { display: flex; align-items: baseline; gap: 6px; justify-content: center; padding: 6px 0 2px; }
.amount-field span { font-family: var(--display); font-size: 26px; color: var(--muted); }
.amount-field input { border: 0; outline: 0; background: transparent; font-family: var(--display); font-weight: 700; font-size: 54px; width: 7ch; text-align: left; letter-spacing: -.03em; font-variant-numeric: tabular-nums; padding: 0; }
.amount-field input::placeholder { color: var(--line); }
.field { display: grid; gap: 7px; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cat-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 4px 7px; display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 500; line-height: 1.2; text-align: center; min-height: 62px; }
.cat-btn .e { font-size: 19px; }
.cat-btn.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.suggest { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.suggest .chip { flex: none; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); width: 36px; height: 36px; font-size: 17px; }
.stepper span { min-width: 64px; text-align: center; font-weight: 600; font-size: 13px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch input { appearance: none; width: 42px; height: 25px; border-radius: 99px; background: var(--line); position: relative; transition: .2s; flex: none; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 20px; }
.impact { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12.5px; display: grid; gap: 8px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; animation: rise .22s ease; font-size: 13px; }
.toast .grow small { display: block; opacity: .7; margin-top: 2px; }
.toast button { background: transparent; border: 0; color: var(--brand); font-weight: 700; color: #7BE0A6; }

/* ---------- plan ---------- */
.lever { display: grid; grid-template-columns: 30px 1fr 150px 92px; align-items: center; gap: 12px; padding: 10px 0; }
.lever + .lever { border-top: 1px solid var(--line-2); }
.lever .ic { font-size: 18px; text-align: center; }
.lever .name { font-weight: 500; font-size: 13px; }
.lever .sub { font-size: 11.5px; color: var(--muted); }
.lever .out { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.lever .out b { display: block; font-size: 13px; color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 22px; }
.nat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.nat.superfluo { color: var(--danger); background: var(--danger-soft); }
.nat.flexivel { color: var(--warn); background: var(--warn-soft); }
.nat.essencial { color: var(--muted); background: var(--surface-3); }
.sub-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 10px 0; }
.sub-row + .sub-row { border-top: 1px solid var(--line-2); }
.sub-row.cancel .t { text-decoration: line-through; color: var(--muted); }
.gantt { display: grid; gap: 6px; }
.gantt-row { display: grid; grid-template-columns: 190px 1fr 86px; gap: 10px; align-items: center; font-size: 12.5px; }
.gantt-track { position: relative; height: 18px; background: var(--surface-3); border-radius: 6px; }
.gantt-bar { position: absolute; top: 0; bottom: 0; background: var(--c-inst); border-radius: 6px; opacity: .85; }
.gantt-bar.done { background: var(--c-inst); opacity: .3; }
.gantt-scale { display: grid; grid-template-columns: 190px 1fr 86px; gap: 10px; font-size: 11px; color: var(--faint); }
.gantt-scale .ticks { display: flex; justify-content: space-between; }
.savings-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.savings-hero > div { padding: 4px 20px; }
.savings-hero > div + div { border-left: 1px solid var(--line); }
.goal-input { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; background: var(--surface); }
.goal-input input { border: 0; outline: 0; background: transparent; width: 100px; font-weight: 700; font-size: 18px; font-family: var(--display); font-variant-numeric: tabular-nums; }

/* ---------- analysis ---------- */
.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.heat th { font-weight: 600; color: var(--muted); font-size: 11.5px; text-align: right; padding: 4px 8px; }
.heat th:first-child { text-align: left; }
.heat td { padding: 8px; border-radius: 7px; text-align: right; font-variant-numeric: tabular-nums; }
.heat td:first-child { text-align: left; white-space: nowrap; background: transparent !important; font-weight: 500; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; }
.hbar + .hbar { margin-top: 10px; }
.hbar .track { grid-column: 1 / 3; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 99px; }

/* ---------- import ---------- */
.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 34px 20px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--surface-2); transition: .15s; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 34px; height: 34px; color: var(--muted); }
.preview { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.preview th, .preview td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
.preview td.num { text-align: right; }
.preview tr.dup td { color: var(--faint); text-decoration: line-through; }
.preview tr.match td:first-child { box-shadow: inset 3px 0 var(--accent); }
.tablewrap { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 12px; }
textarea.input { width: 100%; min-height: 120px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; }
.qr { background: white; padding: 12px; border-radius: 14px; display: inline-block; }
.qr img, .qr svg { display: block; width: 180px; height: 180px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .e { font-size: 34px; }

/* ---------- triage ---------- */
.triage-card { text-align: center; padding: 10px 0 4px; display: grid; gap: 4px; }
.triage-card .m { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.triage-card .a { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- mobile ---------- */
.tabbar { display: none; }
.m-only { display: none; }
@media (max-width: 1100px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
}
@media (max-width: 860px) {
  html, body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: calc(14px + env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom)); }
  .hide-mobile { display: none !important; }
  .m-only { display: block; }
  h1 { font-size: 25px; }
  .page-head { margin-bottom: 16px; }
  .grid { gap: 12px; }
  .span-3 { grid-column: span 12; }
  .card { padding: 16px; border-radius: 18px; }
  .card.hero { padding: 0; }
  .card-head { flex-wrap: wrap; }
  .card-head .seg { width: 100%; }
  .card-head .seg button { flex: 1; }
  .hero { grid-template-columns: 1fr; }
  .hero-main, .hero-side { padding: 18px; }
  .hero-side { border-left: 0; border-top: 1px solid var(--line); }
  .big { font-size: 42px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 0; }
  .tabbar a.on { color: var(--ink); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .fab { align-self: center; justify-self: center; width: 54px; height: 54px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-top: -22px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.45); border: 0; }
  .tabbar .fab svg { width: 26px; height: 26px; }
  .scrim { place-items: end center; }
  .sheet, .sheet.wide { border-radius: 24px 24px 0 0; max-height: 94vh; width: 100%; }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .lever { grid-template-columns: 26px 1fr 84px; }
  .lever input[type=range] { grid-column: 2 / 4; }
  .lever .out { grid-row: 1; grid-column: 3; }
  .gantt-row, .gantt-scale { grid-template-columns: 110px 1fr 70px; }
  .savings-hero { grid-template-columns: 1fr; }
  .savings-hero > div { padding: 10px 0; }
  .savings-hero > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .tx { padding: 12px; }
  .input, .select { font-size: 16px; }
}
.lever .out > span { display: block; }
