/* ============================================================ tokens */
:root {
  --bg: #070b09;
  --bg-2: #0b110e;
  --surface: rgb(255 255 255 / .035);
  --surface-2: rgb(255 255 255 / .06);
  --surface-solid: #111814;
  --line: rgb(255 255 255 / .075);
  --line-2: rgb(255 255 255 / .13);
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #8e8e98;
  --faint: #52525b;
  --invert: #09090b;

  --gasto: #f87171;
  --ganho: #34d399;
  --investimento: #8b9cf9;
  --sobra: #fafafa;

  --g1: #10b981;   /* gradiente da marca: esmeralda → verde → limão */
  --g2: #22c55e;
  --g3: #a3e635;
  --on-accent: #04130b; /* texto sobre o verde vivo: escuro, para ler bem */

  --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 20px 40px -24px rgb(0 0 0 / .8);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --tabs-h: 60px;
  --tabs-bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); /* sobra embaixo da barra flutuante */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f9f6; --bg-2: #eaf2ed; --surface: rgb(255 255 255 / .75); --surface-2: rgb(0 0 0 / .04);
    --surface-solid: #ffffff; --line: rgb(0 0 0 / .07); --line-2: rgb(0 0 0 / .12);
    --text: #0a0a0b; --text-2: #3f3f46; --muted: #71717a; --faint: #a1a1aa; --invert: #fafafa;
    --gasto: #dc2626; --ganho: #059669; --investimento: #4f5fe0; --sobra: #0a0a0b;
    --g1: #047857; --g2: #16a34a; --g3: #65a30d; --on-accent: #fff;
    --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -16px rgb(0 0 0 / .14);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f9f6; --bg-2: #eaf2ed; --surface: rgb(255 255 255 / .75); --surface-2: rgb(0 0 0 / .04);
  --surface-solid: #ffffff; --line: rgb(0 0 0 / .07); --line-2: rgb(0 0 0 / .12);
  --text: #0a0a0b; --text-2: #3f3f46; --muted: #71717a; --faint: #a1a1aa; --invert: #fafafa;
  --gasto: #dc2626; --ganho: #059669; --investimento: #4f5fe0; --sobra: #0a0a0b;
  --g1: #047857; --g2: #16a34a; --g3: #65a30d; --on-accent: #fff;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -16px rgb(0 0 0 / .14);
  color-scheme: light;
}

/* ============================================================ base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 Geist, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overscroll-behavior-y: contain;
  font-feature-settings: "ss01", "cv11";
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a, label, select, input { touch-action: manipulation; }
h2 { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.lg { font-size: 17px; }
.grow { flex: 1; min-width: 0; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.error { color: var(--gasto); min-height: 1.2em; font-size: 13px; margin: 2px 0 0; }
.stack { display: grid; gap: 10px; }

svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* fundo com brilho suave, muda com o estado da gravação */
.aurora {
  position: fixed; inset: -20vh -20vw auto; height: 90vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 30%, color-mix(in srgb, var(--g1) 14%, transparent), transparent 70%),
    radial-gradient(40% 50% at 70% 25%, color-mix(in srgb, var(--g3) 11%, transparent), transparent 70%),
    radial-gradient(35% 45% at 50% 60%, color-mix(in srgb, var(--g2) 10%, transparent), transparent 70%);
  filter: blur(20px); opacity: .55; transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
body.rec .aurora { opacity: 1; transform: scale(1.08); }
body:not(.on-voz) .aurora { opacity: .25; }

/* ============================================================ controles */
input, select {
  width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 13px 14px; font: inherit; font-size: 16px; outline: none;
  transition: border-color .2s, background .2s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--line-2); background: var(--surface); }
input[type="date"] { min-height: 48px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 600; font-size: 15px; cursor: pointer;
  width: 100%; transition: transform .15s var(--ease), opacity .2s, background .2s;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3)); color: var(--on-accent);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--g2) 70%, transparent);
}
.btn.ghost { background: var(--surface); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--gasto); }
.btn svg.i { width: 18px; height: 18px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; margin-top: 18px; font-size: 14px; min-height: 44px; padding: 8px 12px; }
.link b { color: var(--text); font-weight: 600; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); flex: none;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); transition: background .2s, transform .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg.i { width: 18px; height: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card-t { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-t .t { font-size: 14px; font-weight: 600; }
.card-t .s { font-size: 12px; color: var(--muted); }

/* ============================================================ auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 360px; text-align: center; animation: rise .6s var(--ease) both; }
.auth-box h1 { margin: 18px 0 4px; font-size: 34px; font-weight: 600; letter-spacing: -.045em; }
.auth-box form { margin-top: 30px; text-align: left; }
.auth-mark { width: 92px; aspect-ratio: 1; margin: 0 auto; }
.auth-mark .logo-green { animation: fillUp 1.3s .15s var(--ease) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ============================================================ layout */
.view {
  max-width: 540px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 20px) max(16px, env(safe-area-inset-right)) calc(var(--tabs-h) + var(--tabs-bottom) + 28px) max(16px, env(safe-area-inset-left));
  animation: viewIn .45s var(--ease) backwards; /* "backwards": sem transform no fim, senão o + e a caixa de texto (fixed) grudam na seção */
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

/* barra de abas flutuante */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: var(--tabs-bottom); z-index: 20;
  width: min(calc(100vw - 32px), 300px); height: var(--tabs-h); padding: 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / .45);
}
.tabs button {
  background: none; border: 0; color: var(--muted); border-radius: 16px; cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: color .2s, background .25s var(--ease);
}
.tabs button:hover { color: var(--text-2); }
.tabs button svg.i { width: 23px; height: 23px; transition: transform .3s var(--spring); }
.tabs button::after {
  content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%;
  background: linear-gradient(90deg, var(--g1), var(--g3)); opacity: 0; transform: scale(0); transition: .3s var(--spring);
}
.tabs button.active { color: var(--g2); background: color-mix(in srgb, var(--g2) 13%, transparent); }
.tabs button.active::after { opacity: 1; transform: scale(1); }
.tabs button.active svg.i { transform: translateY(-3px); }
.logo-i { display: block; background: currentColor; -webkit-mask: url(/brand/logo-mascara.webp) center / contain no-repeat; mask: url(/brand/logo-mascara.webp) center / contain no-repeat; }
.tabs button .logo-i { width: 25px; height: 25px; transition: transform .3s var(--spring); }
.tabs button.active .logo-i { transform: translateY(-3px); background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3)); }

