/* ===========================================================================
   Painel IA — shell no padrão larasend (sidebar + colunas + detalhe/composer)
   Tokens neutros vindos do tema shadcn do larasend; acento mint da marca.
   O acento é cromo de INTERFACE — nunca cor de dado. As cores de gráfico
   continuam vindo da paleta validada (série azul + status), separadas de propósito.
   =========================================================================== */

:root {
  color-scheme: dark;
  --bg:            #0a0a0a;
  --sidebar-bg:    #121212;
  --panel:         #0f0f0f;
  --panel-2:       #151515;
  --raised:        #1c1c1c;
  --border:        #262626;
  --border-soft:   #1e1e1e;
  --text:          #fafafa;
  --text-2:        #a3a3a3;
  --text-3:        #737373;
  --accent:        #6ee7b7;
  --accent-ink:    #052e22;
  --accent-soft:   rgba(110, 231, 183, 0.10);
  --accent-line:   rgba(110, 231, 183, 0.30);

  /* dados — paleta validada, independente do acento da UI */
  --series-1:      #3987e5;
  --series-track:  #1f3d63;
  --good:          #0ca30c;
  --warning:       #fab219;
  --critical:      #e66767;
  --grid:          #262626;
  --baseline:      #383835;
  --warning-text:  #fab219;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:            #ffffff;
  --sidebar-bg:    #fafafa;
  --panel:         #ffffff;
  --panel-2:       #fafafa;
  --raised:        #f4f4f5;
  --border:        #e5e5e5;
  --border-soft:   #ededed;
  --text:          #0a0a0a;
  --text-2:        #525252;
  --text-3:        #737373;
  --accent:        #0d9488;         /* mint claro não tem contraste em fundo branco */
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(13, 148, 136, 0.10);
  --accent-line:   rgba(13, 148, 136, 0.35);

  --series-1:      #2a78d6;
  --series-track:  #cde2fb;
  --good:          #0ca30c;
  --warning:       #fab219;
  --critical:      #d03b3b;
  --grid:          #e1e0d9;
  --baseline:      #c3c2b7;
  --warning-text:  #8a5a00;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  /* mesma fonte do larasend; cai para a do sistema se a rede bloquear o CDN */
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased; overflow: hidden;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ------------------------------------------------------------------ shell */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 250px; flex-shrink: 0; background: var(--sidebar-bg);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px; }
.burger { border: none; background: transparent; padding: 6px; border-radius: 7px;
          color: var(--text-2); flex-shrink: 0; }
.burger:hover { background: var(--raised); color: var(--text); }
.burger svg { width: 18px; height: 18px; }

/* ---- menu recolhido: vira uma trilha de ícones ----
   Os rótulos somem, mas cada item mantém seu data-tip, então passar o mouse continua
   dizendo o que é — a navegação não fica adivinhação. */
body.menu-min .sidebar { width: 62px; }
body.menu-min .brand { flex-direction: column; gap: 8px; padding: 14px 8px 10px; }
body.menu-min .brand .name,
body.menu-min .nav-sec,
body.menu-min .side-foot .who { display: none; }
/* O rótulo do item é um nó de texto solto, não um <span> — zerar a fonte no item é o que
   realmente o esconde. O ícone é SVG e não depende de font-size; o contador recupera a sua. */
body.menu-min .nav-item { font-size: 0; }
body.menu-min .nav-item .count { font-size: 9.5px; }
body.menu-min .nav { padding: 0 8px 12px; }
body.menu-min .nav-item { justify-content: center; padding: 10px 0; position: relative; }
body.menu-min .nav-item .count {
  position: absolute; top: 3px; right: 4px; margin: 0; padding: 0 4px;
  font-size: 9.5px; line-height: 14px; min-width: 14px; text-align: center;
}
body.menu-min .side-foot { flex-direction: column; gap: 8px; padding: 10px 8px; }
.sidebar { transition: width .2s ease; }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.brand .name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }

.cur-sel-modal { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 14px; }
.fila-tag-bar-inner { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 6%, transparent);
  font-size: 12.5px; }
.fila-tag-bar-inner .btn-icon { padding: 2px 6px; }

.nav { flex: 1; overflow-y: auto; padding: 0 10px 14px; }
.nav-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3);
           font-weight: 700; padding: 14px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-size: 13.5px; margin-bottom: 1px;
  border: 1px solid transparent; user-select: none;
}
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav-item .count {
  margin-left: auto; background: var(--raised); color: var(--text-2);
  border-radius: 6px; padding: 1px 6px; font-size: 11px; font-variant-numeric: tabular-nums;
}
.nav-item.on .count { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.side-foot { border-top: 1px solid var(--border); padding: 12px; display: flex; align-items: center; gap: 10px; }
.side-foot .av { width: 30px; height: 30px; border-radius: 50%; background: var(--raised);
                 display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-2); }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 12.5px; font-weight: 600; }
