/* Dinheiro com Dono — papel de cédula, dinheiro com cor de dono:
   verde = disponível · vermelho = contas · amarelo = atenção · azul = reservas */
:root {
  color-scheme: light;
  --ground: #e9eee9;
  --surface: #fbfcfa;
  --surface-2: #f1f5f1;
  --ink: #13201a;
  --ink-2: #44524a;
  --muted: #6f7c75;
  --line: #d8e0da;
  --line-strong: #bfcac2;
  --on-ink: #f4f7f4;

  --verde: #0b7a4b;
  --verde-ink: #06573a;
  --verde-tint: #d7eee0;
  --verde-fill: #17a066;
  --vermelho: #b8362d;
  --vermelho-tint: #f6ded9;
  --vermelho-fill: #d9544a;
  --amarelo: #8a5f00;
  --amarelo-tint: #faecc9;
  --amarelo-fill: #e9a92a;
  --azul: #2256b8;
  --azul-tint: #dde6f7;
  --azul-fill: #3d74db;
  --azul-soft: #a9c1ee;

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-sheet: 0 -8px 40px rgba(10, 20, 15, 0.22);
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0b110e;
    --surface: #141c18;
    --surface-2: #1b2520;
    --ink: #e6ede8;
    --ink-2: #b2beb7;
    --muted: #84918a;
    --line: #26322c;
    --line-strong: #37453e;
    --on-ink: #0b110e;
    --verde: #4ccb91;
    --verde-ink: #86e2b7;
    --verde-tint: #12352a;
    --verde-fill: #2fb577;
    --vermelho: #f08a7f;
    --vermelho-tint: #3b1d1a;
    --vermelho-fill: #e2645a;
    --amarelo: #f2c05a;
    --amarelo-tint: #352a10;
    --amarelo-fill: #e0a52c;
    --azul: #8eb0f5;
    --azul-tint: #17243f;
    --azul-fill: #5a8bea;
    --azul-soft: #2f4a7e;
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0b110e;
  --surface: #141c18;
  --surface-2: #1b2520;
  --ink: #e6ede8;
  --ink-2: #b2beb7;
  --muted: #84918a;
  --line: #26322c;
  --line-strong: #37453e;
  --on-ink: #0b110e;
  --verde: #4ccb91;
  --verde-ink: #86e2b7;
  --verde-tint: #12352a;
  --verde-fill: #2fb577;
  --vermelho: #f08a7f;
  --vermelho-tint: #3b1d1a;
  --vermelho-fill: #e2645a;
  --amarelo: #f2c05a;
  --amarelo-tint: #352a10;
  --amarelo-fill: #e0a52c;
  --azul: #8eb0f5;
  --azul-tint: #17243f;
  --azul-fill: #5a8bea;
  --azul-soft: #2f4a7e;
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.45 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
body.has-sheet { overflow: hidden; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--azul-fill); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; font-weight: 700; }
.pos { color: var(--verde); }
.neg { color: var(--vermelho); }
.res { color: var(--azul); }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-size: 15px; }
.sentence { color: var(--ink-2); max-width: 65ch; }
.big-sentence { font-size: 18px; max-width: 65ch; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.err { color: var(--vermelho); font-weight: 600; }

/* ─────────── estrutura ─────────── */
.main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 14px 14px calc(var(--nav-h) + 88px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
  outline: none;
}
.boot { padding: 40px 0; color: var(--muted); text-align: center; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 0 2px env(safe-area-inset-bottom);
}
.nav-brand { display: none; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--nav-h); padding: 6px 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: -0.01em;
}
.nav-ic { font-size: 20px; line-height: 1; width: 40px; height: 28px; display: grid; place-items: center; border-radius: 99px; transition: background 0.15s; }
.nav-tx { display: none; }
.nav-item.on { color: var(--ink); }
.nav-item.on .nav-ic { background: var(--verde-tint); }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 31;
  width: 58px; height: 58px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--on-ink); font-size: 30px; line-height: 1;
  box-shadow: 0 10px 24px -8px rgba(10, 20, 15, 0.45);
}
body.is-wizard .nav, body.is-wizard .fab, body.is-login .nav, body.is-login .fab { display: none; }
body.is-wizard .main, body.is-login .main { padding-bottom: 40px; }