/* ============================================================ aba Voz */
/* Cabe inteira na tela de qualquer celular, sem rolar: o triângulo ocupa o espaço que sobra. */
body.on-voz { overflow: hidden; overscroll-behavior: none; }
#view-voz {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
  padding-top: calc(env(safe-area-inset-top) + clamp(10px, 2.2dvh, 20px));
  padding-bottom: calc(var(--tabs-h) + var(--tabs-bottom) + clamp(8px, 1.6dvh, 16px));
}
#view-voz > * { flex: none; }
#view-voz > .stage { flex: 1 1 0; }
.topline { display: flex; align-items: flex-start; justify-content: space-between; }
.greet { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }

.balance { text-align: center; margin-top: clamp(4px, 2.4dvh, 24px); }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.balance-value {
  font-size: clamp(38px, min(13vw, 8.4dvh), 64px); font-weight: 600; letter-spacing: -.055em; line-height: 1.05; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.balance-value .cents { font-size: .45em; letter-spacing: -.02em; color: var(--muted); margin-left: 2px; }
.balance-value.neg { color: var(--gasto); }
.balance-value.neg .cents { color: inherit; opacity: .7; }

.split {
  display: flex; gap: 3px; height: 6px; margin: clamp(12px, 2.6dvh, 20px) auto 12px; max-width: 320px; border-radius: 99px; overflow: hidden;
  background: var(--surface-2);
}
.split span { height: 100%; border-radius: 99px; transition: flex-grow .8s var(--ease); min-width: 0; }
.split .gasto { background: var(--gasto); }
.split .investimento { background: var(--investimento); }
.split .sobra { background: linear-gradient(90deg, var(--g1), var(--g3)); }
.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 340px; margin: 0 auto; font-size: 12px; color: var(--muted); }
.legend span { display: grid; justify-items: center; gap: 2px; }
.legend span > span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend b { color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.stage {
  min-height: 0; container-type: size;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 1.6dvh, 14px); padding: 6px 0;
}

/* o triângulo */
.triangle {
  --lvl: 0;
  position: relative; width: clamp(96px, min(54vw, 29dvh), 230px); aspect-ratio: 1; border: 0; background: none; cursor: pointer; padding: 0; flex: none;
  display: grid; place-items: center; outline: none;
  transition: transform .5s var(--spring);
}
.triangle .glow {
  position: absolute; inset: 10%; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 200deg, var(--g1), var(--g2), var(--g3), var(--g1));
  filter: blur(38px); opacity: .12; animation: breathe 5s ease-in-out infinite;
  transition: opacity .5s var(--ease);
}
.triangle .ring {
  position: absolute; inset: 14%; border-radius: 50%; border: 1px solid var(--text); opacity: 0; pointer-events: none; z-index: 1;
}
.triangle:hover .glow { opacity: .22; }
.triangle:focus-visible .logo-base { background: var(--g2); }
.triangle:active { transform: scale(.95); }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .2; } }

/* gravando: preenche com o gradiente e pulsa com o volume da voz */
.triangle.recording { transform: scale(calc(1.02 + var(--lvl) * .14)); transition: transform .08s linear; }
.triangle.recording .logo-base { opacity: 0; }
.triangle.recording .logo-green { opacity: 1; filter: drop-shadow(0 10px 28px color-mix(in srgb, var(--g2) 55%, transparent)); }
.triangle.recording .glow { opacity: calc(.45 + var(--lvl) * .55); animation: none; transform: scale(calc(1 + var(--lvl) * .5)); }
.triangle.recording .ring { animation: ring 2.4s var(--ease) infinite; border-color: var(--g2); }
.triangle.recording .r2 { animation-delay: .8s; }
.triangle.recording .r3 { animation-delay: 1.6s; }
@keyframes ring { from { transform: scale(.75); opacity: .55; } to { transform: scale(1.75); opacity: 0; } }

/* processando: um traço percorre o contorno */
/* a logo verde sobreposta enche de baixo para cima e esvazia, em loop, sobre a silhueta apagada */
.triangle.processing .logo-base { opacity: .28; }
.triangle.processing .logo-green { opacity: 1; animation: loadFill 1.5s var(--ease) infinite; }
.triangle.processing .glow { opacity: .3; animation: breathe 1.6s ease-in-out infinite; }
@keyframes trace { to { stroke-dashoffset: -100; } }

/* concluído: um flash rápido */
.triangle.done .logo-green { animation: flash .7s var(--ease); }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