.side-foot .who span { display: block; font-size: 11px; color: var(--text-3);
                       overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* nome do rodapé clicável (login mestre): trocar de identidade sem topo duplicado */
.side-foot .who.trocavel { cursor: pointer; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.side-foot .who.trocavel:hover { background: var(--raised); }
.side-foot .who.trocavel:hover span { color: var(--accent); }
.ver { padding: 5px 14px 10px; font-size: 10.5px; color: var(--text-3); cursor: pointer;
       user-select: none; text-align: left; transition: color .15s; }
.ver:hover { color: var(--accent); }
body.menu-min .ver { text-align: center; padding: 4px 0 8px; font-size: 9.5px; }
/* aviso global de índice FTS5 defasado — rodapé da sidebar, visível em qualquer tela */
.fts-alerta { display: flex; align-items: center; gap: 6px; padding: 6px 14px 0;
              font-size: 10.5px; line-height: 1.4; color: var(--warning);
              cursor: pointer; user-select: none; transition: color .15s; }
.fts-alerta[hidden] { display: none; }
.fts-alerta:hover { color: var(--accent); }
.fts-alerta .fts-alerta-ico { font-size: 11px; }
body.menu-min .fts-alerta { justify-content: center; padding: 6px 0 0; font-size: 9.5px; }

/* barra de hit rate (tela Rota de decisão) */
.hr-bar { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; width: 100%; }
.hr-bar div { height: 100%; border-radius: 4px; }

/* ------------------------------------------------------------------ main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; flex-shrink: 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; background: var(--panel);
}
.topbar h1 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.topbar .crumb { color: var(--text-3); font-size: 13px; }
.topbar .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.body { flex: 1; display: flex; min-height: 0; }
.pane { display: flex; flex-direction: column; min-height: 0; }
.pane-filters { width: 236px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; }
.pane-list { width: 400px; flex-shrink: 0; border-right: 1px solid var(--border); }
.pane-detail { flex: 1; min-width: 0; background: var(--panel); }
.pane-full { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 26px 60px; }
@media (max-width: 1500px) { .pane-list { width: 330px; } }
@media (max-width: 1250px) { .pane-filters { display: none; } }

.list-head { padding: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.list-scroll { flex: 1; overflow-y: auto; }

.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
              width: 15px; height: 15px; stroke: var(--text-3); fill: none; stroke-width: 1.7; }
.search input { width: 100%; padding: 8px 10px 8px 32px; }

input[type=text], input[type=search], input[type=password], textarea, select {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-line); }
textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

button {
  cursor: pointer; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  border-radius: 8px; padding: 7px 11px; font-size: 12.5px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
button:hover { background: var(--raised); }
button:disabled { opacity: .45; cursor: not-allowed; }
button svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-danger { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); color: var(--critical); }
.btn-danger:hover { background: color-mix(in srgb, var(--critical) 14%, transparent); }
.btn-icon { padding: 7px; }

/* ------------------------------------------------------------ filtros */
.f-group { margin-bottom: 20px; }
.f-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
           font-weight: 700; margin-bottom: 8px; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg button { flex: 1; border: none; background: transparent; padding: 5px 8px; font-size: 12px;
              color: var(--text-2); border-radius: 6px; justify-content: center; }
.seg button.on { background: var(--raised); color: var(--text); font-weight: 600; }
.f-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-2); margin-bottom: 1px;
}
.f-item:hover { background: var(--raised); color: var(--text); }
.f-item.on { background: var(--raised); color: var(--text); font-weight: 600; }
.f-item .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.f-item .n { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ lista */
.row {
  padding: 12px 14px; border-bottom: 1px solid var(--border-soft); cursor: pointer;
  border-left: 2px solid transparent;
}
.row.tickable { display: flex; align-items: flex-start; gap: 10px; }
.row.tickable .tick { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.row-body { flex: 1; min-width: 0; }
.sel-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--border-soft);
  background: var(--raised); font-size: 12.5px;
}
.row:hover { background: var(--panel-2); }
.row.on { background: var(--accent-soft); border-left-color: var(--accent); }
.row-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.row-key { font-weight: 650; font-size: 13px; color: var(--text); }
.row-when { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.row-sum { font-size: 12.5px; color: var(--text-2); line-height: 1.45;
           display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-why { font-size: 11.5px; color: var(--text-3); margin-top: 5px; display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------ detalhe */
.det-head { padding: 16px 22px; border-bottom: 1px solid var(--border); }
.det-title { font-size: 16px; font-weight: 650; margin: 0 0 4px; letter-spacing: -0.01em; }
.det-sub { font-size: 12.5px; color: var(--text-3); font-family: ui-monospace, monospace; }
.det-tools { display: flex; gap: 8px; align-items: center; padding: 12px 22px;
             border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.det-tools select { width: auto; min-width: 120px; }
.det-scroll { flex: 1; overflow-y: auto; padding: 20px 22px; }
.det-foot { border-top: 1px solid var(--border); padding: 14px 22px 16px; background: var(--panel-2); }
/* Sem scroll interno no conteúdo (ex.: resposta do Agente IA): o detalhe inteiro rola
   como uma página só — cabeçalho, conteúdo e ações juntos, sem barra dentro de barra. */
#revisarDetail, #chamadosDetail { overflow-y: auto; }
#revisarDetail .det-scroll, #chamadosDetail .det-scroll { flex: 0 0 auto; overflow: visible; }

.blk { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
       font-weight: 700; margin: 20px 0 8px; }
.blk:first-child { margin-top: 0; }
.card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; }
.card.quote { border-left: 2px solid var(--border); }
.card.ai { background: color-mix(in srgb, var(--series-1) 8%, var(--panel-2)); border-color: color-mix(in srgb, var(--series-1) 25%, var(--border)); }
.card .who { font-weight: 650; margin-bottom: 2px; }
.card .desc { color: var(--text-2); white-space: pre-wrap; margin-top: 6px; }

.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
       padding: 12px 16px; min-width: 140px; flex: 1; }
.kpi b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { font-size: 12px; color: var(--text-2); }

.ex-registrado-autor { font-weight: 600; max-width: 120px; white-space: nowrap;
                        overflow: hidden; text-overflow: ellipsis; }
.ex-registrado-data { font-size: 11px; white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 7px;
        font-size: 11.5px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text-2); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.chip.ok::before { background: var(--good); }
.chip.warn::before { background: var(--warning); }
.chip.crit::before { background: var(--critical); }
.chip.info::before { background: var(--series-1); }
.chip.acc::before { background: var(--accent); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px;
       font-size: 11px; font-family: ui-monospace, monospace; margin: 2px 4px 2px 0;
       border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--good); }
.tag.novo::before { background: var(--warning); }

.composer { }
.composer-tabs { display: flex; gap: 4px; align-items: center; margin-bottom: 10px; }
.composer-tabs .t { padding: 6px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; border: 1px solid transparent; }
.composer-tabs .t.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 600; }
.composer-tabs .as { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.composer-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }

