/* fire.local — tokens da calculadora de referência (shadcn), visual mínimo. */
@font-face {
  font-family: "Funnel Display"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../vendor/fontes/funnel-display-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Funnel Display"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../vendor/fontes/funnel-display-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: 0 0% 100%;
  --fg: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 5% 96%;
  --muted-fg: 215.4 16.3% 46.9%;
  --borda: 240 5.9% 90%;
  --primary: 247 94% 63%;
  --primary-fg: 246.46 100% 97.3%;
  --lime: 71.87 90.1% 60.39%;
  --lime-fg: 240 5.9% 10%;
  --perigo: 0 72% 51%;
  --raio: .5rem;
  --contorno: #111;
  --grade-linha: #f1f1f3;
  --grade-fundo: #fcfcfc;
  --janela-sombra: #000;
  --c-continuando: #6b7280;
  --c-coast: #0fbe99;
  --c-numero-coast: #3229cb;
  --c-fire: #da294c;
  --fonte-titulo: "Funnel Display", system-ui, sans-serif;
  --fonte: ui-sans-serif, system-ui, sans-serif;
  --fonte-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: 20 14.3% 4.1%;
    --fg: 0 0% 95%;
    --card: 24 9.8% 8%;
    --muted: 240 4% 14%;
    --muted-fg: 215 20.2% 65.1%;
    --borda: 240 3.7% 18%;
    --contorno: #a1a1aa;
    --grade-linha: #1a1817;
    --grade-fundo: #0c0a09;
    --janela-sombra: #d2f557;
    --c-continuando: #9ca3af;
    --c-numero-coast: #8b80ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fonte); line-height: 1.45; background: hsl(var(--bg)); color: hsl(var(--fg)); }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
img { display: block; }

/* ---------- marca ---------- */
.marca { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: inherit; font-family: var(--fonte-titulo); font-size: 1.2rem; letter-spacing: -.01em; }
.marca b { font-weight: 700; font-size: 1.35rem; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.5rem; padding: 0 1rem; border-radius: calc(var(--raio) - 2px);
  font-size: .875rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; background: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:focus-visible, .btn-texto:focus-visible, .info:focus-visible, .tipo:focus-visible, .perfil-botao:focus-visible, .opcao:focus-visible {
  outline: none; box-shadow: 0 0 0 2px hsl(var(--bg)), 0 0 0 4px hsl(var(--primary));
}
.btn-primario { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); }
.btn-primario:hover { background: hsl(var(--primary) / .9); }
.btn-contorno { border-color: hsl(var(--borda)); background: hsl(var(--card)); }
.btn-contorno:hover { border-color: var(--contorno); }
.btn-grande { height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.btn-texto { background: none; border: 0; padding: .25rem 0; cursor: pointer; color: hsl(var(--muted-fg)); font-size: .85rem; font-weight: 500; border-radius: 4px; }
.btn-texto:hover { color: hsl(var(--fg)); text-decoration: underline; }
.btn-link { align-self: flex-start; margin-top: auto; }

/* ícone "i" */
.info {
  display: inline-grid; place-items: center; flex: none;
  width: 1.05rem; height: 1.05rem; border-radius: 999px; padding: 0;
  border: 1px solid hsl(var(--muted-fg) / .6); background: none; cursor: help;
  font: italic 600 .66rem/1 Georgia, serif; color: hsl(var(--muted-fg)); vertical-align: middle;
}
.info:hover, .info[aria-expanded="true"] { background: hsl(var(--fg)); color: hsl(var(--bg)); border-color: hsl(var(--fg)); }
.dica {
  position: fixed; z-index: 200; max-width: 19rem;
  background: hsl(var(--fg)); color: hsl(var(--bg));
  padding: .65rem .8rem; border-radius: var(--raio); font-size: .8rem; line-height: 1.45;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}

/* ---------- layout do painel ---------- */
.janela { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 100dvh; }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; }
.grade {
  display: grid; gap: .75rem; padding: 0 1rem 1rem; min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "resultado" "tipos" "numeros";
}
.area-numeros { grid-area: numeros; }
.area-resultado { grid-area: resultado; display: flex; flex-direction: column; gap: .75rem; min-height: 0; min-width: 0; }
.area-tipos { grid-area: tipos; }
.rodape { padding: .5rem 1rem 1rem; text-align: center; font-size: .72rem; color: hsl(var(--muted-fg)); }

@media (min-width: 1024px) {
  body {
    height: 100dvh; overflow: hidden; padding: 1rem 1.25rem 1.4rem;
    background-color: var(--grade-fundo);
    background-image: linear-gradient(var(--grade-linha) 2px, transparent 2px), linear-gradient(90deg, var(--grade-linha) 2px, transparent 2px);
    background-size: 56px 56px; background-position: -1px -1px;
  }
  .janela {
    height: 100%; min-height: 0; max-width: 1600px; margin: 0 auto;
    background: hsl(var(--bg)); border: 2px solid #000; border-radius: 1.5rem;
    box-shadow: 6px 9px 0 var(--janela-sombra); overflow: clip;
  }
  .topo { padding: .7rem 1.25rem; }
  .grade {
    padding: 0 1.25rem; gap: 1rem;
    grid-template-columns: 17.5rem minmax(0, 1fr) 18.5rem;
    grid-template-areas: "numeros resultado tipos";
  }
  .grade > .card { min-height: 0; overflow: auto; }
  .rodape { padding: .55rem 1rem .65rem; }
}
@media (min-width: 1024px) and (max-height: 760px) {
  .topo { padding: .45rem 1.25rem; }
  .recomendacao { padding: .7rem 1rem !important; }
  .rec-titulo { font-size: 1.5rem !important; }
  .rec-ilustracao { width: 5rem !important; height: 5rem !important; }
  .kpi { padding: .55rem .75rem !important; }
  .tipo { padding: .5rem .7rem !important; }
  .campos { gap: .55rem .6rem !important; }
}
@media (min-width: 1440px) { .grade { grid-template-columns: 19rem minmax(0, 1fr) 20rem; } }

/* ---------- cards ---------- */
.card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--borda)); border-radius: var(--raio);
  padding: 1rem; display: flex; flex-direction: column; gap: .8rem;
}
.card-titulo { font-family: var(--fonte-titulo); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.rotulo { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 500; color: hsl(var(--muted-fg)); }
.nota { font-size: .78rem; color: hsl(var(--muted-fg)); }
.nota b { color: hsl(var(--fg)); }
.nota.alerta { color: hsl(var(--perigo)); }
.aviso { font-size: .78rem; padding: .5rem .65rem; border-radius: calc(var(--raio) - 2px); background: hsl(var(--lime) / .35); }

/* ---------- campos ---------- */
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem .65rem; }
.campo { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.campo label { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 500; color: hsl(var(--muted-fg)); }
.entrada { display: flex; align-items: center; height: 2.35rem; border: 1px solid hsl(var(--borda)); border-radius: calc(var(--raio) - 2px); background: hsl(var(--bg)); overflow: hidden; }
.entrada:focus-within { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .18); }
.entrada > span { padding: 0 0 0 .6rem; font-family: var(--fonte-mono); font-size: .75rem; color: hsl(var(--muted-fg)); }
.entrada > span.depois { padding: 0 .6rem 0 0; }
.entrada input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; padding: 0 .6rem; font-family: var(--fonte-mono); font-size: .875rem; }
.entrada:has(input[aria-invalid="true"]) { border-color: hsl(var(--perigo)); }
.premissas summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: hsl(var(--muted-fg)); list-style: none; display: flex; align-items: center; gap: .35rem; }
.premissas summary::before { content: "+"; display: inline-grid; place-items: center; width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid hsl(var(--borda)); font-size: .8rem; }
.premissas[open] summary::before { content: "–"; }
.premissas summary::-webkit-details-marker { display: none; }
.premissas .campos { margin-top: .65rem; grid-template-columns: 1fr 1fr 1fr; }