.state { font-size: 15px; font-weight: 500; letter-spacing: -.01em; min-height: 1.5em; font-variant-numeric: tabular-nums; text-align: center; }
.state .timer { color: var(--muted); font-weight: 400; margin-left: 6px; }
.example { font-size: 13px; color: var(--faint); min-height: 1.4em; text-align: center; transition: opacity .5s; max-width: 300px; }
/* com suporte a container queries, o triângulo usa exatamente a altura livre do palco */
@supports (width: 1cqh) {
  .triangle { width: clamp(84px, min(58cqw, calc(100cqh - 74px)), 240px); }
  #view-voz:has(.result:not(:empty)) .triangle { width: clamp(44px, min(46cqw, calc(100cqh - 44px)), 200px); }
}
#view-voz:has(.result:not(:empty)) .example { display: none; }
@media (max-height: 760px) {
  #view-voz:has(.result:not(:empty)) :is(.legend, .forecast-chip) { display: none; }
  #view-voz:has(.result:not(:empty)) .split { margin-bottom: 0; }
}

/* resultado da fala */
.result {
  width: 100%; display: grid; gap: 8px; align-content: start;
  max-height: 46%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; /* muitos lançamentos: rola só aqui dentro */
}
.result::-webkit-scrollbar { display: none; }
.result:empty { display: none; }
.heard { font-size: 13.5px; color: var(--muted); text-align: center; padding: 0 12px 6px; line-height: 1.45; }
.heard::before { content: "“"; } .heard::after { content: "”"; }
.entry {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); animation: pop .5s var(--spring) both;
}
.entry .grow .d { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .grow .c { font-size: 12px; color: var(--muted); }
.entry .amt { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.amt.gasto { color: var(--gasto); } .amt.ganho { color: var(--ganho); } .amt.investimento { color: var(--investimento); }
.result-foot { display: flex; justify-content: center; }
.result-foot button {
  background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 14px; min-height: 44px;
  display: inline-flex; gap: 6px; align-items: center; border-radius: 10px;
}
.result-foot button:hover { color: var(--text); background: var(--surface); }
.result-foot svg.i { width: 15px; height: 15px; }
.bubble {
  padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  white-space: pre-line; font-size: 14.5px; animation: pop .45s var(--spring) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* barra de digitação */
.composer {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 19;
  bottom: calc(var(--tabs-bottom) + var(--tabs-h) + 10px);
  width: min(calc(100vw - 32px), 508px); display: flex; gap: 8px; padding: 6px;
  background: color-mix(in srgb, var(--surface-solid) 85%, transparent); border: 1px solid var(--line);
  border-radius: 18px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / .5); animation: pop .35s var(--spring) both;
}
.composer input { background: transparent; border: 0; padding: 10px; min-width: 0; }
.composer .send {
  width: 44px; height: 44px; flex: none; border-radius: 13px; border: 0; background: linear-gradient(135deg, var(--g1), var(--g3)); color: var(--on-accent);
  display: grid; place-items: center; cursor: pointer;
}

/* ============================================================ ícones de categoria */
.tile {
  --c: var(--muted);
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c);
}
.tile svg.i { width: 19px; height: 19px; }
.tile.sm { width: 30px; height: 30px; border-radius: 9px; }
.tile.sm svg.i { width: 15px; height: 15px; }

/* ============================================================ aba Registros */
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 22px; padding: 0 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  min-height: 44px; padding: 8px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: .2s;
}
.filters button.on { background: linear-gradient(135deg, var(--g1), var(--g3)); color: var(--on-accent); border-color: transparent; }

.row { margin-bottom: 28px; animation: rise .5s var(--ease) both; }
.row:nth-child(2) { animation-delay: .06s; } .row:nth-child(3) { animation-delay: .12s; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.row-head .t { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.row-head .t i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.row-head .n { color: var(--faint); font-weight: 500; font-size: 13px; }
.row-head .v { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.02em; color: var(--c); }
.row.gasto { --c: var(--gasto); } .row.ganho { --c: var(--ganho); } .row.investimento { --c: var(--investimento); }

.cards {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  padding: 2px 16px 12px; margin: 0 -16px; scrollbar-width: none;
}
.cards::-webkit-scrollbar { display: none; }
.tx {
  position: relative; flex: 0 0 clamp(138px, calc((100vw - 42px) / 2.25), 172px); scroll-snap-align: start; min-height: 172px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px;
  display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow);
  transition: transform .25s var(--spring), border-color .2s, background .2s;
}
.tx:hover { border-color: var(--line-2); background: var(--surface-2); }
.tx:active { transform: scale(.97); }
.tx .tile { margin-bottom: 12px; }
.tx .amt { font-size: 20px; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--text); }
.tx .desc { font-size: 13px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tx .meta { margin-top: auto; padding-top: 10px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tx .meta svg.i { width: 13px; height: 13px; }
.tx .src { display: inline-flex; align-items: center; gap: 4px; }
.empty {
  flex: 1; display: grid; place-items: center; text-align: center; gap: 4px; min-height: 120px;
  color: var(--faint); font-size: 13.5px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 18px;
}

.fab {
  position: fixed; z-index: 19; right: max(16px, calc(50vw - 254px));
  bottom: calc(var(--tabs-bottom) + var(--tabs-h) + 14px);
  width: 54px; height: 54px; border-radius: 18px; border: 0; background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3)); color: var(--on-accent);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--g2) 65%, transparent);
  transition: transform .3s var(--spring);
}
.fab:hover { transform: rotate(90deg); }
.fab svg.i { width: 24px; height: 24px; stroke-width: 2; }

