/* Sistema de design. Documentação e HTML de cada componente: docs/DESIGN.md.
   Regra: telas novas usam só estes tokens e componentes. Precisou de algo que não existe? Acrescente aqui,
   documente no DESIGN.md e mostre em /estilo. Nada de estilo inline (a CSP bloqueia). */

/* 1. Fonte ------------------------------------------------------------------------------------------ */
/* IBM Plex Sans (variável 400 a 700, recorte latino, licença OFL em fonts/OFL-ibm-plex-sans.txt). Os algarismos
   da Plex já são tabulares por padrão (todos com a mesma largura): colunas de alíquota alinham sem truque. */
@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* 2. Tokens ----------------------------------------------------------------------------------------- */
:root {
    color-scheme: light; /* tema claro sempre */

    /* Neutros (ardósia fria, uma família só) */
    --cor-fundo: #ffffff;
    --cor-fundo-suave: #f5f6f8;
    --cor-fundo-forte: #eceef2;
    --cor-linha: #e1e4ea;
    --cor-linha-forte: #c6ccd6;
    --cor-texto: #141a24;
    --cor-texto-2: #465163;   /* 8,3:1 no branco */
    --cor-texto-3: #5d6879;   /* 5,6:1 no branco; mínimo para texto */

    /* Marca (provisória, 01/12/2026): azul-tinteiro de documento fiscal + cobre de carimbo.
       --cor-marca #1D3A5F: 11,6:1 no branco (texto, links e botões); branco sobre ele idem.
       --cor-apoio #2E5C8A: 6,6:1 no branco; ícones, gráficos e detalhes.
       --cor-destaque #B4532A (cobre): 4,9:1 no branco; só na linha dupla de total, em marcadores e no símbolo.
       Nunca em fundo de seção nem em texto corrido. */
    --cor-marca: #1d3a5f;
    --cor-marca-forte: #132842;
    --cor-marca-suave: #e8eef6;
    --cor-marca-linha: #bccbdf;
    --cor-apoio: #2e5c8a;
    --cor-destaque: #b4532a;
    --cor-destaque-suave: #fbefe8;
    --cor-faixa: var(--cor-destaque); /* nome antigo, mantido para CSS de área que ainda o usa */

    /* Estados */
    --cor-sucesso: #1f6b52;
    --cor-sucesso-suave: #e7f4ef;
    --cor-sucesso-linha: #b7dccd;
    --cor-erro: #b42318;
    --cor-erro-suave: #fdeeec;
    --cor-erro-linha: #f3c4bf;
    --cor-alerta: #7a4f00;
    --cor-alerta-suave: #fff4d6;
    --cor-alerta-linha: #f1d999;
    --cor-info: var(--cor-marca);
    --cor-info-suave: var(--cor-marca-suave);
    --cor-info-linha: var(--cor-marca-linha);
    --cor-foco: #2e5c8a;

    /* Tratamentos da reforma (selo-trat-*): cor de apoio; o texto do selo sempre diz o tratamento. */
    --trat-zero: #0f5f57;           --trat-zero-fundo: #e3f3f0;
    --trat-60: #1d4f91;             --trat-60-fundo: #e6effa;
    --trat-30: #3f4f8f;             --trat-30-fundo: #eceffa;
    --trat-especifico: #6b4a12;     --trat-especifico-fundo: #f8f0de;
    --trat-seletivo: #a3311a;       --trat-seletivo-fundo: #fcebe6;
    --trat-cheia: #2b3442;          --trat-cheia-fundo: #eceef2;

    /* Tipografia */
    --fonte: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --t-xs: 0.8125rem;   /* 13 */
    --t-s: 0.9375rem;    /* 15 */
    --t-m: 1.0625rem;    /* 17, corpo */
    --t-l: 1.25rem;      /* 20 */
    --t-xl: 1.5rem;      /* 24 */
    --t-2xl: clamp(1.625rem, 1.2rem + 1.6vw, 2rem);         /* 26 a 32 */
    --t-3xl: clamp(2rem, 1.35rem + 2.9vw, 3.25rem);         /* 32 a 52, h1 da home */
    --entrelinha: 1.55;
    --entrelinha-titulo: 1.14;

    /* Espaço (base 4) */
    --e-1: 0.25rem; --e-2: 0.5rem; --e-3: 0.75rem; --e-4: 1rem; --e-5: 1.5rem;
    --e-6: 2rem; --e-7: 3rem; --e-8: 4rem; --e-9: 6rem;

    /* Forma e profundidade */
    --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-pilula: 999px;
    --sombra-1: 0 1px 2px rgb(20 26 36 / 0.05), 0 2px 6px -2px rgb(20 26 36 / 0.08);
    --sombra-2: 0 2px 4px rgb(20 26 36 / 0.04), 0 10px 28px -8px rgb(29 58 95 / 0.16);

    --alvo: 44px;          /* alvo de toque mínimo */
    --largura: 72rem;      /* 1152 */
    --largura-texto: 42rem;
    --gutter: var(--e-4);
    --transicao: 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 40em) { :root { --gutter: var(--e-5); } }