.empty { color: var(--text-3); text-align: center; padding: 48px 20px; font-size: 13px; }

/* vôo da tag marcada para o painel de ações em lote (tela Tags) */
.fly-tag {
  position: fixed; z-index: 9999; pointer-events: none;
  font-family: ui-monospace, monospace; font-size: 11px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  padding: 4px 9px; border-radius: 6px; white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: transform .5s cubic-bezier(.25, .6, .3, 1), opacity .5s ease;
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: reduce) { .fly-tag { display: none; } }

/* painel de ações em lote — ocupa a coluna grande (detalhe) em vez da lista espremida */
.sel-panel { padding: 18px 20px; }
.sel-panel .det-title { margin: 0 0 4px; }
.sel-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.sel-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: ui-monospace, monospace; font-size: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  border-radius: 6px; padding: 5px 9px; cursor: pointer; user-select: none;
}
.sel-chip:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.sel-chip .sel-x { opacity: .65; }
.sel-chip .sel-n { color: var(--text-3); }
.sel-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sel-dica { margin: 14px 0 0; max-width: 580px; font-size: 12px; line-height: 1.55; color: var(--text-2); }
.sel-dica b { color: var(--text); }
.muted { color: var(--text-3); font-size: 12px; }

.cfg-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; }
.cfg-row input[type=checkbox] { margin-top: 3px; flex: 0 0 auto; }
.cfg-row-inline { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.cfg-row-inline > b { flex: 0 0 260px; }
.cfg-row-inline input[type=number] {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 13px;
}
.cfg-row-inline textarea { flex: 0 0 auto; }
.cfg-row-inline .muted { flex: 1 1 220px; }
/* ==================================================================== login ====
   Substitui o popup nativo do navegador (HTTP Basic) por uma tela com a cara do
   painel. A raiz virou pública só para isto: o HTML/CSS/JS não carrega dado
   nenhum sozinho — a autenticação de verdade continua no servidor, a cada
   chamada de API (ver _authHeader em painel.js). */
.login-bg {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: var(--bg); align-items: center; justify-content: center; overflow: hidden;
}
body.tela-login .login-bg { display: flex; }
body.tela-login .app { display: none; }

.login-glow {
  position: absolute; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 68%);
  animation: loginGlow 5s ease-in-out infinite;
}
@keyframes loginGlow {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.login-card {
  position: relative; width: min(360px, 92vw); background: var(--raised);
  border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5); text-align: center;
  animation: loginIn .4s ease;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card.shake { animation: loginShake .38s ease; }
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.login-mark { position: relative; width: 56px; height: 56px; margin: 0 auto 18px; }
.login-mark-ring {
  position: absolute; inset: -10px; border-radius: 18px; border: 1px solid var(--accent-line);
  animation: loginRing 2.4s ease-in-out infinite;
}
@keyframes loginRing {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.12); opacity: 0; }
}
.login-mark-txt {
  position: absolute; inset: 0; border-radius: 14px; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center;
  font-weight: 800; font-size: 20px;
}
.login-t { font-size: 17px; font-weight: 680; letter-spacing: -.01em; margin: 0 0 4px; }
.login-sub { font-size: 12px; color: var(--text-3); margin: 0 0 24px; line-height: 1.5; }
.login-campo { text-align: left; margin-bottom: 14px; }
.login-campo label { display: block; font-size: 11px; font-weight: 650; color: var(--text-2);
                      margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.login-erro { min-height: 18px; color: var(--critical); font-size: 12.5px; margin-bottom: 10px; }
.login-btn { width: 100%; justify-content: center; padding: 10px; font-size: 13.5px; font-weight: 650; }

@media (prefers-reduced-motion: reduce) {
  .login-glow, .login-mark-ring, .login-card { animation: none; }
  .login-card.shake { animation: none; }
}

/* ------------------------------------------------------------ manual */
.man-p { font-size: 13.5px; line-height: 1.7; color: var(--text-2); max-width: 860px; margin: 0 0 12px; }
.man-p b { color: var(--text); }
.man-p code, .man-t code { font-family: ui-monospace, monospace; font-size: 12px;
  background: var(--raised); padding: 1px 5px; border-radius: 4px; }
.man-ol { font-size: 13.5px; line-height: 1.75; color: var(--text-2); max-width: 860px;
  padding-left: 20px; margin: 0; }
.man-ol li { margin-bottom: 9px; }
.man-ol b { color: var(--text); }
.man-t { margin: 4px 0 14px; }
.man-t td:first-child { white-space: nowrap; }
.man-h { font-size: 13px; font-weight: 650; color: var(--text); margin: 20px 0 8px; }
.man-h:first-child { margin-top: 0; }
.man-f {
  font-family: ui-monospace, monospace; font-size: 12.5px; background: var(--panel);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 12px 14px; margin: 0 0 12px; color: var(--text);
  max-width: 860px;
}
.man-obs { border-left: 3px solid var(--border); padding-left: 12px; }
.man-alerta {
  border-left: 3px solid var(--warning); padding: 11px 13px; border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  font-size: 13px; line-height: 1.65; color: var(--text-2); max-width: 860px;
}

/* botão ✨ IA: lê a tela (Métricas/Desempenho) e aponta o que melhorar */
.btn-ia { cursor: pointer; font-size: 12px; font-weight: 600; padding: 6px 12px;
  border-radius: 9px; border: 1px solid var(--border); color: var(--text-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent),
              color-mix(in srgb, var(--accent) 4%, transparent)); transition: all .15s; }
