/* =========================================================
   Plano Claro · Onboarding de orçamento pessoal
   Tokens → base → layout → componentes → etapas → responsivo
   ========================================================= */

:root {
  /* Superfícies */
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #EFEBE3;
  --line: #DDD8CD;
  --line-strong: #C8C1B3;

  /* Texto */
  --ink: #17211C;
  --ink-2: #4A564F;
  --ink-3: #5A645E;

  /* Marca */
  --primary: #1E5C45;
  --primary-hover: #174A37;
  --on-primary: #FFFFFF;
  --primary-soft: #E3EEE8;
  --ring: #2F7A5C;

  /* Semântica do orçamento (sempre acompanhada de rótulo) */
  --c-in: #17211C;
  --c-needs: #1E5C45;
  --c-wants: #B8741A;
  --c-debt: #9A3B2F;
  --c-future: #2F5E9E;

  /* Estados */
  --danger: #B3261E;
  --danger-soft: #FBE9E7;
  --warn: #8A5A0B;
  --warn-soft: #FBF1DD;
  --ok: #1E5C45;

  /* Tipografia */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Espaço, raio, sombra, movimento */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --shadow: 0 1px 2px rgba(23, 33, 28, .06), 0 4px 16px rgba(23, 33, 28, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms;
  --t-med: 240ms;

  color-scheme: light;
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1513; --surface: #161E1B; --surface-2: #1E2824; --line: #2A3631; --line-strong: #3A4842;
    --ink: #ECEFEA; --ink-2: #B4BEB7; --ink-3: #8E9A93;
    --primary: #6BC49D; --primary-hover: #84D2AF; --on-primary: #0B1410; --primary-soft: #1C3229; --ring: #84D2AF;
    --c-in: #ECEFEA; --c-needs: #6BC49D; --c-wants: #E3A94A; --c-debt: #EE8A7C; --c-future: #86ADE6;
    --danger: #F2827A; --danger-soft: #3A1E1B; --warn: #E9B866; --warn-soft: #33281A; --ok: #6BC49D;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1513; --surface: #161E1B; --surface-2: #1E2824; --line: #2A3631; --line-strong: #3A4842;
  --ink: #ECEFEA; --ink-2: #B4BEB7; --ink-3: #8E9A93;
  --primary: #6BC49D; --primary-hover: #84D2AF; --on-primary: #0B1410; --primary-soft: #1C3229; --ring: #84D2AF;
  --c-in: #ECEFEA; --c-needs: #6BC49D; --c-wants: #E3A94A; --c-debt: #EE8A7C; --c-future: #86ADE6;
  --danger: #F2827A; --danger-soft: #3A1E1B; --warn: #E9B866; --warn-soft: #33281A; --ok: #6BC49D;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.num, dd, .subtotal strong, .kpi-value { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 50;
  background: var(--primary); color: var(--on-primary);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  min-height: 100dvh;
}

.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: var(--s-6);
  padding: var(--s-6) var(--s-5);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.stage {
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 0 var(--s-7);
}

.summary {
  padding: var(--s-6) var(--s-5) var(--s-6) 0;
}
.summary-card { position: sticky; top: var(--s-6); }

/* Na etapa de resultado, o resumo some e o plano ganha espaço */
body.is-plan .app { grid-template-columns: 280px minmax(0, 1fr); }
body.is-plan .summary,
body.is-plan .mini-summary { display: none; }
body.is-plan .flow { max-width: 880px; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: var(--s-3); }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--primary);
  display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 7px;
}
.brand-mark span { width: 4px; background: var(--on-primary); border-radius: 2px; }
.brand-mark span:nth-child(1) { height: 7px; }
.brand-mark span:nth-child(2) { height: 12px; }
.brand-mark span:nth-child(3) { height: 18px; }