.month-switch { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.month-switch button {
  background: none; border: 0; width: 44px; height: 44px; border-radius: 11px; cursor: pointer; display: grid; place-items: center; color: var(--text-2);
}
.month-switch button:hover { background: var(--surface-2); }
.month-switch button:disabled { opacity: .25; pointer-events: none; }
.month-switch svg.i { width: 16px; height: 16px; }
.month-switch span { min-width: 72px; text-align: center; font-size: 13.5px; font-weight: 500; text-transform: capitalize; }

/* ============================================================ aba Mês */
.hero { text-align: center; padding: 26px 18px 22px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1;
  background: radial-gradient(50% 50% at 50% 0%, color-mix(in srgb, var(--g2) 18%, transparent), transparent 70%);
}
.hero .eyebrow { margin-bottom: 6px; }
.hero .big { font-size: clamp(34px, 11vw, 44px); font-weight: 600; letter-spacing: -.055em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hero .big.neg { color: var(--gasto); }
.hero .big .cents { font-size: .45em; color: var(--muted); letter-spacing: -.02em; }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 5px 10px;
  border-radius: 99px; background: var(--surface-2); color: var(--text-2);
}
.chip svg.i { width: 13px; height: 13px; }
.chip.good { color: var(--ganho); background: color-mix(in srgb, var(--ganho) 12%, transparent); }
.chip.bad { color: var(--gasto); background: color-mix(in srgb, var(--gasto) 12%, transparent); }

.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.flow > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow); }
.flow .l { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.flow .l i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.flow .n { font-size: 16px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow .d { font-size: 11.5px; margin-top: 2px; }
.flow .gasto { --c: var(--gasto); } .flow .ganho { --c: var(--ganho); } .flow .investimento { --c: var(--investimento); }
.up { color: var(--gasto); } .down { color: var(--ganho); } .flat { color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.kpi svg.i { width: 16px; height: 16px; color: var(--muted); }
.kpi .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(14px, 4.3vw, 16px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 8px; }
.kpi .l { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

.donut-wrap { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; }
.donut { width: 132px; height: 132px; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 3.6; transition: stroke-dasharray .9s var(--ease); }
.donut .track { stroke: var(--surface-2); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.donut .center b { font-size: 15px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.donut .center span { font-size: 11px; color: var(--muted); }
.cat-list { display: grid; gap: 10px; min-width: 0; }
.cat-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
.cat-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row .pc { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cat-row .vl { font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cat-more { margin-top: 14px; display: grid; gap: 10px; }
@media (max-width: 400px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .cat-list { width: 100%; } }

.daily { width: 100%; height: 110px; display: block; overflow: visible; }
.daily rect { fill: var(--gasto); opacity: .8; transition: opacity .2s; }
.daily rect:hover { opacity: 1; }
.daily rect.zero { fill: var(--surface-2); opacity: 1; }
.daily rect.today { fill: var(--g3); opacity: 1; }
.daily line { stroke: var(--muted); stroke-width: .35; stroke-dasharray: 1.2 1.2; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 8px; font-variant-numeric: tabular-nums; }

.top { list-style: none; margin: 0; padding: 0; }
.top li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.top li:last-child { border: 0; padding-bottom: 0; }
.top li:first-child { padding-top: 0; }
.top .d { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .c { font-size: 12px; color: var(--muted); }
.top b { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.02em; }

.insight { position: relative; border: 1px solid transparent; background:
  linear-gradient(var(--bg), var(--bg)) padding-box,
  linear-gradient(135deg, color-mix(in srgb, var(--g1) 60%, transparent), color-mix(in srgb, var(--g2) 50%, transparent), color-mix(in srgb, var(--g3) 60%, transparent)) border-box;
}
.insight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--g1) 7%, transparent), color-mix(in srgb, var(--g3) 6%, transparent));
}
.insight .card-t .t { display: flex; align-items: center; gap: 8px; }
.insight .card-t svg.i { width: 17px; height: 17px; stroke: url(#g-tri); }
.insight .txt { position: relative; white-space: pre-line; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.insight .btn { position: relative; margin-top: 16px; }
.skeleton { display: grid; gap: 8px; }
.skeleton span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line-2), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton span:nth-child(2) { width: 85%; } .skeleton span:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================ Perfil */
.me { display: flex; align-items: center; gap: 14px; }
.me-text { min-width: 0; }
.avatar {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; flex: none;
  font-weight: 600; font-size: 22px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3));
}
.group-t { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 24px 4px 10px; }
.wa-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wa-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, #25d366 16%, transparent); color: #25d366; }
.status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-top: 1px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.open { background: var(--ganho); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ganho) 20%, transparent); }
.wa-help { margin-bottom: 2px; }
.wa-note { margin: 12px 0 0; line-height: 1.45; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { display: flex; gap: 12px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.steps li::before {
  counter-increment: s; content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text);
}
.steps b { color: var(--text); font-weight: 600; }
.steps code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

.card.list { padding: 6px 18px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border: 0; }
.field > span { font-size: 14px; color: var(--text-2); flex: none; }
.field input { text-align: right; background: transparent; padding: 10px 0; max-width: 60%; min-height: 44px; }
.field input:focus { background: transparent; border-color: transparent; }
#logout { margin-top: 20px; }

/* ============================================================ folha (dialog) */
dialog {
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--text);
  border-radius: 26px; padding: 12px 18px 18px; width: min(100vw - 24px, 440px); max-height: 92dvh;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6);
}
dialog[open] { animation: sheetIn .45s var(--spring); }
dialog::backdrop { background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(40px); } }
/* no celular, uma folha de verdade presa embaixo; o conteúdo rola por dentro e os botões ficam sempre à vista */
dialog[open] { display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: contain; }
dialog[open] > :not(.sheet-grip) { overflow-y: auto; min-height: 0; flex: 0 1 auto; overscroll-behavior: contain; margin: 0 -18px; padding: 0 18px; }
@media (max-width: 560px) {
  dialog {
    width: 100%; max-width: 100%; max-height: 90dvh; margin: auto 0 0; inset: auto 0 0 0;
    border-radius: 26px 26px 0 0; border-width: 1px 0 0;
    padding: 10px max(18px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 14px) max(18px, env(safe-area-inset-left));
  }
  dialog[open] { animation: sheetUp .42s var(--ease); }
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--line-2); margin: 0 auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#txForm { display: grid; gap: 10px; grid-auto-rows: max-content; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 9px 0; min-height: 40px; border-radius: 10px; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: .2s; display: grid; place-items: center; }
.seg button.on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.seg button.on[data-type="gasto"] { color: var(--gasto); }
.seg button.on[data-type="ganho"] { color: var(--ganho); }
.seg button.on[data-type="investimento"] { color: var(--investimento); }
.small-seg { width: 148px; grid-template-columns: repeat(3, 1fr); }
.small-seg button { padding: 6px 0; min-height: 38px; }
.small-seg svg.i { width: 16px; height: 16px; }
.amount-field { display: flex; align-items: baseline; gap: 8px; padding: 6px 4px 2px; }
.amount-field span { font-size: 22px; color: var(--muted); font-weight: 500; }
.amount-field input { font-size: 36px; font-weight: 600; letter-spacing: -.04em; background: none; padding: 0; border: 0; font-variant-numeric: tabular-nums; }
.amount-field input:focus { background: none; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: min(190px, 28dvh); overscroll-behavior: contain; overflow-y: auto; padding: 2px; }
.cat-grid button {
  display: grid; justify-items: center; gap: 5px; padding: 10px 4px; border-radius: 14px; cursor: pointer;
  border: 1px solid transparent; background: var(--surface-2); font-size: 11.5px; color: var(--text-2);
}
.cat-grid button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); }
.sheet-actions {
  display: grid; grid-template-columns: 56px 1fr; gap: 8px; margin-top: 6px;
  position: sticky; bottom: 0; z-index: 2; padding: 8px 0 2px; background: var(--surface-solid);
  box-shadow: 0 -14px 14px -6px var(--surface-solid);
}
.sheet-actions.new { grid-template-columns: 1fr; }