.btn-ia:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* animação de carregamento do ✨ IA: radar "lendo a tela" */
.ia-load { display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 0; text-align: center; }
.ia-load-anim { position: relative; width: 64px; height: 64px; }
.ia-load-anim::before, .ia-load-anim::after { content: ''; position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid transparent; }
.ia-load-anim::before { border-top-color: var(--accent); animation: iaSpin 1s linear infinite; }
.ia-load-anim::after { border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
  animation: iaSpin 1.4s linear infinite reverse; }
.ia-load-ico { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 26px; animation: iaPulse 1.2s ease-in-out infinite; }
.ia-load-txt { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ia-load-dots::after { content: ''; animation: iaDots 1.4s steps(4, end) infinite; }
@keyframes iaSpin { to { transform: rotate(360deg); } }
@keyframes iaPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: .75; }
}
@keyframes iaDots {
  0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; }
}

/* -------------------------------------------------- seletor de modelo */
.mod-atual { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.mod-lista { margin-top: 14px; }
.mod-lista summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600;
  padding: 8px 0; }
.mod-lista summary:hover { color: var(--text); }

/* --------------------------------------- prompt com blocos identificados */
.prompt-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  max-height: 620px; overflow: auto; padding: 0;
}
/* Rótulo na lateral, não acima: assim um trecho curto não vira uma caixa alta só para
   caber o título, e a leitura do texto segue contínua de cima a baixo. */
.pseg {
  display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start;
  border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 5%, transparent);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.pseg:last-child { border-bottom: none; }
.pseg:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }
.pseg-tag {
  font-family: system-ui, sans-serif; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700; color: var(--c); padding-top: 2px;
  position: sticky; top: 6px;
}
.pseg > span:last-child {
  white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 11.5px;
  line-height: 1.65; color: var(--text); min-width: 0; overflow-wrap: anywhere;
}
@media (max-width: 900px) { .pseg { grid-template-columns: 1fr; gap: 4px; } .pseg-tag { position: static; } }

/* progresso da aprovação */
.prog { margin-bottom: 14px; }
.prog-n { font-size: 19px; font-weight: 680; letter-spacing: -.02em; margin-bottom: 6px; }
.prog-bar { height: 6px; background: var(--grid); border-radius: 0 3px 3px 0; overflow: hidden; margin-bottom: 6px; }
.prog-bar div { height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; transition: width .4s; }
/* card 'processamento da janela de 30 dias' na tela Status — linha rótulo+valor com a
   barra logo abaixo; a segunda barra usa a cor boa (classificação) pra diferenciar do
   download (acento). */
.prog-janela .pj-linha { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; font-size: 13.5px; margin: 2px 0 4px; }
.prog-janela .pj-linha b { font-weight: 650; }
.prog-janela .pj-linha span { font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--text2); }
.prog-janela .prog-bar:nth-of-type(2) div { background: var(--good); }
/* mini-gráfico de classificações por hora no card de processamento */
.prog-janela .pj-grafico { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.prog-janela .pj-grafico-titulo { font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.prog-janela .pj-grafico svg { border-radius: 4px; }
.prog-janela .pj-grafico-legenda { display: flex; gap: 16px; margin-top: 5px; font-size: 11px; color: var(--text-2); }
.prog-janela .pj-grafico-legenda b { font-weight: 650; }
.prog-janela .pj-grafico-legenda .agora b { color: var(--accent); }
.prog-janela .pj-grafico-legenda .pico b { color: var(--good); }

/* formulário de rejeição — cada motivo aponta para uma correção diferente */
.rej { border: 1px solid color-mix(in srgb, var(--critical) 40%, var(--border));
       border-radius: 10px; padding: 14px; margin-top: 12px;
       background: color-mix(in srgb, var(--critical) 5%, transparent); }
.rej-t { font-size: 13px; font-weight: 650; margin-bottom: 12px; }
.rej-op { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px;
          border-radius: 8px; cursor: pointer; margin-bottom: 3px; font-size: 13px; }
.rej-op:hover { background: var(--raised); }
.rej-op input { margin-top: 3px; width: auto; flex-shrink: 0; }
.rej-op .muted { font-size: 12px; line-height: 1.5; margin-top: 2px; }
.rej-acao { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-top: 4px; }

/* ---- coluna de filtros recolhível ----
   Recolhida vira uma trilha estreita com o botão de voltar, em vez de sumir: escondê-la
   por completo deixava o usuário sem como trazê-la de volta sem procurar no topo. */
.pane-filters { position: relative; transition: width .2s ease, padding .2s ease; }
.pf-toggle {
  position: absolute; top: 10px; right: 8px; padding: 5px; border: none;
  background: transparent; color: var(--text-3); border-radius: 6px; z-index: 2;
}
.pf-toggle:hover { background: var(--raised); color: var(--text); }
.pf-toggle svg { width: 15px; height: 15px; transition: transform .2s; }
body.sem-filtros .pane-filters {
  width: 34px; padding: 0; overflow: hidden; flex-shrink: 0;
}
body.sem-filtros .pane-filters > *:not(.pf-toggle) { display: none; }
body.sem-filtros .pf-toggle { right: 4px; }
body.sem-filtros .pf-toggle svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .pane-filters, .pf-toggle svg { transition: none; }
}

/* miniaturas dos anexos que seguem ao modelo */
.anx-mini { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.anx-mini img { width: 54px; height: 40px; object-fit: cover; border-radius: 6px;
                border: 1px solid var(--border); }
img.anx-lazy { background: var(--panel); min-width: 54px; min-height: 40px; }
img.anx-falhou { opacity: .3; }

/* exemplo ilustrativo de um bloco vazio do prompt */
.bloco-ex { margin-top: 8px; }
.bloco-ex summary { cursor: pointer; font-size: 11.5px; color: var(--accent); }
.bloco-ex summary:hover { text-decoration: underline; }
.bloco-ex-txt {
  white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 11px;
  line-height: 1.6; color: var(--text-2); background: var(--panel);
  border: 1px dashed var(--border); border-radius: 8px; padding: 12px; margin-top: 8px;
  max-height: 260px; overflow: auto;   /* blocos longos (exemplos, chamado) não explodem a página */
}

/* legenda de cores — faltava no CSS novo, e por isso os itens saíam grudados sem swatch */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px;
          font-size: 12px; color: var(--text-2); }
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* bloco sem conteúdo: marca escrita, para não parecer barra cheia nem barra ausente */
.bar-track { position: relative; }
.bar-zero {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 700; pointer-events: none;
}

/* ------------------------------------------------------- tutorial guiado */
.tour-spot {
  position: fixed; border-radius: 10px; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .74); pointer-events: none; z-index: 300;
  opacity: 0; transition: opacity .2s, left .3s, top .3s, width .3s, height .3s;
}
.tour-spot.on { opacity: 1; }
.tour-box {
  position: fixed; z-index: 301; width: 350px; background: var(--raised);
  border: 1px solid var(--border); border-radius: 13px; padding: 17px 19px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55); opacity: 0; pointer-events: none;
  transition: opacity .2s, left .3s, top .3s;
}
.tour-box.on { opacity: 1; pointer-events: auto; }
.tour-n { font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
          color: var(--accent); font-weight: 700; margin-bottom: 7px; }
