    /* ═══ Termos de uso e privacidade ═════════════════════════════════════════
       A página /termos (rotas_termos.py + termos-pagina.js), a janela do aceite que aparece por cima do sistema e do app de campo (termos.js e
       campo.js) e o lembrete curto do rodapé de toda tela. Tudo por tokens. O destaque ("o Link apoia a sua decisão") usa o
       tom de pendente (âmbar): é o que a pessoa precisa ler antes de tudo. Nada de controle nativo do navegador: a caixa de "li e concordo" é um botão.
       O texto é longo e jurídico: letra do tamanho do texto base, cor de leitura (não a de rótulo), seções numeradas e o rótulo que abre um
       parágrafo ("Para que:", "Onde ficam:") em negrito, para dar para passar o olho. */

    /* ── o texto (igual na página e na janela) ── */
    .tm-destaque { display: flex; gap: 14px; padding: 18px 20px; border-radius: 14px; background: var(--warn-soft); border: 1px solid var(--warn-bg); color: var(--text); }
    .tm-destaque > svg { flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px; color: var(--warn-fill); }
    .tm-destaque b { display: block; font-size: var(--fs-lg); color: var(--warn); margin-bottom: 6px; }
    .tm-destaque b:last-child { margin-bottom: 0; }      /* destaque só com o título (termos.py, DESTAQUE sem texto) */
    .tm-destaque p { font-size: var(--fs-md); line-height: 1.65; }
    /* o trecho grifado da caixa de aceite (a responsabilidade de quem aceita): negrito com um traço de marca-texto embaixo */
    .tm-grifo { font-weight: 700; color: var(--text); background: linear-gradient(transparent 58%, var(--warn-bg) 58%); padding: 0 2px; border-radius: 2px; }
    .tm-secao { margin-top: 28px; scroll-margin-top: 84px; }
    .tm-secao h2 { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; color: var(--text); letter-spacing: -.01em; margin-bottom: 4px; }
    .tm-num { flex-shrink: 0; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px;
      background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
    .tm-num svg { width: 13px; height: 13px; }
    .tm-secao p { font-size: var(--fs-md); line-height: 1.75; color: var(--text-dim); margin-top: 10px; }
    .tm-rot { color: var(--text); font-weight: 700; }

    /* ── a página /termos ── */
    html:has(.tm-pagina) { scroll-behavior: smooth; }
    /* height: auto — o body de 01-tokens tem altura fixa de 100%, e com ela a barra do topo (sticky) deixaria de grudar depois da 1ª tela */
    .tm-pagina { height: auto; min-height: 100%; background: var(--bg); color: var(--text); }
    .tm-topo { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px;
      background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
    .tm-marca { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: var(--fs-md); min-width: 0; }
    .tm-marca img { width: 32px; height: 32px; border-radius: 9px; }
    .tm-marca span { color: var(--text-mut); white-space: nowrap; }
    .tm-marca b { color: var(--text); }
    .tm-topo-voltar { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
      background: var(--surface); color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease); }
    .tm-topo-voltar:hover { border-color: var(--accent-border); color: var(--accent-strong); background: var(--accent-soft); }
    .tm-topo-voltar svg { width: 16px; height: 16px; }

    /* a página usa a largura toda da janela (sem faixa vazia dos lados), só com a margem de respiro */
    .tm-conteudo { padding: 36px 32px 64px; }
    .tm-capa { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 28px; animation: entra var(--mov-longo) var(--ease) both; }
    .tm-selo { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--accent); box-shadow: var(--shadow); }
    .tm-selo svg { width: 30px; height: 30px; }
    .tm-capa-texto { flex: 1; min-width: 240px; }
    .tm-capa h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
    .tm-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .tm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
      font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
    .tm-situacao { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; }
    .tm-situacao svg { width: 16px; height: 16px; flex-shrink: 0; }
    .tm-situacao.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-bg); }
    .tm-situacao.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-bg); }

    .tm-grade { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
    .tm-sumario { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
      animation: entra var(--mov-longo) var(--ease) both; animation-delay: .06s; }
    .tm-sumario-tit { padding: 2px 8px 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-mut); text-transform: uppercase; letter-spacing: .06em; }
    .tm-sumario a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; color: var(--text-dim); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; line-height: 1.35;
      transition: background .25s var(--ease), color .25s var(--ease); }
    .tm-sumario a .tm-num { min-width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); border-color: var(--border); color: var(--text-mut); transition: inherit; }
    .tm-sumario a:hover { background: var(--surface-2); color: var(--text); }
    .tm-sumario a.atual { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
    .tm-sumario a.atual .tm-num { background: var(--accent); border-color: var(--accent); color: var(--sobre-acento); }

    .tm-doc { min-width: 0; padding: 36px 44px 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
      animation: entra var(--mov-longo) var(--ease) both; animation-delay: .1s; }
    .tm-doc .tm-secao + .tm-secao { padding-top: 28px; border-top: 1px solid var(--border); }
    .tm-contato { display: flex; align-items: center; gap: 14px; margin-top: 32px; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-border); }
    .tm-contato > svg { flex-shrink: 0; width: 24px; height: 24px; color: var(--accent); }
    .tm-contato b { display: block; font-size: var(--fs-md); color: var(--text); }
    .tm-contato span { font-size: var(--fs-sm); color: var(--text-dim); }
    .tm-contato a { font-weight: 600; color: var(--accent-strong); }
    .tm-versoes ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
    .tm-versoes li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-dim); }
    .tm-versoes li b { color: var(--text); }
    .tm-versoes .tm-chip { padding: 2px 8px; }
    .tm-versoes .tm-chip.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-bg); }
    .tm-hash { font-size: var(--fs-xs); color: var(--text-mut); }      /* o começo da impressão digital do texto em vigor */
    .tm-hash code { font-family: var(--mono); }

    @media (max-width: 900px) {
      .tm-grade { grid-template-columns: minmax(0, 1fr); gap: 16px; }
      /* sem espaço ao lado: o sumário vira uma faixa de atalhos que rola de lado (só ela, a página não) */
      .tm-sumario { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 8px; gap: 6px; }
      .tm-sumario::-webkit-scrollbar { display: none; }
      .tm-sumario-tit { display: none; }
      .tm-sumario a { flex-shrink: 0; white-space: nowrap; }
    }
    @media (max-width: 640px) {
      .tm-marca span { display: none; }
      .tm-topo { padding: 12px 16px; }
      .tm-conteudo { padding: 24px 16px 48px; }
      .tm-capa { gap: 14px; }
      .tm-selo { width: 48px; height: 48px; border-radius: 14px; }
      .tm-capa h1 { font-size: var(--fs-xl); }
      .tm-doc { padding: 22px 18px 26px; border-radius: 14px; }
      .tm-destaque { padding: 14px 16px; }
    }
    @media print {
      .tm-topo, .tm-sumario { display: none; }
      .tm-pagina, .tm-doc { background: none; border: none; box-shadow: none; }
      .tm-grade { display: block; }
      .tm-doc { padding: 0; }
      .tm-secao { break-inside: avoid; }
    }

    /* ── a janela do aceite (por cima de tudo) ── */
    /* Aberta, a página de trás não rola (termos.js põe a classe no <html>) e fica desfocada atrás do véu. */
    html.tm-travado, html.tm-travado body { overflow: hidden; }
    .tm-veu { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: var(--veu);
      backdrop-filter: blur(8px) saturate(.9); -webkit-backdrop-filter: blur(8px) saturate(.9); overscroll-behavior: contain; animation: tmVeu .3s var(--ease); }
    @keyframes tmVeu { from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); } }
    .tm-janela { width: min(820px, 100%); max-height: min(90vh, 920px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
      background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 60px color-mix(in srgb, var(--text) 30%, transparent);
      animation: entra var(--mov-longo) var(--ease); }
    .tm-janela-cab { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 28px 16px; border-bottom: 1px solid var(--border); }
    .tm-janela-cab img { width: 40px; height: 40px; border-radius: 11px; }
    .tm-janela-cab h2 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
    .tm-janela-cab p { font-size: var(--fs-xs); color: var(--text-mut); margin-top: 2px; }
    /* quanto do texto já passou (termos.js): a barra corre na borda de baixo do cabeçalho */
    .tm-progresso { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--lido, 0));
      transition: transform .15s linear; }
    .tm-janela-corpo { overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px 28px; }
    .tm-janela-corpo .tm-secao { scroll-margin-top: 0; }
    .tm-janela-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 28px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
    .tm-janela-pe .tm-acoes { display: flex; gap: 8px; margin-left: auto; }
    .tm-aviso { flex: 1; min-width: 220px; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-mut); }
    .tm-erro { width: 100%; font-size: var(--fs-sm); color: var(--danger); }
    .tm-erro:empty { display: none; }
    /* "Li e concordo": um botão no papel de caixa de marcar (sem o controle nativo do navegador), num cartão que se acende ao marcar */
    .tm-ck { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
      font: inherit; font-size: var(--fs-sm); line-height: 1.5; color: var(--text); text-align: left; cursor: pointer; transition: border-color .25s var(--ease), background .25s var(--ease); }
    .tm-ck-caixa { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface);
      display: grid; place-items: center; color: transparent; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
    .tm-ck-caixa svg { width: 12px; height: 12px; }
    .tm-ck:not(:disabled):hover { border-color: var(--accent-border); }
    .tm-ck:not(:disabled):hover .tm-ck-caixa { border-color: var(--accent); }
    /* travada até o texto ir até o fim (termos.js): apagada, sem reagir ao mouse, com a dica embaixo */
    .tm-ck:disabled { cursor: not-allowed; color: var(--text-mut); background: var(--surface-2); }
    .tm-ck:disabled .tm-ck-caixa { background: var(--surface-3); border-style: dashed; }
    .tm-ck-dica { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--warn); }
    .tm-ck:not(:disabled) .tm-ck-dica { display: none; }
    .tm-janela-corpo:focus { outline: none; }               /* o foco vai ao texto ao abrir (para rolar pelo teclado); a barra de leitura já mostra onde está */
    .tm-ck[aria-checked="true"] { border-color: var(--accent-border); background: var(--accent-soft); }
    .tm-ck[aria-checked="true"] .tm-ck-caixa { background: var(--accent); border-color: var(--accent); color: var(--sobre-acento); }
    .tm-ck:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    @media (max-width: 640px) {
      .tm-veu { padding: 10px; }
      .tm-janela { max-height: calc(100dvh - 20px); border-radius: 16px; }
      .tm-janela-cab { padding: 16px 18px 12px; }
      .tm-janela-corpo { padding: 18px; }
      .tm-janela-pe { padding: 14px 18px 16px; }
      .tm-janela-pe .tm-acoes { width: 100%; margin-left: 0; }
      .tm-janela-pe .tm-acoes .cd-b { flex: 1; justify-content: center; }
    }

    /* ── o lembrete do rodapé de toda tela ── */
    .tm-rodape { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 10px 16px 12px; font-size: var(--fs-xs); color: var(--text-mut); text-align: center; }
    .tm-rodape a { font-weight: 600; }
    /* o rodapé é o último filho do .main e traz os 12 px até o fim da página: o .main fica sem recuo embaixo, senão os dois espaços somam
       e a faixa fica grossa. Não use margem negativa para "entrar" no recuo: nas abas de lista + ficha o .main já não tem recuo
       (25-lista-ficha.css), o rodapé vazava para fora do .shell e, no fim da rolagem, empurrava o menu lateral e a lista para cima */
    .main:has(> .tm-rodape) { padding-bottom: 0; }
    /* aba curta: o rodapé desce até o pé da janela em vez de colar no último elemento (o .main já ocupa a altura toda, ver .shell) */
    .main:has(> .tm-rodape) { display: flex; flex-direction: column; }
    .main > .tm-rodape { margin-top: auto; }
    /* aba de lista + ficha (25-lista-ficha.css define --rodape-recuo): a lista desce até o pé da janela por cima da faixa do rodapé, então o
       texto fica centrado só na área da ficha */
    .main > .tm-rodape { padding-left: calc(var(--rodape-recuo, 0px) + 16px); }
    @media (prefers-reduced-motion: reduce) {
      html:has(.tm-pagina) { scroll-behavior: auto; }
      .tm-veu, .tm-janela, .tm-capa, .tm-sumario, .tm-doc { animation: none; }
      .tm-progresso, .tm-sumario a, .tm-ck, .tm-ck-caixa { transition: none; }
    }

    /* o item "Termos de uso" do menu da conta é um link (abre a página numa aba nova): a mesma cara dos outros itens */
    .usr-menu a.acoes-item { color: var(--text); text-decoration: none; }