/* ============================================================ toast */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translate(-50%, -20px);
  background: var(--text); color: var(--invert); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .35s var(--spring); max-width: calc(100vw - 32px); z-index: 50;
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--gasto); color: #fff; }

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

/* ============================================================ moedas */
.amount-field select.cur-sel {
  width: auto; flex: none; padding: 8px 10px; border-radius: 12px; font-size: 15px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); cursor: pointer; align-self: center;
}
.fx-hint { font-size: 13px; color: var(--muted); padding: 0 4px; margin-top: -4px; font-variant-numeric: tabular-nums; }
.fx-hint b { color: var(--text); font-weight: 600; }
.fx { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tx .fx { margin-top: -1px; }

/* ============================================================ fixos */
.fixed-banner {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 12px 14px; margin: -4px 0 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); transition: background .2s, transform .15s;
}
.fixed-banner:hover { background: var(--surface-2); }
.fixed-banner:active { transform: scale(.985); }
.fixed-banner .grow { display: grid; }
.fixed-banner b { font-size: 14.5px; font-weight: 600; }
.fixed-banner .grow span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixed-banner .chev { color: var(--faint); width: 18px; height: 18px; }

.sheet-sub { margin: -6px 0 14px; line-height: 1.5; }
.fix-items { display: grid; gap: 6px; margin-bottom: 12px; max-height: 50dvh; overflow-y: auto; }
.fix-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; text-align: left; width: 100%;
  background: var(--surface-2); border: 1px solid transparent; transition: border-color .2s;
}
.fix-item:hover { border-color: var(--line-2); }
.fix-item .d { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fix-item .c { font-size: 12px; color: var(--muted); }
.fix-item .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.fix-item .v small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.fix-empty { text-align: center; color: var(--faint); font-size: 13.5px; padding: 18px; border: 1px dashed var(--line-2); border-radius: 14px; }
.day-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.day-field span { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.day-field svg.i { width: 17px; height: 17px; color: var(--muted); }
.day-field input { width: 76px; min-height: 44px; text-align: center; font-weight: 600; font-size: 16px; background: var(--surface-solid); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); padding: 2px 4px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--g2); }
dialog > .sheet-grip { margin-bottom: 10px; }
#fixForm { display: grid; gap: 10px; grid-auto-rows: max-content; }