.tour-t { font-size: 16px; font-weight: 650; margin-bottom: 7px; letter-spacing: -.01em; }
.tour-d { font-size: 13.2px; line-height: 1.6; color: var(--text-2); }
.tour-ex {
  margin-top: 11px; padding: 11px 12px; background: var(--panel-2);
  border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0;
  font-size: 12.6px; line-height: 1.6; color: var(--text-2);
}
.tour-ex-l { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
             color: var(--accent); font-weight: 700; margin-bottom: 5px; }
.tour-acts { display: flex; align-items: center; gap: 7px; margin-top: 15px; }
.tour-dots { display: flex; gap: 4px; margin: 0 auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); display: block; }
.tour-dots i.on { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-box { transition: opacity .2s; } }

/* ------------------------------------------------------------ tooltips */
.tip {
  position: fixed; z-index: 200; max-width: 330px; pointer-events: none;
  background: var(--raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; box-shadow: 0 8px 26px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(4px); transition: opacity .14s, transform .14s;
}
.tip.on { opacity: 1; transform: translateY(0); }
.tip-t { font-size: 12.8px; line-height: 1.55; color: var(--text); }
.tip-ex {
  margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--border);
  font-size: 12px; line-height: 1.5; color: var(--text-2); font-style: italic;
}
.tip-ex-l {
  display: block; font-style: normal; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.tip-q {
  display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-3); font-size: 10px; font-weight: 700;
  cursor: help; margin-left: 5px; vertical-align: middle; flex-shrink: 0; line-height: 1;
}
.tip-q:hover, .tip-q:focus { border-color: var(--accent-line); color: var(--accent);
                             background: var(--accent-soft); outline: none; }
[data-tip] { cursor: help; }
.nav-item[data-tip], button[data-tip] { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg);
         padding: 11px 16px; border-radius: 9px; font-size: 13px; z-index: 100; opacity: 0;
         transform: translateY(8px); transition: .18s; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateY(0); }

/* ------------------------------------------------------------ páginas cheias */
.sec { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
       padding: 20px 22px; margin-bottom: 18px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-head h2 { font-size: 14px; margin: 0; font-weight: 650; }
.sec-head .note { font-weight: 400; color: var(--text-3); font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.tile .l { color: var(--text-2); font-size: 12px; margin-bottom: 8px; }
.tile .v { font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: proportional-nums; }
.tile .s { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.tile .chip { margin-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 10.5px; text-transform: uppercase;
     letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
tr:hover td { background: var(--panel-2); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12.5px; }
.bar-name { width: 250px; flex-shrink: 0; color: var(--text-2); font-family: ui-monospace, monospace;
            font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: var(--grid); border-radius: 0 4px 4px 0; height: 14px; position: relative; }
.bar-track.meter { background: var(--series-track); }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; }
.bar-val { width: 96px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12px; flex-shrink: 0; }
.bar-val .s { color: var(--text-3); }
.meter-target { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--text-2);
                box-shadow: 0 0 0 1.5px var(--panel-2); }
.hero { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hero .num { font-size: 50px; font-weight: 680; letter-spacing: -.03em; line-height: 1; }
.hero .cap { color: var(--text-2); font-size: 13px; max-width: 540px; line-height: 1.5; }
.viewtoggle { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--border);
              border-radius: 9px; padding: 3px; margin-left: auto; }
.viewtoggle button { border: none; background: transparent; padding: 5px 11px; font-size: 11.5px; color: var(--text-2); }
.viewtoggle button.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }

/* ------------------------------------------------- como funciona (didático) */
.como-hero { background: linear-gradient(180deg, var(--accent-soft), transparent); border-color: var(--accent-line); }
.como-h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 10px; }
.como-sub { font-size: 15px; line-height: 1.6; color: var(--text-2); max-width: 720px; margin: 0; }
.como-sub b { color: var(--text); }

.passos { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 10px; max-width: 1150px; }
.passo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px 12px; flex: 1 1 0; min-width: 0; cursor: pointer;
         border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
         transition: opacity .3s, border-color .3s, transform .3s, background .3s; }
.passo:hover { border-color: var(--accent-line); }
.passo-n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft);
           border: 1px solid var(--accent-line); color: var(--accent); display: grid;
           place-items: center; font-weight: 750; font-size: 15px; flex-shrink: 0;
           transition: background .3s, color .3s; }
.passo-b { min-width: 0; flex: 1; width: 100%; text-align: center; }
.passo-t { font-size: 13px; font-weight: 650; line-height: 1.35; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.passo-i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border);
           color: var(--text-3); font-size: 10px; font-weight: 700; font-style: italic;
           display: grid; place-items: center; flex-shrink: 0; transition: .25s; }
