/* ALVO: visual aprovado no protótipo. Um destaque (verde), cartões arredondados, menu lateral e jornada escura. */
@font-face { font-family: Inter; src: url('../fonts/inter-variable.ttf') format('truetype'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: Sora; src: url('../fonts/sora-variable.ttf') format('truetype'); font-style: normal; font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #121923; --snow: #F5F8F7;
  --bg: #EDF1F0; --surface: #FFFFFF; --surface-2: #F4F7F6; --fg: #121923; --muted: #56616B; --faint: #85909A; --line: #DCE3E0;
  --accent: #2EFFA0; --on-accent: #0C1A13; --accent-text: #0B7348; --accent-soft: #DCF9EA;
  --danger: #AE3A35; --danger-soft: #F8E4E2; --warn: #8D5E0E; --warn-soft: #FAEFD8;
  --env-giro: #13A176; --env-despesas: #DE6539; --env-retirada: #E5A126; --env-reserva: #776EE3;
  --panel: #121923; --panel-2: #1A2330; --panel-fg: #F5F8F7; --panel-muted: #98A4AD; --panel-line: #27313E;
  --shadow: 0 1px 2px rgba(18, 25, 35, .05), 0 10px 28px rgba(18, 25, 35, .06);
  --font-display: Sora, ui-sans-serif, system-ui, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --side: 240px;
  --control: #FFFFFF; --control-line: var(--line); --control-hover: var(--faint);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0D131B; --surface: #151D28; --surface-2: #1C2532; --fg: #EDF2F0; --muted: #9AA6AE; --faint: #6E7A84; --line: #25303D;
  --accent-text: #2EFFA0; --accent-soft: #15342A; --danger: #F08A84; --danger-soft: #3A2227; --warn: #F0C26A; --warn-soft: #362D1C;
  --panel: #0A1017; --panel-2: #121A24; --panel-line: #1F2833; --shadow: none;
  /* No escuro, os botões secundários ficam um tom acima do cartão pra se destacar. */
  --control: #283447; --control-line: #3A4759; --control-hover: #5A6A80;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, summary, select { cursor: pointer; }
button { border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.18; text-wrap: balance; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
svg { display: block; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 12px 18px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.logo { width: 120px; height: auto; }
.logo-dark, .theme-sun { display: none; }
[data-theme='dark'] .logo-light, [data-theme='dark'] .theme-moon { display: none; }
[data-theme='dark'] .logo-dark, [data-theme='dark'] .theme-sun { display: block; }

/* Botões e links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: var(--r-md); font-weight: 600; white-space: nowrap; transition: transform .12s ease, filter .15s ease, border-color .15s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(.95); }
.btn-secondary { border: 1px solid var(--control-line); background: var(--control); color: var(--fg); }
.btn-secondary:hover { border-color: var(--control-hover); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: var(--r-sm); }
.link { color: var(--accent-text); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger, .danger { color: var(--danger); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--fg); }
.back .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-sm); display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn .icon { width: 18px; height: 18px; }

/* Campos */
.form { display: grid; gap: 16px; align-content: start; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea, .input-sm { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); font-size: 16px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input-sm:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type=file] { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: 14px; color: var(--muted); }
.money-input { position: relative; display: block; }
.money-input::before { content: 'R$'; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.field .money-input input { padding-left: 44px; }
.field.big .money-input input { min-height: 64px; padding-left: 48px; font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.input-sm { min-height: 40px; padding: 8px 10px; font-size: 14px; width: auto; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-cost { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr); gap: 12px; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.actions.end { justify-content: flex-end; }
.actions.start { justify-content: flex-start; flex-wrap: wrap; }
.actions .btn { min-width: 170px; }
.actions.start .btn { min-width: 0; }
.msg { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.msg .icon { width: 18px; height: 18px; margin-top: 1px; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.success { background: var(--accent-soft); color: var(--accent-text); }
.note { display: block; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.note b { color: var(--fg); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.warn b { color: inherit; }
.note.good { display: grid; gap: 4px; background: var(--accent-soft); color: var(--fg); }
.tip { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--accent-soft); }
.tip > .icon { color: var(--accent-text); }
.tip strong { display: block; margin-bottom: 2px; color: var(--accent-text); }
.tip b { color: var(--accent-text); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.good { background: var(--accent-soft); color: var(--accent-text); }
.empty { padding: 24px 12px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 4px; color: var(--fg); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; }
.pills a:hover { color: var(--fg); background: var(--surface-2); }
.pills a[aria-current='page'] { background: var(--fg); color: var(--bg); }
.pills b { font-weight: 700; }

/* Barra e velocímetro */
.bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.gauge svg { width: 100%; overflow: visible; }
.gauge-track, .gauge-progress { fill: none; stroke-width: 22; stroke-linecap: round; }
.gauge-track { stroke: var(--surface-2); }
.gauge-progress { stroke: var(--accent); transition: stroke-dasharray 1.1s cubic-bezier(.2, .8, .2, 1); }
.gauge-knob { transition: transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.gauge-knob-outer { fill: var(--accent); }
.gauge-knob-inner { fill: var(--ink); }
.gauge-percent { fill: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 56px; letter-spacing: -2px; }
.gauge-word { fill: var(--muted); font-size: 17px; }
.trophy { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; justify-self: center; background: var(--accent); color: var(--on-accent); }
.trophy .icon { width: 68px; height: 68px; }

/* Entrada */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(100%, 400px); display: grid; gap: 18px; }
.auth-card h1 { font-size: 34px; }
.auth-card .lead { margin-top: -8px; color: var(--muted); }
.auth-mobile-logo { display: none; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.auth-links.center { justify-content: center; }
.auth-brand { position: sticky; top: 16px; height: calc(100dvh - 32px); margin: 16px; padding: clamp(28px, 4vw, 64px); border-radius: 28px; background: var(--panel); color: var(--panel-fg); display: flex; flex-direction: column; justify-content: center; gap: 28px; overflow: hidden; }
.auth-brand .logo { width: 150px; }
.auth-brand .kicker { color: var(--accent); font-weight: 600; font-size: 14px; }
.auth-brand h2 { margin-top: 10px; font-size: clamp(30px, 3.2vw, 46px); }
.auth-brand > p { max-width: 42ch; color: var(--panel-muted); font-size: 17px; }
.auth-preview { display: flex; align-items: center; gap: 18px; max-width: 440px; padding: 18px 20px; border-radius: 20px; background: var(--panel-2); }
.auth-preview .gauge { width: 136px; flex: none; }
.auth-preview .gauge-track { stroke: var(--panel-line); }
.auth-preview .gauge-percent { fill: var(--panel-fg); }
.auth-preview .gauge-word { fill: var(--panel-muted); }
.auth-preview strong { display: block; font-family: var(--font-display); font-size: 22px; }
.auth-preview span { color: var(--panel-muted); font-size: 14px; }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; color: var(--panel-muted); }
.auth-points li { display: inline-flex; align-items: center; gap: 8px; }
.auth-points .icon { width: 18px; height: 18px; color: var(--accent); }

/* Configuração inicial */
.guide { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100dvh; }
.journey { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 28px 24px; overflow: auto; background: var(--panel); color: var(--panel-fg); }
.journey .logo { width: 112px; }
.journey-title { color: var(--panel-muted); font-size: 13px; margin-bottom: -12px; }
.steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.steps li, .steps a { display: flex; align-items: center; gap: 12px; border-radius: 12px; color: var(--panel-muted); }
.steps li { padding: 10px 12px; }
.steps li:has(a) { padding: 0; }
.steps a { flex: 1; padding: 10px 12px; }
.steps a:hover { background: var(--panel-2); color: var(--panel-fg); }
.steps .dot { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--panel-line); border-radius: 50%; font-size: 12px; font-weight: 700; }
.steps li.done, .steps li.done a { color: #CFD8DE; }
.steps li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.steps .dot .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.steps li.now { background: var(--panel-2); color: var(--panel-fg); font-weight: 600; }
.steps li.now .dot { border-color: var(--accent); color: var(--accent); }
.journey-foot { margin-top: auto; display: grid; gap: 14px; color: var(--panel-muted); font-size: 13px; }
.journey-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.journey-actions form { margin: 0; }
.journey .theme-toggle, .journey-logout { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm); color: var(--panel-muted); font-size: 13px; }
.journey .theme-toggle:hover, .journey-logout:hover { background: var(--panel-2); color: var(--panel-fg); }
.journey .icon { width: 18px; height: 18px; }
.mobile-progress { display: none; }
.guide-main { display: flex; justify-content: center; padding: clamp(28px, 6vw, 72px) 24px 48px; }
.guide-body-inner { width: min(100%, 580px); display: grid; gap: 24px; align-content: start; }
.guide-body-inner > h1 { font-size: clamp(28px, 3.2vw, 38px); }
.guide-body-inner > .lead { margin-top: -10px; color: var(--muted); font-size: 17px; }
.promise { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.promise li { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.promise .icon { width: 22px; height: 22px; justify-self: center; color: var(--accent-text); }
.video { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); background: #0A1017; }
.video iframe { width: 100%; height: 100%; border: 0; }
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); }
.list li > div:first-child { display: grid; min-width: 0; }
.list li span { color: var(--muted); font-size: 14px; }
.list form { margin: 0; }
.list.plain { gap: 0; }
.list.plain li { padding: 13px 0; border-radius: 0; background: none; box-shadow: none; border-bottom: 1px solid var(--line); }
.list.plain li:last-child { border-bottom: 0; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 2px; color: var(--muted); }
.total-line b { color: var(--fg); font-family: var(--font-display); font-size: 22px; white-space: nowrap; }
.add-box { display: grid; gap: 12px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--r-md); }
.add-box .btn { justify-self: start; }

/* Diagnóstico */
.dx { display: grid; gap: 24px; align-content: start; }
.dx-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dx-title h1 { font-size: clamp(32px, 4vw, 44px); }
.dx-title span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.dx-q { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.3; }
.answer { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); }
.answer.wrong { background: var(--danger-soft); color: var(--danger); }
.answer.right { background: var(--accent-soft); color: var(--accent-text); }
.answer .mark { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-weight: 800; }
.answer .mark .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.answer b { font-family: var(--font-display); font-size: 22px; white-space: nowrap; }
.why { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.why p { color: var(--muted); }
.why p b { color: var(--fg); }
.sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; }
.sum .chip { padding: 8px 12px; border-radius: 999px; background: var(--surface-2); font-size: 15px; }
.sum .chip.result { background: var(--accent-soft); color: var(--accent-text); }
.bars { display: grid; gap: 18px; padding: 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.bar-row { display: grid; gap: 6px; }
.bar-row header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.bar-row header b { color: var(--fg); font-family: var(--font-display); font-size: 18px; white-space: nowrap; }
.bars .bar { height: 16px; }
.bar i.tone-red { background: var(--danger); }
.bar i.tone-yellow { background: var(--env-retirada); }
.bar i.goal { background: var(--fg); opacity: .78; }
.verdict { display: flex; align-items: center; gap: 10px; color: var(--accent-text); font-size: 18px; font-weight: 700; }
.verdict.tone-red { color: var(--danger); }
.verdict.tone-yellow { color: var(--warn); }
.options { display: grid; gap: 12px; }
.options form { margin: 0; }
.option { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 18px 20px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: left; transition: border-color .15s ease, transform .12s ease; }
.option:hover { border-color: var(--faint); }
.option:active { transform: scale(.99); }
.option.best { border: 2px solid var(--accent-text); }
.option .tag { grid-column: 1; justify-self: start; margin-bottom: 4px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; }
.option strong { grid-column: 1; font-size: 17px; }
.option span:not(.tag) { grid-column: 1; color: var(--muted); font-size: 14px; }
.option .icon { grid-column: 2; grid-row: 1 / span 3; color: var(--faint); }
.dx-sim { border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.dx-sim summary { display: flex; justify-content: space-between; padding: 16px 18px; font-weight: 600; list-style: none; }
.dx-sim summary::-webkit-details-marker { display: none; }
.dx-sim summary::after { content: '+'; color: var(--muted); font-size: 18px; }
.dx-sim[open] summary::after { content: '−'; }
.sim-body { display: grid; gap: 14px; padding: 0 18px 18px; }
.sim-body label { display: grid; gap: 6px; }
.sim-body input[type=range] { width: 100%; accent-color: var(--accent-text); }
.sim-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.sim-row output { color: var(--fg); font-family: var(--font-display); font-weight: 600; }
.sim-result { padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.sim-result[data-tone='danger'] { background: var(--danger-soft); color: var(--danger); }
.sim-result[data-tone='warning'] { background: var(--warn-soft); color: var(--warn); }

/* Plataforma */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 26px; padding: 22px 14px; overflow: auto; background: var(--surface); border-right: 1px solid var(--line); }
.side-logo { padding: 0 10px; }
.side-logo .logo { width: 108px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; object-fit: cover; }
.avatar.big { width: 72px; height: 72px; font-size: 22px; }
.me { position: relative; }
.me summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; list-style: none; }
.me summary::-webkit-details-marker { display: none; }
.me summary:hover { background: var(--surface-2); }
.me-name { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.me-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name span { color: var(--muted); font-size: 13px; }
.me-chevron { width: 16px; height: 16px; color: var(--muted); transform: rotate(180deg); }
.me-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 40; display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: 0 12px 32px rgba(18, 25, 35, .14); }
.me-down .me-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); width: 230px; }
.me-down .me-name, .me-down .me-chevron { display: none; }
.me-down summary { padding: 4px; }
.me-menu a, .me-menu button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); text-align: left; font-size: 14px; }
.me-menu a:hover, .me-menu button:hover { background: var(--surface-2); }
.me-menu form { margin: 0; }
.mobile-top, .tabbar { display: none; }
.main-wrap { min-width: 0; }
.main:focus { outline: none; }
.content { width: min(100%, 1180px); margin: 0 auto; padding: 28px 28px 56px; }
.stack { display: grid; gap: 20px; align-content: start; }
.narrow { width: min(100%, 620px); margin: 0 auto; }
.narrow.dx { margin-top: 8px; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topline h1 { font-size: 28px; }
.topline p { max-width: 70ch; color: var(--muted); }
.card { min-width: 0; padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.card > h3 + * { margin-top: 12px; }
.narrow-card { max-width: 760px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.card-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-foot { margin-top: 14px; font-size: 14px; }
.label { color: var(--accent-text); font-weight: 600; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.subtitle { margin: 18px 0 4px; }
.empty-page { display: grid; justify-items: center; gap: 12px; padding: 56px 24px; text-align: center; }

/* Início */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-grid .col { display: grid; gap: 20px; min-width: 0; }
.payback { display: grid; gap: 14px; }
.payback-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payback .gauge { width: min(100%, 340px); justify-self: center; margin-top: 4px; }
.payback h2 { font-size: 28px; text-align: center; }
.payback .explain { max-width: 44ch; justify-self: center; color: var(--muted); text-align: center; }
.nudge { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); font-weight: 600; }
.nudge .icon { color: var(--accent-text); }
.money .big { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.money > h3 + .big { margin-top: 2px; }
.split-bar { display: flex; height: 14px; margin: 14px 0 6px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.split-bar span { height: 100%; }
.env { display: grid; margin: 0; padding: 0; list-style: none; }
.env li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.env li:last-child { border-bottom: 0; }
.env .sw { width: 14px; height: 14px; border-radius: 4px; }
.env strong { display: block; }
.env small { color: var(--muted); font-size: 13px; }
.env b { font-family: var(--font-display); font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.env li.locked b { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 14px; }
.env li.locked b .icon { width: 16px; height: 16px; }
.env-giro { background: var(--env-giro); } .env-despesas { background: var(--env-despesas); } .env-retirada { background: var(--env-retirada); } .env-reserva { background: var(--env-reserva); }
.be { display: grid; gap: 8px; margin-top: 14px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface-2); }
.be header { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.be header span { color: var(--muted); }
.be .bar { height: 10px; background: var(--surface); }
.be .bar i { background: var(--env-despesas); }
.alerts { display: grid; }
.alert { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert:last-child { border-bottom: 0; }
.alert .ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--warn-soft); color: var(--warn); }
.alert.danger .ic { background: var(--danger-soft); color: var(--danger); }
.alert.good .ic { background: var(--accent-soft); color: var(--accent-text); }
.alert strong { display: block; }
.alert p { color: var(--muted); font-size: 14px; }
.report { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; }
.rankings { display: grid; gap: 22px; align-content: start; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; margin-top: 8px; }
.chart .col { flex: 1; min-width: 0; height: 100%; display: grid; grid-template-rows: 1fr 16px; gap: 6px; }
.chart .col i { align-self: end; display: block; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--accent); }
.chart .col i.zero { background: var(--surface-2); }
.chart .col small { overflow: visible; color: var(--faint); font-size: 11px; text-align: center; white-space: nowrap; }
.rank { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.rank li { display: grid; gap: 6px; }
.rank header { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.rank header span { color: var(--muted); white-space: nowrap; }
.rank .bar { height: 8px; }

/* Vender */
.sell-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.product { display: grid; gap: 12px; align-content: space-between; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.product h3 { font-size: 18px; }
.product .price { font-family: var(--font-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.product .btn { min-height: 48px; }
.sales-list { display: grid; margin: 4px 0 0; padding: 0; list-style: none; }
.sales-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sales-list li:last-child { border-bottom: 0; }
.sales-list li > div:first-child { display: grid; min-width: 0; }
.sales-list span { color: var(--muted); font-size: 13px; }
.sales-list b { font-family: var(--font-display); white-space: nowrap; }
.sales-list li.is-undone { opacity: .6; }
.sale-end { display: grid; justify-items: end; gap: 2px; }
.sale-end form { margin: 0; }
.sale-end .link { font-size: 13px; }
.card .pills { margin-bottom: 4px; }

/* Janelas */
.dialog { width: min(calc(100% - 32px), 460px); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; border: 0; border-radius: 24px; background: var(--surface); color: var(--fg); overflow-x: hidden; }
.dialog::backdrop { background: rgba(8, 12, 18, .55); }
.dialog[open] { animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
body:has(.dialog[open]) { overflow: hidden; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 23px; }
.dialog-head .icon-btn { margin: -6px -8px 0 0; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.stepper { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 10px; }
.stepper button { min-height: 64px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-size: 28px; }
.stepper button:hover { border-color: var(--faint); }
.stepper input { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--fg); font-family: var(--font-display); font-size: 30px; font-weight: 700; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.total-box { display: grid; justify-items: center; gap: 2px; padding: 18px; border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.total-box > span:first-child { color: var(--muted); font-size: 14px; }
.total-box strong { font-family: var(--font-display); font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.total-box .link { margin-top: 6px; font-size: 14px; }
.total-edit { display: grid; gap: 6px; }
.diff { color: var(--accent-text); font-size: 14px; font-weight: 700; }
.diff.warn { color: var(--warn); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Depois da venda */
.sold { width: min(100%, 980px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sold-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; }
.sold-head h1 { font-size: 36px; }
.sold > .note { grid-column: 1 / -1; }
.sold > .money { grid-column: 1; grid-row: span 2; }
.sold-side { grid-column: 2; display: grid; gap: 14px; }
.sold-side form { margin: 0; justify-self: center; }
.check { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.check .icon { width: 32px; height: 32px; stroke-width: 2.6; }
.pb-move { display: grid; justify-items: center; gap: 10px; text-align: center; }
.pb-move .gauge { width: min(100%, 260px); }
.pb-move strong { display: block; margin-bottom: 4px; font-family: var(--font-display); font-size: 20px; }
.pb-move p { color: var(--muted); }

/* Estoque */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 14px; }
.stat b { font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; }
.table { display: grid; }
.trow { display: grid; grid-template-columns: minmax(0, 1.6fr) 110px 120px 130px 116px; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow.head { padding-top: 0; color: var(--muted); font-size: 13px; }
.t-name { display: grid; min-width: 0; }
.t-name span { color: var(--muted); font-size: 13px; }
.t-val, .t-pot { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.t-act { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.more { position: relative; }
.more summary { list-style: none; }
.t-act .icon-btn { color: var(--fg); }
.more summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 210px; display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: 0 12px 32px rgba(18, 25, 35, .14); }
.more-menu a, .more-menu button { width: 100%; display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; text-align: left; }
.more-menu a:hover, .more-menu button:hover { background: var(--surface-2); }
.more-menu form { margin: 0; }

/* Minha conta */
.profile { display: flex; align-items: center; gap: 18px; }
.rate-box { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-2); }
.rate-box > b { font-family: var(--font-display); font-size: 30px; }
.rate-box p { color: var(--muted); font-size: 14px; }
.tutorials { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tutorial { display: grid; gap: 12px; padding: 12px 12px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.tutorial:hover h3 { color: var(--accent-text); }
.cover { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-md); background: var(--panel) center / cover; color: var(--panel-fg); font-size: 13px; font-weight: 600; }
.cover .icon { width: 34px; height: 34px; color: var(--accent); }
.tutorial > div:last-child { padding: 0 6px; }
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 8px; }

/* Celular */
@media (max-width: 1100px) {
  .home-grid, .sell-layout, .report, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .trow.head { display: none; }
  .t-qty, .t-val { grid-column: 1; }
  .t-val { color: var(--muted); font-size: 14px; font-family: var(--font-body); font-weight: 500; }
  .t-pot { display: none; }
  .t-act { grid-column: 2; grid-row: 1 / span 3; }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-form { place-items: start center; padding: 32px 18px; }
  .auth-mobile-logo { display: block; }
  .auth-mobile-logo .logo { width: 110px; }
  .guide { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .journey { display: none; }
  .mobile-progress { position: sticky; top: 0; z-index: 20; display: grid; gap: 10px; padding: 12px 16px; background: var(--panel); color: var(--panel-fg); }
  .mobile-progress > div:first-child { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--panel-muted); }
  .mobile-progress .logo { width: 84px; margin-right: auto; }
  .mobile-progress b { color: var(--panel-fg); }
  .mobile-progress form { margin: 0; }
  .mobile-progress .icon-btn { color: var(--panel-muted); }
  .mobile-progress .icon-btn span { display: none; }
  .mobile-progress .bar { height: 6px; background: var(--panel-2); }
  .guide-main { padding: 24px 16px 40px; }
  .actions:not(.start):not(.end) { flex-direction: column-reverse; align-items: stretch; }
  .actions .btn { width: 100%; }
  .actions.end .btn { width: 100%; }
  .row2, .row-cost, .stats, .search { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat { padding: 16px; }
  .stat b { font-size: 19px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
  .mobile-top .logo { width: 86px; }
  .tabbar { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--muted); font-size: 12px; font-weight: 500; }
  .tabbar a[aria-current='page'] { color: var(--accent-text); font-weight: 700; }
  .tabbar .icon { width: 22px; height: 22px; }
  .content { padding: 18px 16px 96px; }
  .topline h1 { font-size: 24px; }
  .card { padding: 18px; }
  .payback h2 { font-size: 24px; }
  .sold { grid-template-columns: minmax(0, 1fr); }
  .sold > .money, .sold-side { grid-column: 1; grid-row: auto; }
  .sold-head h1 { font-size: 28px; }
  .check { width: 52px; height: 52px; }
  .pb-move .gauge { width: 200px; }
  .dialog { padding: 20px; }
  .alert { grid-template-columns: 40px minmax(0, 1fr); }
  .alert .btn { grid-column: 2; justify-self: start; }
  .dx-q { font-size: 20px; }
  .answer { padding: 14px; }
  .answer b { font-size: 19px; }
  .profile { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