/* Mês: fixos a cair */
.pending li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pending li:last-child { border: 0; padding-bottom: 0; }
.pending li:first-child { padding-top: 0; }
.pending { list-style: none; margin: 0; padding: 0; }
.pending .d { font-size: 14px; font-weight: 500; }
.pending .c { font-size: 12px; color: var(--muted); }
.pending b { font-variant-numeric: tabular-nums; font-weight: 600; }
.forecast {
  display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--text-2);
}
.forecast b { font-size: 17px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.forecast b.neg { color: var(--gasto); }
.forecast-chip { margin-top: 10px; display: inline-flex; }

/* ============================================================ instalar app */
.app-icon { background: color-mix(in srgb, var(--g2) 16%, transparent); color: var(--g2); }
.install .steps { margin-bottom: 14px; }
.install .ok { display: flex; align-items: center; gap: 8px; color: var(--ganho); font-size: 14px; font-weight: 500; }
.install svg.i.inline { width: 15px; height: 15px; vertical-align: -3px; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ============================================================ Mês: conta do dinheiro */
.hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.hero .forecast { text-align: left; }
.eq { display: grid; }
.eq-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.eq-row:first-child { padding-top: 0; }
.eq-row .op {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none;
  font-weight: 600; font-size: 15px; background: color-mix(in srgb, var(--c, var(--text)) 14%, transparent); color: var(--c, var(--text));
}
.eq-row.ganho { --c: var(--ganho); } .eq-row.gasto { --c: var(--gasto); } .eq-row.investimento { --c: var(--investimento); }
.eq-row .k { font-size: 14.5px; font-weight: 500; }
.eq-row .d, .eq-row .parts { font-size: 12px; color: var(--muted); }
.eq-row b { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.eq-row.total { border: 0; padding-bottom: 0; }
.eq-row.total .k { font-weight: 600; }
.eq-row.total b { font-size: 18px; }
.eq-row b.neg { color: var(--gasto); }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.note svg.i { width: 15px; height: 15px; margin-top: 2px; }
.stale { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--g3); margin-bottom: 10px; position: relative; }
.stale svg.i { width: 15px; height: 15px; }
.disclaimer { position: relative; font-size: 11.5px; color: var(--faint); margin: 12px 0 0; line-height: 1.45; }

/* Segurar para falar: sem seleção de texto, sem menu de toque longo e sem rolagem durante o gesto */
.triangle { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.triangle span, .triangle img { pointer-events: none; }

/* Passo a passo do agente no WhatsApp */
.wa-lead { font-size: 14px; color: var(--text-2); margin: 0 0 14px; line-height: 1.5; }
.step-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 14px; min-height: 44px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: background .2s;
}
.step-btn:hover { background: var(--line-2); }
.step-btn:disabled { opacity: .5; }
.step-btn svg.i { width: 15px; height: 15px; }
.steps code { display: inline-block; margin-top: 4px; }

/* ============================================================ celular */
/* digitando: a barra de abas sai e a caixa de texto desce até o teclado */
/* com o teclado aberto na aba Voz, a barra de abas sai; --kb é a altura do teclado no iPhone (0 no Android) */
body:has(#view-voz input:focus) .tabs { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
body:has(.composer input:focus) .composer { bottom: calc(env(safe-area-inset-bottom) + 10px + var(--kb, 0px)); }
.tabs { transition: opacity .25s, transform .3s var(--ease); }
.composer { transition: bottom .25s var(--ease); }
.fab { right: max(16px, env(safe-area-inset-right), calc(50vw - 254px)); }
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .kpi:last-child { grid-column: span 2; }
  .donut-wrap { gap: 14px; }
}
@media (max-height: 700px) {
  .view { padding-top: calc(env(safe-area-inset-top) + 14px); }
  .legend b { font-size: 13.5px; }
  .forecast-chip { margin-top: 6px; }
  .split { margin: 12px auto 10px; }
}
/* telas baixas (celulares pequenos, teclado aberto): some o que é secundário, nunca rola */
@media (max-height: 620px) {
  #view-voz .example { display: none; }
  #view-voz .greet { font-size: 16px; }
  #view-voz .icon-btn { width: 40px; height: 40px; }
  .balance-value { font-size: clamp(32px, min(12vw, 8dvh), 48px); }
  .forecast-chip .chip { font-size: 11.5px; padding: 4px 9px; }
}
@media (max-height: 540px) {
  #view-voz .forecast-chip, #view-voz .legend { display: none; }
  #view-voz .split { margin: 8px auto 0; }
}
/* digitando: esconde o secundário e reserva espaço para a caixa de texto */
#view-voz:has(#typeForm:not([hidden])) { padding-bottom: calc(var(--tabs-h) + var(--tabs-bottom) + 76px); }
body:has(.composer input:focus) #view-voz { padding-bottom: calc(env(safe-area-inset-bottom) + 84px + var(--kb, 0px)); }
body:has(#askInput:focus) #view-voz { padding-bottom: calc(env(safe-area-inset-bottom) + 12px + var(--kb, 0px)); }
body:has(#askInput:focus) #view-voz :is(.legend, .forecast-chip, .example) { display: none; }
body:has(.composer input:focus) #view-voz :is(.legend, .forecast-chip, .example) { display: none; }

/* ============================================================ parcelas */
.seg.two { grid-template-columns: 1fr 1fr; }
.inst { scroll-margin-bottom: 76px; }
.inst { display: grid; gap: 10px; padding: 4px 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.inst-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; font-size: 14.5px; color: var(--text-2); }
.inst-toggle > span { display: inline-flex; align-items: center; gap: 8px; }
.inst-toggle svg.i { width: 17px; height: 17px; color: var(--muted); }
.inst-toggle input {
  appearance: none; -webkit-appearance: none; width: 46px; height: 28px; min-height: 0; padding: 0; flex: none; cursor: pointer;
  border-radius: 99px; background: var(--line-2); position: relative; border: 0; transition: background .25s var(--ease);
}
.inst-toggle input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .3s var(--spring);
}
.inst-toggle input:checked { background: linear-gradient(135deg, var(--g1), var(--g2)); }
.inst-toggle input:checked::before { transform: translateX(18px); }
.inst-toggle input:focus-visible { outline: 2px solid var(--g2); outline-offset: 2px; }
.inst-body { display: grid; gap: 10px; padding-bottom: 12px; animation: rise .3s var(--ease) both; }
.inst-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.stepper button:active { transform: scale(.94); }
.stepper svg.i { width: 17px; height: 17px; }
.stepper input { width: 58px; min-height: 44px; padding: 8px 4px; text-align: center; font-weight: 600; background: var(--surface-solid); font-variant-numeric: tabular-nums; }
.inst-hint { font-size: 13px; color: var(--muted); line-height: 1.5; font-variant-numeric: tabular-nums; }
.inst-hint b { color: var(--text); font-weight: 600; }
.inst-info {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start; font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 6px 12px; border-radius: 99px; background: var(--surface-2); margin-top: -4px;
}
.inst-info svg.i { width: 15px; height: 15px; color: var(--g2); }
.del-choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--gasto) 35%, transparent); background: color-mix(in srgb, var(--gasto) 7%, transparent);
  animation: rise .25s var(--ease) both;
}
.del-choice > span { grid-column: 1 / -1; font-size: 14px; font-weight: 500; }
.del-choice .btn { padding: 12px 10px; font-size: 14px; min-height: 44px; }
.del-choice .link { grid-column: 1 / -1; margin: 0; justify-self: center; }
.inst-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px 2px 5px; border-radius: 99px;
  letter-spacing: 0;
}
.inst-badge svg.i { width: 12px; height: 12px; color: var(--g2); }
.tx .inst-badge { position: absolute; top: 14px; right: 12px; }
.entry .amt { display: flex; align-items: center; gap: 8px; }
.progress { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; max-width: 180px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3)); }
.inst-list .d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================ tour */
body.touring { overflow: hidden; }
.tour {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: calc(env(safe-area-inset-top) + 8px) 0 calc(env(safe-area-inset-bottom) + 16px);
  animation: viewIn .4s var(--ease) both; overscroll-behavior: contain;
}
.tour::before {
  content: ""; position: absolute; inset: -10% -20% auto; height: 60%; pointer-events: none; z-index: -1;
  background: radial-gradient(45% 50% at 50% 40%, color-mix(in srgb, var(--g2) 16%, transparent), transparent 70%);
}
.tour-top { display: flex; justify-content: flex-end; padding: 0 max(12px, env(safe-area-inset-right)); max-width: 540px; width: 100%; margin: 0 auto; }
.tour-skip { background: none; border: 0; color: var(--muted); font-size: 15px; font-weight: 500; min-height: 44px; padding: 0 14px; border-radius: 12px; cursor: pointer; }
.tour-skip:hover { color: var(--text); background: var(--surface); }
.tour-viewport { flex: 1; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; max-width: 540px; width: 100%; margin: 0 auto; min-height: 0; }
.tour-track { display: flex; height: 100%; transition: transform .45s var(--ease); will-change: transform; }
.tour-track.dragging { transition: none; }
.tour-card {
  flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 0 max(28px, env(safe-area-inset-left)); min-height: 0; overflow: hidden;
  opacity: .35; transition: opacity .45s var(--ease);
}
.tour-card.on { opacity: 1; }
.tour-card h2 { font-size: clamp(24px, 7vw, 30px); margin: clamp(18px, 4dvh, 34px) 0 10px; letter-spacing: -.04em; line-height: 1.15; }
.tour-card p { margin: 0; max-width: 340px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.tour-card p svg.i.inline { width: 17px; height: 17px; vertical-align: -3px; }
.tour-art { position: relative; width: min(78vw, 300px); height: clamp(170px, 30dvh, 250px); display: grid; place-items: center; }
.tour-orb {
  width: clamp(96px, 16dvh, 124px); aspect-ratio: 1; border-radius: 32%; display: grid; place-items: center; color: var(--on-accent);
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3));
  box-shadow: 0 24px 60px -18px color-mix(in srgb, var(--g2) 70%, transparent), inset 0 1px 0 rgb(255 255 255 / .35);
}
.tour-card.on .tour-orb { animation: orbIn .7s var(--spring) both; }
.tour-orb svg.i { width: 46%; height: 46%; stroke-width: 1.6; }
@keyframes orbIn { from { transform: scale(.7) rotate(-8deg); opacity: 0; } }
.tour-float {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--text);
  background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .5);
}
.tour-float svg.i { width: 14px; height: 14px; color: var(--g2); }
.tour-float.f1 { top: 8%; left: 0; }
.tour-float.f2 { bottom: 8%; right: 0; }
.tour-card.on .tour-float { animation: floatIn .6s var(--spring) both; }
.tour-card.on .tour-float.f1 { animation-delay: .15s; }
.tour-card.on .tour-float.f2 { animation-delay: .28s; }
@keyframes floatIn { from { opacity: 0; transform: translateY(12px) scale(.9); } }
.tour-logo { position: relative; display: block; width: 100%; height: 100%; }
.tour-mark { width: clamp(120px, 24dvh, 180px); aspect-ratio: 1; }
.tour-mark .logo-green { opacity: 1; }
.tour-card.on .tour-mark .logo-green { animation: fillUp 1.4s .1s var(--ease) both; }
@keyframes drawTri { to { stroke-dashoffset: 0; } }
.tour-mic { position: relative; width: clamp(110px, 20dvh, 150px); aspect-ratio: 1; display: grid; place-items: center; }
.tour-mic .tour-logo { z-index: 1; }
.tour-mic .logo-base { opacity: 0; }
.tour-mic .logo-green { opacity: 1; filter: drop-shadow(0 16px 30px color-mix(in srgb, var(--g2) 55%, transparent)); }
.tour-mic .ring { position: absolute; inset: 8%; border-radius: 50%; border: 1.5px solid var(--g2); opacity: 0; }
.tour-card.on .tour-mic .ring { animation: ring 2.4s var(--ease) infinite; }
.tour-card.on .tour-mic .r2 { animation-delay: 1.2s; }
.tour-foot { display: grid; gap: 18px; justify-items: center; padding: 12px max(24px, env(safe-area-inset-left)) 0; max-width: 420px; width: 100%; margin: 0 auto; }
.tour-dots { display: flex; gap: 2px; }
.tour-dots button { width: 28px; height: 28px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.tour-dots i { display: block; width: 7px; height: 7px; border-radius: 99px; background: var(--line-2); transition: width .35s var(--spring), background .3s; }
.tour-dots button.on i { width: 22px; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3)); }
.tour-foot .btn { min-height: 52px; font-size: 16px; }
@media (max-height: 620px) {
  .tour-art { height: 150px; }
  .tour-card p { font-size: 15px; }
}
/* sem animação: o tour troca de card sem deslizar e o triângulo já aparece desenhado */
@media (prefers-reduced-motion: reduce) {
  .tour-mark .logo-green, .auth-mark .logo-green { animation: none !important; clip-path: none; }
  .tour-mic .ring { display: none; }
}