/* ---------- Stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stepper button {
  width: 100%; display: flex; align-items: center; gap: var(--s-3);
  min-height: 44px; padding: var(--s-2) var(--s-3);
  background: none; border: 0; border-radius: var(--r-sm);
  text-align: left; color: var(--ink-3); font-size: .9375rem;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.stepper button:disabled { cursor: default; }
.stepper button:not(:disabled):hover { background: var(--surface-2); color: var(--ink); }
.stepper .bullet {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); font-size: .75rem; font-weight: 600;
}
.stepper .bullet .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.stepper li.done button { color: var(--ink-2); }
.stepper li.done .bullet { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary); }
.stepper li.current button { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: var(--shadow); }
.stepper li.current .bullet { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Dica ---------- */
.tip {
  margin-top: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-4);
}
.tip-head { display: flex; align-items: center; gap: var(--s-2); font-size: .8125rem; font-weight: 600; color: var(--primary); margin-bottom: var(--s-2); }
.tip-head .ic { width: 18px; height: 18px; }
.tip p { font-size: .875rem; color: var(--ink-2); }

/* ---------- Topbar + progresso ---------- */
.topbar { display: none; align-items: center; justify-content: space-between; padding: var(--s-4) 0; }
.topbar-step { font-size: .875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.progress { height: 4px; background: var(--surface-2); border-radius: 99px; margin-top: var(--s-6); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: inherit; transition: width var(--t-med) var(--ease); }

/* ---------- Fluxo ---------- */
.flow { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: var(--s-7) 0 var(--s-6); }

.step { animation: enter var(--t-med) var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--s-3); }
.display { font-size: clamp(1.875rem, 3.6vw, 2.75rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; text-wrap: balance; }
.title { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
.display:focus, .title:focus { outline: none; }
.lead { margin-top: var(--s-3); color: var(--ink-2); font-size: 1.0625rem; max-width: 56ch; }
.step > .lead { margin-bottom: var(--s-6); }

/* Promessa (boas-vindas) */
.promise { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: var(--s-3); }
.promise li {
  display: flex; gap: var(--s-4); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5);
}
.promise .ic { color: var(--primary); margin-top: 2px; }
.promise strong { display: block; font-weight: 600; }
.promise span { color: var(--ink-2); font-size: .9375rem; }

/* ---------- Campos ---------- */
.field { border: 0; padding: 0; margin: 0 0 var(--s-5); min-width: 0; }
.field-sm { max-width: 220px; }
.field > label, .field > legend {
  display: flex; align-items: center; gap: var(--s-2);
  font-weight: 600; font-size: .9375rem; margin-bottom: var(--s-2); padding: 0;
}
.field > label .ic { width: 18px; height: 18px; color: var(--ink-3); }
.opt { font-weight: 400; color: var(--ink-3); font-size: .8125rem; }

.input {
  width: 100%; height: 48px; padding: 0 var(--s-4);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font-size: 1rem; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }

.money { position: relative; }
.money > span { position: absolute; left: var(--s-4); top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 500; pointer-events: none; }
.money .input { padding-left: 44px; font-variant-numeric: tabular-nums; font-weight: 500; }

.hint { margin-top: var(--s-2); font-size: .8125rem; color: var(--ink-3); }
.hint-block { margin: 0 0 var(--s-4); font-size: .9375rem; color: var(--ink-2); }
.error { margin-top: var(--s-2); font-size: .8125rem; color: var(--danger); font-weight: 500; }
.error:empty { display: none; }

.money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-4); }

/* Cards de escolha */
.choices { display: grid; gap: var(--s-3); }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
  position: relative; display: flex; align-items: flex-start; gap: var(--s-3);
  min-height: 64px; padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > .ic { color: var(--ink-3); margin-top: 2px; }
.choice strong { display: block; font-weight: 600; font-size: .9375rem; }
.choice small { display: block; color: var(--ink-3); font-size: .8125rem; margin-top: 2px; }
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice:has(input:checked) > .ic { color: var(--primary); }
.choice:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Segmentado */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--s-1); padding: var(--s-1); background: var(--surface-2); border-radius: var(--r-md); }
.segmented label { position: relative; }
@media (max-width: 520px) { .segmented.seg-3 { grid-auto-flow: row; } }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-size: .9375rem; font-weight: 500; color: var(--ink-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 1px; }

/* Contador */
.counter { display: inline-flex; align-items: center; gap: var(--s-2); }
.dep-names { display: grid; gap: var(--s-2); margin-top: var(--s-3); max-width: 360px; }
.dep-names:empty { display: none; }
.dep-names .hint { margin: 0; }
.check-line { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); font-size: .875rem; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--primary); }
.counter-input { width: 72px; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.counter-input::-webkit-outer-spin-button, .counter-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.counter-btn, .icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease);
}
.counter-btn:hover, .icon-btn:hover { background: var(--surface-2); }

