/* =========================================================
   Visual "bento + vidro" (nov/2026): barra de topo, Início em grade, anéis, modo escuro.
   Carregado depois do app.css.
   ========================================================= */

/* Cartões: borda clara, sombra em camadas e leve elevação ao passar o mouse */
.card, .bk { border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 10px 30px -10px rgba(15, 23, 42, .08); }
@media (hover: hover) and (pointer: fine) {
    .card, .bk, .alert, .choice { transition: transform .18s ease, box-shadow .18s ease; }
    a.card:hover, a.bk:hover, a.alert:hover, a.choice:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 18px 36px -12px rgba(15, 23, 42, .16); }
}

/* Esconder valores (botão do olho): borra os números de dinheiro em qualquer tela */
html[data-hide="1"] .money, html[data-hide="1"] .stat-value, html[data-hide="1"] .hero-value, html[data-hide="1"] .kpi-value,
html[data-hide="1"] .das-amount, html[data-hide="1"] .r-amt, html[data-hide="1"] .dc-hero-value, html[data-hide="1"] .seg-num {
    filter: blur(9px); user-select: none;
}

/* ---------- Barra de topo (só no computador) ---------- */
.topbar { display: none; }
@media (min-width: 1024px) {
    .topbar {
        position: sticky; top: 0; z-index: 20;
        display: flex; align-items: center; justify-content: space-between; gap: 16px;
        max-width: 1320px; margin: 0 auto; padding: 14px 40px;
        background: color-mix(in srgb, var(--bg) 82%, transparent);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    }
    .app { padding-top: 12px; }
    .tb-left, .tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .tb-pill, .tb-icon, .tb-ask, .tb-company {
        display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
        background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 600;
        cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); text-decoration: none;
    }
    @media (hover: hover) and (pointer: fine) { .tb-pill:hover, .tb-icon:hover, .tb-ask:hover, .tb-company:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--ink); } }
    .tb-period { cursor: default; color: var(--muted); }
    @media (hover: hover) and (pointer: fine) { .tb-period:hover { border-color: var(--line); color: var(--muted); } }
    .tb-icon { position: relative; width: 40px; padding: 0; justify-content: center; }
    .tb-icon[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-deep); }
    .tb-ask { width: clamp(220px, 26vw, 340px); color: var(--muted); font-weight: 500; }
    /* Quando falta espaço, quem encolhe é a caixa do Assistente, nunca os botões de ícone. */
    .tb-pill, .tb-icon, .tb-company { flex-shrink: 0; }
    .tb-ask { flex: 0 1 auto; min-width: 40px; }
    @media (max-width: 1365px) {
        .topbar .tb-font span, .topbar .tb-company-text { display: none; }
        .topbar .tb-font { width: 44px; padding: 0; justify-content: center; }
        .topbar .tb-company { padding: 0 4px; }
    }
    .tb-ask svg { color: var(--brand); flex-shrink: 0; }
    .tb-ask span { overflow: hidden; text-overflow: ellipsis; }
    .tb-theme .tb-moon { display: none; }
    html[data-theme="dark"] .tb-theme .tb-sun { display: none; }
    html[data-theme="dark"] .tb-theme .tb-moon { display: inline; }
    .tb-company { height: 44px; padding: 0 14px 0 4px; }
    .tb-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
    .tb-company-text { display: flex; flex-direction: column; line-height: 1.15; }
    .tb-company-text strong { font-size: calc(13px * var(--fs, 1)); color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
    .tb-company-text small { display: inline-flex; align-items: center; gap: 5px; font-size: calc(11px * var(--fs, 1)); color: var(--muted); font-weight: 500; }
    .tb-company-text .sb-dot { margin-top: 0; width: 7px; height: 7px; }

    /* A barra de topo já tem "Voltar", sininho e olho: some com os repetidos das telas */
    .page-head.with-back > .icon-btn { display: none; }
    .app > .top .top-actions { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    .tb-company-text, .tb-period, .tb-label { display: none; }
    .tb-company { padding: 0 4px; }
}

/* ---------- Início: linha de 4 indicadores ---------- */
.bento-kpis { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .bento-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .bento-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.app > .bento-kpis { grid-column: 1 / -1; }
.bk {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-height: 178px;
    padding: 18px; background: var(--surface); color: var(--ink); text-decoration: none;
}
.bk-label { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.bk-value { font-size: calc(28px * var(--fs, 1)); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.bk-value.neg { color: var(--out); }
.bk-foot { font-size: calc(12px * var(--fs, 1)); color: var(--muted); margin-top: auto; }
.bk-badge { align-self: flex-start; padding: 3px 9px; border-radius: 999px; font-size: calc(11px * var(--fs, 1)); font-weight: 700; background: rgba(52, 211, 153, .16); color: #34D399; }
.bk-dark { background: linear-gradient(160deg, #0F172A 0%, #1E293B 100%); color: #fff; border-color: rgba(255, 255, 255, .06); }
.bk-dark .bk-label, .bk-dark .bk-foot { color: #94A3B8; }
.bk-spark { display: flex; align-items: flex-end; gap: 6px; height: 46px; margin-top: 6px; }
.bk-spark span { flex: 1; border-radius: 6px 6px 3px 3px; background: rgba(52, 211, 153, .35); min-height: 3px; }
.bk-spark span.now { background: #34D399; }
.bk-split { display: flex; flex-direction: column; gap: 2px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.bk-split .in strong { color: var(--in); }
.bk-split .out strong { color: var(--out); }
.bk-meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: auto; }
.bk-meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34D399, #059669); }
.bk-meter + .bk-foot { margin-top: 0; }
.seg-gauge { width: 100%; max-width: 220px; align-self: center; margin-top: 2px; }
.seg-gauge line { stroke-width: 7; stroke-linecap: round; }
.seg-gauge line.off { stroke: var(--line); }
.seg-gauge line.on { stroke: #10B981; }
.seg-gauge line.on.lvl-warn, .seg-gauge line.on.lvl-atencao { stroke: #F59E0B; }
.seg-gauge line.on.lvl-danger, .seg-gauge line.on.lvl-bad, .seg-gauge line.on.lvl-perigo, .seg-gauge line.on.lvl-estourou { stroke: #EF4444; }
.seg-num { font-size: 30px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.bk-das { background: linear-gradient(145deg, #10B981 0%, #059669 55%, #047857 100%); color: #fff; border-color: transparent; box-shadow: var(--shadow-hero); }
.bk-das .bk-label, .bk-das .bk-foot { color: rgba(255, 255, 255, .88); }
.bk-pill { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: calc(12px * var(--fs, 1)); font-weight: 700; }
.bk-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.bk-actions .btn { flex: 1; min-height: 44px; padding: 0 10px; font-size: calc(13px * var(--fs, 1)); }

/* ---------- Início: gráfico mês a mês + anéis ---------- */
@media (min-width: 1440px) {
    .app:has(> .bento-kpis) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .app > .bento-chart { grid-column: span 3; }
    .app > .bento-rings { grid-column: span 2; }
    .app:has(> .bento-kpis) > .alerts, .app:has(> .bento-kpis) > .recent { grid-column: 1 / -1; }
}
.rev-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; padding-top: 6px; }
.rev-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.rev-bar { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: #34D399; }
.rev-col.now .rev-bar { background: #059669; }
.rev-col.future .rev-bar { background: repeating-linear-gradient(135deg, rgba(16, 185, 129, .28) 0 5px, rgba(16, 185, 129, .12) 5px 10px); border: 1px dashed rgba(5, 150, 105, .45); }
.rev-lbl { font-size: calc(11px * var(--fs, 1)); color: var(--muted); }
.rev-col.now .rev-lbl { color: var(--brand-deep); font-weight: 700; }
.rev-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 0; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.sw-real { background: #34D399; }
.sw-now { background: #059669; }
.sw-proj { background: rgba(16, 185, 129, .2); border: 1px dashed rgba(5, 150, 105, .5); }
.cash-buttons-3 { flex-wrap: wrap; }
.cash-buttons-3 .btn { flex: 1 1 150px; }
.rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; margin-bottom: 14px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; background: var(--surface-2); }
.ring svg { width: 76px; height: 76px; margin-bottom: 4px; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 7; }
.ring-fill { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring-num { font-size: 15px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.ring strong { font-size: calc(13px * var(--fs, 1)); }
.ring span { font-size: calc(11px * var(--fs, 1)); color: var(--muted); }
.ring-green .ring-fill { stroke: #10B981; }
.ring-blue .ring-fill { stroke: #3B82F6; }
.ring-amber .ring-fill { stroke: #F59E0B; }
.ring-orange .ring-fill { stroke: #F97316; }
@media (max-width: 380px) { .ring svg { width: 60px; height: 60px; } }

/* ---------- INSS: situação da licença ---------- */
.mat-diagnosis { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; margin-top: 12px; }
.mat-diagnosis strong { font-size: calc(16px * var(--fs, 1)); }
.mat-diagnosis span { font-size: calc(14px * var(--fs, 1)); color: var(--ink-2); }
.mat-ok { background: var(--in-soft); border: 1px solid color-mix(in srgb, var(--in) 30%, transparent); }
.mat-ok strong { color: var(--in); }
.mat-warn { background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
.mat-warn strong { color: var(--amber); }
.mat-bad { background: var(--out-soft); border: 1px solid color-mix(in srgb, var(--out) 30%, transparent); }
.mat-bad strong { color: var(--out); }
.mat-kind { margin: 4px 0 12px; }

/* ---------- Modo escuro "vidro" ---------- */
html[data-theme="dark"] {
    --bg: #0B0F19;
    --surface: rgba(30, 41, 59, .65);
    --surface-2: rgba(15, 23, 42, .55);
    --ink: #E2E8F0;
    --ink-2: #CBD5E1;
    --muted: #94A3B8;
    --line: rgba(255, 255, 255, .08);
    --brand-soft: rgba(16, 185, 129, .14);
    --brand-deep: #6EE7B7;
    --brand-strong: #34D399;
    --in: #34D399; --in-soft: rgba(52, 211, 153, .12);
    --out: #F87171; --out-soft: rgba(248, 113, 113, .12);
    --amber: #FBBF24; --amber-soft: rgba(251, 191, 36, .12);
    --blue: #60A5FA; --blue-soft: rgba(96, 165, 250, .12);
    --violet: #A78BFA; --violet-soft: rgba(167, 139, 250, .12);
    --rose: #F472B6; --rose-soft: rgba(244, 114, 182, .12);
    --teal: #2DD4BF; --teal-soft: rgba(45, 212, 191, .12);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
}
html[data-theme="dark"] body {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(16, 185, 129, .10), transparent 60%),
        radial-gradient(700px 500px at 10% 110%, rgba(124, 58, 237, .10), transparent 60%),
        #0B0F19;
    background-attachment: fixed;
}
html[data-theme="dark"] .card, html[data-theme="dark"] .bk:not(.bk-dark):not(.bk-das), html[data-theme="dark"] .quick,
html[data-theme="dark"] .alert, html[data-theme="dark"] .choice, html[data-theme="dark"] .tb-pill, html[data-theme="dark"] .tb-icon,
html[data-theme="dark"] .tb-ask, html[data-theme="dark"] .tb-company, html[data-theme="dark"] .icon-btn {
    background: rgba(30, 41, 59, .65); border-color: rgba(255, 255, 255, .08); color: var(--ink);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
html[data-theme="dark"] .bk-dark { background: linear-gradient(160deg, rgba(2, 6, 23, .92), rgba(15, 23, 42, .92)); border-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: rgba(15, 23, 42, .7); color: var(--ink); border-color: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .btn-ghost { background: rgba(255, 255, 255, .06); color: var(--ink); border-color: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .rev-col.now .rev-bar { background: #10B981; }
html[data-theme="dark"] .topbar { background: rgba(11, 15, 25, .72); }

.cash-buttons-3 .btn { white-space: nowrap; }

/* ---------- Tema claro padrão, com mais contraste e letra um pouco maior (público de todas as idades) ---------- */
:root {
    --bg: #F8FAFC;
    --line: #CBD5E1;
    --muted: #475569;
    --ink-2: #1E293B;
}
body { font-size: calc(17px * var(--fs, 1)); }
.bk-foot, .rev-lbl, .ring span, .rev-legend, .tb-company-text small { font-size: calc(13px * var(--fs, 1)); }
.bk-label, .ring strong { font-size: calc(14px * var(--fs, 1)); }
.app > *, .bento-kpis > *, .bk, .card { min-width: 0; max-width: 100%; }
@media (min-width: 1024px) { .app { max-width: min(1320px, 100%); } }

/* ---------- Ilustrações ---------- */
.illu { display: inline-flex; flex-shrink: 0; }
.illu svg { width: 100%; height: 100%; display: block; }
.page-head:has(> .illu-head) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top .illu-head { margin-left: auto; }
@media (max-width: 1023px) { .top .illu-head { display: none; } .page-head .illu-head { width: 52px !important; height: 52px !important; } }

/* ---------- Cartões que abrem explicação ---------- */
button.bk, button.ring { font: inherit; text-align: left; cursor: pointer; width: 100%; }
button.ring { text-align: center; color: var(--ink); }
button.bk:focus-visible, button.ring:focus-visible { outline: 3px solid #34D399; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    button.bk:hover, button.ring:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 18px 36px -12px rgba(15, 23, 42, .16); }
    button.ring { transition: transform .18s ease, box-shadow .18s ease; }
}

/* ---------- Gaveta (lateral no computador, de baixo no celular) ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); animation: fade-in .2s ease; }
.drawer {
    position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    padding: 28px 22px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
    background: #fff; color: #0F172A; box-shadow: 0 -20px 50px -10px rgba(15, 23, 42, .35);
    animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1);
}
.drawer:focus { outline: none; }
.drawer h2 { margin: 4px 0 0; font-size: calc(22px * var(--fs, 1)); letter-spacing: -.01em; }
.drawer-intro { margin: 0; font-size: calc(17px * var(--fs, 1)); color: #1E293B; line-height: 1.5; }
.drawer-steps { counter-reset: s; list-style: none; margin: 6px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.drawer-steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 52px; border-radius: 14px; background: #F1F5F9; border: 1px solid #E2E8F0; font-size: calc(16px * var(--fs, 1)); line-height: 1.45; }
.drawer-steps li::before { content: counter(s); position: absolute; left: 14px; top: 11px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #10B981; color: #fff; font-weight: 800; font-size: calc(14px * var(--fs, 1)); }
.drawer-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: #FFFBEB; border: 1px solid #FDE68A; color: #78350F; font-size: calc(15px * var(--fs, 1)); text-align: left; width: 100%; }
.drawer-note .icon { flex-shrink: 0; margin-top: 2px; }
.drawer-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
.drawer-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #CBD5E1; background: #fff; color: #0F172A; font-size: calc(18px * var(--fs, 1)); cursor: pointer; }
@media (min-width: 1024px) {
    .drawer {
        left: auto; top: 0; bottom: 0; width: 440px; max-height: none; border-radius: 26px 0 0 26px;
        padding: 36px 30px 30px; animation: slide-in .28s cubic-bezier(.2, .8, .2, 1);
    }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { animation: none; } }
html[data-theme="dark"] .drawer { background: #111827; color: #E2E8F0; }
html[data-theme="dark"] .drawer-intro { color: #CBD5E1; }
html[data-theme="dark"] .drawer-steps li { background: rgba(30, 41, 59, .8); border-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .drawer-close { background: #1E293B; color: #E2E8F0; border-color: rgba(255, 255, 255, .12); }
.mat-das { margin-top: 12px; }

/* =========================================================
   Revisão de legibilidade e acabamento (05/11/2026)
   Pensada para quem lê com mais dificuldade: sem textos todos em maiúsculas,
   rótulos com contraste de pelo menos 4,5:1, foco do teclado sempre visível.
   ========================================================= */
/* Rótulos em letra normal (maiúsculas cansam a leitura) */
.day-label, .terms-hero .terms-kicker { text-transform: none; letter-spacing: 0; font-size: calc(13px * var(--fs, 1)); }
@media (min-width: 1024px) {
    .sb-group { text-transform: none; letter-spacing: 0; font-size: calc(12.5px * var(--fs, 1)); color: #94A3B8; }
    .sb-brand small { font-size: calc(12px * var(--fs, 1)); }
}

/* Foco do teclado visível em tudo que é clicável */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #10B981; outline-offset: 2px; border-radius: 8px;
}
.sidebar a:focus-visible { outline-color: #34D399; }

/* Seleção de texto, cursor e barra de rolagem com as cores da marca */
::selection { background: #A7F3D0; color: #0F172A; }
input, textarea { caret-color: #059669; }
html { scrollbar-color: #CBD5E1 transparent; }
html[data-theme=dark] { scrollbar-color: #334155 transparent; }
html[data-theme=dark] ::selection { background: #065F46; color: #fff; }

/* Valores em dinheiro com algarismos alinhados */
.money, .bk strong, .ring strong { font-variant-numeric: tabular-nums; }

/* Garantia extra contra corte lateral nas grades do Início */
.bento-kpis > *, .bento-rings, .bento-chart { min-width: 0; max-width: 100%; }

/* =========================================================
   Letra grande (05/11/2026)
   Todos os font-size usam calc(Npx * var(--fs)). Aqui só muda a escala;
   a disposição da tela continua a mesma.
   ========================================================= */
:root { --fs: 1; }
html[data-font=grande] { --fs: 1.2; }
html[data-font=grande] body { line-height: 1.55; }

.tb-font[aria-pressed=true], .icon-btn-font[aria-pressed=true] {
    background: #ECFDF5; border-color: #10B981; color: #047857;
}
html[data-theme=dark] .tb-font[aria-pressed=true],
html[data-theme=dark] .icon-btn-font[aria-pressed=true] { background: rgba(16,185,129,.18); color: #6EE7B7; }

/* Minha conta → Tela e leitura: linhas com chave liga/desliga */
.view-prefs { display: flex; flex-direction: column; gap: 4px; }
.view-prefs .account-sub { margin: -4px 0 6px; }
.pref {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px;
    padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: none;
    color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.pref:first-of-type { border-top: 0; }
.pref-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #F1F5F9; color: var(--ink-2); flex: none; }
.pref-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pref-body strong { font-size: calc(16px * var(--fs, 1)); }
.pref-body span { font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.pref-switch {
    position: relative; flex: none; width: 52px; height: 30px; border-radius: 999px;
    background: #CBD5E1; transition: background .2s cubic-bezier(.16,1,.3,1);
}
.pref-switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .2s cubic-bezier(.16,1,.3,1);
}
.pref[aria-pressed=true] .pref-switch { background: #059669; }
.pref[aria-pressed=true] .pref-switch::after { transform: translateX(22px); }
.pref[aria-pressed=true] .pref-ico { background: #ECFDF5; color: #047857; }
html[data-theme=dark] .pref-ico { background: rgba(148,163,184,.14); color: #CBD5E1; }
html[data-theme=dark] .pref-switch { background: #475569; }
@media (prefers-reduced-motion: reduce) { .pref-switch, .pref-switch::after { transition: none; } }

/* Cabeçalho do Início: o nome da empresa quebra em até 2 linhas em vez de passar por baixo dos botões */
.top .hello { flex: 1; }
.top .hello > div { min-width: 0; }
.top .top-actions { flex: none; }
.top .hello-title {
    white-space: normal; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Valor em dinheiro nunca é cortado com "…": se não couber, desce para a linha de baixo */
.stat-value { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.2; }
/* Descrição dos lançamentos e nome de arquivo: até 2 linhas, em vez de cortar na primeira */
.r-desc, .doc-file-body strong {
    white-space: normal; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* =========================================================
   Contraste mínimo 4,5:1 e área de toque de 40px (05/11/2026)
   Medido tela por tela no celular. O verde #059669 com texto branco dava 3,8:1.
   ========================================================= */
html:not([data-theme=dark]) { --out: #B42318; --amber: #B45309; }
.btn-primary { background: var(--brand-strong); }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--brand-deep); } }
html[data-theme=dark] .btn-primary { background: #059669; }
.link, .link-btn, .nav-item.active { color: var(--brand-strong); }
html:not([data-theme=dark]) .chip-ok { color: #065F46; }
html:not([data-theme=dark]) .chip-warn { color: #92400E; }
html:not([data-theme=dark]) .chip-info { color: #1D4ED8; }
.nav-item { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
html:not([data-theme=dark]) .nav-item:not(.active) { color: #475569; }

/* Botões pequenos com área de toque maior (o desenho continua do mesmo tamanho) */
.del-btn { min-width: 44px; min-height: 44px; }
.link-btn { min-height: 44px; }
.card-head .link { display: inline-flex; align-items: center; min-height: 44px; }

/* =========================================================
   Pendências e certidões (/certidoes)
   ========================================================= */
.cert-intro { color: var(--ink-2); font-size: calc(16px * var(--fs, 1)); line-height: 1.55; max-width: 68ch; margin: 0 0 16px; }
.cert-cnpj { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cert-cnpj-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cert-cnpj-text strong { font-size: calc(22px * var(--fs, 1)); font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--ink); }
.cert-blockers { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cert-blockers li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); }
.cert-blocker-text { color: var(--ink); line-height: 1.45; }
.cert-blocker-text .link { display: inline; margin-left: 4px; }
.cert-gap { margin-top: 12px; }
.cert-title { font-size: calc(19px * var(--fs, 1)); font-weight: 750; color: var(--ink); margin: 28px 0 12px; }
.cert { display: flex; flex-direction: column; gap: 8px; }
.cert-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cert-head h3 { margin: 0; font-size: calc(17px * var(--fs, 1)); font-weight: 750; color: var(--ink); }
.cert > p { margin: 0; color: var(--ink-2); line-height: 1.5; max-width: 68ch; }
.cert > p.muted-sm { color: var(--muted); }
.cert-meta { font-weight: 650; color: var(--ink) !important; }
.cert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cert-actions .btn { min-height: 44px; }
.cert-keep { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cert-keep p { margin: 0; }
@media (min-width: 1024px) {
    .cert-cnpj { flex-wrap: nowrap; }
}
@media (min-width: 1024px) {
    .app > .cert-intro, .app > .cert-title { grid-column: 1 / -1; }
    .app > .cert-intro { margin-bottom: 0; }
    .app > .cert-title { margin: 12px 0 -8px; }
}


/* ---------- Certidões guardadas e gaveta de conferência ---------- */
.cert-saved { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 12px 14px; border-radius: 14px; background: #F8FAFC; }
.cert-saved-ico { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); }
.cert-saved-ico.warn { background: var(--amber-soft); color: var(--amber); }
.cert-saved-ico.bad { background: var(--out-soft); color: var(--out); }
.cert-saved-ico.info { background: #E2E8F0; color: #334155; }
.cert-saved-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cert-saved-body strong { font-size: calc(15px * var(--fs, 1)); color: #0F172A; }
.cert-saved-body span { font-size: calc(13px * var(--fs, 1)); color: #475569; }
.cert-saved .chip { flex-shrink: 0; }
.cert-open { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: calc(14px * var(--fs, 1)); font-weight: 650; }
.cert-upload { cursor: pointer; }
.cert-upload[aria-busy="true"] { opacity: .75; pointer-events: none; }
.cert-file { display: inline-flex; align-items: center; gap: 6px; margin: 0; max-width: 100%; font-size: calc(14px * var(--fs, 1)); color: #475569; overflow-wrap: anywhere; }
.cert-form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 4px; text-align: left; }
.cert-form .status-line { margin-top: 0; }
.cert-form .drawer-note { margin: 0; }
html[data-theme="dark"] .cert-saved { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .cert-saved-body strong { color: #F1F5F9; }
html[data-theme="dark"] .cert-saved-body span, html[data-theme="dark"] .cert-file { color: #CBD5E1; }
html[data-theme="dark"] .cert-saved-ico.info { background: rgba(255, 255, 255, .08); color: #E2E8F0; }

.cert-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 12px; background: #EFF6FF; color: #1E3A8A; font-size: calc(14px * var(--fs, 1)); line-height: 1.45; }
.cert-hint .icon { flex-shrink: 0; margin-top: 2px; }
html[data-theme="dark"] .cert-hint { background: rgba(59, 130, 246, .12); color: #DBEAFE; }

/* Raio-X: aviso de que o INSS perdoado não conta como carência nem tempo de contribuição */
.forgive-warn { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #FFFBEB; color: #78350F; font-size: calc(14px * var(--fs, 1)); line-height: 1.5; }
.forgive-warn .icon { flex-shrink: 0; margin-top: 2px; color: #B45309; }
.forgive-warn strong { color: #78350F; }
html[data-theme="dark"] .forgive-warn { background: rgba(245, 158, 11, .12); border-color: rgba(252, 211, 77, .35); color: #FDE68A; }
html[data-theme="dark"] .forgive-warn strong, html[data-theme="dark"] .forgive-warn .icon { color: #FCD34D; }

/* Termos: Encarregado de Dados (LGPD, art. 41) */
.terms-dpo { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2, #F1F5F9); line-height: 1.5; }
.terms-dpo .icon { flex-shrink: 0; margin-top: 3px; }
.terms-dpo a { overflow-wrap: anywhere; }
html[data-theme="dark"] .terms-dpo { background: rgba(255, 255, 255, .06); }

/* =========================================================
   Auditoria de design: Apple HIG + mobile-native (05/11/2026)
   ========================================================= */

/* iPhone deitado não aumenta a letra sozinho. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Toque: sem espera de duplo toque e sem selecionar o texto do botão ao segurar. */
:is(.btn, .icon-btn, .avatar, .pick, .link, .link-btn, .del-btn, .segmented button, .ai-chip, .ai-new, .dc-value,
    .nav-item, .nav-fab, .q, .sb-link, .tb-pill, .tb-icon, .tb-ask, .tb-company, .cert-open, .drawer-close,
    .choice, .pref, .option, .service, .paths a, a.alert, a.card, a.bk, button.bk, button.ring, summary, .check, .nf-check,
    .sb-brand, .sb-company) {
    touch-action: manipulation;
    -webkit-user-select: none; user-select: none;
}
:is(button, .btn, [role=button], summary, label.check) { -webkit-touch-callout: none; }

/* Resposta no instante em que o dedo encosta (:active), curta e com saída suave. */
:is(.btn, .icon-btn, .avatar, .pick, .link-btn, .del-btn, .segmented button, .ai-chip, .ai-new, .dc-value,
    .cert-open, .drawer-close, .tb-pill, .tb-icon, .tb-ask, .tb-company) {
    transition: transform .12s ease-out, background-color .15s ease, color .15s ease, opacity .15s ease, box-shadow .15s ease;
}
:is(.btn, .icon-btn, .avatar, .pick, .link-btn, .del-btn, .segmented button, .ai-chip, .ai-new, .dc-value,
    .cert-open, .drawer-close, .tb-pill, .tb-icon, .tb-ask, .tb-company):active:not([disabled]) { transform: scale(.97); }
:is(a.card, a.bk, button.bk, button.ring, a.alert, .choice, .pref, .option, .service, .q, summary) { transition: transform .14s ease-out, box-shadow .18s ease, background-color .15s ease; }
:is(a.card, a.bk, button.bk, button.ring, a.alert, .choice, .pref, .option, .service, .q, summary):active { transform: scale(.985); }
:is(.nav-item, .sb-link, a.link, .paths a) { transition: opacity .12s ease-out; }
:is(.nav-item, .sb-link, a.link, .paths a):active { opacity: .6; }
.nav-fab-btn { transition: transform .12s ease-out; }
.nav-fab:active .nav-fab-btn { transform: scale(.94); }

/* Alvos de toque de 44 x 44 px (o desenho pode ser menor; a área de toque não). */
.avatar { flex-shrink: 0; }
a.link:not(:is(p, li, small, span, label) a) { display: inline-flex; align-items: center; min-height: 44px; }
summary { min-height: 44px; }
/* Computador: 44 px também com mouse (decisão do Willyson, 05/11/2026). Para caber em notebook,
   só a lista de links rola; a marca no alto e a empresa embaixo ficam sempre à vista. */
@media (min-width: 1024px) {
    .sb-link { min-height: 44px; }
    .sidebar { overflow: hidden; }
    .sb-nav {
        min-height: 0; overflow-y: auto; overscroll-behavior: contain;
        margin: 0 -6px; padding: 0 6px;
        scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .35) transparent;
    }
    .tb-pill, .tb-icon, .tb-ask { height: 44px; }
    .tb-icon { width: 44px; }
}

/* Caixa dentro de caixa: dentro de um cartão, o aviso vira fundo suave, sem borda nem sombra. */
:is(.card, .bk) .alert { border-color: transparent; box-shadow: none; background: var(--surface-2); }
.card .guide li { border-color: transparent; background: var(--surface-2); }

/* Valores em reais nunca partem em duas linhas nem são cortados. */
.money, .kpi-value, .hero-value, .stat-value, .r-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-value { overflow: visible; text-overflow: clip; }

/* Nomes longos de empresa quebram dentro do espaço, sem empurrar a tela para o lado. */
.hero-sub, .company-name, .company-legal, .sb-company strong, .account-name { min-width: 0; overflow-wrap: anywhere; }

/* =========================================================
   Rolagem no celular (05/11/2026)
   1) Cabeçalho do Início fica preso no alto, com efeito vidro: o olho de esconder valores
      está sempre à mão, em qualquer ponto da página.
   2) Os 4 cartões do resumo viram um carrossel de deslizar para o lado.
   No computador nada muda: a barra de topo já é fixa e os cartões seguem em grade.
   ========================================================= */
@media (max-width: 1023px) {
    .app > .top {
        position: sticky; top: 0; z-index: 50;
        /* Cobre também a área do relógio/notch: o vidro vai até a beirada da tela. */
        margin: calc(-14px - env(safe-area-inset-top)) -16px 0;
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
        background: color-mix(in srgb, var(--bg) 85%, transparent);
        -webkit-backdrop-filter: blur(12px) saturate(1.6);
        backdrop-filter: blur(12px) saturate(1.6);
        transition: box-shadow .2s ease;
    }
    /* Linha fina embaixo só quando há conteúdo passando por baixo. */
    html[data-scrolled] .app > .top { box-shadow: 0 1px 0 var(--line); }
    /* Sem suporte a desfoque: fundo sólido, para o texto nunca ficar ilegível. */
    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .app > .top { background: var(--bg); }
    }

    .bento-kpis {
        display: flex; gap: 16px;
        overflow-x: auto; overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
        /* Encosta nas bordas da tela; o respiro embaixo deixa a sombra dos cartões aparecer. */
        margin-left: -16px; margin-right: -16px; max-width: none;
        padding: 4px 16px 16px; margin-bottom: -12px;
        scrollbar-width: none;
    }
    .bento-kpis::-webkit-scrollbar { display: none; }
    .bento-kpis > * { flex: 0 0 85%; max-width: 85%; scroll-snap-align: center; scroll-snap-stop: always; }
}

/* =========================================================
   Início no celular mais curto (06/11/2026)
   3) Atalhos numa linha só, de deslizar para o lado, logo abaixo dos cartões.
   4) Gráfico do mês a mês mais baixo e "Ganhei / Gastei" lado a lado.
   ========================================================= */
@media (max-width: 1023px) {
    .app > .quick {
        display: flex; gap: 12px;
        overflow-x: auto; overscroll-behavior-x: contain;
        scroll-snap-type: x proximity; scroll-padding-inline: 16px;
        margin-left: -16px; margin-right: -16px; max-width: none;
        padding: 2px 16px 8px;
        background: none; border: 0; border-radius: 0; box-shadow: none;
        scrollbar-width: none;
    }
    .app > .quick::-webkit-scrollbar { display: none; }
    .app > .quick .q {
        flex: 0 0 70px; min-height: 44px; padding: 4px 0;
        scroll-snap-align: start; gap: 6px;
        font-size: calc(12px * var(--fs, 1));
    }
    .app > .quick .q > span:last-child {
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .app > .quick .q-ico { width: 56px; height: 56px; border-radius: 20px; }
    html[data-theme="dark"] .app > .quick { background: none; border: 0; box-shadow: none; }

    .bento-chart .rev-bars { height: 112px; gap: 5px; }
    .bento-chart .card-head { margin-bottom: 8px; }
    .bento-chart .rev-legend { margin-top: 6px; }
    /* "Ganhei" e "Gastei" lado a lado; se o texto não couber, quebra em 2 linhas dentro do botão. */
    .bento-chart .cash-buttons-3 .btn { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 8px; white-space: normal; line-height: 1.2; text-align: center; }
    .bento-chart .cash-buttons-3 .btn:last-child { flex-basis: 100%; }
}

/* =========================================================
   Entrada e cadastro (06/11/2026): ilustração no login, links simples na tela do CNPJ
   e tela de espera enquanto o app fala com a Receita.
   ========================================================= */
.auth-illu { align-self: center; margin: -8px 0 -4px; }
.onb-links { display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center; }
.onb-links .link { color: var(--brand-strong); font-weight: 650; }
.onb-links .onb-link-soft { color: var(--muted); font-weight: 600; }

.loading-screen {
    position: fixed; inset: 0; z-index: 200;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    padding: 24px max(24px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    text-align: center; animation: espera-entra .2s ease-out;
}
.loading-screen[hidden] { display: none; }
.loading-art { animation: espera-pulsa 1.6s ease-in-out infinite; }
.loading-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 4px solid color-mix(in srgb, var(--brand) 18%, transparent); border-top-color: var(--brand);
    animation: espera-gira .8s linear infinite;
}
.loading-text { max-width: 300px; font-size: calc(17px * var(--fs, 1)); font-weight: 700; color: var(--ink); line-height: 1.35; }
@keyframes espera-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes espera-pulsa { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes espera-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .loading-screen, .loading-art { animation: none; }
    .loading-spinner { animation-duration: 2.4s; }
}

/* =========================================================
   Início inteligente (06/11/2026)
   - Cartão principal muda conforme a prioridade: "Prioridade hoje" (DAS, verde) ou "Tudo em dia" (azul-noite).
   - Caixa mostra o DAS já separado e o lucro livre.
   - Atalhos com brilho (semana sem nota) e bolinha vermelha (Declaração pendente).
   - Cartão de ação do boleto atrasado abre a gaveta, sem sair do Início.
   ========================================================= */
.bk-eyebrow {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    padding: 4px 10px; border-radius: 999px;
    font-size: calc(12px * var(--fs, 1)); font-weight: 800; letter-spacing: .01em;
    background: rgba(255, 255, 255, .2); color: #fff;
}
.bk-actions-hero { flex-direction: column; }
.bk-actions-hero .btn { flex: none; width: 100%; }
.bk-actions-hero .btn-hero { min-height: 52px; font-size: calc(16px * var(--fs, 1)); font-weight: 800; }

.bk-night { background: linear-gradient(155deg, #0A1A3F 0%, #12306A 100%); color: #fff; border-color: transparent; box-shadow: 0 18px 40px -18px rgba(10, 26, 63, .7); }
.bk-night .bk-foot { color: rgba(255, 255, 255, .78); }
.bk-night .bk-foot strong { color: #fff; }
.bk-night .bk-eyebrow { background: rgba(52, 211, 153, .18); color: #6EE7B7; }
.bk-hero-row { display: flex; align-items: center; gap: 12px; }
.bk-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: calc(14px * var(--fs, 1)); line-height: 1.35; color: rgba(255, 255, 255, .88); }
.bk-hero-title { font-size: calc(20px * var(--fs, 1)); font-weight: 800; letter-spacing: -.01em; color: #fff; overflow-wrap: anywhere; }
.bk-hero-text b { color: #6EE7B7; }
.bk-hero-gauge { flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; }
.bk-hero-gauge .seg-gauge { max-width: 96px; }
.bk-hero-gauge small { margin-top: -2px; font-size: calc(11px * var(--fs, 1)); color: rgba(255, 255, 255, .72); }
.bk-night .seg-num { fill: #fff; }
.bk-night .seg-gauge line.off { stroke: rgba(255, 255, 255, .18); }

.cash-lines { display: flex; flex-direction: column; gap: 3px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.cash-lines > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cash-lines strong { color: var(--ink-2); font-weight: 700; }
.cash-lines strong.in { color: var(--in); }
.cash-lines strong.out { color: var(--out); }
.cash-free {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    margin-top: auto; padding: 10px 12px; border-radius: 14px;
    background: var(--in-soft); color: var(--in);
    font-size: calc(13px * var(--fs, 1)); font-weight: 700;
}
.cash-free strong { font-size: calc(22px * var(--fs, 1)); font-weight: 800; letter-spacing: -.02em; }
.cash-free.neg { background: var(--out-soft); color: var(--out); }
html[data-theme="dark"] .cash-free { background: rgba(16, 185, 129, .14); color: #34D399; }
html[data-theme="dark"] .cash-free.neg { background: rgba(239, 68, 68, .14); color: #F87171; }

.q-ico { position: relative; }
@supports (corner-shape: squircle) {
    .app > .quick .q-ico { border-radius: 50%; corner-shape: squircle; }
}
.q-glow .q-ico {
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--blue) 55%, transparent);
    animation: q-brilho 2.4s ease-in-out infinite;
}
.q-glow > span:last-child { color: var(--ink); font-weight: 700; }
@keyframes q-brilho {
    50% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent), 0 0 16px 2px color-mix(in srgb, var(--blue) 35%, transparent); }
}
.q-badge { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: #EF4444; box-shadow: 0 0 0 3px var(--bg); }
@media (prefers-reduced-motion: reduce) { .q-glow .q-ico { animation: none; } }

button.action-card { width: 100%; font: inherit; text-align: left; cursor: pointer; }
@media (min-width: 1024px) { .app > .action-cards { grid-column: 1 / -1; } }

/* ---------- Contador parceiro: só quando o faturamento passa o limite em mais de 20% ---------- */
.notice-partner { background: var(--out-soft); color: var(--ink-2); gap: 12px; margin: 0 0 16px; }
.notice-partner strong { display: flex; gap: 8px; align-items: flex-start; color: var(--out); line-height: 1.4; }
.notice-partner strong svg { flex-shrink: 0; margin-top: 1px; }
.app > .notice-partner { grid-column: 1 / -1; align-self: start; margin: 0; }
@media (min-width: 1024px) { .app > .notice-partner .btn { width: auto; align-self: flex-start; } }
.ai-text a.ai-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 6px; padding: 0 16px; text-decoration: none; }

/* ---------- Aviso de cookies (LGPD): primeira visita, some no "Entendi" ---------- */
.cookie-banner {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 45; width: min(560px, calc(100% - 32px));
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: #FFFFFF; color: var(--ink-2); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .35);
    font-size: calc(14px * var(--fs, 1)); line-height: 1.45;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1; }
.cookie-banner a { color: var(--brand-strong); font-weight: 600; text-decoration: underline; white-space: nowrap; }
.cookie-banner .btn { flex-shrink: 0; min-height: 44px; padding: 0 22px; }
html[data-theme="dark"] .cookie-banner { background: #111827; }
/* No celular, fica acima da barra de baixo. */
@media (max-width: 1023px) { body:has(.bottom-nav) .cookie-banner { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (max-width: 479px) { .cookie-banner { flex-direction: column; align-items: stretch; } }

/* ---------- Janelas da Política de Privacidade e dos Termos (tela Entrar) ---------- */
.legal-dialog {
    width: min(680px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 32px);
    padding: 0; border: 0; border-radius: 20px; background: var(--bg); color: var(--ink);
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .45);
}
.legal-dialog[open] { display: flex; flex-direction: column; }
.legal-dialog::backdrop { background: rgba(15, 23, 42, .55); }
html:has(.legal-dialog[open]) { overflow: hidden; }
.legal-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.legal-dialog-head h2 { font-size: calc(18px * var(--fs, 1)); margin: 0; }
.legal-dialog-close { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2, #F1F5F9); color: var(--ink); font-size: 18px; cursor: pointer; }
.legal-dialog-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.legal-dialog-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.legal-dialog-foot form { margin: 0; }
.check a { color: var(--brand-strong); font-weight: 650; text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------- Quem somos (Decreto 7.962/2013, art. 2º): nome, CNPJ, endereço e contato ---------- */
.company-id { font-style: normal; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 4px; text-align: center; font-size: calc(12px * var(--fs, 1)); line-height: 1.5; color: var(--muted); }
.company-id strong { color: var(--ink-2); font-size: calc(13px * var(--fs, 1)); }
.company-id a { color: var(--brand-strong); font-weight: 600; }
.app > .company-id { grid-column: 1 / -1; }
.terms-dpo { display: flex; gap: 8px; align-items: flex-start; }
.terms-dpo .icon { flex-shrink: 0; margin-top: 2px; }

/* ---------- Teclado: o contorno de foco não é cortado nos cartões de deslizar ---------- */
@media (max-width: 1023px) {
    .bento-kpis > .bk:focus-visible, .app > .quick .q:focus-visible { outline-offset: -3px; }
}