@media (min-width: 980px) {
  .nav {
    top: 0; right: auto; width: 220px; grid-template-columns: 1fr; align-content: start; gap: 2px;
    border-top: 0; border-right: 1px solid var(--line); padding: 22px 12px;
  }
  .nav-brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 22px; font: 700 17px/1.1 var(--f-display); letter-spacing: -0.01em; }
  .nav-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--verde-tint); font-size: 18px; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 44px; padding: 6px 10px; font-size: 15px; border-radius: 12px; }
  .nav-item:hover { background: var(--surface-2); }
  .nav-tx { display: inline; }
  .nav-tx-short { display: none; }
  .nav-ic { width: 30px; height: 30px; font-size: 18px; }
  .nav-item.on { background: var(--surface-2); }
  .main { margin-left: 220px; max-width: 920px; margin-right: auto; padding: 28px 40px 80px; gap: 18px; }
  .fab { bottom: 28px; right: 28px; }
  body.is-wizard .main, body.is-login .main { margin: 0 auto; }
}
@media (min-width: 1300px) { .main { margin-left: calc(220px + (100vw - 220px - 920px) / 2); } }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 4px; }
.topbar h1 { font: 700 28px/1.05 var(--f-display); letter-spacing: -0.02em; font-variation-settings: "wdth" 92; }
.topbar .brand { font-size: 24px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.sync-tx { display: none; }
@media (min-width: 560px) { .sync-tx { display: inline; } }
.sync-offline { color: var(--amarelo); border-color: var(--amarelo-fill); }

/* ─────────── componentes ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 16px; border-radius: 13px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 15px; line-height: 1.1; text-align: center; text-decoration: none;
  transition: transform 0.08s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--ink); color: var(--on-ink); }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-small { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.danger, .danger { color: var(--vermelho); }
.btn.armed { background: var(--vermelho-fill); color: #fff; box-shadow: none; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.icon-btn {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 17px;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.armed { width: auto; padding: 0 10px; background: var(--vermelho-fill); color: #fff; font-size: 13px; font-weight: 700; }
.icon-btn[disabled] { opacity: 0.3; cursor: default; }

.panel { background: var(--surface); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.panel.plain { background: transparent; padding: 4px 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { font: 700 19px/1.15 var(--f-display); letter-spacing: -0.01em; }
.panel-head h3 { font: 700 17px/1.2 var(--f-display); }
.count { min-width: 26px; height: 26px; padding: 0 8px; display: grid; place-items: center; border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 700; }
.pair { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; }
.grid-3 { display: grid; gap: 10px; grid-template-columns: 1fr 1fr 2fr; }
.grid-icon { display: grid; gap: 10px; grid-template-columns: 76px 1fr; }
.actions-row, .row-act { display: flex; gap: 8px; align-items: center; }
.actions-row { flex-wrap: wrap; }
.actions-row .btn { flex: 1 1 auto; }
.row-act.wrap { flex-wrap: wrap; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 700; line-height: 1.5; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.p-red { background: var(--vermelho-tint); color: var(--vermelho); }
.p-green { background: var(--verde-tint); color: var(--verde); }
.p-yellow { background: var(--amarelo-tint); color: var(--amarelo); }
.p-blue { background: var(--azul-tint); color: var(--azul); }
.p-ink { background: var(--surface-2); color: var(--ink-2); }

.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 12px;
  border-radius: 99px; border: 0; background: var(--surface-2); color: var(--ink-2); cursor: pointer; font-weight: 600; font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip.on { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.chip.sm { min-height: 30px; padding: 4px 12px; font-size: 13.5px; }
.radio-chip input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chip:has(input:checked) { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.radio-chip:has(input:focus-visible) { outline: 3px solid var(--azul-fill); outline-offset: 2px; }

.callout { padding: 12px 14px; border-radius: var(--r-md); font-size: 15px; max-width: none; }
.callout.danger { background: var(--vermelho-tint); color: var(--ink); }
.callout.warn { background: var(--amarelo-tint); color: var(--ink); }
.callout.info { background: var(--azul-tint); color: var(--ink); }
.note { font-size: 15px; color: var(--ink-2); padding-top: 10px; border-top: 1px solid var(--line); }

/* ─────────── formulários ─────────── */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field > span small, .env-row small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.field > small { color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea, .inline-form input, .money-input, .suffix-input, .erow-name, .env-row select {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.field textarea { min-height: 64px; resize: vertical; }
.field select { appearance: auto; }
.field input:focus, .field select:focus, .field textarea:focus, .money-input:focus-within, .suffix-input:focus-within, .erow-name:focus { border-color: var(--ink); outline: none; }
.money-input, .suffix-input { display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.money-input > span, .suffix-input > span { color: var(--muted); font-weight: 700; font-size: 15px; }
.money-input input, .suffix-input input { border: 0 !important; padding: 10px 0; min-height: 44px; background: transparent; font-variant-numeric: tabular-nums; font-weight: 600; outline: none; flex: 1; min-width: 0; width: 100%; }
.field.big .money-input { min-height: 60px; }
.field.big .money-input input { font-size: 26px; font-weight: 600; }
.field.big .money-input > span { font-size: 18px; }
.field.sm input, .field.sm select, .field.sm .money-input { min-height: 42px; }
.field.sm .money-input input { min-height: 40px; }
.check, .radio { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input, .radio input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.radio-row { border: 0; padding: 0; margin: 0; display: grid; gap: 2px; }
.radio-row legend, .checks legend, .chips-field legend { font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.chips-field, .checks { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { display: grid; gap: 2px; padding-top: 6px; }
.checks .hint { margin-bottom: 4px; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--verde-fill); }
.inline-form { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .inline-form { grid-template-columns: 1.3fr 1fr auto; } }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.icon-input { text-align: center; font-size: 22px; }
.env-grid { display: grid; gap: 10px; }
.env-row { display: grid; grid-template-columns: 1fr minmax(0, 170px); gap: 10px; align-items: center; }
.env-row:has(> .link) { grid-template-columns: 1fr minmax(0, 150px) auto; }
.env-row > span { font-weight: 600; }
.total-line { font-size: 15px; color: var(--ink-2); }

/* ─────────── início ─────────── */
.hero {
  background: var(--verde-tint);
  border-radius: 24px;
  padding: 18px 18px 16px;
  display: grid;
  gap: 12px;
}
.hero.tone-warn { background: var(--amarelo-tint); }
.hero.tone-over { background: var(--vermelho-tint); }
.hero-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-2); }
.hero-head h2 { font-size: 13.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.hero-grid { display: grid; gap: 14px; }
@media (min-width: 620px) { .hero-grid { grid-template-columns: 1.35fr 1fr; align-items: end; } }
.hero-main { display: grid; gap: 4px; }
.hero-k { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.hero-of { font-size: 14.5px; color: var(--ink-2); }
.money-big {
  display: inline-flex; align-items: baseline; flex-wrap: nowrap;
  font-family: var(--f-display); font-weight: 750; font-variation-settings: "wdth" 82, "opsz" 96;
  font-size: clamp(50px, 15vw, 76px); line-height: 0.92; letter-spacing: -0.035em;
  color: var(--verde-ink); font-variant-numeric: lining-nums;
}
.hero.tone-over .money-big { color: var(--vermelho); }
.hero.tone-warn .money-big { color: var(--amarelo); }
.money-big .cur { font-size: 0.34em; font-weight: 700; margin-right: 0.18em; letter-spacing: 0; align-self: flex-start; margin-top: 0.3em; }
.money-big .dec { font-size: 0.4em; letter-spacing: 0; }
.money-big .sign { margin-right: 0.05em; }
.money-big.ink { color: var(--ink); font-size: clamp(40px, 11vw, 56px); }
.money-big.res { color: var(--azul); font-size: clamp(38px, 10vw, 52px); }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { display: grid; gap: 2px; background: color-mix(in srgb, var(--surface) 72%, transparent); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.mini strong { font-size: 21px; }
.mini small { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.meter { height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 70%, transparent); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--verde-fill); transition: width 0.4s; }
.hero.tone-warn .meter > span { background: var(--amarelo-fill); }
.hero.tone-over .meter > span { background: var(--vermelho-fill); }
.meter.slim { height: 8px; background: var(--surface-2); }
.meter.slim > span { background: var(--ink-2); }
.meter.res { background: var(--azul-tint); }
.meter.res > span { background: var(--azul-fill); }
.meter-legend { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); margin-top: -6px; }
.hero-status { font-weight: 700; font-size: 16px; }
.hero-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }

.quick { display: grid; gap: 6px; padding: 2px 2px 4px; }
.quick-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.quick-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.quick-row input { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface); padding: 10px 14px; font-size: 18px; }
.quick-row input:focus { border-color: var(--ink); outline: none; }
.quick-row .btn { min-height: 52px; }
.quick-hint { font-size: 13.5px; color: var(--muted); padding-left: 4px; }

.saldo-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; }
.saldo-line strong { font-size: 24px; }
.dono-bar { display: flex; gap: 2px; height: 22px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.dono-bar.is-empty { height: 8px; }
.seg { flex: 1 1 0; min-width: 4px; }
.seg-red { background: var(--vermelho-fill); }
.seg-blue { background: var(--azul-fill); }
.seg-blue2 { background: var(--azul-soft); }
.seg-green { background: var(--verde-fill); }
.seg-short { background: repeating-linear-gradient(45deg, var(--vermelho-fill) 0 4px, var(--vermelho-tint) 4px 8px); }
.trio { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trio-item { display: grid; gap: 2px; align-content: start; padding: 10px; border-radius: 12px; min-width: 0; }
.trio-item > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.trio-item strong { font-size: 17px; overflow-wrap: anywhere; }
.trio-item small { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.t-red { background: var(--vermelho-tint); } .t-red strong { color: var(--vermelho); }
.t-blue { background: var(--azul-tint); } .t-blue strong { color: var(--azul); }
.t-green { background: var(--verde-tint); } .t-green strong { color: var(--verde); }
@media (max-width: 380px) { .trio { grid-template-columns: 1fr; } }

.tile { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 4px; align-content: start; justify-items: start; }
.tile-k { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tile-v { font-size: 26px; line-height: 1.15; }
.tile-sub { font-weight: 700; }
.tile-when { color: var(--ink-2); font-size: 14.5px; }
.tile .btn { margin-top: 6px; }

.alerts { list-style: none; padding: 0; display: grid; gap: 8px; }
.alert { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; background: var(--surface); border-radius: 14px; padding: 10px 12px; }
.alert p { font-size: 15px; line-height: 1.35; }
.alert .btn { grid-column: 2; justify-self: start; }
@media (min-width: 560px) { .alert { grid-template-columns: auto 1fr auto; } .alert .btn { grid-column: auto; } }
.alert-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); font-size: 17px; }
.lv-danger .alert-ic { background: var(--vermelho-tint); }
.lv-warn .alert-ic { background: var(--amarelo-tint); }
.lv-info .alert-ic { background: var(--azul-tint); }
.lv-ok .alert-ic, .lv-money .alert-ic { background: var(--verde-tint); }

.quad { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .quad { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quad > div { display: grid; gap: 2px; align-content: start; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.quad span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.quad b { font-size: 18px; overflow-wrap: anywhere; }
.quad small { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

/* ─────────── listas ─────────── */
.rows { list-style: none; padding: 0; display: grid; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.rows > .row:first-child { border-top: 0; }
.row.is-off { opacity: 0.55; }
.row-ic { width: 26px; text-align: center; font-size: 18px; }
.row-main { display: grid; gap: 2px; min-width: 0; justify-items: start; }
.row-main b { font-weight: 700; overflow-wrap: anywhere; }
.row-main small { color: var(--muted); font-size: 13.5px; }
.row > .num { text-align: right; white-space: nowrap; }
.row-act { justify-content: flex-end; }
@media (max-width: 520px) {
  .row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .row > .row-act { grid-column: 2 / -1; justify-content: flex-start; }
}
.rows.compact .row { padding: 6px 0; grid-template-columns: auto 1fr auto; }
.tx-day { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 10px; }

.owners { display: grid; gap: 10px; }
.owner { border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.o-red { background: var(--vermelho-tint); }
.o-blue { background: var(--azul-tint); }
.o-green { background: var(--verde-tint); }
.owner-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.o-red .owner-head b { color: var(--vermelho); }
.o-blue .owner-head b { color: var(--azul); }
.o-green .owner-head b { color: var(--verde); }
.owner-list { list-style: none; padding: 0; display: grid; }
.owner-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); font-size: 15px; align-items: baseline; }
.owner-list li:first-child { border-top: 0; }
.owner-list .when { font-size: 13px; color: var(--ink-2); text-align: right; }
@media (max-width: 480px) { .owner-list li { grid-template-columns: minmax(0, 1fr) auto; } .owner-list .when { grid-column: 1; grid-row: 2; text-align: left; } }
.saldo-hero { display: grid; gap: 4px; }
.saldo-hero small { color: var(--ink-2); }
details.more summary { cursor: pointer; font-weight: 700; color: var(--azul); font-size: 14.5px; }
details.more[open] summary { margin-bottom: 6px; }

/* ─────────── calendário ─────────── */
.month-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.month-nav h2 { text-align: center; font: 700 20px/1.1 var(--f-display); }
.month-nav .icon-btn { font-size: 26px; background: var(--surface-2); }
.cal-panel { padding: 12px; }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-head span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-cell {
  min-height: 60px; display: grid; grid-template-rows: auto 1fr auto; gap: 1px; align-items: start;
  padding: 5px 4px; border-radius: 10px; border: 0; background: var(--surface-2); text-align: left; cursor: pointer; min-width: 0;
}
.cal-cell.is-out { background: transparent; cursor: default; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-cell.is-sel { background: var(--ink); color: var(--on-ink); }
.cal-cell.is-sel .cal-bal { color: var(--on-ink); }
.cal-n { font-size: 13px; font-weight: 700; }
.cal-marks { display: flex; flex-wrap: wrap; gap: 2px; align-content: center; }
.cal-bal { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; font-weight: 500; letter-spacing: -0.03em; }
.cal-bal.neg { color: var(--vermelho); }
.mk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.mk.in { background: var(--verde-fill); }
.mk.out { background: var(--vermelho-fill); }
.mk.res { background: var(--azul-fill); }
.mk.sp { background: var(--amarelo-fill); border-radius: 2px; }
.cal-cell.is-sel .mk { box-shadow: 0 0 0 1.5px var(--on-ink); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
@media (min-width: 700px) { .cal-cell { min-height: 76px; padding: 7px; } .cal-bal { font-size: 12px; } .cal-n { font-size: 14px; } }
.dot-in, .dot-out, .dot-res { width: 10px; height: 10px; border-radius: 50%; justify-self: center; }
.dot-in { background: var(--verde-fill); }
.dot-out { background: var(--vermelho-fill); }
.dot-res { background: var(--azul-fill); }
.agenda { list-style: none; padding: 0; display: grid; }
.agenda > li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.agenda > li:first-child { border-top: 0; }
.agenda > li.is-past { opacity: 0.62; }
.agenda > li.is-today .ag-date b { background: var(--ink); color: var(--on-ink); }
.ag-date { display: grid; justify-items: center; align-content: start; }
.ag-date b { font: 700 20px/1 var(--f-display); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); }
.ag-date span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.agenda .rows .row { padding: 4px 0; border-top: 0; grid-template-columns: auto minmax(0, 1fr) auto; }
.ag-bal { grid-column: 2; font-size: 13px; color: var(--muted); }

/* ─────────── contas ─────────── */
.seg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; background: var(--surface); padding: 4px; border-radius: 14px; }
.seg-tab { min-height: 42px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; padding: 4px; line-height: 1.1; }
.seg-tab.on { background: var(--ink); color: var(--on-ink); }
.feature { background: var(--surface); box-shadow: inset 0 0 0 2px var(--azul-tint); }
.feature-grid, .facts { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .feature-grid, .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } .facts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature-grid > div, .facts > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.feature-grid dt, .facts dt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.feature-grid dd, .facts dd { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.facts dd.big { font-size: 24px; }
.freed { background: var(--verde-tint); }
.freed .eyebrow { color: var(--verde-ink); }
.freed .rows .row { border-top-color: color-mix(in srgb, var(--ink) 10%, transparent); }
.freed-line { font-size: 15.5px; }
.analysis .panel-head b { font-size: 15px; }
.qa { display: grid; gap: 2px; }
.qa-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; font-size: 15px; }
.yn { display: flex; gap: 4px; }
.suggest { background: var(--azul-tint); border-radius: 12px; padding: 10px 12px; font-size: 15px; }

/* ─────────── relatórios / metas ─────────── */
.close-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .close-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.close-grid > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; align-content: start; }
.close-grid span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.close-grid b { font-size: 19px; overflow-wrap: anywhere; }
.close-grid small { font-size: 12.5px; color: var(--muted); }
.close-grid .wide { grid-column: 1 / -1; background: var(--ink); color: var(--on-ink); }
.close-grid .wide span { color: var(--on-ink); opacity: 0.8; }
.close-grid .wide b { font-size: 24px; }
.sentences { display: grid; gap: 6px; padding-left: 18px; color: var(--ink-2); }
.hbars { list-style: none; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hb-track { position: relative; height: 14px; }
.hb-fill, .hb-ghost { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.hb-ghost { opacity: 0.25; }
.tone-pos { background: var(--verde-fill); }
.tone-neg { background: var(--vermelho-fill); }
.tone-ink { background: var(--ink-2); }
.tone-res { background: var(--azul-fill); }
.hb-val { font-size: 13.5px; }
.goal { background: var(--azul-tint); }
.goal-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; }
.goal-grid > div { display: grid; gap: 4px; }
.goal-v { font-size: 28px; }
.goal .meter { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 12px; border-radius: 14px; border: 0; background: var(--surface-2); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); min-width: 0; }
.choice span { font-weight: 700; font-size: 14px; }
.choice b { font-size: 16px; overflow-wrap: anywhere; }
.choice small { color: var(--muted); font-size: 12.5px; }
.choice.on { box-shadow: inset 0 0 0 2.5px var(--azul-fill); background: var(--azul-tint); }
@media (max-width: 460px) { .choices { grid-template-columns: 1fr; } }
.contacts { display: grid; gap: 8px; }
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px; align-items: center; }
.contact-row input { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.contact-row input:focus { border-color: var(--ink); outline: none; }
.schedule { list-style: none; padding: 0; display: grid; gap: 6px; }
.schedule li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 10px; font-size: 14.5px; }
.schedule b { font-weight: 700; font-size: 14px; }

/* ─────────── gráficos ─────────── */
.chart { width: 100%; min-height: 60px; }
.svg-chart { display: block; width: 100%; height: auto; overflow: visible; }
.svg-chart .grid { stroke: var(--line); stroke-width: 1; }
.svg-chart .axis0 { stroke: var(--line-strong); stroke-width: 1; }
.svg-chart .tick { fill: var(--muted); font: 500 11.5px var(--f-body); }
.svg-chart .tick.strong { fill: var(--ink); font-weight: 700; }
.svg-chart .val { fill: var(--ink); font: 700 11.5px var(--f-body); }
.svg-chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.svg-chart .line.proj { stroke: var(--ink-2); stroke-dasharray: 5 5; }
.svg-chart .area { fill: var(--ink); opacity: 0.08; stroke: none; }
.svg-chart .today { stroke: var(--amarelo-fill); stroke-width: 1.5; }
.svg-chart .dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.svg-chart .dot.proj { fill: var(--ink-2); }
.svg-chart .cross { stroke: var(--muted); stroke-width: 1; }
.svg-chart .cross-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.svg-chart .col path { stroke: none; }
.svg-chart .col.tone-ink path { fill: var(--ink-2); }
.svg-chart .col.tone-over path { fill: var(--vermelho-fill); }
.svg-chart .col.tone-pos path { fill: var(--verde-fill); }
.svg-chart .col.tone-res path { fill: var(--azul-fill); }
.svg-chart .col:hover path { opacity: 0.8; }
.svg-chart .limit { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.svg-chart .col { background: none; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; max-width: 280px; }

/* ─────────── folhas / avisos ─────────── */
#sheet-root { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 12, 9, 0.5); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 14px; box-shadow: var(--shadow-sheet); animation: up 0.18s ease-out;
}
.sheet > h2 { font: 700 22px/1.15 var(--f-display); padding-right: 44px; letter-spacing: -0.01em; }
.sheet-x { position: absolute; top: 12px; right: 12px; }
@media (min-width: 700px) {
  .sheet { left: 50%; top: 50%; bottom: auto; right: auto; width: min(580px, 92vw); max-height: 88vh; transform: translate(-50%, -50%); border-radius: 24px; animation: none; }
}
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-form { display: grid; gap: 14px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.sheet-actions .btn-solid { flex: 1 1 180px; }
@media (min-width: 700px) { .sheet-actions .btn-solid { flex: 0 0 auto; } }
#canbuy-result { display: grid; gap: 12px; }
.impact { font-size: 14.5px; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; border-radius: 12px; }
.menu { display: grid; gap: 6px; }
.menu-item { text-align: left; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 0; background: var(--surface-2); font-weight: 600; cursor: pointer; }
.menu-item:hover { background: var(--line); }
.verdict { border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.verdict-label { font: 750 22px/1.1 var(--f-display); letter-spacing: -0.01em; }
.v-good { background: var(--verde-tint); }
.v-warn { background: var(--amarelo-tint); }
.v-bad { background: var(--vermelho-tint); }
.sim { display: grid; gap: 0; }
.sim > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sim > div:first-child { border-top: 0; }
.sim dt { color: var(--ink-2); }
.sim dd { text-align: right; }
.sub { font: 700 17px/1.2 var(--f-display); }
.dist { list-style: none; padding: 0; display: grid; gap: 6px; }
.dist li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; }
.dist-t { display: grid; }
.dist-t small { color: var(--ink-2); font-size: 13px; }
.dist-ic { font-size: 20px; text-align: center; }
.dist-red { background: var(--vermelho-tint); }
.dist-blue { background: var(--azul-tint); }
.dist-green { background: var(--verde-tint); }
.dist-yellow { background: var(--amarelo-tint); }
.dist-after { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; padding: 12px 14px; background: var(--ink); color: var(--on-ink); border-radius: 14px; }
.dist-after b { font-size: 22px; }
.explain { list-style: none; padding: 0; display: grid; }
.explain li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; }
.explain li:first-child { border-top: 0; }
.explain li > span { display: grid; gap: 2px; min-width: 0; }
.explain li small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.explain li b { white-space: nowrap; }
.explain li.total { font-weight: 700; }
.explain li.total b { font-size: 18px; }
.explain li.why { display: block; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 6px 0; border-top: 0; font-size: 15px; }
.explain li.why.warn { background: var(--amarelo-tint); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 86px + env(safe-area-inset-bottom)); z-index: 80; display: grid; gap: 8px; width: min(94vw, 460px); pointer-events: none; }
@media (min-width: 980px) { .toasts { bottom: 28px; } }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: var(--on-ink); padding: 12px 14px; border-radius: 14px; font-size: 14.5px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5); transition: opacity 0.3s, transform 0.3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast button { background: none; border: 1.5px solid currentColor; color: inherit; border-radius: 9px; padding: 5px 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ─────────── assistente ─────────── */
.wiz { display: grid; gap: 18px; padding-top: 8px; max-width: 40rem; margin: 0 auto; width: 100%; }
.wiz-head { display: grid; gap: 10px; }
.wiz-head h1 { font: 750 34px/1.02 var(--f-display); letter-spacing: -0.03em; font-variation-settings: "wdth" 86; }
.wiz-progress { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.wiz-count { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.wiz-bar { height: 6px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.wiz-bar span { display: block; height: 100%; background: var(--verde-fill); border-radius: 99px; }
.wiz-form { display: grid; gap: 16px; background: var(--surface); border-radius: 24px; padding: 18px 16px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.wiz-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding-top: 6px; position: sticky; bottom: 0; background: var(--surface); padding-bottom: 4px; }
.edit-list { display: grid; gap: 10px; }
.erow, .wb { border: 0; margin: 0; padding: 12px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 8px; position: relative; min-width: 0; }
.erow { grid-template-columns: 1fr auto; }
.erow .erow-fields { grid-column: 1 / -1; }
.erow-x { grid-row: 1; grid-column: 2; }
.erow-name { font-weight: 700; min-height: 42px !important; }
.erow-fields { display: grid; gap: 8px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.wb .erow-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); }
.field.day input { text-align: center; }
.wb-top { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.wb-ic { font-size: 22px; width: 30px; text-align: center; }
.wb-inst { display: grid; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface); }
.wb[data-freq="weekly"] .only-monthly, .bf[data-freq="weekly"] .only-monthly { display: none !important; }
.wb[data-freq="monthly"] .only-weekly, .bf[data-freq="monthly"] .only-weekly { display: none !important; }
.bf { display: grid; gap: 12px; }
.result { display: grid; gap: 8px; justify-items: start; background: var(--verde-tint); border-radius: 20px; padding: 18px; }
.login { max-width: 24rem; margin: 12vh auto 0; display: grid; gap: 14px; background: var(--surface); padding: 24px; border-radius: 24px; }
.login h1 { font: 750 30px/1 var(--f-display); letter-spacing: -0.02em; }
.login-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--verde-tint); font-size: 26px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