/* descrição e "na prática" vivem no painel-tooltip (passoTip) abaixo — cards ficam compactos */
.passo-d { display: none; }
.passo-tip { display: none; }

/* painel-tooltip: a explicação do passo ativo (ou de todos em "ver tudo") */
.passo-tip-panel {
  margin-top: 14px; border: 1px solid var(--accent-line); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  padding: 14px 18px; min-height: 60px; max-width: 1150px;
}
.passo-tip-i + .passo-tip-i { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.passo-tip-t { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.passo-tip-d { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.passo-tip-ex {
  margin-top: 10px; background: var(--panel-2); border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0; font-size: 12.8px; line-height: 1.6; color: var(--text-2);
  padding: 10px 13px;
}
.passo-tip-l { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
               color: var(--accent); font-weight: 700; margin-bottom: 5px; }

/* setas entre os cards: fluxo HORIZONTAL — linha fina + bolha que corre da esquerda para a direita */
.passo-seta { position: relative; width: 34px; height: 2px; margin: 0; flex-shrink: 0; align-self: center; }
.passo-seta .trilho { position: absolute; inset: 0; background: var(--border); border-radius: 2px; }
.passo-seta .bolha {
  position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--accent); opacity: 0;
  box-shadow: 0 0 8px var(--accent);
}
@keyframes corre { 0% { left: -2px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 30px; opacity: 0; } }

/* ---- estado ativo, por passo ---- */
.passos[data-on="1"] .passo:not([data-p="1"]),
.passos[data-on="2"] .passo:not([data-p="2"]),
.passos[data-on="3"] .passo:not([data-p="3"]),
.passos[data-on="4"] .passo:not([data-p="4"]) { opacity: .38; }
.passos[data-on="1"] .passo[data-p="1"],
.passos[data-on="2"] .passo[data-p="2"],
.passos[data-on="3"] .passo[data-p="3"],
.passos[data-on="4"] .passo[data-p="4"] {
  border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 4%, var(--panel));
}
.passos[data-on="1"] .passo[data-p="1"] .passo-n,
.passos[data-on="2"] .passo[data-p="2"] .passo-n,
.passos[data-on="3"] .passo[data-p="3"] .passo-n,
.passos[data-on="4"] .passo[data-p="4"] .passo-n { background: var(--accent); color: var(--accent-ink); }
.passos[data-on="1"] .passo[data-p="1"] .passo-i,
.passos[data-on="2"] .passo[data-p="2"] .passo-i,
.passos[data-on="3"] .passo[data-p="3"] .passo-i,
.passos[data-on="4"] .passo[data-p="4"] .passo-i { border-color: var(--accent); color: var(--accent); }
.passos[data-on="1"] .passo[data-p="1"] .passo-tip,
.passos[data-on="2"] .passo[data-p="2"] .passo-tip,
.passos[data-on="3"] .passo[data-p="3"] .passo-tip,
.passos[data-on="4"] .passo[data-p="4"] .passo-tip {
  max-height: 260px; opacity: 1; margin-top: 11px; padding: 12px 13px;
}
/* a bolha corre no trecho que acabou de ser percorrido (as setas são os filhos 2, 4 e 6) */
.passos[data-on="2"] .passo-seta:nth-of-type(2) .bolha,
.passos[data-on="3"] .passo-seta:nth-of-type(4) .bolha,
.passos[data-on="4"] .passo-seta:nth-of-type(6) .bolha { animation: corre 1.1s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .passo, .passo-tip, .passo-n, .passo-i { transition: none; }
  .passo-seta .bolha { animation: none !important; opacity: .9; left: 12px; }
}

.demo-grid { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .demo-grid { grid-template-columns: 1fr; } .demo-arrow { display: none; } }
.demo-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
            color: var(--text-3); font-weight: 700; margin-bottom: 8px; }
.demo-arrow { align-self: center; text-align: center; color: var(--text-3); font-size: 22px; }
.hl { background: color-mix(in srgb, var(--warning) 26%, transparent); padding: 0 4px; border-radius: 3px; }
.gl-line { padding: 5px 0; font-size: 13.5px; border-bottom: 1px solid var(--border-soft); }
.gl-line:last-child { border-bottom: none; }
.demo-ans { transition: border-color .3s, background .3s; }
.demo-ans.good { border-color: color-mix(in srgb, var(--good) 55%, var(--border)); }
.demo-ans.bad { border-color: color-mix(in srgb, var(--critical) 50%, var(--border)); }
.demo-tagline { margin-bottom: 8px; }
.demo-verdict { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
                font-size: 13px; font-weight: 600; }
.demo-verdict.ok { color: var(--good); }
.demo-verdict.bad { color: var(--critical); }

.acoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.acao { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--panel); }
.acao-s { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); font-weight: 700; }
.acao-t { font-size: 15px; font-weight: 650; margin: 6px 0 8px; }
.acao-d { font-size: 13px; color: var(--text-2); line-height: 1.55; min-height: 62px; }
.acao-bar { height: 6px; background: var(--grid); border-radius: 0 3px 3px 0; margin: 14px 0 8px; overflow: hidden; }
.acao-bar div { height: 100%; border-radius: 0 3px 3px 0; }
.acao-e { font-size: 12.5px; color: var(--text-2); font-weight: 600; }

.naos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.nao { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
       background: var(--panel); font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.nao b { color: var(--text); display: block; margin-bottom: 4px; }
.nao-x { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
         background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical);
         font-weight: 700; margin-bottom: 10px; }

.tecnico summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600; }
.tecnico summary:hover { color: var(--text); }
.tecnico[open] summary { margin-bottom: 4px; }