@media (min-width: 64em) { :root { --gutter: var(--e-6); } }

/* 3. Base ------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--cor-linha-forte) transparent; }
body {
    margin: 0;
    background: var(--cor-fundo);
    color: var(--cor-texto);
    font-family: var(--fonte);
    font-size: var(--t-m);
    line-height: var(--entrelinha);
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
main { flex: 1 0 auto; outline: none; }
::selection { background: var(--cor-marca-suave); color: var(--cor-marca-forte); }
input, textarea { caret-color: var(--cor-marca); }

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    line-height: var(--entrelinha-titulo);
    letter-spacing: -0.015em;
    text-wrap: balance;
    font-style: normal;
}
h1 { font-size: var(--t-2xl); letter-spacing: -0.024em; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-l); letter-spacing: -0.012em; }
h4 { font-size: var(--t-m); letter-spacing: 0; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: var(--e-3); }
small { font-size: var(--t-s); }
strong, b { font-weight: 600; }
img, svg { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }

a { color: var(--cor-marca); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--cor-marca-forte); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cor-foco); outline-offset: 2px; border-radius: 3px; }

.num { font-variant-numeric: tabular-nums; }
.codigo { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; } /* NCM, dispositivo */
.texto-2 { color: var(--cor-texto-2); }
.texto-3 { color: var(--cor-texto-3); }
.texto-pequeno { font-size: var(--t-s); }
.medida { max-width: var(--largura-texto); }
.visualmente-oculto {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* 4. Layout ----------------------------------------------------------------------------------------- */
.largura { width: 100%; max-width: calc(var(--largura) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.conteudo-estreito { width: 100%; max-width: calc(var(--largura-texto) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.secao { padding-block: var(--e-7); }
.secao + .secao { border-top: 1px solid var(--cor-linha); }
@media (min-width: 64em) { .secao { padding-block: var(--e-8); } }
.secao-cabeca { display: grid; gap: var(--e-2); margin-bottom: var(--e-5); }
.secao-cabeca p { color: var(--cor-texto-2); max-width: var(--largura-texto); }
.pilha > * + * { margin-top: var(--e-4); }
.pilha-pequena > * + * { margin-top: var(--e-2); }
.linha-acoes { display: flex; flex-wrap: wrap; gap: var(--e-3); align-items: center; }

/* Pular para o conteúdo */
.pular {
    position: absolute; left: var(--e-3); top: -100px; z-index: 10;
    background: var(--cor-texto); color: #fff; padding: var(--e-3) var(--e-4); border-radius: var(--r-1);
    text-decoration: none; font-weight: 600;
}
.pular:focus { top: var(--e-3); color: #fff; }

/* 5. Marca ------------------------------------------------------------------------------------------ */
/* Símbolo provisório num único arquivo (public/assets/img/marca.svg); o nome é texto (APP_NAME). */
.marca { display: inline-flex; align-items: center; gap: 10px; color: var(--cor-texto); }
.marca-simbolo { width: 28px; height: 28px; flex: none; display: block; }
.marca-nome { font-weight: 650; font-size: 1.125rem; letter-spacing: -0.022em; color: var(--cor-marca); white-space: nowrap; }

/* Faixa fixa de aviso (toda página, acima do cabeçalho) */
.faixa-aviso { background: var(--cor-marca); color: #fff; font-size: var(--t-xs); line-height: 1.4; }
.faixa-aviso p { display: flex; gap: var(--e-2); align-items: center; padding-block: 7px; margin: 0; }
.faixa-aviso svg { width: 15px; height: 15px; flex: none; opacity: 0.85; }
.faixa-aviso strong { font-weight: 600; }

/* 6. Cabeçalho -------------------------------------------------------------------------------------- */
/* Celular: marca, "Menu" (um <details> que abre a lista embaixo do cabeçalho, sem JS) e a conta numa linha só.
   A partir de 62em o <details> some e a .topo-nav aparece na mesma linha. */
.topo { position: relative; border-bottom: 1px solid var(--cor-linha); background: var(--cor-fundo); }
.topo-faixa {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "marca menu conta";
    align-items: center;
    column-gap: var(--e-2);
}
.topo-faixa > .topo-nav { display: none; }
.topo-menu { grid-area: menu; }
.topo-menu > summary {
    display: inline-flex; align-items: center; gap: var(--e-2); min-height: var(--alvo); padding-inline: var(--e-3);
    border-radius: var(--r-2); color: var(--cor-texto); font-size: var(--t-s); font-weight: 600; cursor: pointer; list-style: none;
}
.topo-menu > summary::-webkit-details-marker { display: none; }
.topo-menu > summary::after {
    content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg); transition: transform var(--transicao);
}
@media (max-width: 30em) { /* até 480 px: marca, Menu e conta (inclusive "Minha conta") cabem numa linha */
    .topo-faixa { column-gap: var(--e-1); }
    .topo .marca { gap: 6px; }
    .topo .marca-nome { font-size: 1rem; }
    .topo-menu > summary { padding-inline: var(--e-2); }
    .topo-conta .botao { padding-inline: var(--e-3); }
}
@media (max-width: 22.49em) { /* abaixo de 360 px só o símbolo; o link da marca mantém o nome no aria-label */
    .topo .marca-nome { display: none; }
    main .botao { white-space: normal; text-align: center; } /* botão de texto longo quebra em vez de estourar */
}
.topo-menu[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.topo-menu > summary:hover { color: var(--cor-marca-forte); background: var(--cor-fundo-suave); }
.topo-menu > nav {
    position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
    background: var(--cor-fundo); border-bottom: 1px solid var(--cor-linha); box-shadow: var(--sombra-2);
}
.topo-menu ul { margin: 0 auto; padding-block: var(--e-2); list-style: none; }
.topo-menu li + li { border-top: 1px solid var(--cor-linha); }
.topo-menu a {
    display: flex; align-items: center; min-height: var(--alvo); padding-block: var(--e-2);
    color: var(--cor-texto); font-weight: 540; text-decoration: none;
}
.topo-menu a:hover { color: var(--cor-marca-forte); text-decoration: underline; }
.topo-menu a[aria-current="page"] { color: var(--cor-marca); font-weight: 640; }
.topo-marca { grid-area: marca; display: inline-flex; align-items: center; min-height: 60px; text-decoration: none; justify-self: start; }
.topo-marca:hover .marca-nome { color: var(--cor-marca-forte); }
.topo-conta { grid-area: conta; }
.topo-nav { grid-area: nav; margin-inline: calc(var(--e-3) * -1); }
.topo-nav ul { display: flex; gap: var(--e-1); margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.topo-nav a {
    display: inline-flex; align-items: center; min-height: var(--alvo); padding-inline: var(--e-3);
    color: var(--cor-texto-2); font-size: var(--t-s); font-weight: 540; text-decoration: none; white-space: nowrap;
    position: relative;
}
.topo-nav a:hover { color: var(--cor-texto); }
.topo-nav a[aria-current="page"] { color: var(--cor-texto); }
.topo-nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: var(--e-3); right: var(--e-3); bottom: 0; height: 2px;
    background: var(--cor-marca); border-radius: 2px;
}
@media (min-width: 62em) { /* a lista inteira só cabe ao lado da marca e da conta a partir de 992 px */
    .topo-faixa { grid-template-columns: auto 1fr auto; grid-template-areas: "marca nav conta"; column-gap: var(--e-4); }
    .topo-faixa > .topo-nav { display: block; }
    .topo-menu { display: none; }
    .topo-marca { min-height: 68px; }
    .topo-nav { margin-inline: var(--e-4) 0; }
    .topo-nav a { min-height: 68px; }
}

/* 7. Botões ----------------------------------------------------------------------------------------- */
.botao {
    --b-fundo: var(--cor-fundo); --b-texto: var(--cor-texto); --b-linha: var(--cor-linha-forte);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
    min-height: var(--alvo); padding: 0 var(--e-5);
    border: 1px solid var(--b-linha); border-radius: var(--r-2);
    background: var(--b-fundo); color: var(--b-texto);
    font: inherit; font-size: var(--t-m); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em;
    text-decoration: none; cursor: pointer; user-select: none; white-space: nowrap;
    transition: background-color var(--transicao), border-color var(--transicao), color var(--transicao), transform var(--transicao), box-shadow var(--transicao);
    -webkit-tap-highlight-color: transparent;
}
.botao:hover { text-decoration: none; }
.botao:active { transform: translateY(1px); }
.botao svg { width: 1.15em; height: 1.15em; }
.botao-primario { --b-fundo: var(--cor-marca); --b-texto: #fff; --b-linha: var(--cor-marca); box-shadow: 0 1px 2px rgb(19 40 66 / 0.28); }
.botao-primario:hover { --b-fundo: var(--cor-marca-forte); --b-linha: var(--cor-marca-forte); color: #fff; }
.botao-secundario:hover { --b-linha: var(--cor-texto-3); --b-fundo: var(--cor-fundo-suave); color: var(--cor-texto); }
.botao-fantasma { --b-linha: transparent; --b-texto: var(--cor-marca); padding-inline: var(--e-3); }
.botao-fantasma:hover { --b-fundo: var(--cor-marca-suave); color: var(--cor-marca-forte); }
.botao-perigo { --b-texto: var(--cor-erro); --b-linha: var(--cor-erro-linha); }
.botao-perigo:hover { --b-fundo: var(--cor-erro-suave); color: var(--cor-erro); }
.botao-grande { min-height: 56px; padding-inline: var(--e-6); font-size: var(--t-l); border-radius: var(--r-3); }
.botao-pequeno { min-height: var(--alvo); padding-inline: var(--e-4); font-size: var(--t-s); }
.botao-bloco { display: flex; width: 100%; }
.botao[disabled], .botao[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.botao[aria-busy="true"] { cursor: progress; }
.botao[aria-busy="true"]::after {
    content: ""; width: 1em; height: 1em; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; animation: giro 700ms linear infinite;
}
@keyframes giro { to { transform: rotate(360deg); } }
/* No celular o botão de 44 px de altura mínima já atende ao alvo de toque; o pequeno ganha área invisível */
.botao-pequeno { position: relative; }
.botao-pequeno::before { content: ""; position: absolute; inset: -2px 0; }

/* 8. Campos ----------------------------------------------------------------------------------------- */
.campo { display: grid; gap: var(--e-2); }
.campo + .campo { margin-top: var(--e-5); }
.campo-rotulo { font-weight: 600; font-size: var(--t-s); }
.campo-ajuda { color: var(--cor-texto-3); font-size: var(--t-s); }
.campo-erro { color: var(--cor-erro); font-size: var(--t-s); font-weight: 540; display: flex; gap: var(--e-2); align-items: flex-start; }
.entrada, .selecao, .area {
    width: 100%; min-height: 48px; padding: var(--e-3) var(--e-4);
    border: 1px solid var(--cor-linha-forte); border-radius: var(--r-2);
    background: var(--cor-fundo); color: var(--cor-texto);
    font: inherit; font-size: var(--t-m); /* 17 px evita zoom no iOS */
    transition: border-color var(--transicao), box-shadow var(--transicao);
}
.area { min-height: 120px; resize: vertical; line-height: var(--entrelinha); }
.entrada::placeholder, .area::placeholder { color: var(--cor-texto-3); opacity: 1; }
.entrada:hover, .selecao:hover, .area:hover { border-color: var(--cor-texto-3); }
.entrada:focus, .selecao:focus, .area:focus { outline: none; border-color: var(--cor-marca); box-shadow: 0 0 0 3px var(--cor-marca-suave); }
.entrada[aria-invalid="true"], .selecao[aria-invalid="true"], .area[aria-invalid="true"] { border-color: var(--cor-erro); }
.entrada[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--cor-erro-suave); }
.entrada:disabled { background: var(--cor-fundo-suave); color: var(--cor-texto-3); }
.selecao {
    appearance: none; padding-right: var(--e-7);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%234a524c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right var(--e-4) center; background-size: 16px;
}
.opcao { display: flex; gap: var(--e-3); align-items: flex-start; min-height: var(--alvo); padding-block: var(--e-2); cursor: pointer; }
.opcao input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--cor-marca); flex-shrink: 0; }
.mel { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; } /* honeypot */
.formulario { max-width: 28rem; }
.formulario .botao-bloco { margin-top: var(--e-6); }

/* 9. Cartão e painel -------------------------------------------------------------------------------- */
.cartao { background: var(--cor-fundo); border: 1px solid var(--cor-linha); border-radius: var(--r-3); padding: var(--e-5); }
.cartao-elevado { border-color: transparent; box-shadow: var(--sombra-2), 0 0 0 1px var(--cor-linha); }
.painel { background: var(--cor-fundo-suave); border-radius: var(--r-3); padding: var(--e-5); }
@media (min-width: 48em) { .cartao, .painel { padding: var(--e-6); } }
.cartao > * + *, .painel > * + * { margin-top: var(--e-3); }

/* 10. Avisos ---------------------------------------------------------------------------------------- */
.aviso {
    --a-cor: var(--cor-info); --a-fundo: var(--cor-info-suave); --a-linha: var(--cor-info-linha);
    display: flex; gap: var(--e-3); align-items: flex-start;
    padding: var(--e-3) var(--e-4); border: 1px solid var(--a-linha); border-radius: var(--r-2);
    background: var(--a-fundo); color: var(--cor-texto); font-size: var(--t-s);
}
.aviso::before {
    content: ""; flex: 0 0 8px; height: 8px; margin-top: 0.5em; border-radius: 50%; background: var(--a-cor);
}
.aviso strong { color: var(--a-cor); }
.aviso-sucesso { --a-cor: var(--cor-sucesso); --a-fundo: var(--cor-sucesso-suave); --a-linha: var(--cor-sucesso-linha); }
.aviso-erro { --a-cor: var(--cor-erro); --a-fundo: var(--cor-erro-suave); --a-linha: var(--cor-erro-linha); }
.aviso-alerta { --a-cor: var(--cor-alerta); --a-fundo: var(--cor-alerta-suave); --a-linha: var(--cor-alerta-linha); }
.avisos-topo { display: grid; gap: var(--e-2); padding-top: var(--e-4); }

/* 11. Selo (etiqueta curta) ------------------------------------------------------------------------- */
.selo {
    display: inline-flex; align-items: center; gap: var(--e-1); min-height: 24px; padding: 0 var(--e-2);
    border-radius: var(--r-1); background: var(--cor-fundo-forte); color: var(--cor-texto-2);
    font-size: var(--t-xs); font-weight: 600; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.selo-marca { background: var(--cor-marca-suave); color: var(--cor-marca-forte); }
.selo-sucesso { background: var(--cor-sucesso-suave); color: var(--cor-sucesso); }
.selo-erro { background: var(--cor-erro-suave); color: var(--cor-erro); }
.selo-alerta { background: var(--cor-alerta-suave); color: var(--cor-alerta); }

/* 12. Filete (assinatura: a linha dupla de total da contabilidade) ------------------------------------ */
.filete { height: 0; border: 0; border-top: 3px double var(--cor-destaque); margin: 0; }
.filete-curto { width: 64px; }

/* 13. Lista em linhas (substitui grade de cartões) ------------------------------------------------- */
.linhas { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--cor-linha); }
.linhas > li { border-bottom: 1px solid var(--cor-linha); }
.linha {
    display: grid; grid-template-columns: 1fr auto; gap: var(--e-1) var(--e-4); align-items: center;
    padding: var(--e-4) 0; min-height: 64px; color: inherit; text-decoration: none;
}
a.linha:hover .linha-titulo { color: var(--cor-marca-forte); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.linha-titulo { font-weight: 620; font-size: var(--t-m); }
.linha-texto { grid-column: 1; color: var(--cor-texto-2); font-size: var(--t-s); }
.linha-lado { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: var(--e-3); color: var(--cor-texto-3); font-size: var(--t-s); }
.linha-seta { width: 18px; height: 18px; color: var(--cor-texto-3); transition: transform var(--transicao), color var(--transicao); }
a.linha:hover .linha-seta { transform: translateX(3px); color: var(--cor-marca); }

/* 14. Tabela ---------------------------------------------------------------------------------------- */
.tabela-rolagem { overflow-x: auto; border: 1px solid var(--cor-linha); border-radius: var(--r-2); }
.tabela { width: 100%; border-collapse: collapse; font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.tabela th, .tabela td { padding: var(--e-3) var(--e-4); text-align: left; border-bottom: 1px solid var(--cor-linha); vertical-align: top; }
.tabela thead th { background: var(--cor-fundo-suave); color: var(--cor-texto-2); font-weight: 600; font-size: var(--t-xs); white-space: nowrap; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: var(--cor-fundo-suave); }
.tabela .direita { text-align: right; }

/* 15. Progresso ------------------------------------------------------------------------------------- */
.progresso { display: grid; gap: var(--e-2); }
.progresso-rotulo { display: flex; justify-content: space-between; gap: var(--e-3); font-size: var(--t-s); color: var(--cor-texto-2); font-variant-numeric: tabular-nums; }
.progresso-barra { width: 100%; height: 8px; border: 0; border-radius: var(--r-pilula); background: var(--cor-fundo-forte); overflow: hidden; appearance: none; display: block; }
.progresso-barra::-webkit-progress-bar { background: var(--cor-fundo-forte); border-radius: var(--r-pilula); }
.progresso-barra::-webkit-progress-value { background: var(--cor-marca); border-radius: var(--r-pilula); transition: width 300ms ease-out; }
.progresso-barra::-moz-progress-bar { background: var(--cor-marca); border-radius: var(--r-pilula); }
.progresso-erro .progresso-barra::-webkit-progress-value { background: var(--cor-erro); }
.progresso-erro .progresso-barra::-moz-progress-bar { background: var(--cor-erro); }

/* 17. Trilha (breadcrumb) e paginação --------------------------------------------------------------- */
.trilha ol { display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-2); margin: 0; padding: 0; list-style: none; font-size: var(--t-s); color: var(--cor-texto-3); }
.trilha li + li::before { content: "/"; margin-right: var(--e-2); color: var(--cor-linha-forte); }
.trilha a { color: var(--cor-texto-2); text-decoration: none; }
.trilha a:hover { color: var(--cor-marca-forte); text-decoration: underline; }
.paginacao { display: flex; flex-wrap: wrap; gap: var(--e-2); align-items: center; justify-content: center; margin-top: var(--e-6); }
.paginacao a, .paginacao span {
    display: inline-grid; place-items: center; min-width: var(--alvo); min-height: var(--alvo); padding-inline: var(--e-3);
    border-radius: var(--r-2); font-variant-numeric: tabular-nums; text-decoration: none; color: var(--cor-texto-2);
}
.paginacao a:hover { background: var(--cor-fundo-suave); color: var(--cor-texto); }
.paginacao [aria-current="page"] { background: var(--cor-texto); color: #fff; font-weight: 600; }

/* 18. Perguntas frequentes -------------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--cor-linha); }
.faq details { border-bottom: 1px solid var(--cor-linha); }
.faq summary {
    display: flex; justify-content: space-between; align-items: center; gap: var(--e-4);
    min-height: 60px; padding-block: var(--e-3); cursor: pointer; list-style: none; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: ""; flex: 0 0 12px; height: 12px; border-right: 2px solid var(--cor-texto-3); border-bottom: 2px solid var(--cor-texto-3);
    transform: translateY(-3px) rotate(45deg); transition: transform var(--transicao);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq summary:hover { color: var(--cor-marca-forte); }
.faq .faq-resposta { padding-bottom: var(--e-5); color: var(--cor-texto-2); max-width: var(--largura-texto); }

/* 20. Estado vazio ---------------------------------------------------------------------------------- */
.vazio { display: grid; gap: var(--e-3); justify-items: start; padding: var(--e-6) var(--e-5); border: 1px dashed var(--cor-linha-forte); border-radius: var(--r-3); color: var(--cor-texto-2); }
.vazio h3 { color: var(--cor-texto); font-size: var(--t-m); }

/* 21. Rodapé ---------------------------------------------------------------------------------------- */
.rodape { margin-top: var(--e-8); padding-block: var(--e-7) var(--e-6); border-top: 1px solid var(--cor-linha); background: var(--cor-fundo-suave); font-size: var(--t-s); color: var(--cor-texto-2); }
.rodape-grade { display: grid; gap: var(--e-6); }
.rodape-marca { display: grid; gap: var(--e-3); max-width: 22rem; }
.rodape-aviso { color: var(--cor-texto-2); }
.rodape-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-4); }
.rodape-nav ul { margin: 0; padding: 0; list-style: none; }
.rodape-nav a { display: inline-flex; align-items: center; min-height: var(--alvo); color: var(--cor-texto-2); text-decoration: none; }
.rodape-nav a:hover { color: var(--cor-marca-forte); text-decoration: underline; }
.rodape-fornecedor { grid-column: 1 / -1; padding-top: var(--e-5); border-top: 1px solid var(--cor-linha); color: var(--cor-texto-3); font-size: var(--t-xs); line-height: 1.6; }
.rodape-fornecedor a { color: var(--cor-texto-2); }
@media (min-width: 48em) {
    .rodape-grade { grid-template-columns: 1.3fr 1fr; align-items: start; }
}

/* 22. Página de erro -------------------------------------------------------------------------------- */
.erro { padding-block: var(--e-8) var(--e-7); display: grid; gap: var(--e-4); justify-items: start; }
.erro-codigo { font-size: var(--t-s); color: var(--cor-texto-3); font-variant-numeric: tabular-nums; }
.erro-busca { width: 100%; max-width: var(--largura-texto); }
.erro-texto { color: var(--cor-texto-2); max-width: 34rem; }
.erro-acoes { display: flex; flex-wrap: wrap; gap: var(--e-3); margin-top: var(--e-3); }

/* 23. Home ------------------------------------------------------------------------------------------ */
.abertura { padding-block: var(--e-6) var(--e-7); }
.abertura-grade { display: grid; gap: var(--e-7); align-items: center; }
.abertura-texto { display: grid; gap: var(--e-5); justify-items: start; }
.abertura h1 { font-size: var(--t-3xl); font-weight: 640; letter-spacing: -0.034em; line-height: 1.04; max-width: 14ch; }
.abertura-sub { font-size: var(--t-l); line-height: 1.45; color: var(--cor-texto-2); max-width: 32rem; }
.abertura-acao { display: grid; gap: var(--e-3); width: 100%; max-width: 26rem; }
.abertura-acao form { margin: 0; }
.abertura-fatos { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-5); margin: 0; padding: 0; list-style: none; color: var(--cor-texto-2); font-size: var(--t-s); }
.abertura-fatos li { display: flex; align-items: baseline; gap: var(--e-2); }
.abertura-fatos strong { color: var(--cor-texto); font-size: var(--t-m); font-variant-numeric: tabular-nums; }
.abertura-nota { color: var(--cor-texto-3); font-size: var(--t-xs); }
@media (min-width: 64em) {
    .abertura { padding-block: var(--e-8) var(--e-8); }
    .abertura-grade { grid-template-columns: 1.08fr 0.92fr; gap: var(--e-8); }
}

.dupla { display: grid; gap: var(--e-7); }
@media (min-width: 64em) { .dupla { grid-template-columns: 1fr 1fr; gap: var(--e-8); } }

/* 24. Página de componentes (/estilo, só dev) ------------------------------------------------------- */
.estilo-bloco { padding-block: var(--e-6); border-top: 1px solid var(--cor-linha); display: grid; gap: var(--e-4); }
.estilo-amostras { display: flex; flex-wrap: wrap; gap: var(--e-3); }
.estilo-cor { width: 120px; font-size: var(--t-xs); color: var(--cor-texto-2); }
.estilo-cor i { display: block; height: 56px; border-radius: var(--r-2); border: 1px solid var(--cor-linha); margin-bottom: var(--e-2); }
.estilo-cor-fundo-suave { background: var(--cor-fundo-suave); } .estilo-cor-fundo-forte { background: var(--cor-fundo-forte); }
.estilo-cor-linha { background: var(--cor-linha); } .estilo-cor-texto { background: var(--cor-texto); }
.estilo-cor-texto-2 { background: var(--cor-texto-2); } .estilo-cor-marca { background: var(--cor-marca); }
.estilo-cor-marca-suave { background: var(--cor-marca-suave); } .estilo-cor-destaque { background: var(--cor-destaque); }
.estilo-cor-apoio { background: var(--cor-apoio); } .estilo-cor-sucesso { background: var(--cor-sucesso); }
.estilo-cor-erro { background: var(--cor-erro); } .estilo-cor-alerta { background: var(--cor-alerta-suave); }
.estilo-cor-info { background: var(--cor-info-suave); }

/* 27. Busca grande (produto ou NCM) ------------------------------------------------------------------- */
/* <form class="busca" role="search" action="/busca"> rótulo, .busca-caixa (entrada + botão), exemplos */
.busca { display: grid; gap: var(--e-3); width: 100%; max-width: 40rem; }
.busca-rotulo { font-weight: 600; font-size: var(--t-s); }
.busca-caixa {
    display: grid; grid-template-columns: 1fr; gap: var(--e-2);
}
.busca-entrada {
    width: 100%; min-height: 60px; padding: var(--e-3) var(--e-4) var(--e-3) 48px;
    border: 1.5px solid var(--cor-linha-forte); border-radius: var(--r-3);
    background: var(--cor-fundo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23465163' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20 20'/%3E%3C/svg%3E") no-repeat 16px center / 20px;
    color: var(--cor-texto); font: inherit; font-size: var(--t-l);
    transition: border-color var(--transicao), box-shadow var(--transicao);
}
.busca-entrada::placeholder { color: var(--cor-texto-3); opacity: 1; }
.busca-entrada:hover { border-color: var(--cor-texto-3); }
.busca-entrada:focus { outline: none; border-color: var(--cor-marca); box-shadow: 0 0 0 4px var(--cor-marca-suave); }
.busca-caixa .botao { min-height: 60px; border-radius: var(--r-3); font-size: var(--t-l); }
@media (min-width: 40em) {
    .busca-caixa { grid-template-columns: 1fr auto; gap: 0; }
    .busca-entrada { border-radius: var(--r-3) 0 0 var(--r-3); border-right-width: 0; }
    .busca-caixa .botao { border-radius: 0 var(--r-3) var(--r-3) 0; padding-inline: var(--e-6); }
}
.busca-ajuda { color: var(--cor-texto-3); font-size: var(--t-s); }
.busca-exemplos { display: flex; flex-wrap: wrap; gap: var(--e-2); margin: 0; padding: 0; list-style: none; font-size: var(--t-s); }
.busca-exemplos a {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--e-3);
    border: 1px solid var(--cor-linha); border-radius: var(--r-pilula); color: var(--cor-texto-2); text-decoration: none;
    position: relative;
}
.busca-exemplos a::before { content: ""; position: absolute; inset: -4px 0; } /* alvo de 44 px */
.busca-exemplos a:hover { border-color: var(--cor-marca-linha); background: var(--cor-marca-suave); color: var(--cor-marca-forte); }

/* 28. Tabela de alíquotas ------------------------------------------------------------------------------ */
/* <table class="tabela tabela-aliquotas"> números à direita (.aliquota), ano escolhido (.e-atual), total em tfoot
   com a linha dupla de total. Percentuais sempre com vírgula e "%" no próprio texto. */
.tabela-aliquotas td.aliquota, .tabela-aliquotas th.aliquota { text-align: right; white-space: nowrap; }
.tabela-aliquotas td.aliquota { font-size: var(--t-m); }
.tabela-aliquotas tbody th { font-weight: 600; text-align: left; white-space: nowrap; }
.tabela-aliquotas tr.e-atual { background: var(--cor-marca-suave); }
.tabela-aliquotas tr.e-atual th::after { content: "ano escolhido"; display: block; font-size: var(--t-xs); font-weight: 500; color: var(--cor-marca); }
.tabela-aliquotas tbody tr.e-atual:hover { background: var(--cor-marca-suave); }
.tabela-aliquotas tfoot td, .tabela-aliquotas tfoot th {
    border-top: 3px double var(--cor-texto); border-bottom: 0; font-weight: 650; font-size: var(--t-m);
}
.tabela-aliquotas .nulo { color: var(--cor-texto-3); }
.tabela-aliquotas caption { caption-side: bottom; padding: var(--e-3) var(--e-4); text-align: left; color: var(--cor-texto-3); font-size: var(--t-xs); border-top: 1px solid var(--cor-linha); }

/* 29. Selo de tratamento tributário ------------------------------------------------------------------- */
/* <span class="selo-trat selo-trat-zero">Alíquota zero</span>. Classe = slug de regras.json (zero, reducao_60,
   reducao_30, regime_especifico, seletivo, cheia) ou "estimativa". O texto diz o tratamento; a cor só apoia. */
.selo-trat {
    --s-cor: var(--trat-cheia); --s-fundo: var(--trat-cheia-fundo);
    display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px 0 8px;
    border-radius: var(--r-1); background: var(--s-fundo); color: var(--s-cor);
    font-size: var(--t-xs); font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.selo-trat::before {   /* barrinha de carga: cheia = 100 %, 30 % = 70 %, 60 % = 40 %, zero = vazia */
    content: ""; flex: none; width: 14px; height: 6px; border-radius: 1px;
    border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor var(--s-carga, 100%), transparent 0);
}
.selo-trat-zero { --s-cor: var(--trat-zero); --s-fundo: var(--trat-zero-fundo); --s-carga: 0%; }
.selo-trat-reducao_60 { --s-cor: var(--trat-60); --s-fundo: var(--trat-60-fundo); --s-carga: 40%; }
.selo-trat-reducao_30 { --s-cor: var(--trat-30); --s-fundo: var(--trat-30-fundo); --s-carga: 70%; }
.selo-trat-regime_especifico { --s-cor: var(--trat-especifico); --s-fundo: var(--trat-especifico-fundo); }
.selo-trat-regime_especifico::before { background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 4px); }
.selo-trat-seletivo { --s-cor: var(--trat-seletivo); --s-fundo: var(--trat-seletivo-fundo); }
.selo-trat-seletivo::before { width: 18px; }
.selo-trat-cheia { --s-cor: var(--trat-cheia); --s-fundo: var(--trat-cheia-fundo); }
.selo-trat-estimativa { --s-cor: var(--cor-texto-2); --s-fundo: transparent; border: 1px dashed var(--cor-linha-forte); }
.selo-trat-estimativa::before { display: none; }
.selo-trat-grande { min-height: 34px; padding-inline: 12px 14px; font-size: var(--t-s); }

/* 30. Caixa de aviso legal e citação da fonte ---------------------------------------------------------- */
/* <aside class="aviso-legal"> título curto + texto; <p class="fonte-legal"> dispositivo · data · link. */
.aviso-legal {
    display: grid; grid-template-columns: 22px 1fr; gap: var(--e-1) var(--e-3);
    padding: var(--e-4) var(--e-5); border: 1px solid var(--cor-linha-forte); border-radius: var(--r-2);
    background: var(--cor-fundo-suave); color: var(--cor-texto-2); font-size: var(--t-s);
}
.aviso-legal > svg { grid-column: 1; grid-row: 1 / span 9; width: 20px; height: 20px; margin-top: 1px; color: var(--cor-marca); }
.aviso-legal > :not(svg) { grid-column: 2; }
.aviso-legal-titulo { color: var(--cor-texto); font-weight: 600; font-size: var(--t-s); }
.aviso-legal p + p { margin-top: var(--e-1); }
.fonte-legal { display: flex; flex-wrap: wrap; gap: 2px var(--e-2); color: var(--cor-texto-3); font-size: var(--t-xs); }
.fonte-legal > * + *::before { content: "·"; display: inline-block; margin-right: var(--e-2); color: var(--cor-texto-3); text-decoration: none; }
.fonte-legal a { color: var(--cor-texto-2); }

/* 31. Número de destaque (resultado de cálculo, preço) ------------------------------------------------- */
.valor { display: grid; gap: 2px; }
.valor-rotulo { color: var(--cor-texto-2); font-size: var(--t-s); }
.valor-numero { font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.valor-nota { color: var(--cor-texto-3); font-size: var(--t-xs); }

/* 25. Movimento: respeita quem pede menos ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* 26. Impressão ------------------------------------------------------------------------------------- */
@media print {
    .topo-nav, .topo-menu, .topo-conta, .rodape-nav, .pular, .botao { display: none !important; }
    body { font-size: 12pt; }
    a { color: inherit; text-decoration: none; }
}

/* Link "ver mais" no fim de um bloco */
.mais { margin-top: var(--e-5); }
.mais a { display: inline-flex; align-items: center; gap: var(--e-2); min-height: var(--alvo); font-weight: 600; text-decoration: none; }
.mais a:hover { text-decoration: underline; }
.mais svg { width: 18px; height: 18px; transition: transform var(--transicao); }
.mais a:hover svg { transform: translateX(3px); }

/* Linha no celular: o texto ocupa a largura toda; o lado fica ao lado do título */
@media (max-width: 47.99em) {
    .linha { align-items: start; }
    .linha-texto { grid-column: 1 / -1; }
    .linha-lado { grid-row: 1; }
}
.paginacao svg { width: 18px; height: 18px; }
.icone { width: 1.25em; height: 1.25em; }

/* Ajustes do QA de 29/11/2026: alvos de toque de 44 px em links de lista e região rolável com foco visível. */
.progresso-rotulo a, .documento-indice a { display: inline-flex; align-items: center; min-height: var(--alvo); }
.tabela-rolagem:focus-visible { outline: 2px solid var(--cor-marca); outline-offset: 2px; }