/* ============================================================ WhatsApp no Perfil */
a.btn { text-decoration: none; }
.wa-seg { margin-bottom: 14px; }
.wa-talk { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.wa-talk code {
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); padding: 4px 9px; border-radius: 8px;
}
.wa-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.wa-actions .btn, .phone-row .btn { white-space: nowrap; }
.wa-actions .ghost { width: auto; }
.wa-off { margin-top: 8px; }
.phone-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.phone-row .btn { width: auto; padding-inline: 16px; }
.pair-code {
  font-family: "Geist Mono", ui-monospace, monospace; font-size: clamp(26px, 9vw, 34px); font-weight: 500; letter-spacing: .12em;
  text-align: center; padding: 14px 8px; margin-bottom: 16px; border-radius: var(--r-md); user-select: all;
  background: color-mix(in srgb, var(--g2) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--g2) 45%, transparent);
}
.pair-code + .steps { margin-bottom: 4px; }
.wa-help > .btn.ghost:last-child { margin-top: 14px; }
@media (max-width: 360px) { .phone-row { grid-template-columns: 1fr; } .phone-row .btn { width: 100%; } }

/* ============================================================ lançamento incompleto */
/* "50" → escolher o tipo; "televisão" → digitar o valor */
.ask-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; animation: pop .45s var(--spring) both; }
.ask-type {
  min-height: 48px; border-radius: var(--r-md); cursor: pointer; font-size: 14.5px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); transition: transform .15s var(--ease), background .2s;
}
.ask-type:active { transform: scale(.96); }
.ask-type.gasto { --c: var(--gasto); } .ask-type.ganho { --c: var(--ganho); } .ask-type.investimento { --c: var(--investimento); }
.ask-value {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-2); animation: pop .45s var(--spring) both;
}
.ask-value span { color: var(--muted); font-weight: 500; }
.ask-value input { background: none; border: 0; padding: 10px 0; font-size: 18px; font-weight: 600; min-width: 0; }
.ask-value input:focus { background: none; }
.ask-value .btn { width: auto; padding: 12px 18px; }

