    /* ── FORNECEDORES ─────────────────────────────────── */
    /* ══ Select customizado ═══════════════════════════════════════════════
       O <select> nativo não permite estilizar a lista aberta — fonte, cor,
       espaçamento e item marcado são do sistema operacional. O nativo continua
       no DOM (invisível) como fonte do valor e pra disparar 'change'; o que
       aparece é este botão + popover. Ver upgradeSelect() no script. */
    /* Sem declarar `display`: <div> já é block, e assim a regra `.co-select
       { display: none }` (definida antes desta) continua valendo no wrapper.
       Declarar aqui venceria por ordem e o select mobile vazaria no desktop. */
    .sel { position: relative; width: 100%; }
    .sel-native { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
    .sel-btn {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
      font: inherit; font-size: var(--fs-sm); text-align: left; background: var(--surface);
      color: var(--text); cursor: pointer; transition: border-color .14s, box-shadow .14s, background .14s;
      text-transform: none; letter-spacing: normal; font-weight: 400;
    }
    .sel-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
    .sel-btn:focus-visible, .sel.open .sel-btn {
      outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
    }
    .sel-btn .sel-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sel-btn .sel-val.ph { color: var(--text-mut); }
    .sel-btn svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-mut); transition: transform .18s; }
    .sel.open .sel-btn svg { transform: rotate(180deg); }
    .sel-pop {
      position: fixed; z-index: 400; min-width: 180px;
      background: var(--surface); border: 1px solid var(--border-strong);
      border-radius: 10px; box-shadow: 0 12px 28px rgba(23,26,43,.16), 0 2px 6px rgba(23,26,43,.06);
      padding: 5px; overflow: hidden; display: flex; flex-direction: column;
      animation: selIn .13s ease-out;
    }
    .sel-search { padding: 4px 4px 6px 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
    .sel-search input {
      width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--border);
      border-radius: 7px; font: inherit; font-size: var(--fs-sm); background: var(--surface-2); color: var(--text);
    }
    .sel-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
    /* A máscara evita que o último item visível fique cortado no meio parecendo
       defeito — o corte vira um esmaecido que indica que a lista continua. */
    .sel-list {
      overflow-y: auto; max-height: 264px;
      -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
              mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    }
    .sel-list:not(.rola) { -webkit-mask-image: none; mask-image: none; }
    .sel-opt {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      padding: 8px 10px; border-radius: 7px; font-size: var(--fs-sm); color: var(--text); line-height: 1.35;
      cursor: pointer; white-space: normal; overflow-wrap: anywhere;      /* opção longa quebra em linhas: cortar com reticências escondia justamente o fim ("Material › Acabamentos › Forro…") */
    }
    .sel-opt:hover, .sel-opt.cursor { background: var(--surface-2); }
    .sel-opt[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
    .sel-opt[aria-selected="true"]::after { content: '✓'; font-size: var(--fs-xs); }
    .sel-vazio { padding: 14px 10px; text-align: center; font-size: var(--fs-sm); color: var(--text-mut); }
    /* O wrapper herda as classes do <select> original. Aqui só neutralizamos o
       que era decoração de campo (borda/fundo/padding) — quem desenha é o
       botão. `display` fica de fora de propósito: é assim que `.co-select`
       continua escondendo a coisa toda no desktop. */
    .sel.co-select { padding: 0; border: 0; background: none; max-width: none; }
    .forn-grid .sel-btn, .me-grid .sel-btn { padding: 8px 10px; }
    .sel-inline { display: inline-block; width: auto; min-width: 150px; }

    /* ══ Balão (tooltip) ═══════════════════════════════════════════════════
       UM balão em todo o Link, com a mesma cara em todo lugar; a única variação é a do tema (--tip-* em 01-tokens e 13-escuro):
         · o curto, de `title`/`data-tip` (utilidades.js; o login tem uma cópia em login.js): preso ao elemento, com a seta. O texto
           sai do `title` no primeiro hover (senão o balão do navegador aparece junto); a quebra de linha do texto é respeitada;
         · o rico dos painéis (`data-dz`, dashboard.js, e `data-cdp-dica` do Controle de ponto): segue o mouse, sem seta, mais largo,
           montado com as peças .tip-cab/.tip-lin/… abaixo;
         · o cartão (`data-tip-html`, utilidades.js): preso ao elemento como o curto, mas com conteúdo montado (.tip-cartao; ex.: a nota da
           empresa, .tip-nota-*).
       O balão só aparece quando acrescenta algo: a regra de "não repetir o que está à vista" fica em utilidades.js. */
    .tip {
      position: fixed; z-index: 9000; left: 0; top: 0; max-width: 300px; padding: 8px 12px;
      background: var(--tip-bg); color: var(--text); border: 1px solid var(--tip-borda); border-radius: 10px; box-shadow: var(--tip-sombra);
      font-family: var(--sans); font-size: var(--fs-xs); line-height: 1.5; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere;
      pointer-events: none; opacity: 0; transform: translateY(4px) scale(.97);
      transform-origin: var(--tip-ax, 50%) 100%;   /* cresce a partir da seta */
      transition: opacity .16s var(--ease), transform .22s var(--ease);
    }
    .tip[data-lado="baixo"] { transform: translateY(-4px) scale(.97); transform-origin: var(--tip-ax, 50%) 0; }
    .tip.show, .tip[data-lado="baixo"].show { opacity: 1; transform: none; }
    /* a seta: um quadrado girado com a borda só nos dois lados que ficam para fora */
    .tip::after {
      content: ''; position: absolute; width: 8px; height: 8px; background: var(--tip-bg); border: solid var(--tip-borda); border-width: 0;
      transform: rotate(45deg); left: var(--tip-ax, 50%); margin-left: -5px;
    }
    .tip[data-lado="cima"]::after   { bottom: -5px; border-width: 0 1px 1px 0; }
    .tip[data-lado="baixo"]::after  { top: -5px; border-width: 1px 0 0 1px; }
    .tip[data-lado="direita"] { transform: translateX(-4px) scale(.97); transform-origin: 0 var(--tip-ay, 50%); }
    .tip[data-lado="direita"].show { transform: none; }
    .tip[data-lado="direita"]::after { left: -5px; top: var(--tip-ay, 50%); margin: -5px 0 0; border-width: 0 0 1px 1px; }
    .tip-rico::after { display: none; }
    /* o rico (painéis): título com um contexto, linhas "rótulo … valor", barra, comparação, "quem mais tem" e o rodapé do clique */
    .tip-rico { width: 310px; max-width: calc(100vw - 16px); padding: 12px 14px; font-size: var(--fs-sm); font-weight: 400; white-space: normal; }
    .tip-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
    .tip-cab b { font-weight: 700; }
    .tip-cab em { flex-basis: 100%; font-style: normal; font-size: var(--fs-xs); color: var(--text-mut); }
    .tip-lin, .tip-sub { display: flex; align-items: center; gap: 8px; }
    .tip-lin { margin-top: 6px; } .tip-lin span { flex: 1; }
    .tip-lin b, .tip-sub b { margin-left: auto; font-variant-numeric: tabular-nums; }
    .tip-sub { padding-left: 16px; margin-top: 3px; font-size: var(--fs-xs); color: var(--text-dim); }
    .tip-sub span { display: inline-flex; align-items: center; gap: 6px; }
    .tip-rico small { display: block; margin: 2px 0 0 16px; font-size: var(--fs-xs); color: var(--text-mut); }
    .tip-rico .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
    .tip-rico .k.trab { background: var(--border-strong); } .tip-rico .k.ext { background: var(--accent); } .tip-rico .k.comum { background: var(--accent); opacity: .6; } .tip-rico .k.esp { background: var(--accent-strong); }
    .tip-comp { margin: 8px 0 0 16px; font-size: var(--fs-xs); font-weight: 600; } .tip-comp.acima { color: var(--danger); } .tip-comp.abaixo { color: var(--ok); }
    .tip-desc { margin: 0 0 6px; font-size: var(--fs-xs); color: var(--text-dim); }
    .tip-bar { height: 5px; margin: 4px 0 2px 16px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
    .tip-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
    .tip-top { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
    .tip-top em { display: block; margin-bottom: 4px; font-style: normal; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-mut); }
    .tip-top div { display: flex; gap: 10px; padding: 2px 0; font-size: var(--fs-xs); }
    .tip-top span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tip-top b { font-variant-numeric: tabular-nums; }
    .tip-top .tip-desc { margin: 0; }
    .tip-rico .pill { font-size: var(--fs-xs); }
    .tip-datas { margin: 0; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; line-height: 1.5; }
    .tip-rod { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-mut); }
    /* o cartão (data-tip-html): mesma caixa e mesma seta do curto, mais largo e com o conteúdo em blocos */
    .tip-cartao { width: 300px; max-width: calc(100vw - 16px); padding: 0; font-weight: 400; white-space: normal; }
    /* nota da empresa (notaSelo, comentarios-unidade.js): rótulo, quem escreveu e quando, o texto em citação */
    .tip-nota-tit { display: flex; align-items: center; gap: 6px; padding: 9px 14px 8px; border-bottom: 1px solid var(--border); color: var(--text-mut); }
    .tip-nota-tit svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
    .tip-nota-tit b { font-weight: 600; color: var(--text-dim); }
    .tip-nota-tit span { margin-left: auto; font-variant-numeric: tabular-nums; }
    .tip-nota-cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; }
    .tip-nota-cab div { min-width: 0; }
    .tip-nota-cab b { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tip-nota-cab em { display: block; font-style: normal; color: var(--text-mut); font-variant-numeric: tabular-nums; }
    .tip-nota-txt {
      margin: 10px 14px 13px; padding: 1px 0 1px 10px; border-left: 2px solid var(--accent-border);
      font-size: var(--fs-sm); line-height: 1.5; color: var(--text-dim); white-space: pre-line;
      display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
    }
    @media (prefers-reduced-motion: reduce) { .tip, .tip[data-lado="direita"], .tip[data-lado="baixo"] { transition: none; transform: none; } }

    /* ══ Campo de data ════════════════════════════════════════════════════ */
    input[type="date"] {
      padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
      font: inherit; font-size: var(--fs-sm); background: var(--surface);
      color: var(--text); transition: border-color .14s, box-shadow .14s;
    }
    input[type="date"]:hover { border-color: var(--border-strong); }
    input[type="date"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
    input[type="date"]::-webkit-calendar-picker-indicator {
      cursor: pointer; opacity: .5; padding: 2px; border-radius: 4px; transition: opacity .14s, background .14s;
    }
    input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--accent-soft); }
    .data-br { font-size: var(--fs-sm); white-space: nowrap; }
    .data-br .dow { color: var(--text-mut); font-size: var(--fs-xs); margin-left: 6px; }

    /* Aba Cadastros > Modelo de e-mail — campos largos: parágrafo inteiro num
       input de uma linha é ilegível, por isso a aba é separada de Parâmetros. */
    .me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
    .me-grid label, .me-full { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); }
    .me-full { margin-top: 14px; }
    .me-grid input, .me-full textarea, .me-full input {
      padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
      font: inherit; font-size: var(--fs-sm); background: var(--surface); color: var(--text);
      text-transform: none; letter-spacing: normal; font-weight: 400; width: 100%; box-sizing: border-box;
    }
    .me-full textarea { resize: vertical; line-height: 1.5; min-height: 70px; }
    .me-hint { font-size: var(--fs-xs); font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--text-mut); }
    .me-hint code { font-family: var(--mono); font-size: var(--fs-xs); background: var(--surface-3); padding: 1px 4px; border-radius: 4px; }
    .me-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: #fff; color: #000; overflow-x: auto; }
    .forn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
    .forn-grid label { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); }
    .forn-grid input, .forn-grid select {
      padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
      font: inherit; font-size: var(--fs-sm); background: var(--surface); color: var(--text); text-transform: none; letter-spacing: normal; font-weight: 400;
    }
    .forn-grid input:focus, .forn-grid select:focus { outline: 2px solid var(--accent-border); outline-offset: -1px; }

    /* ── EXPORTAR ─────────────────────────────────────── */
    #exportar-modal .modal-box { max-width: 560px; }
    #exportar-modal .grid2 { display: grid; gap: 16px; }
    .drop { border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 22px 14px; text-align: center; cursor: pointer; position: relative; transition: border-color .15s, background .15s; }
    .drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
    .drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
    .drop .ic { font-size: var(--fs-xl); }
    .drop .t1 { font-size: var(--fs-sm); color: var(--text-dim); margin-top: 6px; }
    .drop .fn { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); margin-top: 4px; word-break: break-all; display: none; }

    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
      padding: 10px 16px; border-radius: 7px; border: none; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
    .btn:disabled { opacity: .45; cursor: not-allowed; }
    .btn.is-off { opacity: .5; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:not(:disabled):hover { background: var(--accent-strong); }
    .btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
    .btn-ghost:not(:disabled):hover { background: var(--surface-2); }
    .btn svg { width: 16px; height: 16px; }

    .note { padding: 10px 12px; border-radius: 7px; font-size: var(--fs-xs); margin-top: 12px; }
    .note.ok  { background: var(--ok-bg);     color: var(--ok); }
    .note.err { background: var(--danger-bg); color: var(--danger); }
    .note .mono { font-family: var(--mono); font-size: var(--fs-xs); opacity: .85; display: block; margin-top: 3px; word-break: break-all; }

    /* ── LOG DRAWER ───────────────────────────────────── */
    .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
      background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 30px rgba(15,23,42,.1);
      transform: translateX(100%); transition: transform .22s ease; z-index: 80; display: flex; flex-direction: column; }
    .drawer.open { transform: none; }
    .drawer header { height: var(--head-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 20px; border-bottom: 1px solid var(--border); }
    .drawer header h3 { font-size: var(--fs-md); }
    .log-filtros { flex-shrink: 0; padding: 12px 20px 4px; margin-bottom: 0; }
    .log-filtros .n { font-weight: 500; opacity: .7; }

    /* Linha do tempo: o ícone diz do que se trata (varredura, unidade,
       e-mail…), a cor diz como foi — mesma regra de cor do resto do app. */
    .log-body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
    .log-dia {
      position: sticky; top: 0; z-index: 1; background: var(--surface);
      padding: 14px 0 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-mut);
    }
    .log-item { position: relative; display: grid; grid-template-columns: 26px 1fr auto; column-gap: 12px; padding-bottom: 16px; }
    .log-item::before {
      content: ''; position: absolute; left: 12px; top: 30px; bottom: 2px;
      width: 2px; border-radius: 1px; background: var(--surface-3);
    }
    .log-grupo .log-item:last-child::before { display: none; }
    .log-ic {
      width: 26px; height: 26px; border-radius: 50%;
      display: grid; place-items: center;
      background: var(--surface-3); color: var(--text-dim);
    }
    .log-ic svg { width: 14px; height: 14px; }
    .log-item.ok .log-ic    { background: var(--ok-bg);     color: var(--ok); }
    .log-item.aviso .log-ic { background: var(--warn-bg);   color: var(--warn); }
    .log-item.erro .log-ic  { background: var(--danger-bg); color: var(--danger); }
    .log-txt { min-width: 0; padding-top: 3px; }
    .log-msg { font-size: var(--fs-sm); font-weight: 600; color: var(--text); line-height: 1.35; }
    .log-det { font-size: var(--fs-xs); color: var(--text-mut); line-height: 1.45; margin-top: 2px; word-break: break-word; }
    .log-item.erro .log-det { color: var(--danger); }
    .log-hora { padding-top: 4px; font-size: var(--fs-xs); color: var(--text-mut); white-space: nowrap; }
    .log-vazio { padding: 48px 0; text-align: center; font-size: var(--fs-sm); color: var(--text-mut); }
    .scrim { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
    .scrim.open { opacity: 1; pointer-events: auto; }

    /* ── Vários modelos de e-mail ─────────────────────────────────── */
    .me-modelos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
    .me-chip {
      display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
      font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim);
      background: var(--surface); border: 1px solid var(--border); transition: background .18s, border-color .18s, color .18s;
    }
    .me-chip:hover { border-color: var(--accent-border); color: var(--accent-strong); }
    .me-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
    .me-chip-pad { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); }
    .me-chip.on .me-chip-pad { background: rgba(255, 255, 255, .22); color: #fff; }
    .me-chip.novo { border-style: dashed; color: var(--accent-strong); }
    .me-chip svg { width: 13px; height: 13px; }
    .pd-modelo { display: inline-flex; align-items: center; gap: 6px; color: var(--text-mut); }
    .pd-modelo svg { width: 15px; height: 15px; flex: none; }
    .pd-modelo .sel { width: auto; min-width: 150px; max-width: 240px; }
    .pd-modelo .sel-btn { padding: 6px 10px; }

    /* Downloads gerados na hora (Exportar Excel, Baixar modelo): "Gerando…" enquanto o servidor monta o arquivo */
    .top-btn.gerando, .btn.gerando, .cd-b.gerando { pointer-events: none; cursor: progress; color: var(--accent-strong); border-color: var(--accent-border); background: var(--accent-soft); }
    .top-btn.pronto, .btn.pronto, .cd-b.pronto { pointer-events: none; color: var(--ok); border-color: var(--ok-fill); background: var(--ok-soft, var(--ok-bg)); }
    .exp-spin { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid var(--accent-border); border-top-color: var(--accent); animation: expGira .7s linear infinite; }
    .btn-mini .exp-spin { width: 11px; height: 11px; border-width: 2px; }
    .btn-mini.pronto svg { width: 13px; height: 13px; }
    @keyframes expGira { to { transform: rotate(360deg); } }

    /* ── NOTIFICAÇÕES ─────────────────────────────────── */
    /* Avisos compactos empilhados no rodapé, no centro da tela (ver notificacoes.js): é a faixa que quase nunca
       tem botão — os do painel lateral e dos cabeçalhos ficam nos cantos. Ícone na cor do tipo, detalhe cortado
       em 2 linhas, barra de tempo que pausa no hover. Clicar em qualquer ponto do aviso fecha; os mais antigos
       encolhem para só o título. */
    #toasts {
      position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 500;
      display: flex; flex-direction: column; align-items: center; gap: 8px;
      width: min(400px, calc(100vw - 24px));
      pointer-events: none;
    }
    .toast {
      --t-cor: var(--info-fill); --t-bg: var(--info-bg); --t-txt: var(--info);
      pointer-events: auto; position: relative; overflow: hidden; width: 100%; cursor: pointer;
      display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 11px; align-items: center;
      padding: 10px 8px 11px 10px;
      background: color-mix(in srgb, var(--surface) 94%, transparent);
      -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
      border: 1px solid color-mix(in srgb, var(--t-cor) 26%, var(--border)); border-radius: 16px;
      box-shadow: 0 16px 38px rgba(23, 26, 43, .2), 0 2px 8px rgba(23, 26, 43, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
      animation: toastIn .32s cubic-bezier(.2, 1.1, .3, 1);
      transition: transform .25s var(--ease), opacity .25s, box-shadow .25s;
    }
    .toast::before {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(100deg, color-mix(in srgb, var(--t-cor) 13%, transparent), transparent 55%);
    }
    .toast:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(23, 26, 43, .24), 0 2px 8px rgba(23, 26, 43, .1); }
    .toast.ok    { --t-cor: var(--ok-fill);     --t-bg: var(--ok-bg);     --t-txt: var(--ok); }
    .toast.aviso { --t-cor: var(--warn-fill);   --t-bg: var(--warn-bg);   --t-txt: var(--warn); }
    .toast.erro  { --t-cor: var(--danger-fill); --t-bg: var(--danger-bg); --t-txt: var(--danger); }
    .toast.saindo {
      animation: toastOut .24s ease-in forwards; pointer-events: none;
      height: 0 !important; margin-top: -8px; padding-block: 0 !important; border-width: 0; overflow: hidden;
      transition: height .24s ease, margin .24s ease, padding .24s ease, border-width .24s ease;
    }
    /* os mais antigos encolhem: só o título; o mouse em cima da pilha abre todos de novo */
    #toasts .toast:not(:last-child) { padding-block: 7px 8px; opacity: .92; }
    #toasts:not(:hover) .toast:not(:last-child) .toast-det, #toasts:not(:hover) .toast:not(:last-child) .toast-acao { display: none; }
    .toast-ic {
      position: relative; width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center;
      background: var(--t-cor); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--t-cor) 42%, transparent);
    }
    .toast-ic svg { width: 17px; height: 17px; }
    .toast-txt { position: relative; min-width: 0; }
    .toast-tit { display: flex; align-items: baseline; gap: 7px; font-size: var(--fs-sm); font-weight: 700; color: var(--text); line-height: 1.3; }
    .toast-tit > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .toast-n { font-size: 11px; font-weight: 700; color: var(--t-txt); background: var(--t-bg); padding: 0 6px; border-radius: 999px; flex-shrink: 0; }
    .toast-det {
      margin-top: 1px; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-dim); word-break: break-word;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .toast-acao {
      position: relative; font: inherit; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
      padding: 6px 11px; border-radius: 9px; cursor: pointer;
      border: 1px solid color-mix(in srgb, var(--t-cor) 45%, transparent); background: var(--t-bg); color: var(--t-txt);
      transition: background .15s, color .15s;
    }
    .toast-acao:hover { background: var(--t-cor); color: #fff; }
    .toast-x {
      position: relative; width: 24px; height: 24px; border-radius: 8px; border: none; background: none;
      display: grid; place-items: center; cursor: pointer; color: var(--text-mut); opacity: 0; transition: opacity .15s, background .15s;
    }
    .toast:hover .toast-x, .toast.erro .toast-x, .toast-x:focus-visible { opacity: 1; }
    .toast-x:hover { background: var(--surface-3); color: var(--text); }
    .toast-x svg { width: 13px; height: 13px; }
    .toast-tempo {
      position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
      background: var(--t-cor); opacity: .6; transform-origin: left;
      animation: toastTempo linear forwards;
    }
    .toast:hover .toast-tempo { animation-play-state: paused; }
    @keyframes toastIn    { from { opacity: 0; transform: translateY(18px) scale(.94); } }
    @keyframes toastOut   { to   { opacity: 0; transform: translateY(10px) scale(.96); } }
    @keyframes toastTempo { from { transform: scaleX(1); } to { transform: scaleX(0); } }
    @media (max-width: 640px) { #toasts { bottom: 12px; width: calc(100vw - 20px); } }

    /* ══ Controles do sistema no lugar dos do navegador ═════════════════════
       Barra de rolagem, caixa de marcação, campo numérico, calendário e caixa de
       confirmação. (Select e dica de mouse já tinham versão própria.) */
    @supports not selector(::-webkit-scrollbar) { * { scrollbar-color: var(--border-strong) transparent; } }
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
    ::-webkit-scrollbar-thumb:hover { background: var(--accent-border); background-clip: content-box; }
    ::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: content-box; }
    ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
    ::-webkit-scrollbar-corner { background: transparent; }

    input[type="checkbox"] {
      -webkit-appearance: none; appearance: none; flex: none; margin: 0; width: 18px; height: 18px; vertical-align: middle;
      display: inline-grid; place-content: center; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface);
      cursor: pointer; transition: background .14s, border-color .14s, box-shadow .14s;
    }
    input[type="checkbox"]::after {
      content: ""; width: 10px; height: 10px; background: #fff; transform: scale(0); transition: transform .14s;
      clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
    }
    input[type="checkbox"]:hover { border-color: var(--accent-border); }
    input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
    input[type="checkbox"]:checked::after { transform: scale(1); }
    input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
    input[type="checkbox"]:disabled { opacity: .5; cursor: default; }

    input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
    input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
    input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }

    .sel.dt { width: 100%; }
    .conf-data .sel.dt { width: auto; min-width: 150px; }
    .pl-data .sel.dt { flex: 1; min-width: 0; }
    .dt-btn svg { width: 15px; height: 15px; }
    .sel.open .dt-btn svg { transform: none; }
    .dt-pop { padding: 10px; gap: 6px; min-width: 252px; }
    .dt-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
    .dt-topo b { font-size: var(--fs-sm); }
    .dt-nav { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); cursor: pointer; }
    .dt-nav:hover { background: var(--accent-soft); color: var(--accent-strong); }
    .dt-nav svg { width: 14px; height: 14px; }
    .dt-sem, .dt-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
    .dt-sem span { font-size: 11px; font-weight: 700; color: var(--text-mut); padding: 2px 0; }
    .dt-dia { height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; transition: background .12s, color .12s; }
    .dt-dia:hover { background: var(--accent-soft); color: var(--accent-strong); }
    .dt-dia.hoje { box-shadow: inset 0 0 0 1px var(--accent-border); font-weight: 700; }
    .dt-dia.sel { background: var(--accent); color: #fff; font-weight: 700; }
    .dt-rod { display: flex; justify-content: space-between; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
    .dt-rod button { border: 0; background: transparent; color: var(--accent-strong); font: inherit; font-size: var(--fs-xs); font-weight: 700; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
    .dt-rod button:hover { background: var(--accent-soft); }

    .cf-overlay { z-index: 500; }
    .cf-box { max-width: 420px; }
    .cf-corpo { padding: 22px 22px 8px; }
    .cf-corpo h3 { margin: 0 0 8px; font-size: var(--fs-lg); }
    .cf-corpo p { margin: 0; white-space: pre-line; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-dim); }
    .cf-acoes { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }

    /* Link Assistant (IA da plataforma): botão provisório fixo no canto inferior direito. Semitransparente em repouso,
       100% ao passar o mouse ou receber foco. Ainda sem ação: quando o assistente existir, o clique abre o painel dele. */
    .link-assistant {
      position: fixed; right: 20px; bottom: 20px; z-index: 30;
      display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
      border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer;
      box-shadow: 0 6px 18px rgba(23, 26, 43, .22);
      opacity: .4; transition: opacity .2s var(--ease), transform .2s var(--ease);
    }
    .link-assistant svg { width: 22px; height: 22px; }
    html[data-assistente="0"] .link-assistant, html[data-assistente="0"] .la-painel, html[data-assistente="0"] .la-hist, html[data-assistente="0"] #la-veu { display: none; }     /* empresa que desligou o Link Assistant */
    .link-assistant:hover, .link-assistant:focus-visible { opacity: 1; transform: translateY(-2px); }
    .link-assistant:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
    @media (prefers-reduced-motion: reduce) { .link-assistant { transition: none; } .link-assistant:hover, .link-assistant:focus-visible { transform: none; } }

    /* Chat lateral do Link Assistant: reaproveita o painel lateral (.cd-painel) e ainda não tem função — só a conversa de boas-vindas
       e o campo desativado. Ao abrir, o botão flutuante some (o painel cobre o canto). */
    .la-corpo { gap: 14px; background: var(--bg); }
    .la-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-md); color: var(--text); }
    .la-msg svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
    .la-rodape { position: relative; }
    .la-sug { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 24px 12px; pointer-events: none; }
    .la-sug:empty { display: none; }
    .la-sug-tit { grid-column: 1 / -1; margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-mut); text-shadow: 0 0 6px var(--bg), 0 0 6px var(--bg); }
    .la-chip { pointer-events: auto; display: flex; align-items: flex-start; gap: 8px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--accent-border); border-radius: 14px; background: var(--surface); color: var(--accent); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-align: left; line-height: 1.35; cursor: pointer; box-shadow: 0 4px 14px rgba(23, 26, 43, .12); transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); animation: entra var(--mov-medio) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
    .la-chip svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
    .la-chip:hover { background: var(--accent-soft); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23, 26, 43, .16); }
    .la-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .la-esqueleto { pointer-events: none; border-color: var(--border); background: linear-gradient(100deg, var(--surface) 30%, var(--accent-soft) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: laBrilho 1.2s linear infinite; }
    @keyframes laBrilho { to { background-position: -300% 0; } }
    .la-msg.eu { align-self: flex-end; flex-direction: row-reverse; border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border-color: var(--accent-border); }
    @media (prefers-reduced-motion: reduce) { .la-chip, .la-esqueleto { animation: none; transition: none; } .la-chip:hover { transform: none; } }
    .la-pe { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 14px 24px 16px; border-top: 1px solid var(--border); }
    .la-pe .cd-b:disabled, .la-pe .cd-in:disabled { opacity: .55; cursor: not-allowed; }
    .la-pe.ocupado .cd-b { opacity: .55; pointer-events: none; }
    /* o modo é só o ícone, ao lado do campo e da mesma altura dele; o nome do modo vem no tooltip (title) */
    .la-modo { align-self: stretch; display: grid; place-items: center; width: 42px; padding: 0; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-dim); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
    .la-modo:hover, .la-modo[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
    .la-modo svg { width: 16px; height: 16px; }
    .la-hist-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
    .la-painel .cd-painel-cab .cd-ib + .cd-ib { margin-left: 0; }
    .la-modo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    /* anexos e mensagem de voz do chat */
    .la-pe { grid-template-columns: auto auto minmax(0, 1fr) auto; }
    .la-clip { align-self: stretch; display: grid; place-items: center; width: 42px; padding: 0; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-dim); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
    .la-clip svg { width: 16px; height: 16px; } .la-clip:hover, .la-clip:focus-visible { background: var(--accent-soft); color: var(--accent); } .la-clip:disabled { opacity: .55; cursor: not-allowed; }
    .la-anexos { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 24px 0; } .la-anexos[hidden] { display: none; }
    .la-anexo { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: var(--fs-xs); color: var(--text-dim); }
    .la-anexo svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent); } .la-anexo b { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); } .la-anexo small { color: var(--text-mut); white-space: nowrap; }
    .la-anexo button { display: grid; place-items: center; padding: 2px; border: 0; border-radius: 50%; background: none; color: var(--text-mut); cursor: pointer; } .la-anexo button:hover { background: var(--surface-3); color: var(--text); } .la-anexo button svg { width: 12px; height: 12px; color: inherit; }
    .la-msg.eu:has(.la-anexos-msg) { flex-direction: column; align-items: flex-end; }
    .la-msg.eu .la-anexos-msg { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .la-msg.eu .la-anexo { padding-right: 10px; background: var(--surface); }
    .la-voz { display: inline-flex; align-items: center; gap: 8px; } .la-voz svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
    .la-voz-ondas { display: inline-flex; align-items: center; gap: 2px; height: 22px; } .la-voz-ondas i { display: block; width: 3px; min-height: 2px; border-radius: 2px; background: var(--accent); opacity: .85; }
    .la-painel.arrastando::after { content: 'Solte para anexar (até 3 arquivos de 15 MB)'; position: absolute; inset: 12px; z-index: 30; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--accent-strong); font-size: var(--fs-md); font-weight: 600; pointer-events: none; }
    /* o microfone nasce em cima do Enviar quando o mouse chega nele (ou o foco); em tela de toque ele fica sempre ao lado */
    .la-enviar-w { position: relative; display: flex; align-items: stretch; }
    .la-enviar-w::before { content: ''; position: absolute; left: -10px; right: -10px; bottom: 100%; height: 64px; pointer-events: none; } .la-enviar-w:hover::before { pointer-events: auto; }
    .la-mic { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 5; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--accent-border); border-radius: 50%; background: var(--surface); color: var(--accent); cursor: pointer;
      box-shadow: 0 10px 24px rgba(23, 26, 43, .18); opacity: 0; transform: translateY(14px) scale(.55); pointer-events: none; transition: opacity .2s var(--ease), transform .35s cubic-bezier(.2, 1.4, .4, 1), background .2s var(--ease); }
    .la-mic svg { width: 20px; height: 20px; }
    .la-enviar-w:hover .la-mic, .la-enviar-w:focus-within .la-mic { opacity: 1; transform: none; pointer-events: auto; } .la-mic:hover, .la-mic:focus-visible { background: var(--accent-soft); outline: 0; box-shadow: 0 0 0 4px var(--accent-soft), 0 10px 24px rgba(23, 26, 43, .18); }
    @media (hover: none) { .la-enviar-w { gap: 8px; } .la-mic { position: static; opacity: 1; transform: none; pointer-events: auto; width: 42px; height: auto; border-radius: 10px; box-shadow: none; } }
    /* gravando: a barra de mensagem vira o gravador (onda ao vivo, bolinha e brilho que pulsam com a voz) */
    .la-pe.gravando > :not(.la-rec):not(.la-enviar-w) { display: none; } .la-pe.gravando .la-mic { display: none; }
    .la-pe.gravando .la-rec { grid-row: 1; } .la-pe.gravando .la-enviar-w { grid-column: 4; grid-row: 1; }
    .la-rec { --n: 0; position: relative; grid-column: 1 / 4; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; overflow: hidden; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--accent-soft);
      box-shadow: 0 0 calc(var(--n) * 26px) calc(var(--n) * 4px) color-mix(in srgb, var(--accent) 38%, transparent); } .la-rec[hidden] { display: none; }
    .la-rec canvas { flex: 1; min-width: 0; height: 34px; display: block; }
    .la-rec-ponto { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--danger-fill); transform: scale(calc(1 + var(--n) * .6)); box-shadow: 0 0 0 calc(var(--n) * 9px) color-mix(in srgb, var(--danger-fill) 30%, transparent); }
    .la-rec-tempo { min-width: 38px; text-align: right; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-dim); }
    .la-rec-dica { position: absolute; left: 64px; right: 70px; text-align: center; font-size: var(--fs-xs); color: var(--text-mut); pointer-events: none; transition: opacity .3s var(--ease); } .la-rec-dica.some { opacity: 0; }
    @media (prefers-reduced-motion: reduce) { .la-mic, .la-clip { transition: none; } .la-rec { box-shadow: none; } .la-rec-ponto { transform: none; box-shadow: none; } }
    /* menu de modos (igual ao do Claude Code): abre para cima, sobre as sugestões */
    .la-menu { position: absolute; left: 24px; right: 24px; bottom: 100%; z-index: 3; margin-bottom: -4px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 34px rgba(23, 26, 43, .2); animation: entra var(--mov-curto) var(--ease); }
    .la-menu[hidden] { display: none; }
    .la-menu-cab { padding: 6px 10px 8px; font-size: var(--fs-sm); color: var(--text-mut); }
    .la-modo-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease); }
    .la-modo-item > svg:first-child { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--text-mut); }
    .la-modo-item > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .la-modo-item b { font-size: var(--fs-md); font-weight: 600; }
    .la-modo-item small { font-size: var(--fs-sm); color: var(--text-mut); line-height: 1.35; }
    .la-modo-item > svg:last-child:not(:first-child) { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
    .la-modo-item:hover:not(:disabled), .la-modo-item:focus-visible { background: var(--accent-soft); outline: none; }
    .la-modo-item.ativo { background: var(--accent-soft); }
    .la-modo-item.ativo > svg:first-child { color: var(--accent); }
    .la-modo-item:disabled { opacity: .5; cursor: not-allowed; }
    /* cartão de aprovação de uma alteração que o agente deixou aguardando */
    .la-aprova { align-self: stretch; padding: 12px 14px; border: 1px solid var(--warn-fill); border-radius: 14px; background: var(--warn-bg); color: var(--text); font-size: var(--fs-md); animation: entra var(--mov-curto) var(--ease); }
    .la-aprova p { margin: 0 0 10px; white-space: pre-wrap; }
    .la-aprova-real { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--text-mut); font-size: var(--fs-sm); overflow-wrap: anywhere; }
    .la-aprova-real strong { color: var(--text); font-weight: 600; }
    .la-aprova.feito { border-color: var(--ok-fill); background: var(--ok-bg); } .la-aprova.recusado { border-color: var(--border); background: var(--surface); }
    .la-aprova.feito p, .la-aprova.recusado p { margin: 0; }
    .la-aprova-bt { display: flex; gap: 8px; }
    .la-msg p { white-space: pre-wrap; margin: 0; min-width: 0; }
    /* resposta do agente formatada (assistente-formato.js): título, listas, tabela, CNPJ em mono */
    .la-msg { position: relative; }
    .la-msg.eu, .la-msg.rica { padding-right: 36px; }
    .la-msg.rica { max-width: 100%; }
    .la-copiar { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-mut); cursor: pointer; opacity: 0; transition: opacity .2s var(--ease), background .2s var(--ease), color .2s var(--ease); }
    .la-copiar svg { width: 14px; height: 14px; }
    .la-msg:hover .la-copiar, .la-copiar:focus-visible { opacity: 1; }
    .la-copiar:hover { background: var(--accent-soft); color: var(--accent); }
    .la-copiar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
    @media (hover: none) { .la-copiar { opacity: 1; } }
    .la-tab-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
    .la-mini { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-dim); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
    .la-mini svg { width: 14px; height: 14px; }
    .la-mini:hover { background: var(--accent-soft); color: var(--accent); }
    .la-mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    /* histórico de sessões: segundo painel lateral, à esquerda do chat (sai de debaixo dele) */
    .cd-painel.la-hist { right: min(460px, 100vw); width: min(340px, calc(100vw - min(460px, 100vw))); z-index: 200; box-shadow: -10px 0 30px rgba(23, 26, 43, .12); }
    .la-hist .cd-painel-corpo { gap: 6px; padding: 14px; background: var(--bg); }
    .la-hist-vazio { margin: 24px 10px; text-align: center; font-size: var(--fs-md); color: var(--text-mut); }
    .la-hist-item { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .2s var(--ease), background .2s var(--ease); animation: entra var(--mov-curto) var(--ease) backwards; }
    .la-hist-item:hover { border-color: var(--accent-border); background: var(--accent-soft); }
    .la-hist-item.ativo { border-color: var(--accent); }
    .la-hist-abrir { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
    .la-hist-mod { width: 22px; height: 22px; margin-left: 10px; flex-shrink: 0; object-fit: contain; }   /* a marca do módulo a que a conversa pertence */
    .la-hist-abrir b { font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .la-hist-abrir small { font-size: var(--fs-sm); color: var(--text-mut); }
    .la-hist-abrir:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
    .la-hist-item .cd-ib { margin: 0 6px 0 0; }
    .la-hist-item .cd-ib.armado { background: var(--danger-bg); color: var(--danger); }
    @media (max-width: 860px) { .cd-painel.la-hist { right: 0; width: min(340px, 100vw); z-index: 202; } }
    .la-md { flex: 1; min-width: 0; font-size: var(--fs-md); line-height: 1.5; overflow-wrap: anywhere; }
    .la-md > :not(:first-child) { margin-top: 10px; }
    .la-md p { margin: 0; white-space: normal; }
    .la-md h4 { margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--text); }
    .la-md hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
    .la-md ul, .la-md ol { margin: 0; padding-left: 20px; } .la-md li + li { margin-top: 3px; }
    .la-md li::marker { color: var(--accent); }
    .la-md li > ul, .la-md li > ol { margin-top: 4px; }
    .la-md strong { font-weight: 700; }
    .la-md code, .la-cnpj { font-family: var(--mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
    .la-md code { padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
    .la-cnpj { white-space: nowrap; color: var(--text-dim); }
    .la-tab { overflow-x: auto; margin: 0 -4px; border: 1px solid var(--border); border-radius: 10px; }
    .la-tab table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
    .la-tab th { padding: 8px 10px; text-align: left; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-mut); background: var(--bg); white-space: nowrap; position: sticky; top: 0; }
    .la-tab td { padding: 7px 10px; border-top: 1px solid var(--border); vertical-align: top; }
    .la-tab tbody tr:hover td { background: var(--accent-soft); }
    .la-msg.pensando .la-md { display: flex; gap: 5px; align-items: center; height: 20px; }
    .la-msg.pensando .la-md > span { margin: 0; }                   /* anula o espaçamento entre blocos do .la-md: era ele que descia as bolinhas 2 e 3 */
    .la-msg.pensando .la-md span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .35; animation: laPensa 1s var(--ease) infinite; }
    .la-msg.pensando .la-md span:nth-child(2) { animation-delay: .15s; } .la-msg.pensando .la-md span:nth-child(3) { animation-delay: .3s; }
    @keyframes laPensa { 50% { opacity: 1; } }                      /* só pisca: bolinhas sempre na mesma linha */
    .la-msg.pensando { align-items: center; } .la-msg.pensando > svg { margin-top: 0; }
    @media (prefers-reduced-motion: reduce) { .la-menu, .la-aprova, .la-hist-item { animation: none; } .la-msg.pensando .la-md span { animation: none; opacity: .7; } .la-modo-item, .la-modo { transition: none; } }
    body.la-aberto .link-assistant { opacity: 0; pointer-events: none; }
    /* chat aberto: a página de trás não rola (o véu escurece, mas a roda do mouse atravessava); o scroll do chat e do histórico não escapa para ela */
    html:has(body.la-aberto) { overflow: hidden; scrollbar-gutter: stable; }
    .la-corpo, .la-hist-lista { overscroll-behavior: contain; }

    /* Fim de lista paginada: a sentinela que carrega mais linhas sozinha ao chegar perto da tela (sentinelaMais, lista-movimento.js).
       Nenhuma lista do Link tem botão "Carregar mais". */
    .mais-ao-rolar { display: flex; justify-content: center; padding: 14px 6px; color: var(--text-mut); font-size: var(--fs-xl); }
    .mais-ao-rolar[hidden] { display: none; }
    .mais-ao-rolar .icone { width: 1em; height: 1em; }

    /* Esqueleto de carregamento (esqueleto(), lista-movimento.js): a forma do que vai chegar, no lugar do texto "Carregando…".
       O brilho é o mesmo do assistente (laBrilho); com menos movimento ele fica parado (regra geral de 01-tokens.css). */
    .esq { display: flex; flex-direction: column; gap: 16px; animation: entra var(--mov-medio) var(--ease) backwards; }
    .esq i { display: block; border-radius: 14px; border: 1px solid var(--border);
      background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: laBrilho 1.4s linear infinite; }
    .esq-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
    .esq-kpi { height: 112px; }
    .esq-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
    .esq-bloco { height: 300px; }
    .esq-lista { gap: 8px; }
    .esq-lin { height: 52px; border-radius: 12px; }
    .esq-lin:nth-child(2n) { opacity: .8; } .esq-lin:nth-child(3n) { opacity: .6; }