/* Checkbox */
.check { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) 0; cursor: pointer; font-size: .9375rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; cursor: pointer; }

/* Callout */
.callout { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-md); margin: var(--s-3) 0; font-size: .9375rem; }
.callout-warn { background: var(--warn-soft); color: var(--ink); }
.callout-warn .ic { color: var(--warn); margin-top: 2px; }
.callout-danger { background: var(--danger-soft); }
.callout-danger .ic { color: var(--danger); margin-top: 2px; }

/* Subtotal */
.subtotal {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: var(--s-2); padding: var(--s-4) var(--s-5);
  background: var(--surface-2); border-radius: var(--r-md);
}
.subtotal span { color: var(--ink-2); font-size: .9375rem; }
.subtotal strong { font-size: 1.25rem; }

/* Métodos */
.method-body { display: grid; gap: var(--s-2); width: 100%; }
.method-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.method-head strong { font-size: 1.0625rem; }
.badge { font-style: normal; font-size: .75rem; font-weight: 600; padding: 2px var(--s-2); border-radius: 99px; background: var(--primary); color: var(--on-primary); }
.mini-bar { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.mini-bar .bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; }
.mini-bar .bar i { display: block; height: 100%; }
.mini-bar .legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mini-bar .legend b { font-weight: 600; color: var(--ink); }

/* ---------- Ações ---------- */
.actions {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 calc(var(--s-7) * -1); padding: var(--s-4) var(--s-7);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.actions-buttons { display: flex; align-items: center; gap: var(--s-3); max-width: 640px; margin: 0 auto; }
body.is-plan .actions-buttons { max-width: 880px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5); border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 600; font-size: 1rem;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); margin-left: auto; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; color: var(--ink-2); padding: 0 var(--s-3); text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--ink); }

.mini-summary { display: none; }

/* ---------- Resumo ---------- */
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s-5); box-shadow: var(--shadow); }
.summary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.summary-head h2 { font-size: 1rem; font-weight: 600; }
.summary-close { display: none; }
.summary-empty { font-size: .875rem; color: var(--ink-3); margin-bottom: var(--s-4); }
.summary-list { margin: 0; display: grid; gap: var(--s-3); }
.summary-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.summary-list dt { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-2); font-size: .9375rem; }
.summary-list dd { margin: 0; font-weight: 600; }
.summary-list dd small { font-weight: 400; color: var(--ink-3); margin-left: var(--s-1); }
.summary-total { padding-top: var(--s-3); border-top: 1px solid var(--line); }
.summary-total dt { color: var(--ink); font-weight: 600; }
.summary-total dd { font-size: 1.375rem; }
.summary-total dd.pos { color: var(--ok); }
.summary-total dd.neg { color: var(--danger); }

.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-in { background: var(--c-in); }
.dot-needs { background: var(--c-needs); }
.dot-wants { background: var(--c-wants); }
.dot-debt { background: var(--c-debt); }
.dot-future { background: var(--c-future); }