/* ---------- recomendação + kpis ---------- */
.recomendacao {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: var(--raio);
  background: hsl(var(--lime)); color: hsl(var(--lime-fg)); border: 1px solid #000; border-bottom-width: 3px;
}
.recomendacao .rotulo { color: hsl(var(--lime-fg) / .7); }
.recomendacao.sem-tipo { background: hsl(var(--muted)); color: hsl(var(--fg)); border-color: hsl(var(--borda)); }
.recomendacao.sem-tipo .rotulo { color: hsl(var(--muted-fg)); }
.rec-titulo { font-family: var(--fonte-titulo); font-size: 1.85rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.rec-motivo { font-size: .9rem; margin-top: .3rem; max-width: 46rem; }
.rec-ilustracao { width: 6.5rem; height: auto; flex: none; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.kpi { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .9rem; border: 1px solid hsl(var(--borda)); border-radius: var(--raio); background: hsl(var(--card)); min-width: 0; }
.kpi b { font-family: var(--fonte-titulo); font-size: 1.35rem; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { font-size: .75rem; color: hsl(var(--muted-fg)); }
.kpi:first-child { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-fg)); }
.kpi:first-child .rotulo, .kpi:first-child small { color: hsl(var(--primary-fg) / .8); }
.kpi:first-child .info { color: hsl(var(--primary-fg)); border-color: hsl(var(--primary-fg) / .7); }

/* ---------- gráfico ---------- */
.card-grafico { flex: 1; min-height: 16rem; gap: .5rem; }
@media (min-width: 1024px) { .card-grafico { min-height: 0; } }
.grafico-topo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.legenda { display: flex; gap: 1rem; margin: 0; padding: 0; list-style: none; font-size: .75rem; color: hsl(var(--muted-fg)); }
.legenda li { display: inline-flex; align-items: center; gap: .4rem; }
.legenda i { display: inline-block; width: 1.1rem; height: 0; border-top: 2px solid; }
.l-continuando { border-top-style: dashed !important; color: var(--c-continuando); }
.l-coast { color: var(--c-coast); }
.l-meta { border-top-style: dotted !important; color: var(--c-fire); }
.grafico { position: relative; flex: 1; min-height: 14rem; }
@media (min-width: 1024px) { .grafico { min-height: 0; } }
.grafico canvas { position: absolute; inset: 0; }

/* ---------- tipos ---------- */
.tipos { display: flex; flex-direction: column; gap: .5rem; }
.tipo {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .15rem .5rem;
  width: 100%; text-align: left; cursor: pointer; padding: .65rem .8rem;
  border: 1px solid hsl(var(--borda)); border-radius: var(--raio); background: hsl(var(--card));
  transition: border-color .15s, background .15s;
}
.tipo:hover { border-color: var(--contorno); }
.tipo[aria-checked="true"] { border-color: hsl(var(--primary)); box-shadow: inset 0 0 0 1px hsl(var(--primary)); background: hsl(var(--primary) / .05); }
.tipo-nome { white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; font-family: var(--fonte-titulo); font-weight: 600; font-size: .98rem; }
.tipo-meta { font-family: var(--fonte-mono); font-size: .78rem; text-align: right; }
.tipo-quando { grid-column: 1 / -1; font-size: .76rem; color: hsl(var(--muted-fg)); }
.tipo-quando b { color: hsl(var(--fg)); font-weight: 600; }
.selo { white-space: nowrap; margin-left: .25rem; vertical-align: 1px; font-family: var(--fonte); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 999px; background: hsl(var(--lime)); color: hsl(var(--lime-fg)); border: 1px solid #000; }

/* ---------- menu do perfil ---------- */
.menu-perfil { position: relative; }
.perfil-botao { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .25rem .25rem; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; text-align: left; }
.perfil-botao:hover, .perfil-botao[aria-expanded="true"] { border-color: hsl(var(--borda)); background: hsl(var(--muted)); }
.perfil-texto { display: flex; flex-direction: column; line-height: 1.2; }
.perfil-texto b { font-size: .9rem; }
.perfil-texto small { font-size: .75rem; color: hsl(var(--muted-fg)); }
.avatar {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 999px; overflow: hidden; display: grid; place-items: center;
  background: hsl(var(--lime)); color: hsl(var(--lime-fg)); border: 1.5px solid #000;
  font-family: var(--fonte-titulo); font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 100; min-width: 14rem;
  display: flex; flex-direction: column; padding: .35rem; gap: .1rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--borda)); border-radius: var(--raio); box-shadow: 0 10px 30px rgb(0 0 0 / .14);
}
.menu button { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; padding: .5rem .6rem; border: 0; background: none; border-radius: 6px; font-size: .85rem; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: hsl(var(--muted)); outline: none; }
.menu button[aria-current="true"] { font-weight: 700; }
.menu .avatar { width: 1.6rem; height: 1.6rem; font-size: .75rem; border-width: 1px; }
.menu .perigo { color: hsl(var(--perigo)); }
#menu-perfis:not(:empty) { border-bottom: 1px solid hsl(var(--borda)); padding-bottom: .3rem; margin-bottom: .3rem; }

