/* Finanças: prévia. Celular primeiro (régua de 360 px), alvo de toque de 48 px. */

:root {
  --fundo: #F4F3EF;
  --superficie: #FFFFFF;
  --superficie-2: #ECEAE3;
  --superficie-3: #E2DFD6;
  --texto: #1C1D1A;
  --texto-2: #5C5F57;
  --linha: #E4E1D9;
  --linha-forte: #CFCBC0;
  --bom: #157A3C;
  --bom-suave: #E3F2E8;
  --ruim: #B8261C;
  --ruim-suave: #FBE8E5;
  --atencao: #8A5300;
  --atencao-suave: #FBEFD9;
  --barra-gasto: #8D9088;
  --sombra: 0 1px 2px rgba(28, 29, 26, .06), 0 2px 8px rgba(28, 29, 26, .04);
  --sombra-forte: 0 8px 24px rgba(28, 29, 26, .18);
  --seg-ativo: #FFFFFF;
  --marca: #1F8A4C;
  --marca-texto: #1F8A4C;
  --sobre-marca: #FFFFFF;
  --marca-suave: #E4F1E9;
  --marca-borda: #A9D3B9;
  --raio: 20px;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, sans-serif;
  color-scheme: light;
}

:root[data-tema="escuro"] {
  --fundo: #111312;
  --superficie: #1B1E1C;
  --superficie-2: #262A27;
  --superficie-3: #313632;
  --texto: #F0F1EC;
  --texto-2: #A8ACA3;
  --linha: #2B2F2C;
  --linha-forte: #434943;
  --bom: #5BD68A;
  --bom-suave: #17301F;
  --ruim: #FF8A7E;
  --ruim-suave: #3A1D1A;
  --atencao: #F2B65A;
  --atencao-suave: #382B15;
  --barra-gasto: #7E837B;
  --sombra: none;
  --sombra-forte: 0 8px 24px rgba(0, 0, 0, .5);
  --seg-ativo: #3A403B;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
body.com-folha { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--marca-texto); outline-offset: 2px; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.ic { width: 24px; height: 24px; flex: none; }
.txt-bom { color: var(--bom); }
.txt-ruim { color: var(--ruim); }
.centro { text-align: center; }
.mini { font-size: 13px; color: var(--texto-2); }

/* ---------- botões ---------- */
.btn-icone {
  width: 48px; height: 48px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 14px; background: transparent; color: var(--texto);
}
.btn-icone:active { background: var(--superficie-2); }
.btn-icone:disabled { opacity: .3; }
.btn-icone.perigo { color: var(--ruim); }
.btn-primario {
  min-height: 52px; padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px;
  background: var(--marca); color: var(--sobre-marca);
  font-size: 17px; font-weight: 700;
  transition: transform .12s ease-out, opacity .15s;
}
.btn-primario:active { transform: scale(.97); }
.btn-primario:disabled { opacity: .45; transform: none; }
.btn-primario.perigo { background: var(--ruim); color: #FFFFFF; }
:root[data-tema="escuro"] .btn-primario.perigo { color: #1B0D0B; }
.btn-primario.largo { width: 100%; }
.btn-sec {
  min-height: 48px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--linha-forte); border-radius: 14px;
  background: var(--superficie); font-weight: 600;
}
.btn-link {
  min-height: 48px; padding: 0 12px;
  border: 0; background: none;
  color: var(--marca-texto); font-weight: 700; font-size: 16px;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}

/* ---------- campos ---------- */
.campo {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1.5px solid var(--linha-forte); border-radius: 14px;
  background: var(--superficie); color: var(--texto);
  font-size: 17px;
}
.campo::placeholder, .campo-grande::placeholder { color: var(--texto-2); opacity: .8; }
.campo:focus, .campo-grande:focus { outline: none; border-color: var(--marca-texto); box-shadow: 0 0 0 3px var(--marca-suave); }
textarea.campo { resize: none; line-height: 1.35; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.campo-rotulo { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 700; color: var(--texto); }
.campo-rotulo small { font-weight: 400; color: var(--texto-2); }
.ajuda { margin-top: 10px; font-size: 14px; color: var(--texto-2); }

/* ---------- entrada ---------- */
.entrada {
  height: 100dvh; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
}
.entrada-topo { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0; }
.pontos { display: flex; gap: 8px; }
.pontos span { width: 8px; height: 8px; border-radius: 4px; background: var(--linha-forte); transition: width .25s ease-out, background-color .25s; }
.pontos span.feito { background: var(--marca-borda); }
.pontos span.ativo { width: 26px; background: var(--marca); }
.trilho-janela { flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.trilho {
  display: flex; height: 100%;
  transform: translateX(calc(var(--passo) * -100%));
  transition: transform .34s cubic-bezier(.22, .8, .24, 1);
}
.trilho.arrastando { transition: none; }
.passo { flex: 0 0 100%; height: 100%; overflow-y: auto; display: flex; flex-direction: column; padding: 0 24px; }
.passo-meio { margin: auto 0; padding: 16px 0; }
.passo-meio.centro { text-align: center; }
.pergunta { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; margin-bottom: 22px; text-wrap: balance; }
.campo-grande {
  width: 100%; min-height: 64px; padding: 14px 18px;
  border: 2px solid var(--linha-forte); border-radius: 18px;
  background: var(--superficie); color: var(--texto);
  font-size: 22px; font-weight: 600;
}
.exemplo-entrada { align-self: center; margin-bottom: 8px; flex: none; }
.entrada-rodape { flex: none; display: flex; justify-content: center; padding: 12px 24px calc(20px + env(safe-area-inset-bottom)); }
.btn-proximo {
  min-width: 220px; min-height: 58px; padding: 0 30px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 29px;
  background: var(--marca); color: var(--sobre-marca);
  font-size: 18px; font-weight: 700;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--marca) 35%, transparent);
  transition: transform .12s ease-out, opacity .2s, background-color .25s;
}
.btn-proximo:active { transform: scale(.97); }
.btn-proximo:disabled { opacity: .35; box-shadow: none; }
.btn-proximo .ic { transition: transform .2s; }
.btn-proximo:not(:disabled):hover .ic { transform: translateX(3px); }

.ramos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ramo {
  min-height: 72px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
  border: 2px solid var(--linha); border-radius: 16px;
  background: var(--superficie); text-align: left;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  transition: border-color .15s, background-color .15s;
}
.ramo .ic { color: var(--texto-2); }
.ramo[aria-pressed="true"] { border-color: var(--marca-texto); background: var(--marca-suave); }
.ramo[aria-pressed="true"] .ic { color: var(--marca-texto); }
.ramos + .campo { margin-top: 12px; }

.cores { display: grid; grid-template-columns: repeat(5, 52px); gap: 10px; justify-content: space-between; }
.amostra {
  position: relative; width: 52px; height: 52px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--a);
  color: var(--a-txt, #FFFFFF);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.amostra .ic { opacity: 0; width: 26px; height: 26px; stroke-width: 3; }
.amostra[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--fundo), 0 0 0 6px var(--texto); }
.amostra[aria-pressed="true"] .ic { opacity: 1; }
.amostra.outra {
  cursor: pointer;
  background: var(--a, conic-gradient(from 0deg, #E53935, #F9A825, #43A047, #1E88E5, #8E24AA, #E53935));
}
.amostra.outra input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.outra-txt {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--texto-2); font-weight: 600;
}
.amostra.outra[aria-pressed="true"] .outra-txt { display: none; }
.cores { margin-bottom: 26px; }

.previas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.previa { margin: 0; min-width: 0; }
.previa figcaption { margin-top: 6px; font-size: 13px; color: var(--texto-2); text-align: center; }
.mini-tela {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 16px;
  background: var(--p-fundo); color: var(--p-texto);
  border: 1px solid color-mix(in srgb, var(--p-texto) 14%, transparent);
  font-size: 12px;
}
.mini-topo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mini-av { width: 20px; height: 20px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--p-marca); color: var(--p-sobre); font-weight: 800; font-size: 11px; }
.mini-nome { font-weight: 800; color: var(--p-marca-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.mini-cartao { background: var(--p-sup); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.mini-rot { font-size: 10px; opacity: .75; }
.mini-valor { font-size: 17px; font-weight: 800; color: var(--p-bom); }
.mini-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 10px;
  background: var(--p-marca); color: var(--p-sobre); font-weight: 700; font-size: 12px;
}
.mini-btn .ic { width: 14px; height: 14px; stroke-width: 3; }

.selo {
  width: 92px; height: 92px; margin: 0 auto 22px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--marca); color: var(--sobre-marca);
  animation: aparecer .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.selo .ic { width: 46px; height: 46px; stroke-width: 2.6; }
.sub { font-size: 17px; color: var(--texto-2); line-height: 1.5; text-wrap: balance; }
.sub strong { display: inline-block; font-size: 20px; margin-bottom: 6px; color: var(--marca-texto); }
@keyframes aparecer { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- casca ---------- */
.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--fundo) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.avatar {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--marca); color: var(--sobre-marca);
  font-weight: 800; font-size: 18px;
}
.topo-nome { min-width: 0; font-size: 19px; font-weight: 800; color: var(--marca-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.conteudo { padding: 2px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.titulo { font-size: 26px; font-weight: 800; letter-spacing: -.015em; padding: 6px 2px 2px; }

.abas {
  position: fixed; bottom: 0; left: 50%; z-index: 10;
  width: min(100%, 520px); transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr 80px 1fr 1fr; align-items: center;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  background: var(--superficie); border-top: 1px solid var(--linha);
}
.aba {
  min-height: 60px; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--texto-2);
  font-size: 12.5px; font-weight: 600;
}
.aba-ic { position: relative; width: 56px; height: 30px; display: grid; place-items: center; border-radius: 15px; transition: background-color .2s; }
.aba.ativa { color: var(--texto); font-weight: 800; }
.aba.ativa .aba-ic { background: var(--marca-suave); color: var(--marca-texto); }
.selo-num {
  position: absolute; top: -3px; right: 6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--ruim); color: var(--superficie);
  font-size: 11px; font-weight: 800; line-height: 1;
}
.aba-mais {
  justify-self: center; width: 62px; height: 62px; margin-top: -26px;
  display: grid; place-items: center;
  border: 4px solid var(--fundo); border-radius: 22px;
  background: var(--marca); color: var(--sobre-marca);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--marca) 40%, transparent);
  transition: transform .12s ease-out;
}
.aba-mais:active { transform: scale(.94); }
.aba-mais .ic { width: 30px; height: 30px; stroke-width: 2.6; }

/* ---------- cartões ---------- */
.cartao {
  background: var(--superficie); border-radius: var(--raio);
  padding: 16px; box-shadow: var(--sombra); border: 1px solid var(--linha);
}
.cartao h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.cartao-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rotulo { font-size: 14px; color: var(--texto-2); font-weight: 600; }

.mes-troca { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px; }
.mes-troca h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

.heroi { padding: 18px 18px 16px; }
.heroi .rotulo { font-size: 15px; }
.valor-heroi { font-size: 42px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; margin: 4px 0 6px; overflow-wrap: anywhere; }
.valor-heroi .centavos { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.heroi.bom .valor-heroi { color: var(--bom); }
.heroi.ruim .valor-heroi { color: var(--ruim); }
.frase { font-size: 16px; color: var(--texto); }
.pilula {
  margin-top: 12px; padding: 8px 14px 8px 10px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 14px; background: var(--superficie-2);
  font-size: 15px; line-height: 1.3;
}
.pilula b { display: block; font-weight: 700; font-size: 14px; }
.pilula small { display: block; font-size: 13px; color: var(--texto-2); }
.pilula .ic { width: 22px; height: 22px; stroke-width: 2.6; }
.pilula.sobe { background: var(--bom-suave); }
.pilula.sobe .ic { color: var(--bom); }
.pilula.desce { background: var(--ruim-suave); }
.pilula.desce .ic { color: var(--ruim); }

.numeros { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 4px; }
.numeros > div { padding: 0 8px 0 10px; min-width: 0; }
.numeros > div + div { border-left: 1px solid var(--linha); }
.numeros .rotulo { font-size: 13px; }
.numeros .valor { font-size: clamp(15px, 4.5vw, 19px); font-weight: 800; letter-spacing: -.015em; white-space: nowrap; margin-top: 2px; }
.numeros .mini { font-size: 12px; margin-top: 2px; line-height: 1.25; }

.alerta {
  width: 100%; min-height: 56px; padding: 10px 10px 10px 14px;
  display: flex; align-items: center; gap: 10px;
  border: 0; border-radius: 16px; text-align: left;
  background: var(--atencao-suave); color: var(--texto);
  font-size: 15px; line-height: 1.3;
}
.alerta > .ic:first-child { color: var(--atencao); }
.alerta.vencido { background: var(--ruim-suave); }
.alerta.vencido > .ic:first-child { color: var(--ruim); }
.alerta-txt { flex: 1; min-width: 0; }
.alerta-txt b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerta-txt small { display: block; font-size: 14px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerta > .ic:last-child { color: var(--texto-2); width: 20px; }

/* gráfico */
.legenda { display: flex; gap: 14px; font-size: 13px; color: var(--texto-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.leg-venda, .leg-gasto { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.leg-venda { background: var(--marca); }
.leg-gasto { background: var(--barra-gasto); }
.grafico-caixa { margin: 10px -4px 0; min-height: 190px; }
.grafico { display: block; width: 100%; height: auto; touch-action: pan-y; overflow: visible; }
.g-grade { stroke: var(--linha); stroke-width: 1; }
.g-eixo { fill: var(--texto-2); font-size: 11px; font-family: var(--fonte); }
.g-venda { fill: var(--marca); }
.g-gasto { fill: var(--barra-gasto); }
.g-grupo { transition: opacity .15s; }
.grafico.com-realce .g-grupo { opacity: .35; }
.grafico.com-realce .g-grupo.ativo { opacity: 1; }
.g-alvo { fill: transparent; cursor: pointer; }
.grafico-info { margin-top: 6px; min-height: 42px; font-size: 14px; line-height: 1.45; }
.grafico-dica { font-size: 12px; color: var(--texto-2); }

/* barras horizontais */
.barras { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.barras li { padding: 6px 0; }
.barra-botao { width: 100%; padding: 6px 0; border: 0; background: none; text-align: left; border-radius: 10px; }
.barras li:has(.barra-botao) { padding: 0; }
.barra-linha { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.barra-linha span { min-width: 0; font-weight: 600; }
.barra-linha small { font-weight: 400; color: var(--texto-2); font-size: 13px; }
.barra-linha small.bloco { display: block; }
.barra-linha b { white-space: nowrap; font-weight: 700; }
.barra-trilho { margin-top: 6px; height: 8px; border-radius: 4px; background: var(--superficie-2); overflow: hidden; }
.barra-trilho i { display: block; height: 100%; border-radius: 4px; background: var(--barra-gasto); }
.pessoal { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--linha); display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--texto-2); }
.pessoal .ic { width: 20px; height: 20px; }
.pessoal b { color: var(--texto); }
.outros { margin-top: 8px; }

/* vazio */
.vazio { text-align: center; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vazio h2 { font-size: 20px; }
.vazio p { color: var(--texto-2); max-width: 30ch; }
.vazio .btn-primario { margin-top: 8px; }
.vazio-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--marca-suave); color: var(--marca-texto); }
.vazio-ic .ic { width: 32px; height: 32px; }
.mais-mini { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--marca); color: var(--sobre-marca); vertical-align: -6px; }
.mais-mini .ic { width: 16px; height: 16px; stroke-width: 3; }

/* ---------- extrato ---------- */
.busca {
  display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 14px;
  border-radius: 16px; background: var(--superficie); border: 1.5px solid var(--linha);
}
.busca:focus-within { border-color: var(--marca-texto); box-shadow: 0 0 0 3px var(--marca-suave); }
.busca .ic { color: var(--texto-2); }
.busca input { flex: 1; min-width: 0; min-height: 50px; border: 0; background: none; outline: none; font-size: 17px; }
.resumo-busca { background: var(--marca-suave); border-color: var(--marca-borda); }
.valor-medio { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; }
.dia { display: flex; flex-direction: column; gap: 6px; }
.dia-cab { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px 0; font-size: 14px; font-weight: 700; color: var(--texto-2); }
.dia-cab span:last-child { font-weight: 700; }
.lista { padding: 4px 0; }
.lanc {
  width: 100%; min-height: 64px; padding: 8px 14px;
  display: flex; align-items: center; gap: 12px;
  border: 0; background: none; text-align: left;
}
.lanc + .lanc { border-top: 1px solid var(--linha); }
.lanc:active { background: var(--superficie-2); }
.lanc-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--superficie-2); color: var(--texto-2); }
.lanc-ic .ic { width: 22px; height: 22px; }
.lanc-ic.eh-venda { background: var(--bom-suave); color: var(--bom); }
.lanc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lanc-titulo { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lanc-titulo.apagado { color: var(--texto-2); font-weight: 600; font-style: italic; }
.lanc-sub { font-size: 13px; color: var(--texto-2); }
.lanc-valor { font-weight: 700; white-space: nowrap; font-size: 16px; }

/* ---------- boletos ---------- */
.btn-novo-boleto {
  width: 100%; min-height: 76px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  border: 2px dashed var(--marca-borda); border-radius: var(--raio);
  background: var(--marca-suave); text-align: left;
}
.btn-novo-boleto b { display: block; font-size: 17px; color: var(--texto); }
.btn-novo-boleto small { display: block; font-size: 14px; color: var(--texto-2); }
.nb-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--marca); color: var(--sobre-marca); }
.grupo { display: flex; flex-direction: column; gap: 8px; }
.grupo-cab { display: flex; justify-content: space-between; padding: 8px 4px 0; font-size: 15px; font-weight: 800; }
.grupo-cab span:last-child { color: var(--texto-2); font-weight: 700; }
.boleto {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; background: var(--superficie); border: 1px solid var(--linha); box-shadow: var(--sombra);
}
.boleto-corpo {
  min-height: 76px; padding: 12px 14px 12px 12px;
  display: flex; align-items: center; gap: 12px;
  border: 0; background: none; text-align: left;
}
.boleto-corpo:active { background: var(--superficie-2); }
.data-bloco {
  width: 48px; height: 52px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--superficie-2); line-height: 1;
}
.data-bloco b { font-size: 20px; font-weight: 800; }
.data-bloco span { font-size: 12px; color: var(--texto-2); margin-top: 3px; }
.boleto-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.b-nome { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-linha2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.b-valor { font-weight: 800; white-space: nowrap; font-size: 17px; }
.b-status { font-size: 13px; color: var(--texto-2); font-weight: 600; white-space: nowrap; }
.boleto.vencido .b-status { color: var(--ruim); }
.boleto.vencido .data-bloco { background: var(--ruim-suave); color: var(--ruim); }
.boleto.perto .b-status { color: var(--atencao); }
.boleto.perto .data-bloco { background: var(--atencao-suave); }
.boleto.pago { box-shadow: none; background: transparent; }
.boleto.pago .b-valor, .boleto.pago .b-nome { color: var(--texto-2); }
.btn-pago {
  min-height: 48px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-top: 1px solid var(--linha); background: none;
  font-weight: 700; font-size: 15px;
}
.btn-pago:active { background: var(--superficie-2); }
.btn-pago .ic { width: 18px; height: 18px; stroke-width: 2.6; color: var(--bom); }

/* ---------- ajustes ---------- */
.ajustes h2 { margin-bottom: 4px; }
.ajustes .cores { margin-top: 4px; }
.ajustes .segmento { margin-top: 10px; }
.linha-ajuste {
  width: 100%; min-height: 60px; padding: 8px 4px;
  display: flex; align-items: center; gap: 12px;
  border: 0; border-top: 1px solid var(--linha); background: none; text-align: left;
}
.ajustes h2 + .linha-ajuste { border-top: 0; }
.ajustes .campo + .linha-ajuste { margin-top: 12px; }
.linha-ajuste > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.linha-ajuste small { color: var(--texto-2); font-size: 13px; }
.linha-ajuste b { font-weight: 700; }
.linha-ajuste > .ic { color: var(--texto-2); }
.linha-ajuste.perigo, .linha-ajuste.perigo > .ic { color: var(--ruim); }
.rodape-ajustes { text-align: center; font-size: 13px; color: var(--texto-2); padding: 8px 16px; }

/* ---------- segmentos ---------- */
.segmento {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; border-radius: 15px; background: var(--superficie-2);
}
.segmento button {
  min-height: 44px; padding: 0 6px;
  border: 0; border-radius: 11px; background: transparent;
  color: var(--texto-2); font-weight: 600; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
  transition: background-color .15s, color .15s;
}
.segmento button small { font-size: 12px; font-weight: 500; opacity: .85; }
.segmento button[aria-pressed="true"] { background: var(--seg-ativo); color: var(--texto); font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

/* ---------- folha ---------- */
.folha-fundo { position: fixed; inset: 0; z-index: 20; background: rgba(12, 14, 13, .5); opacity: 0; transition: opacity .22s; }
.folha-fundo.aberta { opacity: 1; }
.folha {
  position: fixed; left: 50%; bottom: 0; z-index: 21;
  width: min(100%, 520px); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  transform: translate(-50%, 100%);
  transition: transform .28s cubic-bezier(.22, .8, .24, 1);
  background: var(--superficie); border-radius: 26px 26px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  outline: none;
}
.folha.aberta { transform: translate(-50%, 0); }
.folha.cheia { height: 100dvh; max-height: 100dvh; border-radius: 0; display: flex; flex-direction: column; overflow: hidden; }
.folha-topo {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 4px;
  min-height: 60px; padding: 6px 8px; background: var(--superficie);
}
.folha-topo h2 { text-align: center; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folha-corpo { padding: 4px 16px 20px; display: flex; flex-direction: column; }
.folha-corpo > .btn-primario { margin-top: 18px; }
.folha-corpo > .segmento { margin-top: 2px; }

.escolha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 24px; }
.escolha-btn {
  min-height: 150px; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid transparent; border-radius: 22px;
  transition: transform .12s ease-out;
}
.escolha-btn:active { transform: scale(.97); }
.escolha-btn .ic { width: 40px; height: 40px; margin-bottom: 4px; }
.escolha-btn b { font-size: 22px; font-weight: 800; }
.escolha-btn span { font-size: 14px; color: var(--texto-2); }
.escolha-btn.venda { background: var(--bom-suave); }
.escolha-btn.venda .ic { color: var(--bom); }
.escolha-btn.gasto { background: var(--ruim-suave); }
.escolha-btn.gasto .ic { color: var(--ruim); }

/* lançar */
.chip-data {
  position: relative; min-height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 22px; background: var(--superficie-2);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.chip-data .ic { width: 20px; height: 20px; }
.chip-data input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.valor-tela {
  flex: none; display: flex; align-items: baseline; justify-content: center; gap: 8px;
  padding: 4px 16px 10px; font-weight: 800; letter-spacing: -.02em;
}
.valor-tela .rs { font-size: 24px; color: var(--texto-2); font-weight: 700; }
#l-valor { font-size: 48px; line-height: 1.1; }
.valor-tela.zerado #l-valor { color: var(--texto-2); opacity: .55; }
.lanc-folha.venda #l-valor { color: var(--bom); }
.lanc-folha.venda .valor-tela.zerado #l-valor { color: var(--texto-2); }
.lanc-detalhes { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.motivo-caixa { position: relative; }
.sugestoes { display: none; }
.digitando .sugestoes.com-itens {
  display: flex; flex-direction: column;
  margin-top: 6px; border-radius: 14px; overflow: hidden;
  border: 1.5px solid var(--linha); background: var(--superficie);
}
.sugestao {
  min-height: 50px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 0; background: none; text-align: left; font-size: 17px; font-weight: 600;
}
.sugestao + .sugestao { border-top: 1px solid var(--linha); }
.sugestao small { font-size: 13px; color: var(--texto-2); font-weight: 400; }
.sugestao:active { background: var(--superficie-2); }
.rapidos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.rapidos::-webkit-scrollbar { display: none; }
.rapido {
  flex: none; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--linha-forte); border-radius: 20px;
  background: transparent; font-weight: 600; font-size: 15px;
}
.rapido[aria-pressed="true"] { background: var(--marca-suave); border-color: var(--marca-texto); color: var(--texto); }
.dica-pessoal { font-size: 14px; color: var(--texto-2); padding: 4px 4px 0; }
.info-dia { flex: none; text-align: center; font-size: 15px; color: var(--texto-2); padding: 0 24px; }
.digitando .rapidos, .digitando .segmento, .digitando .dica-pessoal, .digitando .teclado { display: none; }
.teclado {
  flex: none; margin-top: auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px 16px 0;
}
.tecla {
  height: clamp(46px, 7dvh, 58px);
  display: grid; place-items: center;
  border: 0; border-radius: 16px; background: var(--superficie-2);
  font-size: 26px; font-weight: 600;
  transition: background-color .08s;
}
.tecla:active { background: var(--superficie-3); }
.folha-rodape { flex: none; display: flex; gap: 8px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.folha-rodape .btn-primario { min-height: 56px; flex: 1; }
.folha-rodape .btn-icone { width: 56px; height: 56px; border: 1.5px solid var(--linha-forte); border-radius: 16px; }
.digitando .folha-rodape { margin-top: auto; }

/* boleto novo */
.foto-escolha {
  position: relative; min-height: 72px; padding: 12px 14px;
  display: flex; align-items: center; gap: 14px;
  border: 2px dashed var(--marca-borda); border-radius: 18px;
  background: var(--marca-suave); cursor: pointer;
}
.foto-escolha input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.foto-escolha:focus-within { outline: 3px solid var(--marca-texto); outline-offset: 2px; }
.foto-escolha b { display: block; }
.foto-escolha small { display: block; color: var(--texto-2); font-size: 14px; }
.foto-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--marca); color: var(--sobre-marca); }
.b-foto { display: block; width: 100%; max-height: 220px; object-fit: contain; margin-top: 12px; border-radius: 14px; background: var(--superficie-2); }
.b-arquivo { margin-top: 12px; display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--superficie-2); font-weight: 600; overflow-wrap: anywhere; }
.b-msg { font-size: 14px; color: var(--texto-2); margin-top: 8px; }
.b-msg:empty { display: none; }
.b-leitura { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-top: 8px; color: var(--texto-2); }
.b-leitura:empty { display: none; }
.b-leitura .ic { width: 20px; height: 20px; }
.b-leitura.certo { color: var(--bom); font-weight: 600; }
.b-leitura.atencao { color: var(--atencao); font-weight: 600; }
.dupla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dupla label { min-width: 0; }
.dupla .campo { min-width: 0; }
.campo-rs { position: relative; display: block; }
.campo-rs > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-2); font-weight: 600; }
.campo-rs .campo { padding-left: 42px; }
.b-status-grande { text-align: center; font-weight: 700; color: var(--texto-2); margin-bottom: 4px; }
.b-status-grande.vencido { color: var(--ruim); }
.b-status-grande.perto { color: var(--atencao); }
.linha-copiar { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--superficie-2); }
.linha-copiar code { font-family: ui-monospace, "Roboto Mono", "DejaVu Sans Mono", monospace; font-size: 14px; overflow-wrap: anywhere; line-height: 1.5; }
.linha-copiar .btn-sec { align-self: flex-start; }