/* ============================================================ tocar ou segurar */
.rec-cancel {
  min-height: 44px; padding: 8px 20px; border-radius: 99px; cursor: pointer; font-size: 14px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); animation: pop .3s var(--spring) both;
}
.rec-cancel:hover { background: var(--surface-2); color: var(--text); }
body.rec #view-voz .example { display: none; }
@supports (width: 1cqh) {
  #view-voz:has(#recCancel:not([hidden])) .triangle { width: clamp(80px, min(58cqw, calc(100cqh - 120px)), 240px); }
}

/* link da política de privacidade (login e Perfil) */
.legal { display: block; width: fit-content; margin: 14px auto 0; padding: 10px 12px; font-size: 13px; color: var(--muted); text-decoration: none; }
.legal:hover { color: var(--text); text-decoration: underline; }

/* interruptor (Perfil › Sons) */
.field input.switch {
  appearance: none; -webkit-appearance: none; width: 46px; height: 28px; min-height: 0; max-width: none; padding: 0; flex: none;
  cursor: pointer; border-radius: 99px; background: var(--line-2); position: relative; border: 0; transition: background .25s var(--ease);
}
.field input.switch::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .3s var(--spring);
}
.field input.switch:checked { background: linear-gradient(135deg, var(--g1), var(--g2)); }
.field input.switch:checked::before { transform: translateX(18px); }
.field input.switch:focus-visible { outline: 2px solid var(--g2); outline-offset: 2px; }

/* ============================================================ logo */
/* A logo nova em duas camadas: a silhueta (máscara) pintada com a cor do texto (branca no escuro, preta no
   claro) e a versão verde por cima. Os estados só trocam a visibilidade e animam a camada verde. */
.logo { position: relative; display: block; }
.logo-base, .logo-green { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo-base {
  z-index: 2; background: var(--text); transition: opacity .35s var(--ease), background .3s;
  -webkit-mask: url(/brand/logo-mascara.webp) center / contain no-repeat; mask: url(/brand/logo-mascara.webp) center / contain no-repeat;
}
.logo-green {
  z-index: 3; object-fit: contain; opacity: 0; transition: opacity .35s var(--ease), filter .35s;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.auth-mark .logo-base { opacity: .16; }
.auth-mark .logo-green { opacity: 1; }
/* enche de baixo para cima (login e tour) */
@keyframes fillUp { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
/* carregando: enche de baixo para cima e esvazia por cima, em loop */
@keyframes loadFill {
  0% { clip-path: inset(100% 0 0 0); }
  50% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 100% 0); }
}