/* ---------- perguntas em tela cheia ---------- */
.perguntas { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; background: hsl(var(--bg)); overflow: auto; }
.perg-barra { position: absolute; inset: 0 0 auto 0; height: 4px; background: hsl(var(--muted)); }
.perg-barra i { display: block; height: 100%; width: 0; background: hsl(var(--primary)); transition: width .35s ease; }
.perg-topo { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; }
.perg-corpo { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 44rem; margin: 0 auto; padding: 1rem 1.5rem 2rem; gap: 2rem; position: relative; z-index: 1; }
.perg-passo { display: flex; flex-direction: column; gap: 1rem; animation: entra .3s ease; }
.perg-num { font-size: .9rem; font-weight: 700; color: hsl(var(--primary)); }
.perg-titulo { font-family: var(--fonte-titulo); font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 600; line-height: 1.12; letter-spacing: -.025em; }
.perg-titulo em { font-style: normal; color: hsl(var(--primary)); }
.perg-dica { font-size: 1rem; color: hsl(var(--muted-fg)); max-width: 36rem; }
.perg-entrada { display: flex; align-items: baseline; gap: .6rem; border-bottom: 2px solid hsl(var(--fg) / .25); max-width: 32rem; transition: border-color .15s; }
.perg-entrada:focus-within { border-color: hsl(var(--primary)); }
.perg-entrada span { font-family: var(--fonte-titulo); font-size: clamp(1.4rem, 3vw, 2rem); color: hsl(var(--muted-fg)); }
.perg-entrada input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: .35rem 0; font-family: var(--fonte-titulo); font-size: clamp(1.5rem, 3.2vw, 2.25rem); }
.perg-entrada input::placeholder { color: hsl(var(--muted-fg) / .45); }
.perg-retorno { min-height: 1.5em; font-size: 1rem; color: hsl(var(--fg) / .8); }
.perg-retorno.erro { color: hsl(var(--perigo)); }
.perg-acoes { display: flex; align-items: center; gap: 1rem; }
.perg-enter { font-size: .8rem; color: hsl(var(--muted-fg)); }
kbd { font-family: var(--fonte); font-weight: 600; }
.perg-rodape { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem 1.25rem; font-size: .8rem; color: hsl(var(--muted-fg)); }
.cena { position: fixed; right: 4vw; bottom: 8vh; width: min(30vw, 24rem); aspect-ratio: 1; pointer-events: none; }
.cena img { position: absolute; height: auto; animation: flutua 7s ease-in-out infinite; transition: opacity .3s; }
.cena-a { width: 62%; right: 6%; bottom: 4%; }
.cena-b { width: 38%; left: 0; top: 8%; animation-delay: -2.5s !important; }
.cena-c { width: 18%; right: 0; top: 0; animation-delay: -4.5s !important; }
@media (max-width: 1100px) { .cena { display: none; } }
.opcoes { display: flex; flex-direction: column; gap: .55rem; max-width: 32rem; }
.opcao {
  display: flex; align-items: center; gap: .8rem; text-align: left; cursor: pointer;
  padding: .75rem .9rem; border: 1px solid hsl(var(--borda)); border-radius: var(--raio); background: hsl(var(--card)); font-size: 1rem;
}
.opcao:hover { border-color: var(--contorno); }
.opcao[aria-checked="true"] { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .08); box-shadow: inset 0 0 0 1px hsl(var(--primary)); }
.opcao kbd { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 1px solid hsl(var(--borda)); border-radius: 5px; font-size: .78rem; flex: none; }
.opcao[aria-checked="true"] kbd { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); border-color: hsl(var(--primary)); }