/* ------------------------------------------------------------ diagramas */
figure.fig { margin: 0; }
figure.fig svg { max-width: 100%; height: auto; display: block; }
figure.fig figcaption { color: var(--text-2); font-size: 12.5px; margin-top: 10px; line-height: 1.55; }
.dg-box  { fill: var(--panel); stroke: var(--border); stroke-width: 1; }
.dg-soft { fill: var(--bg); stroke: var(--border-soft); stroke-width: 1; }
.dg-acc  { fill: var(--accent-soft); stroke: var(--accent-line); stroke-width: 1.5; }
.dg-warn { fill: color-mix(in srgb, var(--warning) 12%, var(--panel)); stroke: var(--warning); stroke-width: 1.5; }
.dg-l    { fill: var(--text); font-size: 12.5px; font-weight: 620; }
.dg-s    { fill: var(--text-3); font-size: 10.5px; }
.dg-e    { stroke: var(--text-2); stroke-width: 1.5; fill: none; }
.dg-eo   { stroke: var(--text-3); stroke-width: 1.5; fill: none; stroke-dasharray: 5 4; opacity: .8; }
.dg-et   { fill: var(--text-2); font-size: 10.5px; }
.dg-eto  { fill: var(--text-3); font-size: 10.5px; font-style: italic; }
.dg-t    { fill: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; }
.dg-step { transition: opacity .28s ease; }
figure.fig[data-step] .dg-step { opacity: .26; }
figure.fig[data-step="0"] .dg-step { opacity: 1; }
figure.fig[data-step="1"] .dg-step[data-s="1"],
figure.fig[data-step="2"] .dg-step[data-s="2"],
figure.fig[data-step="3"] .dg-step[data-s="3"],
figure.fig[data-step="4"] .dg-step[data-s="4"],
figure.fig[data-step="5"] .dg-step[data-s="5"],
figure.fig[data-step="6"] .dg-step[data-s="6"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .dg-step { transition: none; }
  figure.fig[data-step] .dg-step { opacity: 1; }
}
.flow-cap { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
            border-radius: 9px; padding: 12px 14px; font-size: 13px; line-height: 1.55; margin-top: 14px; min-height: 58px; }

/* chips clicáveis de família no histórico */
.fam { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
       border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
       font-size: 12px; color: var(--text-2); background: var(--panel); }
.fam:hover { border-color: var(--accent-line); color: var(--text); }
.fam.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.fam b { font-variant-numeric: tabular-nums; }