.stack { display: flex; gap: 2px; height: 12px; margin-top: var(--s-5); border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.seg { display: block; height: 100%; width: 0; transition: width var(--t-med) var(--ease); }
.seg-needs { background: var(--c-needs); }
.seg-wants { background: var(--c-wants); }
.seg-debt { background: var(--c-debt); }
.seg-future { background: var(--c-future); }
.stack-caption { margin-top: var(--s-2); font-size: .8125rem; color: var(--ink-3); }

.privacy { display: flex; gap: var(--s-2); align-items: flex-start; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: .8125rem; color: var(--ink-3); }
.privacy .ic { width: 16px; height: 16px; margin-top: 2px; }

/* ---------- Plano (resultado) ---------- */
.plan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.plan-head .lead { margin-top: var(--s-2); }
.chip { display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-3); border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-size: .8125rem; font-weight: 600; }
.chip .ic { width: 16px; height: 16px; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.kpi-label { font-size: .8125rem; color: var(--ink-2); }
.kpi-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; margin-top: var(--s-1); }
.kpi-note { font-size: .8125rem; margin-top: var(--s-1); color: var(--ink-3); }
.kpi.pos .kpi-value { color: var(--ok); }
.kpi.neg .kpi-value { color: var(--danger); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); margin-bottom: var(--s-5); }
.panel h3 { font-size: 1.0625rem; font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.panel h3 .ic { color: var(--primary); }
.panel > p { color: var(--ink-2); font-size: .9375rem; margin-top: var(--s-1); }

.buckets { display: grid; gap: var(--s-5); margin-top: var(--s-5); }
.bucket-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-2); }
.bucket-name { display: flex; align-items: center; gap: var(--s-2); font-weight: 600; }
.bucket-vals { font-size: .9375rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bucket-vals b { color: var(--ink); }
.track { position: relative; height: 12px; background: var(--surface-2); border-radius: 99px; }
.track .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.track .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.bucket-status { margin-top: var(--s-2); font-size: .8125rem; font-weight: 500; }
.bucket-status.ok { color: var(--ok); }
.bucket-status.over { color: var(--danger); }
.bucket-status.under { color: var(--warn); }
.legend-line { display: flex; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-4); font-size: .8125rem; color: var(--ink-3); }
.legend-line span { display: inline-flex; align-items: center; gap: var(--s-2); }
.legend-line .tick { width: 2px; height: 12px; background: var(--ink); }

.reserve { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }
.reserve dt { font-size: .8125rem; color: var(--ink-2); }
.reserve dd { margin: var(--s-1) 0 0; font-weight: 700; font-size: 1.125rem; }
.reserve-track { margin-top: var(--s-4); }
.reserve-note { margin-top: var(--s-3); font-size: .9375rem; color: var(--ink-2); }

.next-steps { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-3); counter-reset: ns; }
.next-steps li { display: flex; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); counter-increment: ns; }
.next-steps li::before {
  content: counter(ns); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: .875rem;
}
.next-steps li.urgent::before { background: var(--danger); color: #fff; }
.next-steps strong { display: block; font-weight: 600; }
.next-steps span { color: var(--ink-2); font-size: .9375rem; }

.disclaimer { font-size: .8125rem; color: var(--ink-3); margin-top: var(--s-2); }

/* ---------- Overlay / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 15, 13, .45); z-index: 20; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); z-index: 40;
  background: var(--ink); color: var(--bg); padding: var(--s-3) var(--s-5); border-radius: var(--r-md);
  font-size: .9375rem; opacity: 0; pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(0, 1fr) 320px; }
  body.is-plan .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { display: flex; }
  .progress { margin-top: 0; }
  .stage { padding: 0 var(--s-6); }
  .actions { margin: 0 calc(var(--s-6) * -1); padding: var(--s-4) var(--s-6); }
}

@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .stage { padding: 0 var(--s-4); }
  .actions { margin: 0 calc(var(--s-4) * -1); padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); }
  .flow { padding: var(--s-6) 0 var(--s-5); }

  /* Resumo vira "bottom sheet" */
  .summary {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0;
    transform: translateY(105%); transition: transform var(--t-med) var(--ease);
  }
  .summary.open { transform: none; }
  .summary-card { position: static; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: calc(var(--s-5) + env(safe-area-inset-bottom)); }
  .summary-close { display: grid; }

  .mini-summary {
    display: flex; align-items: center; gap: var(--s-2); width: 100%;
    min-height: 40px; padding: 0 var(--s-1) var(--s-3); margin-bottom: var(--s-3);
    background: none; border: 0; border-bottom: 1px solid var(--line);
    font-size: .875rem; color: var(--ink-2);
  }
  .mini-summary strong { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
  .mini-summary strong.neg { color: var(--danger); }
  .mini-summary .ic { width: 18px; height: 18px; }
}

@media (max-width: 560px) {
  .kpis, .reserve { grid-template-columns: 1fr; }
  .money-grid, .choices.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .btn { padding: 0 var(--s-4); }
  .btn-ghost span { display: none; }
  .btn-ghost { width: 48px; padding: 0; }
  .segmented { grid-auto-flow: row; }
  .lead { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