@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .perg-passo, .cena img { animation: none; } .perg-barra i { transition: none; } }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 300; background: #000; color: hsl(var(--lime)); padding: .6rem 1rem; border-radius: var(--raio); font-size: .875rem; font-weight: 600; }

/* ---------- celular ---------- */
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr; }
  .rec-ilustracao { display: none; }
  .legenda { gap: .6rem; }
  .premissas .campos { grid-template-columns: 1fr 1fr; }
}
.campo .cab { display: flex; align-items: center; gap: .3rem; }

/* avatares */
.avatares { display: flex; flex-wrap: wrap; gap: .9rem; }
.avatar-opcao { width: 5rem; height: 5rem; padding: 0; border-radius: 999px; border: 2px solid transparent; background: none; cursor: pointer; transition: transform .15s; }
.avatar-opcao img { width: 100%; height: 100%; border-radius: 999px; border: 1.5px solid #000; }
.avatar-opcao:hover { transform: translateY(-3px); }
.avatar-opcao[aria-checked="true"] { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--bg)), 0 0 0 6px hsl(var(--primary)); }
.avatar-opcao:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--bg)), 0 0 0 6px hsl(var(--primary) / .6); }
.avatar { background: hsl(var(--lime)); }
.avatar:has(img) { border: 0; background: none; }