/* ---------- aviso e confirmação ---------- */
.aviso {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 40;
  width: min(calc(100% - 24px), 480px);
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 6px 6px 16px;
  border-radius: 16px; background: var(--texto); color: var(--fundo);
  font-weight: 600; font-size: 15px; box-shadow: var(--sombra-forte);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: transform .22s ease-out, opacity .22s;
}
.aviso.visivel { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.aviso span { flex: 1; }
.aviso button { min-height: 44px; padding: 0 12px; border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.confirma {
  width: min(calc(100% - 32px), 400px); padding: 22px 20px 16px;
  border: 0; border-radius: 22px; background: var(--superficie); color: var(--texto);
  box-shadow: var(--sombra-forte);
}
.confirma::backdrop { background: rgba(12, 14, 13, .55); }
.confirma h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.confirma p { color: var(--texto-2); }
.confirma-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.confirma-acoes .btn-primario, .confirma-acoes .btn-sec { min-height: 52px; }

/* ---------- telas largas ---------- */
@media (min-width: 560px) {
  .folha.cheia { height: min(100dvh, 860px); border-radius: 26px 26px 0 0; }
  .aviso { bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

:root[data-tema="escuro"] .amostra { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
:root[data-tema="escuro"] .amostra[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--fundo), 0 0 0 6px var(--texto); }