/* linhas de métrica que levam ao caso concreto */
.bar-row.clicavel, .hero.clicavel { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.bar-row.clicavel:hover, .hero.clicavel:hover { background: var(--accent-soft); }

/* comparação lado a lado: IA × técnico */
.comp { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media (max-width: 1200px) { .comp { grid-template-columns: 1fr; } }

/* janela de datas personalizada nos filtros */
.f-per { display: flex; gap: 6px; margin-top: 8px; }
.f-per input[type=date] {
  flex: 1; min-width: 0; padding: 6px 8px; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 7px; color-scheme: dark;
}
:root[data-theme="light"] .f-per input[type=date] { color-scheme: light; }
.f-per input[type=date]:focus { outline: none; border-color: var(--accent-line); }

/* índice do manual */
.man-idx { display: flex; flex-wrap: wrap; gap: 8px; }
.man-idx a {
  display: inline-block; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 12.5px; color: var(--text-2); text-decoration: none;
  background: var(--panel);
}
.man-idx a:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.man-idx-sub { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.man-idx-sub a { font-size: 11.5px; padding: 5px 10px; color: var(--text-3); }
.man-ul { font-size: 13.5px; line-height: 1.7; color: var(--text-2); max-width: 860px;
          padding-left: 20px; margin: 0 0 12px; }
.man-ul li { margin-bottom: 7px; }
.man-ul b { color: var(--text); }
/* destaca a seção alvo por um instante ao chegar pelo índice */
.sec:target { border-color: var(--accent-line); }
.man-h[id] { scroll-margin-top: 20px; }
.sec[id] { scroll-margin-top: 16px; }

/* índice do manual recolhido por padrão — não come a tela toda */
.man-sum > summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--text-2);
                     list-style: none; }
.man-sum > summary::-webkit-details-marker { display: none; }
.man-sum > summary::before { content: '▸ '; color: var(--accent); }
.man-sum[open] > summary::before { content: '▾ '; }
.man-sum > summary:hover { color: var(--text); }

/* linha do tempo do chamado */
.ldt { display: flex; flex-direction: column; gap: 2px; }
.ldt-i { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; }
.ldt-i:not(:last-child)::after {
  content: ''; position: absolute; left: 4px; top: 22px; bottom: -4px;
  width: 1px; background: var(--border);
}
.ldt-p { width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
         flex-shrink: 0; margin-top: 5px; z-index: 1; }
.ldt-i.pend .ldt-p { background: var(--border); border: 1px solid var(--text-3); }
.ldt-i.pend b { color: var(--text-3); }
.ldt-d { color: var(--text-2); font-size: 12px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.ldt-i .muted { font-size: 12px; line-height: 1.5; margin-top: 2px; }

/* as duas medidas de concordância, lado a lado */
.duas-medidas { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
                gap: 14px; margin-bottom: 20px; }
.duas-medidas > div { border: 1px solid var(--border); border-radius: 10px;
                      padding: 14px 16px; background: var(--panel); }
.dm-n { font-size: 30px; font-weight: 680; letter-spacing: -.02em; line-height: 1; }
.dm-forte { color: var(--accent); }
.dm-dif { color: var(--warning); }
.dm-t { font-size: 12.5px; font-weight: 600; margin: 6px 0 4px; }
.duas-medidas .muted { font-size: 11.5px; line-height: 1.5; }

/* índice do manual como coluna lateral (mesmo recolher dos filtros) */
.man-nav { font-size: 12.5px; line-height: 1.4; padding: 7px 9px; }
.man-nav.man-sub { padding-left: 20px; font-size: 11.5px; color: var(--text-3); }
.man-nav.man-sub::before { content: '· '; }
.man-nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.man-nav.man-sub.on { color: var(--accent); }
#pgManual { scroll-behavior: smooth; }
#fManual { padding-top: 34px; }

/* separador de grupo na fila */
.grp { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px;
       font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
       color: var(--text-3); font-weight: 700; background: var(--panel);
       border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.grp span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp b { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* hierarquia das referências de qualidade */
.ref-ordem { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
             gap: 14px; margin-bottom: 14px; }
.ref-ordem > div { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
                   background: var(--panel); }
.ref-ordem .ref-1 { border-color: var(--accent-line); background: var(--accent-soft); }
.ref-ordem b { font-size: 13.5px; }
.ref-ordem .muted { font-size: 12px; line-height: 1.55; margin: 5px 0 8px; }
.ref-n { font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.ref-1 .ref-n { color: var(--accent); }
.ref-2 .ref-n { color: var(--text-2); }

/* botão que revela a marcação do agente só depois da decisão */
.revelar { border-style: dashed; color: var(--text-3); font-size: 11.5px; }
.revelar:hover { color: var(--text); border-color: var(--accent-line); }

/* ---------------------------------------------------- modais do painel */
.modal-bg {
  position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.68);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; transition: opacity .18s;
}
.modal-bg.on { opacity: 1; }
.modal {
  width: min(520px, 100%); background: var(--raised); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  transform: translateY(8px); transition: transform .18s;
}
/* variante retangular: usa bem mais a tela (insights ✨, vídeo, changelog) mantendo a mesma caixa */
.modal-wide { width: min(960px, 94vw); max-height: 88vh; overflow: auto; border-radius: 16px; }
.modal-bg.on .modal { transform: translateY(0); }
.modal-t { font-size: 17px; font-weight: 680; letter-spacing: -.01em; margin-bottom: 8px; }
.modal-d { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.modal-obs {
  margin-top: 12px; padding: 11px 13px; border-left: 3px solid var(--warning);
  border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--warning) 8%, transparent);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
}
.modal-campo { margin-top: 14px; }
.modal-campo label { display: block; font-size: 11.5px; font-weight: 650; color: var(--text-2);
                     margin-bottom: 5px; }
.modal-erro { color: var(--critical); font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.modal-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal-acts button { padding: 8px 16px; }

/* ------------------------------------------------- anexo em tamanho grande */
.anx-clic { cursor: zoom-in; transition: border-color .15s; }
.anx-clic:hover { border-color: var(--accent) !important; }
.lb { background: rgba(0,0,0,.88); }
.lb-box { display: flex; flex-direction: column; gap: 10px; max-width: 94vw; max-height: 92vh; }
.lb-box img { max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 10px;
              cursor: zoom-out; background: var(--panel); }
.lb-pe { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 12.5px; }
.lb-pe span { flex: 1; font-family: ui-monospace, monospace; overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; }
.lb-pe a { color: var(--accent); text-decoration: none; }
.lb-pe a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .modal-bg, .modal { transition: none; } }

/* validação ao vivo do modelo */
.chip.crit { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }

/* lista de chamados de uma hora (modal do gráfico de classificações no Status) */
.ph-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 12px;
            max-height: 56vh; overflow: auto; padding-right: 4px; }
.ph-linha { display: flex; align-items: center; gap: 10px; padding: 8px 11px;
            border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
            font-size: 12.5px; color: var(--text); transition: border-color .12s, background .12s; }
.ph-linha:hover { background: var(--raised); border-color: var(--accent-line); }
.ph-linha .chip { flex-shrink: 0; }
.ph-linha.off { cursor: default; opacity: .62; }
.ph-linha.off:hover { background: transparent; border-color: var(--border); }

/* ---- status / health, no formato "lista de serviço" (dot + nome + detalhe) ---- */
.aws-tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.aws-tabela thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.aws-row td { padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.aws-row { cursor: pointer; }
.aws-row:hover td { background: var(--panel-2); }
.aws-ic { width: 28px; }
.aws-dot {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  background: var(--text-3);
}
.aws-dot.ok { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.aws-dot.crit { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 18%, transparent); }
.aws-nome { font-weight: 600; white-space: nowrap; width: 1%; padding-right: 22px; }
.aws-det { color: var(--text-2); }

/* aviso de loop aberto na tela Revisar: cobertura de revisão muito abaixo do volume.
   Sem revisão, classificar não ensina — o aviso aponta para a tela Desempenho. */
.aviso-loop {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--warning) 12%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.45;
  margin-bottom: 14px;
}
.aviso-loop b { color: var(--warning); }
.aviso-loop .btn { margin-left: auto; }

/* banner de status geral, estilo página de status pública (ok/degradado/crítico) */
.status-banner {
  padding: 16px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
  color: #fff; margin-bottom: 18px;
}
.status-banner.ok { background: var(--good); }
.status-banner.warn { background: var(--warning); color: #1a1400; }
.status-banner.crit { background: var(--critical); }

.status-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.status-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-soft); cursor: pointer;
}
.status-item:last-child { border-bottom: none; }
.status-item:hover { background: var(--panel-2); }
.status-item-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.status-item-txt b { display: block; font-size: 14px; }
.status-item-txt span { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.status-item-tag { font-size: 12.5px; font-weight: 650; white-space: nowrap; flex-shrink: 0; }
.status-item-tag.ok { color: var(--good); }
.status-item-tag.crit { color: var(--critical); }
.status-item-tag.muted { color: var(--text-3); }

/* Callout "Como ler esta tela" — explicação com casos reais nas telas de decisão */
.como-ler {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--raised);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}
.como-ler b { color: var(--text-3); }
.como-ler code { font-size: 12px; }