/* calendário de anos */
.anos { max-width: 26rem; display: flex; flex-direction: column; gap: .75rem; }
.anos-topo { display: flex; align-items: center; justify-content: space-between; }
.anos-topo b { font-family: var(--fonte-titulo); font-size: 1.25rem; font-weight: 600; }
.anos-nav { width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid hsl(var(--borda)); background: hsl(var(--card)); cursor: pointer; font-size: 1.1rem; }
.anos-nav:hover { border-color: var(--contorno); }
.anos-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.ano { height: 3rem; border-radius: var(--raio); border: 1px solid hsl(var(--borda)); background: hsl(var(--card)); cursor: pointer; font-family: var(--fonte-titulo); font-size: 1.1rem; }
.ano:hover:not(:disabled) { border-color: var(--contorno); }
.ano.fora { color: hsl(var(--muted-fg)); border-style: dashed; }
.ano:disabled { opacity: .3; cursor: not-allowed; }
.ano[aria-pressed="true"] { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); border-color: hsl(var(--primary)); }
.ano:focus-visible, .anos-nav:focus-visible { outline: none; box-shadow: 0 0 0 2px hsl(var(--bg)), 0 0 0 4px hsl(var(--primary)); }

/* barra de idade */
.barra-idade { max-width: 32rem; display: flex; flex-direction: column; gap: 1rem; }
.barra-valor { font-family: var(--fonte-titulo); font-size: clamp(3rem, 7vw, 4.5rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.barra-valor small { font-size: .35em; font-weight: 500; color: hsl(var(--muted-fg)); margin-left: .3rem; letter-spacing: 0; }
.barra-idade input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 2.5rem; background: none; cursor: pointer; --pct: 50%;
}
.barra-idade input[type="range"]::-webkit-slider-runnable-track {
  height: .6rem; border-radius: 999px; border: 1.5px solid #000;
  background: linear-gradient(90deg, hsl(var(--lime)) var(--pct), hsl(var(--muted)) var(--pct));
}
.barra-idade input[type="range"]::-moz-range-track { height: .6rem; border-radius: 999px; border: 1.5px solid #000; background: hsl(var(--muted)); }
.barra-idade input[type="range"]::-moz-range-progress { height: .6rem; border-radius: 999px; background: hsl(var(--lime)); }
.barra-idade input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.9rem; height: 1.9rem; margin-top: -.72rem; border-radius: 999px;
  background: hsl(var(--primary)); border: 2px solid #000; box-shadow: 0 3px 0 #000;
}
.barra-idade input[type="range"]::-moz-range-thumb { width: 1.9rem; height: 1.9rem; border-radius: 999px; background: hsl(var(--primary)); border: 2px solid #000; box-shadow: 0 3px 0 #000; }
.barra-idade input[type="range"]:focus-visible { outline: none; }
.barra-idade input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px hsl(var(--primary) / .35), 0 3px 0 #000; }
.barra-marcas { display: flex; justify-content: space-between; font-size: .8rem; color: hsl(var(--muted-fg)); }
.som { align-self: flex-start; }

/* ===================== legibilidade ===================== */
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
@media (prefers-color-scheme: dark) { :root { --muted-fg: 220 14% 70%; } }
.card-titulo { font-size: 1.05rem; }
.campo label, .rotulo { font-size: .8rem; }
.entrada { height: 2.5rem; }
.entrada input { font-size: .95rem; font-variant-numeric: tabular-nums; }
.entrada > span { font-size: .78rem; }
.nota { font-size: .85rem; line-height: 1.45; }
.rec-motivo { font-size: .98rem; line-height: 1.45; }
.kpi small, .tipo-quando { font-size: .8rem; }
.kpi b { font-variant-numeric: tabular-nums; }
.tipo-meta { font-size: .82rem; font-variant-numeric: tabular-nums; }

/* premissas em linhas: rótulo à esquerda, campo curto à direita */
.premissas .campos.linhas { grid-template-columns: 1fr; gap: .5rem; }
.campos.linhas .campo { flex-direction: row; align-items: center; justify-content: space-between; gap: .75rem; }
.campos.linhas .entrada { width: 6.5rem; flex: none; }
.premissas summary::before { content: ""; width: .5rem; height: .5rem; border: solid currentColor; border-width: 0 2px 2px 0; border-radius: 0; transform: rotate(-45deg); transition: transform .2s; margin: 0 .2rem 0 .1rem; }
.premissas[open] summary::before { content: ""; transform: rotate(45deg); }
.premissas summary { font-size: .85rem; padding: .2rem 0; }

/* ===================== topo: olhinho ===================== */
.topo-acoes { display: flex; align-items: center; gap: .35rem; }
.olho { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 999px; border: 1px solid transparent; background: none; color: hsl(var(--muted-fg)); cursor: pointer; transition: background .15s, color .15s; }
.olho:hover { background: hsl(var(--muted)); color: hsl(var(--fg)); }
.olho[aria-pressed="true"] { color: hsl(var(--primary)); }
.olho:focus-visible { outline: none; box-shadow: 0 0 0 2px hsl(var(--bg)), 0 0 0 4px hsl(var(--primary)); }
.olho svg { width: 1.25rem; height: 1.25rem; }
/* o olho só esconde a coluna "Seus números" */
.area-numeros :is(.entrada input, #nota-poupanca, .plano-mes .valor, .plano-mes .detalhe, .progresso b, .progresso small, .progresso-barra) { transition: filter .25s; }
html.privado .area-numeros :is(.entrada input, #nota-poupanca, .plano-mes .valor, .plano-mes .detalhe, .progresso b, .progresso small, .progresso-barra) { filter: blur(7px); }
html.privado .area-numeros .entrada:focus-within input { filter: none; }

/* ===================== plano do mês ===================== */
.plano-mes { border: 1px solid hsl(var(--borda)); border-left: 4px solid hsl(var(--primary)); border-radius: var(--raio); padding: .75rem .85rem; display: flex; flex-direction: column; gap: .2rem; background: hsl(var(--primary) / .04); }
.plano-mes:empty { display: none; }
.plano-mes .titulo { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: hsl(var(--muted-fg)); }
.plano-mes .titulo svg { width: 1rem; height: 1rem; color: hsl(var(--primary)); }
.plano-mes .valor { font-family: var(--fonte-titulo); font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plano-mes .valor small { font-size: .6em; font-weight: 500; color: hsl(var(--muted-fg)); }
.plano-mes .detalhe { font-size: .84rem; line-height: 1.45; }
.plano-mes .falta { color: hsl(var(--perigo)); font-weight: 600; }
.plano-mes .folga { color: #0e9f7e; font-weight: 600; }
@media (prefers-color-scheme: dark) { .plano-mes .folga { color: var(--c-coast); } }

/* ===================== símbolos dos tipos ===================== */
.tipo { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: .7rem; }
.tipo-icone { grid-row: 1 / 3; width: 2.25rem; height: 2.25rem; border-radius: .6rem; display: grid; place-items: center; border: 1.5px solid #000; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.tipo-icone svg { width: 1.2rem; height: 1.2rem; }
.t-tradicional { background: #ffb36b; color: #111; }
.t-lean { background: #b8f0d8; color: #111; }
.t-fat { background: hsl(var(--lime)); color: #111; }
.t-coast { background: #a9d6ff; color: #111; }
.t-barista { background: #e8c9a8; color: #111; }
.tipo[aria-checked="true"] .tipo-icone { transform: scale(1.08) rotate(-4deg); }
.tipo-quando { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .7rem; }
.mini { display: inline-flex; align-items: center; gap: .25rem; }
.mini svg { width: .85rem; height: .85rem; opacity: .75; }
.rec-titulo { display: flex; align-items: center; gap: .55rem; }
.rec-titulo .tipo-icone { width: 2.4rem; height: 2.4rem; grid-row: auto; }

/* ===================== animações ===================== */
:root { --suave: cubic-bezier(.22, 1, .36, 1); }
@keyframes surge { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes some { to { opacity: 0; transform: translateY(-10px); } }
@keyframes pulso { 0% { transform: scale(1); } 40% { transform: scale(1.012); } 100% { transform: scale(1); } }
@keyframes abre { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes aparece { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sobe { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.entrando :is(.area-numeros, .recomendacao, .kpi, .card-grafico, .area-tipos) { animation: surge .6s var(--suave) both; }
.entrando .recomendacao { animation-delay: .05s; }
.entrando .kpi:nth-child(1) { animation-delay: .1s; }
.entrando .kpi:nth-child(2) { animation-delay: .15s; }
.entrando .kpi:nth-child(3) { animation-delay: .2s; }
.entrando .card-grafico { animation-delay: .25s; }
.entrando .area-tipos { animation-delay: .3s; }
.entrando .tipo { animation: surge .5s var(--suave) both; }
.entrando .tipo:nth-child(1) { animation-delay: .35s; } .entrando .tipo:nth-child(2) { animation-delay: .4s; }
.entrando .tipo:nth-child(3) { animation-delay: .45s; } .entrando .tipo:nth-child(4) { animation-delay: .5s; }
.entrando .tipo:nth-child(5) { animation-delay: .55s; }
.recomendacao.mudou { animation: pulso .5s var(--suave); }
.troca { animation: aparece .35s var(--suave); }
.menu:not([hidden]) { animation: abre .18s var(--suave); transform-origin: top right; }
.dica:not([hidden]) { animation: aparece .15s ease-out; }
.toast:not([hidden]) { animation: sobe .3s var(--suave); }
.tipo { transition: border-color .2s, background .2s, transform .2s var(--suave), box-shadow .2s; }
.tipo:hover { transform: translateY(-1px); }
.kpi, .recomendacao { transition: background .3s, border-color .3s; }
.perg-passo { animation: surge .45s var(--suave); }
.perg-passo.saindo { animation: some .16s ease-in forwards; }
.perg-barra i { transition: width .5s var(--suave); }
.opcao, .ano, .avatar-opcao { transition: border-color .15s, background .15s, transform .2s var(--suave), box-shadow .15s; }
.opcao:hover, .ano:hover:not(:disabled) { transform: translateY(-1px); }
.cena img { transition: opacity .35s, transform .35s; }
.cena.trocando img { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* tipo: nome ocupa a 1ª linha inteira; quando + valor na 2ª */
.tipos .tipo { grid-template-areas: none; grid-template-columns: auto minmax(0, 1fr) auto; row-gap: .2rem; }
.tipos .tipo > .tipo-icone { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.tipos .tipo > .tipo-nome { grid-column: 2 / 4; grid-row: 1; justify-self: start; min-width: 0; white-space: normal; }
.tipos .tipo > .tipo-quando { grid-column: 2; grid-row: 2; }
.tipos .tipo > .tipo-meta { grid-column: 3; grid-row: 2; align-self: end; }

/* ===================== tela preenchida: colunas laterais esticam ===================== */
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: -.3rem -.4rem -.3rem 0; }
.card-cab .olho { width: 2.1rem; height: 2.1rem; }

/* esquerda: o card do mês cresce e leva o progresso para baixo */
.plano-mes { flex: 1 0 auto; gap: .3rem; }
.progresso { margin-top: auto; padding-top: .8rem; display: flex; flex-direction: column; gap: .4rem; }
.progresso-topo { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; color: hsl(var(--muted-fg)); }
.progresso-topo b { font-family: var(--fonte-titulo); font-size: 1.05rem; color: hsl(var(--fg)); font-variant-numeric: tabular-nums; }
.progresso-barra { height: .6rem; border-radius: 999px; border: 1.5px solid #000; background: hsl(var(--muted)); overflow: hidden; }
.progresso-barra i { display: block; height: 100%; background: hsl(var(--lime)); transform-origin: left; transform: scaleX(0); transition: transform .8s var(--suave); }
.progresso small { font-size: .78rem; color: hsl(var(--muted-fg)); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .progresso-barra { border-color: hsl(var(--borda)); } }

/* direita: os 5 tipos dividem a altura toda */
.area-tipos .tipos { flex: 1 0 auto; }
.tipos .tipo { flex: 1 0 auto; align-content: center; row-gap: .25rem; }
.tipos .tipo > .tipo-icone { grid-row: 1 / 4; }
.tipos .tipo > .tipo-desc { grid-column: 2 / 4; grid-row: 2; font-size: .8rem; color: hsl(var(--muted-fg)); line-height: 1.35; }
.tipos .tipo > .tipo-quando { grid-row: 3; }
.tipos .tipo > .tipo-meta { grid-row: 3; }
@media (min-width: 1024px) and (max-height: 820px) {
  .tipos .tipo > .tipo-desc { display: none; }
  .progresso small { display: none; }
  .progresso { padding-top: .5rem; }
}

/* cabeçalho na cor do tipo escolhido */
.recomendacao { transition: background .35s var(--suave), border-color .35s; }
.recomendacao.rec-tradicional { background: #ffb36b; }
.recomendacao.rec-lean { background: #b8f0d8; }
.recomendacao.rec-fat { background: hsl(var(--lime)); }
.recomendacao.rec-coast { background: #a9d6ff; }
.recomendacao.rec-barista { background: #e8c9a8; }
.recomendacao:not(.sem-tipo) { color: #111; }
.recomendacao:not(.sem-tipo) .rotulo { color: rgb(17 17 17 / .7); }
.rec-titulo .tipo-icone { background: transparent; }
.voltar-rec { color: #111; font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.voltar-rec:hover { color: #000; }
.rec-ilustracao { width: 6.5rem; height: 6.5rem; object-fit: contain; }
.recomendacao.mudou .rec-ilustracao { animation: surge .5s var(--suave); }
@media (min-width: 1024px) and (max-height: 760px) {
  .area-numeros { gap: .55rem; }
  .entrada { height: 2.2rem; }
  .plano-mes { padding: .55rem .75rem; gap: .1rem; }
  .plano-mes .valor { font-size: 1.25rem; }
  .progresso { padding-top: .35rem; gap: .25rem; }
}
