/*
  fluent.css: sistema visual do Espelhos (UI-00).
  Fluent 2, tema claro, feito à mão. Sem framework, sem build.
  Única fonte de cor, tipo, espaço e componente das telas. As tarefas de front-end
  só consomem estas classes e tokens; valor solto em outro CSS é bug.
  Referência visual de cada componente e estado: /static/design.html.

  Ícones: sprite /static/icones.svg (Fluent UI System Icons, MIT).
    <svg class="ic" aria-hidden="true"><use href="/static/icones.svg#folder"/></svg>
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  /* Cores da especificação (Fluent 2, tema claro) */
  --fundo-app: #faf9f8;
  --superficie: #ffffff;
  --superficie-2: #f5f5f5;        /* hover de linha e de botão sutil */
  --superficie-3: #e0e0e0;        /* pressionado */
  --traco: #e0e0e0;               /* divisórias */
  --traco-suave: #f0f0f0;         /* separador entre linhas da lista */
  --traco-forte: #d1d1d1;         /* bordas de campo e botão */
  --traco-forte-hover: #c7c7c7;
  --traco-forte-ativo: #b3b3b3;
  --traco-acessivel: #616161;     /* borda inferior de campo (Fluent strokeAccessible) */
  --texto: #242424;
  --texto-2: #616161;
  --texto-3: #707070;
  --icone: #424242;
  --marca: #0f6cbd;
  --marca-hover: #115ea3;
  --marca-ativo: #0c3b5e;
  --selecao: #ebf3fc;
  --selecao-hover: #cfe4fa;
  --selecao-borda: #0f6cbd;
  --sucesso: #107c10;
  --sucesso-texto: #0e700e;
  --sucesso-fundo: #f1faf1;
  --sucesso-borda: #9fd89f;
  --atencao: #bc4b09;
  --atencao-texto: #8a3707;
  --atencao-fundo: #fff4ce;
  --atencao-borda: #f2d58a;
  --erro: #c50f1f;
  --erro-hover: #b10e1c;
  --erro-ativo: #960b18;
  --erro-texto: #b10e1c;
  --erro-fundo: #fdf3f4;
  --erro-borda: #eeacb2;
  --info-fundo: #fafafa;
  --info-borda: #e0e0e0;
  --neutro: #616161;
  --neutro-fundo: #f0f0f0;
  --desab-fundo: #f0f0f0;
  --desab-traco: #e0e0e0;
  --desab-texto: #bdbdbd;
  --trilha-progresso: #e6e6e6;
  --sobreposicao: rgba(0, 0, 0, .4);
  --tipo-pdf: #c43e1c;            /* ícone de PDF, como no OneDrive */
  --tipo-imagem: #038387;         /* ícone de foto */
  --foco: #000000;

  /* Tipografia (rampa Fluent 2) */
  --fonte: "Segoe UI", "Segoe UI Web (West European)", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --t-caption: 400 12px/16px var(--fonte);
  --t-caption-forte: 600 12px/16px var(--fonte);
  --t-body: 400 14px/20px var(--fonte);
  --t-body-forte: 600 14px/20px var(--fonte);
  --t-subtitulo: 600 16px/22px var(--fonte);
  --t-titulo: 600 20px/28px var(--fonte);
  --t-titulo-grande: 600 28px/36px var(--fonte);

  /* Espaço (base 4 px) */
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 20px; --e-6: 24px; --e-8: 32px;
  --alt-linha: 36px;
  --alt-comandos: 44px;
  --alt-app: 48px;
  --alt-controle: 32px;
  --alt-controle-p: 24px;
  --recuo-arvore: 20px;
  --larg-arvore: 240px;
  --larg-detalhes: 320px;
  --larg-dialogo: 480px;

  /* Forma */
  --raio-p: 2px;
  --raio: 4px;
  --raio-g: 8px;
  --raio-pilula: 999px;
  --sombra-2: 0 1px 2px rgba(0,0,0,.14), 0 0 2px rgba(0,0,0,.12);
  --sombra-4: 0 2px 4px rgba(0,0,0,.14), 0 0 2px rgba(0,0,0,.12);
  --sombra-8: 0 4px 8px rgba(0,0,0,.14), 0 0 2px rgba(0,0,0,.12);
  --sombra-16: 0 8px 16px rgba(0,0,0,.14), 0 0 2px rgba(0,0,0,.12);

  /* Movimento: só em resposta a ação */
  --dur-menu: 100ms;
  --dur-painel: 200ms;
  --curva-entrada: cubic-bezier(0.1, 0.9, 0.2, 1);   /* Fluent curveDecelerateMid */
  --curva-saida: cubic-bezier(0.7, 0, 1, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-menu: 0ms; --dur-painel: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; }
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: var(--t-body);
  color: var(--texto);
  background: var(--fundo-app);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
ul[role], ol[role] { list-style: none; padding: 0; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }

.num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.reticencias { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

a, .link {
  color: var(--marca); text-decoration: none; cursor: pointer;
  background: none; border: 0; padding: 0; border-radius: var(--raio-p);
}
a:hover, .link:hover { color: var(--marca-hover); text-decoration: underline; }
a:active, .link:active { color: var(--marca-ativo); }

/* Rampa tipográfica */
.t-caption { font: var(--t-caption); }
.t-caption-forte { font: var(--t-caption-forte); }
.t-body { font: var(--t-body); }
.t-body-forte { font: var(--t-body-forte); }
.t-subtitulo { font: var(--t-subtitulo); }
.t-titulo { font: var(--t-titulo); }
.t-titulo-grande { font: var(--t-titulo-grande); }
.t-2 { color: var(--texto-2); }
.t-3 { color: var(--texto-3); }

/* Ícones (20 px por padrão, cor do texto) */
.ic { width: 20px; height: 20px; flex: none; fill: currentColor; display: inline-block; vertical-align: middle; }
.ic-12 { width: 12px; height: 12px; }
.ic-16 { width: 16px; height: 16px; }
.ic-24 { width: 24px; height: 24px; }
.ic-48 { width: 48px; height: 48px; }
.ic-pdf { color: var(--tipo-pdf); }
.ic-imagem { color: var(--tipo-imagem); }
.ic-marca { color: var(--marca); }

.divisor-v { width: 1px; height: 20px; background: var(--traco); flex: none; margin: 0 var(--e-1); }
.divisor-h { height: 1px; background: var(--traco); border: 0; margin: var(--e-2) 0; }
.espaco { flex: 1 1 auto; }

/* ==========================================================================
   3. Botões
   .btn (padrão), .btn-primario, .btn-sutil, .btn-perigo, .btn-perigo-solido
   Modificadores: .btn-icone (só ícone), .btn-pequeno (24 px)
   Estados: :hover, :active, :focus-visible, :disabled / [aria-disabled="true"], [aria-pressed="true"]
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--alt-controle); min-width: 96px; padding: 0 12px;
  font: var(--t-body-forte); white-space: nowrap;
  color: var(--texto); background: var(--superficie);
  border: 1px solid var(--traco-forte); border-radius: var(--raio);
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background-color var(--dur-menu), border-color var(--dur-menu), color var(--dur-menu);
}
.btn .ic { color: inherit; }
.btn:hover { background: var(--superficie-2); border-color: var(--traco-forte-hover); text-decoration: none; color: var(--texto); }
.btn:active { background: var(--superficie-3); border-color: var(--traco-forte-ativo); }
.btn[aria-pressed="true"], .btn[aria-expanded="true"] { background: var(--superficie-3); border-color: var(--traco-forte-ativo); }

.btn-primario { color: #fff; background: var(--marca); border-color: transparent; }
.btn-primario:hover { color: #fff; background: var(--marca-hover); border-color: transparent; }
.btn-primario:active, .btn-primario[aria-expanded="true"] { color: #fff; background: var(--marca-ativo); border-color: transparent; }

.btn-sutil { background: transparent; border-color: transparent; }
.btn-sutil .ic { color: var(--icone); }
.btn-sutil:hover { background: var(--superficie-2); border-color: transparent; }
.btn-sutil:hover .ic { color: var(--marca); }
.btn-sutil:active, .btn-sutil[aria-expanded="true"] { background: var(--superficie-3); border-color: transparent; }
.btn-sutil:active .ic { color: var(--marca-ativo); }

/* Ação destrutiva fora de diálogo: texto vermelho sobre fundo claro */
.btn-perigo { color: var(--erro); }
.btn-perigo .ic { color: var(--erro); }
.btn-perigo:hover { color: var(--erro-hover); background: var(--erro-fundo); border-color: var(--erro-borda); }
.btn-perigo:active { color: var(--erro-ativo); background: #f9e1e3; border-color: var(--erro); }
/* Confirmação destrutiva no diálogo: vermelho sólido */
.btn-perigo-solido { color: #fff; background: var(--erro); border-color: transparent; }
.btn-perigo-solido:hover { color: #fff; background: var(--erro-hover); border-color: transparent; }
.btn-perigo-solido:active { color: #fff; background: var(--erro-ativo); border-color: transparent; }

.btn-icone { min-width: 0; width: var(--alt-controle); padding: 0; }
.btn-pequeno { height: var(--alt-controle-p); min-width: 64px; padding: 0 8px; font: var(--t-caption-forte); gap: 4px; }
.btn-pequeno.btn-icone { width: var(--alt-controle-p); min-width: 0; padding: 0; }
.btn-pequeno .ic { width: 16px; height: 16px; }

.btn:disabled, .btn[aria-disabled="true"],
.btn:disabled:hover, .btn[aria-disabled="true"]:hover {
  color: var(--desab-texto); background: var(--desab-fundo); border-color: var(--desab-traco); cursor: not-allowed;
}
.btn-sutil:disabled, .btn-sutil[aria-disabled="true"],
.btn-sutil:disabled:hover, .btn-sutil[aria-disabled="true"]:hover { background: transparent; border-color: transparent; }
.btn:disabled .ic, .btn[aria-disabled="true"] .ic { color: var(--desab-texto); }

/* ==========================================================================
   4. Barra do app (48 px, cor da marca, como o cabeçalho do Microsoft 365)
   ========================================================================== */
.barra-app {
  display: flex; align-items: center; gap: var(--e-2);
  height: var(--alt-app); padding: 0 var(--e-2) 0 var(--e-4);
  background: var(--marca); color: #fff; flex: none;
}
.barra-app :focus-visible { outline-color: #fff; }
.app-marca { display: inline-flex; align-items: center; gap: var(--e-2); font: var(--t-subtitulo); color: #fff; white-space: nowrap; }
.app-marca .ic { width: 24px; height: 24px; }
.barra-app .divisor-v { background: rgba(255,255,255,.4); margin: 0 var(--e-2); }
.barra-app .btn-sutil, .barra-app .btn-sutil .ic { color: #fff; }
.barra-app .btn-sutil:hover { background: rgba(255,255,255,.14); }
.barra-app .btn-sutil:hover .ic { color: #fff; }
.barra-app .btn-sutil:active { background: rgba(0,0,0,.18); }

/* Trilha (breadcrumb): serve na barra do app e em fundo claro */
.trilha { display: flex; align-items: center; min-width: 0; list-style: none; margin: 0; padding: 0; }
.trilha li { display: flex; align-items: center; min-width: 0; }
.trilha-item {
  display: inline-flex; align-items: center; height: var(--alt-controle); padding: 0 6px;
  border: 0; border-radius: var(--raio); background: transparent;
  color: var(--texto-2); font: var(--t-body); cursor: pointer; white-space: nowrap; text-decoration: none;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis;
}
.trilha-item:hover { background: var(--superficie-2); color: var(--texto); text-decoration: none; }
.trilha-item:active { background: var(--superficie-3); }
.trilha-item[aria-current="page"] { font: var(--t-body-forte); color: var(--texto); cursor: default; background: transparent; }
.trilha-sep { color: var(--texto-2); width: 16px; height: 16px; flex: none; }
.barra-app .trilha-item { color: rgba(255,255,255,.88); }
.barra-app .trilha-item:hover { color: #fff; background: rgba(255,255,255,.14); }
.barra-app .trilha-item:active { background: rgba(0,0,0,.18); }
.barra-app .trilha-item[aria-current="page"] { color: #fff; background: transparent; }
.barra-app .trilha-sep { color: rgba(255,255,255,.75); }

/* ==========================================================================
   5. Barra de comandos (44 px) e menu suspenso
   ========================================================================== */
.barra-comandos {
  display: flex; align-items: center; gap: 2px;
  height: var(--alt-comandos); padding: 0 var(--e-2);
  background: var(--superficie); border-bottom: 1px solid var(--traco); flex: none;
}
.cmd {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--alt-controle); padding: 0 8px;
  font: var(--t-body); color: var(--texto); white-space: nowrap;
  background: transparent; border: 1px solid transparent; border-radius: var(--raio);
  cursor: pointer; user-select: none;
  transition: background-color var(--dur-menu);
}
.cmd > .ic { color: var(--marca); }
.cmd .cmd-seta { width: 12px; height: 12px; color: var(--texto-2); margin-left: 2px; }
.cmd:hover { background: var(--superficie-2); }
.cmd:hover > .ic { color: var(--marca-hover); }
.cmd:active, .cmd[aria-expanded="true"], .cmd[aria-pressed="true"] { background: var(--superficie-3); }
.cmd:active > .ic { color: var(--marca-ativo); }
.cmd:disabled, .cmd[aria-disabled="true"] { color: var(--desab-texto); background: transparent; cursor: not-allowed; }
.cmd:disabled > .ic, .cmd[aria-disabled="true"] > .ic, .cmd:disabled .cmd-seta { color: var(--desab-texto); }
.cmd-icone { width: var(--alt-controle); padding: 0; justify-content: center; }

.ancora-menu { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 200px; max-width: 320px; padding: 4px;
  background: var(--superficie); border: 1px solid transparent; border-radius: var(--raio);
  box-shadow: var(--sombra-4);
  display: flex; flex-direction: column; gap: 2px;
  animation: menu-entra var(--dur-menu) var(--curva-entrada);
}
.menu-direita { left: auto; right: 0; }
@keyframes menu-entra { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 8px;
  height: var(--alt-controle); padding: 0 8px; width: 100%;
  font: var(--t-body); color: var(--texto); text-align: left; white-space: nowrap;
  background: transparent; border: 0; border-radius: var(--raio); cursor: pointer;
}
.menu-item > .ic { color: var(--icone); }
.menu-item:hover, .menu-item.ativo { background: var(--superficie-2); }
.menu-item:hover > .ic { color: var(--marca); }
.menu-item:active { background: var(--superficie-3); }
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item:disabled, .menu-item[aria-disabled="true"] { color: var(--desab-texto); background: transparent; cursor: not-allowed; }
.menu-item:disabled > .ic, .menu-item[aria-disabled="true"] > .ic { color: var(--desab-texto); }
.menu-rotulo { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.menu-atalho { margin-left: var(--e-6); font: var(--t-caption); color: var(--texto-2); }
.menu-item:disabled .menu-atalho { color: var(--desab-texto); }
.menu-divisor { height: 1px; background: var(--traco); margin: 2px -4px; border: 0; }
.menu-titulo { font: var(--t-caption-forte); color: var(--texto-2); padding: 6px 8px 2px; }

/* ==========================================================================
   6. Casca da aplicação: barra do app, barra de comandos, três colunas
   ========================================================================== */
.casca { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; background: var(--fundo-app); }
.casca-corpo {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-template-columns: var(--larg-arvore) minmax(0, 1fr) var(--larg-detalhes);
}
.casca-corpo.sem-detalhes { grid-template-columns: var(--larg-arvore) minmax(0, 1fr); }
.painel-navegacao {
  min-height: 0; overflow: auto; background: var(--fundo-app);
  border-right: 1px solid var(--traco); display: flex; flex-direction: column;
}
.painel-conteudo { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--superficie); }
.cabecalho-conteudo { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-4) var(--e-5) var(--e-3); flex: none; }
.cabecalho-conteudo .t-titulo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secao-titulo { font: var(--t-caption-forte); color: var(--texto-2); padding: var(--e-3) var(--e-4) var(--e-1); }
/* Cabeçalho do painel esquerdo ("Comarcas", "Páginas") com ação opcional à direita */
.navegacao-cabecalho {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e-2);
  min-height: 40px; padding: var(--e-2) var(--e-2) 0 var(--e-4);
  font: var(--t-caption-forte); color: var(--texto-2);
}
.navegacao-cabecalho > .num, .navegacao-cabecalho > .t-caption { font-weight: 400; padding-right: var(--e-2); }

/* ==========================================================================
   7. Árvore (role="tree"): comarcas > varas
   Marcação: li[role=treeitem][aria-level][aria-expanded][aria-selected] > .arvore-linha + ul[role=group]
   Nível visual por --nivel (0, 1, 2) no li.
   ========================================================================== */
.arvore { list-style: none; margin: 0; padding: 4px 0; }
.arvore ul { list-style: none; margin: 0; padding: 0; }
.arvore [role="treeitem"], .arvore [role="option"] { display: block; }
.arvore-linha {
  position: relative; display: flex; align-items: center; gap: 4px;
  height: var(--alt-controle); margin: 1px 4px; border-radius: var(--raio);
  padding-left: calc(4px + var(--nivel, 0) * var(--recuo-arvore)); padding-right: 8px;
  color: var(--texto); cursor: pointer; user-select: none;
}
.arvore-linha:hover { background: var(--superficie-2); }
.arvore-linha:active { background: var(--superficie-3); }
.arvore-chevron {
  width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center;
  color: var(--texto-2); border-radius: var(--raio-p);
}
.arvore-chevron .ic { width: 16px; height: 16px; transition: transform var(--dur-menu) var(--curva-entrada); }
[aria-expanded="true"] > .arvore-linha .arvore-chevron .ic { transform: rotate(90deg); }
.arvore-chevron.vazio { visibility: hidden; }
.arvore-linha > .ic { color: var(--icone); }
.arvore-rotulo { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.arvore-contagem { font: var(--t-caption); color: var(--texto-2); font-variant-numeric: tabular-nums; }
[aria-expanded="false"] > [role="group"] { display: none; }

[aria-selected="true"] > .arvore-linha { background: var(--selecao); font-weight: 600; }
[aria-selected="true"] > .arvore-linha:hover { background: var(--selecao-hover); }
[aria-selected="true"] > .arvore-linha > .ic { color: var(--marca); }
[aria-selected="true"] > .arvore-linha::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 2px; background: var(--selecao-borda);
}
.arvore [role="treeitem"]:focus-visible, .arvore [role="option"]:focus-visible { outline: none; }
.arvore [role="treeitem"]:focus-visible > .arvore-linha,
.arvore [role="option"]:focus-visible > .arvore-linha { outline: 2px solid var(--foco); outline-offset: -2px; }
[aria-disabled="true"] > .arvore-linha { color: var(--desab-texto); cursor: not-allowed; background: transparent; }
[aria-disabled="true"] > .arvore-linha .ic { color: var(--desab-texto); }

/* Ponto de status (8 px), para listas compactas; sempre acompanhado de texto ou rótulo acessível */
.ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--neutro); }
.ponto-sucesso { background: var(--sucesso); }
.ponto-atencao { background: var(--atencao); }
.ponto-erro { background: var(--erro); }
.ponto-progresso { background: conic-gradient(var(--marca) var(--pct, 50%), transparent 0); box-shadow: inset 0 0 0 1.5px var(--marca); }
.ponto-fila { background: transparent; box-shadow: inset 0 0 0 1.5px var(--neutro); }

/* Contador (pendências) */
.contador {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--raio-pilula);
  font: var(--t-caption-forte); font-variant-numeric: tabular-nums;
  background: var(--neutro-fundo); color: var(--texto-2);
}
.contador-atencao { background: var(--atencao-fundo); color: var(--atencao-texto); }
.contador-zero { background: transparent; color: var(--texto-3); font-weight: 400; }

/* ==========================================================================
   8. Lista (role="grid"), comportamento do OneDrive
   <div class="lista-rolagem"><table class="lista" role="grid">...</table></div>
   Linha: tr[aria-selected]. Caixa de seleção aparece no hover, fica quando marcada.
   ========================================================================== */
.lista-rolagem { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; }
.lista { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font: var(--t-body); }
.lista thead th {
  position: sticky; top: 0; z-index: 2;
  height: var(--alt-linha); padding: 0; text-align: left; font-weight: 400;
  background: var(--superficie); border-bottom: 1px solid var(--traco); color: var(--texto-2);
}
.lista-ordenar {
  display: flex; align-items: center; gap: 4px; width: 100%; height: calc(var(--alt-linha) - 1px);
  padding: 0 8px; background: transparent; border: 0; border-radius: 0; text-align: inherit;
  color: inherit; font: var(--t-body); cursor: pointer; white-space: nowrap;
}
.lista-ordenar:hover { background: var(--superficie-2); color: var(--texto); }
.lista-ordenar:active { background: var(--superficie-3); }
.lista-ordenar:focus-visible { outline-offset: -2px; }
.lista-ordenar .ic { width: 16px; height: 16px; color: var(--texto); }
.lista th[aria-sort="ascending"] .lista-ordenar, .lista th[aria-sort="descending"] .lista-ordenar { color: var(--texto); font-weight: 600; }
.lista .direita, .lista .direita .lista-ordenar { text-align: right; justify-content: flex-end; }

.lista tbody td {
  height: var(--alt-linha); padding: 0 8px;
  border-bottom: 1px solid var(--traco-suave); background: var(--superficie);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lista tbody tr { cursor: default; }
.lista tbody tr:hover td { background: var(--superficie-2); }
.lista tbody tr:active td { background: var(--superficie-3); }
.lista tbody tr[aria-selected="true"] td { background: var(--selecao); }
.lista tbody tr[aria-selected="true"]:hover td { background: var(--selecao-hover); }
.lista tbody tr:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.lista tbody tr[aria-disabled="true"] td,
.lista tbody tr[aria-disabled="true"] .nome,
.lista tbody tr[aria-disabled="true"] .celula-nome > .ic { color: var(--desab-texto); }
.lista td.num, .lista .num { font-variant-numeric: tabular-nums; }
.lista .col-selecao { width: 40px; padding: 0; text-align: center; }
.lista .col-selecao .caixa-selecao { opacity: 0; transition: opacity var(--dur-menu); }
.lista tr:hover .col-selecao .caixa-selecao,
.lista tr:focus-within .col-selecao .caixa-selecao,
.lista tr:focus-visible .col-selecao .caixa-selecao,
.lista tr[aria-selected="true"] .col-selecao .caixa-selecao,
.lista .caixa-selecao:checked,
.lista .caixa-selecao:indeterminate,
.lista.modo-selecao .col-selecao .caixa-selecao { opacity: 1; }

.celula-nome { display: flex; align-items: center; gap: 8px; min-width: 0; }
.celula-nome .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--texto); }
.celula-nome .nome:hover { text-decoration: underline; color: var(--texto); cursor: pointer; }
.lista-acoes { margin-left: auto; opacity: 0; flex: none; }
.lista tr:hover .lista-acoes, .lista tr:focus-within .lista-acoes, .lista tr[aria-selected="true"] .lista-acoes { opacity: 1; }

/* Caixa de seleção (16 px, Fluent Checkbox) */
.caixa-selecao {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 16px; height: 16px; border: 1px solid var(--traco-acessivel); border-radius: var(--raio-p);
  background: var(--superficie) center / 12px 12px no-repeat; cursor: pointer; vertical-align: middle;
}
.caixa-selecao:hover { border-color: var(--texto); }
.caixa-selecao:checked {
  background-color: var(--marca); border-color: var(--marca);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M9.76 3.2a.75.75 0 0 1 .04 1.06l-4.25 4.5a.75.75 0 0 1-1.08.02l-2.25-2.25a.75.75 0 0 1 1.06-1.06l1.7 1.7 3.72-3.93a.75.75 0 0 1 1.06-.04Z'/%3E%3C/svg%3E");
}
.caixa-selecao:checked:hover { background-color: var(--marca-hover); border-color: var(--marca-hover); }
.caixa-selecao:indeterminate { border-color: var(--marca); background-image: none; box-shadow: inset 0 0 0 3px var(--superficie), inset 0 0 0 8px var(--marca); }
.caixa-selecao:disabled { border-color: var(--desab-traco); background-color: var(--desab-fundo); cursor: not-allowed; }
.caixa-selecao:checked:disabled { background-color: var(--desab-traco); border-color: var(--desab-traco); }
.caixa {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--alt-controle);
  padding: 0 4px; font: var(--t-body); cursor: pointer; border-radius: var(--raio); user-select: none;
}
.caixa:has(.caixa-selecao:disabled) { color: var(--desab-texto); cursor: not-allowed; }

/* ==========================================================================
   9. Painel de detalhes (320 px, à direita)
   ========================================================================== */
.painel-detalhes {
  width: var(--larg-detalhes); min-height: 0; display: flex; flex-direction: column;
  background: var(--superficie); border-left: 1px solid var(--traco);
}
.casca-corpo > .painel-detalhes { width: auto; }
.painel-detalhes.entrando { animation: painel-entra var(--dur-painel) var(--curva-entrada); }
@keyframes painel-entra { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.detalhes-cabecalho { display: flex; align-items: flex-start; gap: var(--e-2); padding: var(--e-4) var(--e-3) var(--e-3) var(--e-5); flex: none; }
.detalhes-cabecalho > .ic { width: 24px; height: 24px; margin-top: -1px; }
.detalhes-titulo { flex: 1 1 auto; min-width: 0; font: var(--t-subtitulo); overflow-wrap: anywhere; }
.detalhes-cabecalho .btn-icone { margin-top: -5px; }
.detalhes-corpo { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 var(--e-5) var(--e-4); display: flex; flex-direction: column; gap: var(--e-4); }
.detalhes-secao { display: flex; flex-direction: column; gap: var(--e-2); }
.detalhes-secao > h3 { font: var(--t-body-forte); }
.pares { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px var(--e-3); font: var(--t-body); }
.pares dt { color: var(--texto-2); }
.pares dd { color: var(--texto); margin: 0; overflow-wrap: anywhere; }
.detalhes-rodape { display: flex; flex-wrap: wrap; gap: var(--e-2); padding: var(--e-3) var(--e-5) var(--e-4); border-top: 1px solid var(--traco); flex: none; }
.detalhes-rodape > .btn { flex: 1 1 0; min-width: 0; }
.detalhes-rodape > .largura-total, .detalhes-rodape > p { flex: 1 1 100%; }

/* ==========================================================================
   10. Selo de status: ponto + texto (cor nunca é o único sinal)
   .selo-sucesso (concluída, ok) .selo-progresso (lendo, --pct) .selo-fila (na fila)
   .selo-atencao (conferir dígito, conferir leitura) .selo-erro (falhou)
   .selo-neutro (sem caixa, descartado)
   ========================================================================== */
.selo {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  height: 20px; padding: 0 8px 0 6px; border-radius: var(--raio-pilula);
  font: var(--t-caption-forte); white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--neutro-fundo); color: var(--texto-2);
}
.selo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--neutro); flex: none; }
.selo-sucesso { background: var(--sucesso-fundo); color: var(--sucesso-texto); }
.selo-sucesso::before { background: var(--sucesso); }
.selo-atencao { background: var(--atencao-fundo); color: var(--atencao-texto); }
.selo-atencao::before { background: var(--atencao); }
.selo-erro { background: var(--erro-fundo); color: var(--erro-texto); }
.selo-erro::before { background: var(--erro); }
.selo-progresso { background: var(--selecao); color: var(--marca-hover); }
.selo-progresso::before {
  background: conic-gradient(var(--marca) var(--pct, 50%), transparent 0);
  box-shadow: inset 0 0 0 1.5px var(--marca);
}
.selo-fila::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--neutro); }
.selo-neutro::before { background: var(--texto-3); }
.selo-riscado::before { background: linear-gradient(135deg, transparent 42%, var(--texto-3) 42%, var(--texto-3) 58%, transparent 58%); box-shadow: inset 0 0 0 1.5px var(--texto-3); }
/* Descartado: selo cheio, para não se confundir com "sem caixa" (neutro) */
.selo-descartado { background: var(--texto-3); color: #fff; }
.selo-descartado::before { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
.selo-descartado.selo-riscado::before { background: linear-gradient(135deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%); box-shadow: inset 0 0 0 1.5px #fff; }

/* ==========================================================================
   11. Barra de progresso (4 px)
   ========================================================================== */
.progresso { display: flex; align-items: center; gap: var(--e-2); min-width: 0; }
.barra-progresso {
  position: relative; flex: 1 1 auto; height: 4px; min-width: 48px;
  background: var(--trilha-progresso); border-radius: 2px; overflow: hidden;
}
.barra-progresso > span { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: var(--marca); border-radius: 2px; transition: width var(--dur-painel) linear; }
.barra-progresso.indeterminada > span { width: 33%; animation: progresso-vai 1.6s linear infinite; }
@keyframes progresso-vai { from { left: -33%; } to { left: 100%; } }
.barra-progresso.erro > span { background: var(--erro); }
.barra-progresso.concluida > span { background: var(--sucesso); }
.progresso-texto { font: var(--t-caption); color: var(--texto-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   12. Campos: .campo > .campo-rotulo + .entrada (input/select) + .campo-mensagem
   ========================================================================== */
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo-rotulo { font: var(--t-caption-forte); color: var(--texto); }
.campo-rotulo .obrigatorio { color: var(--erro); margin-left: 2px; }
.entrada {
  height: var(--alt-controle); width: 100%; min-width: 0; padding: 0 10px;
  font: var(--t-body); color: var(--texto); background: var(--superficie);
  border: 1px solid var(--traco-forte); border-bottom-color: var(--traco-acessivel); border-radius: var(--raio);
  transition: border-color var(--dur-menu), box-shadow var(--dur-menu);
}
.entrada::placeholder { color: var(--texto-3); opacity: 1; }
.entrada:hover { border-color: var(--traco-forte-hover); border-bottom-color: #575757; }
.entrada:active { border-color: var(--traco-forte-ativo); border-bottom-color: #4a4a4a; }
/* Foco de campo: traço inferior de 2 px na cor da marca (Fluent Input) */
.entrada:focus, .entrada:focus-visible { outline: none; border-bottom-color: var(--marca); box-shadow: inset 0 -1px 0 var(--marca); }
.entrada:disabled { color: var(--desab-texto); background: var(--superficie); border-color: var(--desab-traco); cursor: not-allowed; }
.entrada[aria-invalid="true"] { border-color: var(--erro); }
.entrada[aria-invalid="true"]:focus { border-bottom-color: var(--erro); box-shadow: inset 0 -1px 0 var(--erro); }
.entrada.num { font-variant-numeric: tabular-nums; }
select.entrada {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--superficie) no-repeat right 8px center / 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23616161' d='M15.85 7.65a.5.5 0 0 1 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16a.5.5 0 0 1 .7 0Z'/%3E%3C/svg%3E");
}
.entrada-com-icone { position: relative; display: flex; align-items: center; }
.entrada-com-icone > .ic { position: absolute; left: 8px; width: 16px; height: 16px; color: var(--texto-2); pointer-events: none; }
.entrada-com-icone > .entrada { padding-left: 30px; }
.campo-mensagem { display: flex; align-items: flex-start; gap: 4px; font: var(--t-caption); color: var(--texto-2); }
.campo-mensagem .ic { width: 12px; height: 12px; margin-top: 2px; }
.campo-mensagem.erro { color: var(--erro-texto); }
.campo-mensagem.erro .ic { color: var(--erro); }
.linha-campos { display: grid; gap: var(--e-3); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* ==========================================================================
   13. Diálogo
   Com <dialog class="dialogo"> e showModal(): Esc fecha e o foco fica preso (nativo).
   Sem <dialog>: .sobreposicao > .dialogo[role=dialog][aria-modal=true] + JS de foco.
   ========================================================================== */
.sobreposicao { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--e-4); background: var(--sobreposicao); animation: sobrepor var(--dur-painel) var(--curva-entrada); }
dialog.dialogo::backdrop { background: var(--sobreposicao); animation: sobrepor var(--dur-painel) var(--curva-entrada); }
@keyframes sobrepor { from { opacity: 0; } to { opacity: 1; } }
.dialogo {
  width: var(--larg-dialogo); max-width: calc(100vw - 32px); max-height: calc(100vh - 48px);
  margin: auto; padding: var(--e-6); overflow: auto;
  display: flex; flex-direction: column; gap: var(--e-2);
  color: var(--texto); background: var(--superficie);
  border: 1px solid transparent; border-radius: var(--raio-g); box-shadow: var(--sombra-16);
  animation: dialogo-entra var(--dur-painel) var(--curva-entrada);
}
@keyframes dialogo-entra { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.dialogo-cabecalho { display: flex; align-items: flex-start; gap: var(--e-2); }
.dialogo-titulo { flex: 1 1 auto; font: var(--t-titulo); }
.dialogo-cabecalho .btn-icone { margin: -2px -6px 0 0; }
.dialogo-corpo { display: flex; flex-direction: column; gap: var(--e-4); font: var(--t-body); padding-top: var(--e-1); }
.dialogo-rodape { display: flex; justify-content: flex-end; gap: var(--e-2); margin-top: var(--e-4); }

/* ==========================================================================
   14. Zona de soltar, estado vazio, aviso (MessageBar), atalho
   ========================================================================== */
.zona-soltar {
  display: flex; align-items: center; justify-content: center; gap: var(--e-2);
  min-height: 56px; padding: var(--e-3) var(--e-4);
  color: var(--texto-2); background: var(--superficie);
  border: 1px dashed var(--traco-forte); border-radius: var(--raio);
  transition: background-color var(--dur-menu), border-color var(--dur-menu);
}
.zona-soltar > .ic { color: var(--marca); }
.zona-soltar:hover { border-color: var(--traco-forte-ativo); }
.zona-soltar.ativa { background: var(--selecao); border-color: var(--marca); color: var(--texto); }
.zona-soltar:focus-visible { outline-offset: 2px; }

.vazio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--e-2); padding: var(--e-8) var(--e-6); text-align: center; }
.vazio > .ic { width: 48px; height: 48px; color: var(--texto-3); margin-bottom: var(--e-2); }
.vazio-titulo { font: var(--t-subtitulo); }
.vazio-texto { color: var(--texto-2); max-width: 360px; }
.vazio .btn { margin-top: var(--e-3); }

.aviso-inline {
  display: flex; align-items: flex-start; gap: var(--e-2);
  min-height: 36px; padding: 7px var(--e-2) 7px var(--e-3);
  font: var(--t-body); color: var(--texto);
  background: var(--info-fundo); border: 1px solid var(--info-borda); border-radius: var(--raio);
}
.aviso-inline > .ic { margin-top: 0; color: var(--texto-2); }
.aviso-texto { flex: 1 1 auto; min-width: 0; padding: 0 0; }
.aviso-texto strong { font-weight: 600; margin-right: 4px; }
.aviso-acoes { display: flex; align-items: center; gap: 4px; flex: none; margin: -2px 0; }
.aviso-inline .btn-icone { margin: -4px -2px -4px 0; }
.aviso-sucesso { background: var(--sucesso-fundo); border-color: var(--sucesso-borda); }
.aviso-sucesso > .ic { color: var(--sucesso); }
.aviso-atencao { background: var(--atencao-fundo); border-color: var(--atencao-borda); }
.aviso-atencao > .ic { color: var(--atencao); }
.aviso-erro { background: var(--erro-fundo); border-color: var(--erro-borda); }
.aviso-erro > .ic { color: var(--erro); }

kbd, .dica-atalho {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font: var(--t-caption); color: var(--texto-2); white-space: nowrap;
  background: var(--superficie); border: 1px solid var(--traco); border-bottom-width: 2px; border-radius: var(--raio);
}

/* Tag (chip): estado curto de um objeto, clicável para a explicação (Fluent Tag, tamanho pequeno).
   .tag (neutro, informativo) .tag-atencao .tag-sucesso. O ícone repete a cor, que nunca é o único
   sinal. Botão: Enter, Espaço, clique ou toque abrem o popover (aria-expanded). */
.tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 100%;
  height: var(--alt-controle-p); padding: 0 8px 0 6px; border-radius: var(--raio);
  font: var(--t-caption-forte); white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer;
  color: var(--texto); background: var(--neutro-fundo); border: 1px solid transparent;
  transition: background-color var(--dur-menu), border-color var(--dur-menu);
}
.tag > .ic { width: 16px; height: 16px; color: var(--texto-2); }
.tag:hover { background: var(--superficie-3); }
.tag[aria-expanded="true"] { border-color: var(--traco-forte-ativo); }
.tag-atencao { color: var(--atencao-texto); background: var(--atencao-fundo); border-color: var(--atencao-borda); }
.tag-atencao > .ic { color: var(--atencao); }
.tag-atencao:hover { background: #fdeab0; }
.tag-atencao[aria-expanded="true"] { border-color: var(--atencao); }
.tag-sucesso { color: var(--sucesso-texto); background: var(--sucesso-fundo); border-color: var(--sucesso-borda); }
.tag-sucesso > .ic { color: var(--sucesso); }
.tag-sucesso:hover { background: #e2f4e2; }
.tag-sucesso[aria-expanded="true"] { border-color: var(--sucesso); }
.tag-rotulo { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Tag com ação (adendo de 22/10 do ADR-0004; Fluent Tag com o botão de dispensar, aqui um ✓): o chip
   é um grupo (.tag-grupo) com o botão do rótulo (.tag-botao, abre o popover) e, no aviso que se
   confere ali, o botão da ação (.tag-acao). A cor e a borda ficam no grupo; hover e foco, em cada botão. */
.tag-grupo { padding: 0; gap: 0; cursor: default; }
.tag-grupo:hover { background: var(--neutro-fundo); }
.tag-atencao.tag-grupo:hover { background: var(--atencao-fundo); }
.tag-sucesso.tag-grupo:hover { background: var(--sucesso-fundo); }
.tag-botao, .tag-acao {
  display: inline-flex; align-items: center; gap: 4px; height: 100%; min-width: 0; margin: 0;
  padding: 0 8px 0 6px; border: 0; border-radius: inherit; font: inherit; color: inherit; background: transparent; cursor: pointer;
}
.tag-acao { padding: 0 6px; border-left: 1px solid var(--traco); border-radius: 0 var(--raio) var(--raio) 0; }
.tag-com-acao .tag-botao { border-radius: var(--raio) 0 0 var(--raio); }
.tag-botao > .ic, .tag-acao > .ic { width: 16px; height: 16px; color: var(--texto-2); }
.tag-atencao .tag-botao > .ic, .tag-atencao .tag-acao > .ic { color: var(--atencao); }
.tag-atencao .tag-acao { border-left-color: var(--atencao-borda); }
.tag-sucesso .tag-botao > .ic { color: var(--sucesso); }
.tag-botao:hover, .tag-acao:hover { background: var(--superficie-3); }
.tag-atencao .tag-botao:hover, .tag-atencao .tag-acao:hover { background: #fdeab0; }
.tag-sucesso .tag-botao:hover { background: #e2f4e2; }
.tag-botao:focus-visible, .tag-acao:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.tag-grupo:has(.tag-botao[aria-expanded="true"]) { border-color: var(--traco-forte-ativo); }
.tag-atencao.tag-grupo:has(.tag-botao[aria-expanded="true"]) { border-color: var(--atencao); }
.tag-sucesso.tag-grupo:has(.tag-botao[aria-expanded="true"]) { border-color: var(--sucesso); }
/* Botões no pé do popover ("Marcar como conferido", "Desfazer"), como o Popover do Fluent com ações */
.popover-acoes { display: flex; justify-content: flex-end; gap: var(--e-2); padding-top: var(--e-2); border-top: 1px solid var(--traco-suave); }

/* Popover: explicação ancorada num controle (Fluent Popover). Não é modal: Esc ou clique fora
   fecham e o foco volta ao controle que abriu. Posição fixa, calculada por quem abre. */
.popover {
  position: fixed; top: 0; left: 0; z-index: 46;
  width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: var(--e-3) var(--e-4);
  display: flex; flex-direction: column; gap: var(--e-2);
  font: var(--t-body); color: var(--texto); background: var(--superficie);
  border-radius: var(--raio-g); box-shadow: var(--sombra-16);
  animation: menu-entra var(--dur-menu) var(--curva-entrada);
}
/* o foco entra na superfície só para o leitor de tela ler o conteúdo; o anel fica no chip ao voltar */
.popover:focus, .popover:focus-visible { outline: none; }
.popover-item { display: flex; align-items: flex-start; gap: var(--e-2); }
.popover-item > .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--texto-2); }
.popover-item.atencao > .ic { color: var(--atencao); }
.popover-item.sucesso > .ic { color: var(--sucesso); }
.popover-item strong { display: block; font: var(--t-body-forte); }
.popover-item p { color: var(--texto-2); }
.popover-item + .popover-item { padding-top: var(--e-2); border-top: 1px solid var(--traco-suave); }

/* Dica flutuante (Tooltip) */
.dica {
  position: absolute; z-index: 40; max-width: 240px; padding: 4px 11px 6px;
  font: var(--t-caption); color: var(--texto); background: var(--superficie);
  border-radius: var(--raio); box-shadow: var(--sombra-8);
}

/* ==========================================================================
   15. Revisão: visualizador da folha, realces de linha, zoom flutuante, recorte
   ========================================================================== */
.visualizador { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--neutro-fundo); }
.visualizador-folha { position: relative; margin: var(--e-6) auto; background: #fff; box-shadow: var(--sombra-4); }
.realce {
  position: absolute; display: block; padding: 0; cursor: pointer;
  border: 1px solid rgba(15,108,189,.4); background: rgba(15,108,189,.04); border-radius: var(--raio-p);
}
.realce:hover { background: rgba(15,108,189,.14); }
.realce.pendente { border-color: var(--atencao); background: rgba(188,75,9,.08); }
.realce.pendente:hover { background: rgba(188,75,9,.16); }
/* Descartado (apenso, riscado, repetição): o número fica apagado e cortado por um traço, e a
   etiqueta ganha "✕"; a borda tracejada de antes se confundia com o OK (pedido de 2026-10-01). */
.realce.descartado { border: 1.5px solid var(--texto-3); background: rgba(240,240,240,.62); }
.realce.descartado:hover { background: rgba(240,240,240,.45); }
.realce.descartado::after {
  content: ""; position: absolute; left: 2%; right: 2%; top: 50%; height: 2px; margin-top: -1px;
  background: var(--texto-3); pointer-events: none;
}
.realce.descartado .realce-rotulo { color: #fff; background: var(--texto-3); border-color: var(--texto-3); }
.realce.descartado .realce-rotulo::after { content: " ✕"; }
.realce.atual { border: 2px solid var(--marca); background: rgba(15,108,189,.14); box-shadow: 0 0 0 3px rgba(15,108,189,.22); }
.realce.descartado.atual { border-color: var(--marca); background: rgba(240,240,240,.5); }
.realce:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }
.realce-rotulo {
  position: absolute; right: calc(100% + 4px); top: 50%; transform: translateY(-50%);
  min-width: 20px; height: 18px; padding: 0 4px; border-radius: var(--raio-p); white-space: nowrap;
  font: var(--t-caption-forte); line-height: 16px; text-align: center;
  color: var(--marca); background: var(--superficie); border: 1px solid rgba(15,108,189,.55);
}
.realce.pendente .realce-rotulo { color: var(--atencao-texto); background: var(--atencao-fundo); border-color: var(--atencao); }
.realce.atual .realce-rotulo { color: #fff; background: var(--marca); border-color: var(--marca); }
/* Amostra de cada estado dos realces (no cabeçalho da folha, a partir de 640 px). */
.legenda-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legenda-amostra {
  position: relative; flex: none; width: 26px; height: 12px; border-radius: var(--raio-p);
  border: 1px solid rgba(15,108,189,.55); background: rgba(15,108,189,.06);
}
.legenda-amostra.pendente { border-color: var(--atencao); background: rgba(188,75,9,.12); }
.legenda-amostra.descartado { border: 1.5px solid var(--texto-3); background: rgba(240,240,240,.9); }
.legenda-amostra.descartado::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 2px; margin-top: -1px; background: var(--texto-3);
}
.zoom-flutuante {
  position: absolute; left: 50%; bottom: var(--e-4); transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--superficie); border-radius: var(--raio); box-shadow: var(--sombra-8);
}
.zoom-valor { min-width: 52px; text-align: center; font: var(--t-body); font-variant-numeric: tabular-nums; }
.recorte {
  display: flex; align-items: center; height: 48px; padding: 0 var(--e-3); overflow: hidden;
  background: #f7f5ef; border: 1px solid var(--traco); border-radius: var(--raio);
}
.numero-processo { font: var(--t-subtitulo); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Acordeão simples com <details> (histórico) */
.sanfona > summary {
  display: flex; align-items: center; gap: 4px; height: var(--alt-controle); padding: 0 4px;
  font: var(--t-body-forte); cursor: pointer; list-style: none; border-radius: var(--raio);
}
.sanfona > summary::-webkit-details-marker { display: none; }
.sanfona > summary:hover { background: var(--superficie-2); }
.sanfona > summary .ic { width: 16px; height: 16px; color: var(--texto-2); transition: transform var(--dur-menu) var(--curva-entrada); }
.sanfona[open] > summary .ic { transform: rotate(90deg); }
.historico { list-style: none; padding: 4px 0 0 24px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.historico li { display: flex; flex-direction: column; font: var(--t-body); }
.historico .quando { font: var(--t-caption); color: var(--texto-2); }

/* Alto contraste do Windows */
@media (forced-colors: active) {
  [aria-selected="true"] > .arvore-linha, .lista tbody tr[aria-selected="true"] td { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .selo::before, .barra-progresso > span { forced-color-adjust: none; background: CanvasText; }
  .btn, .entrada, .menu, .dialogo { border-color: CanvasText; }
}
