/* Painel do piloto (#360, #372). Identidade Truatos: TODA cor vem de pay-web/src/styles/globals.css (truatos-*) e
   tokens.css (ink-*, success/warning/danger/info); nenhuma cor nova. Tema escuro por padrão; claro pelo botão
   (data-tema no <html>, gravado em cookie) ou, na primeira visita, por prefers-color-scheme. Fonte do sistema: nenhuma
   fonte é baixada. Animação só com transform e opacity; desliga com prefers-reduced-motion e com Save-Data (.calmo). */
:root {
  --truatos-50: #eef0ea; --truatos-100: #d7e3dc; --truatos-200: #aecbbd; --truatos-300: #7ea997; --truatos-400: #4f8770;
  --truatos-500: #2f6d55; --truatos-600: #1a5640; --truatos-700: #0e3b2e; --truatos-800: #0a2e24; --truatos-900: #07241c;
  --ink-50: #f4f6f4; --ink-100: #e7ebe8; --ink-200: #d2d8d3; --ink-300: #aab4ad; --ink-500: #5a655e; --ink-600: #3f4a44;
  --ink-700: #2a342e; --ink-800: #1a221d; --ink-900: #111813; --ink-950: #0a0f0c;
  --success-50: #e3f1e8; --warning-50: #fffbeb; --warning-500: #f59e0b; --warning-700: #b45309;
  --danger-50: #fef2f2; --danger-500: #ef4444; --danger-700: #b91c1c; --info-50: #eff6ff; --info-500: #3b82f6; --info-700: #1d4ed8;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Hanken Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-control: 0.5rem; --r-surface: 0.75rem; --r-pill: 9999px;
  /* escuro (padrão): neutros ink-950..700 de fundo, ink-50..300 de texto; verde da marca clareado para destaque */
  --bg: var(--ink-950); --surface: var(--ink-900); --surface-2: var(--ink-800); --line: var(--ink-700);
  --text: var(--ink-50); --text-2: var(--ink-200); --muted: var(--ink-300);
  --accent: var(--truatos-300); --action: var(--truatos-500); --action-hover: var(--truatos-400); --on-action: #fff;
  --top-bg: var(--truatos-900); --top-text: var(--ink-50);
  --ok-bg: var(--truatos-600); --ok-fg: var(--success-50); --warn-bg: var(--warning-700); --warn-fg: var(--warning-50);
  --bad-bg: var(--danger-700); --bad-fg: var(--danger-50); --info-bg: var(--info-700); --info-fg: var(--info-50);
  --neutral-bg: var(--ink-700); --neutral-fg: var(--ink-100); --danger: var(--danger-500);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark; accent-color: var(--truatos-400);
}
/* claro: os valores do painel de antes (#360). Dois blocos iguais: o botão (data-tema) e a primeira visita (sistema). */
:root[data-tema="claro"] {
  --bg: var(--ink-50); --surface: #fff; --surface-2: var(--ink-50); --line: var(--ink-200);
  --text: var(--ink-900); --text-2: var(--ink-700); --muted: var(--ink-500);
  --accent: var(--truatos-600); --action: var(--truatos-600); --action-hover: var(--truatos-700);
  --top-bg: var(--truatos-700);
  --ok-bg: var(--success-50); --ok-fg: var(--truatos-600); --warn-bg: var(--warning-50); --warn-fg: var(--warning-700);
  --bad-bg: var(--danger-50); --bad-fg: var(--danger-700); --info-bg: var(--info-50); --info-fg: var(--info-700);
  --neutral-bg: var(--ink-100); --neutral-fg: var(--ink-700); --danger: var(--danger-700);
  --shadow: 0 1px 2px rgba(10, 15, 12, 0.06);
  color-scheme: light; accent-color: var(--truatos-600);
}
@media (prefers-color-scheme: light) {
  :root:not([data-tema]) {
    --bg: var(--ink-50); --surface: #fff; --surface-2: var(--ink-50); --line: var(--ink-200);
    --text: var(--ink-900); --text-2: var(--ink-700); --muted: var(--ink-500);
    --accent: var(--truatos-600); --action: var(--truatos-600); --action-hover: var(--truatos-700);
    --top-bg: var(--truatos-700);
    --ok-bg: var(--success-50); --ok-fg: var(--truatos-600); --warn-bg: var(--warning-50); --warn-fg: var(--warning-700);
    --bad-bg: var(--danger-50); --bad-fg: var(--danger-700); --info-bg: var(--info-50); --info-fg: var(--info-700);
    --neutral-bg: var(--ink-100); --neutral-fg: var(--ink-700); --danger: var(--danger-700);
    --shadow: 0 1px 2px rgba(10, 15, 12, 0.06);
    color-scheme: light; accent-color: var(--truatos-600);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/20px var(--font); overflow-x: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 12px; }
p.warn { color: var(--warn-fg); background: var(--warn-bg); padding: 6px 8px; border-radius: var(--r-control); font-size: 12px; }
p.warn a { color: inherit; }
.empty { color: var(--muted); font-size: 13px; margin: 4px 0; }
.err { background: var(--bad-bg); color: var(--bad-fg); border-radius: var(--r-control); padding: 8px 10px; font-size: 13px; }
.num { font-family: var(--font-mono); color: var(--accent); font-weight: 600; margin-right: 6px; }

/* botões: alvo de toque de 44 px */
button, .btn { font: inherit; font-size: 14px; min-height: 44px; padding: 0 14px; border-radius: var(--r-control); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
button.pri { background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 600; }
button.pri:hover { background: var(--action-hover); }
button.perigo { background: var(--bad-bg); border-color: var(--bad-bg); color: var(--bad-fg); font-weight: 600; }
button.icone { min-width: 44px; padding: 0; font-size: 18px; }
button.link { min-height: 44px; border: 0; background: none; color: var(--accent); padding: 0 6px; text-decoration: underline; text-align: left; }
input, textarea { font: inherit; font-size: 16px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--surface-2); color: var(--text); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin: 12px 0 4px; }
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; margin: 0 6px 0 0; vertical-align: middle; }
label.check { display: flex; align-items: center; min-height: 44px; }

/* topo */
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; background: var(--top-bg); color: var(--top-text); }
.marca { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-height: 44px; }
.logo { height: 18px; width: auto; }
.wordmark { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; font-size: 20px; line-height: 1; }
.top .sub { font-size: 13px; opacity: 0.85; }
.top .who { font-size: 12px; opacity: 0.85; overflow-wrap: anywhere; }
.top form { margin: 0; }
.top button { background: transparent; color: inherit; border-color: rgba(255, 255, 255, 0.4); }
.aviso { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; font-weight: 600; }
.aviso button { margin-left: 8px; }

/* grade: uma coluna no celular, mais densa no desktop */
main.painel { max-width: 1280px; margin: 0 auto; padding: 8px; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-surface); box-shadow: var(--shadow); padding: 12px; min-width: 0; }
.card h2, .sec-head h2 { font-family: var(--font-display); font-size: 16px; line-height: 22px; margin: 0 0 8px; }
.sec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sec-head h2 { margin: 0; flex: 1; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }
h3 { font-size: 13px; color: var(--text-2); margin: 12px 0 4px; }
.status-line { margin: 0; text-align: right; }
@media (min-width: 760px) {
  main.painel { padding: 12px; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wide, .status-line { grid-column: 1 / -1; }
  .card { padding: 14px; }
}
@media (min-width: 1100px) { main.painel:not(.detalhe) { grid-template-columns: repeat(4, minmax(0, 1fr)); } .meio { grid-column: span 2; } }

/* visão geral */
.resumo { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .resumo { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control); padding: 8px 10px; min-width: 0; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 600; overflow-wrap: anywhere; }
.kpi .note { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.kpi.alerta { border-color: var(--warning-500); }
.kpi progress { width: 100%; height: 6px; }

.pill { display: inline-block; border-radius: var(--r-pill); padding: 2px 8px; font-size: 11px; line-height: 16px; font-weight: 600; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-fg); }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.pill.info { background: var(--info-bg); color: var(--info-fg); }

/* agentes */
/* abas Cartões | Escritório (#381); a do escritório não aparece com menos movimento nem com Save-Data */
.abas { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-control); overflow: hidden; }
.abas button { border: 0; border-radius: 0; background: transparent; color: var(--text-2); min-height: 44px; padding: 4px 12px; }
.abas button[aria-selected="true"] { background: var(--action); color: var(--on-action); }
.escritorio .cena { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--ink-950); }
.escritorio canvas { display: block; width: 100%; margin: 0 auto; image-rendering: pixelated; touch-action: manipulation; }
.escritorio canvas.mao { cursor: pointer; }
.escritorio .dica { position: absolute; max-width: 220px; padding: 6px 8px; border-radius: var(--r-control); background: var(--surface); color: var(--text);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; overflow-wrap: anywhere; }
.escritorio-pe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.escritorio-pe .credito { font-size: 11px; }
.agentes { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .agentes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.agente { position: relative; border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--surface-2); padding: 12px; min-width: 0; }
.agente .cab { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; cursor: pointer; min-height: 44px; }
.agente .title { font-weight: 600; overflow-wrap: anywhere; flex: 1; min-width: 120px; }
.modelo { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; font-size: 12px; font-weight: 700;
  color: var(--ink-950); background: var(--ink-300); border-radius: 50%; }
.modelo.m-fable { background: var(--truatos-300); border-radius: 8px 50% 50% 50%; }
.modelo.m-opus { background: var(--info-500); color: #fff; }
.modelo.m-sonnet { background: var(--warning-500); border-radius: 8px; }
.modelo.m-haiku { background: var(--ink-200); border-radius: 50% 50% 8px 8px; }
/* modelos alternativos (#396): mesmas cores da paleta Truatos, só a forma muda (#419) */
.modelo.m-deepseek { background: var(--danger-500); color: #fff; border-radius: 50% 8px 8px 50%; }
.modelo.m-glm { background: var(--ink-600); color: #fff; border-radius: 8px 8px 50% 8px; }
.trilha { display: flex; margin: 10px 0 8px; padding: 0; list-style: none; }
.passo { flex: 1; position: relative; text-align: center; min-width: 0; }
.passo::before { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.passo:first-child::before { display: none; }
.passo.feita::before, .passo.atual::before { background: var(--action-hover); }
.ponto { position: relative; display: block; width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--line); z-index: 1; }
.passo.feita .ponto { background: var(--action-hover); }
.passo.atual .ponto { background: var(--accent); }
.passo.pulada .ponto { background: none; border: 2px dashed var(--line); }
.passo.atual .ponto::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--accent); animation: pulso 1.4s ease-out infinite; }
.passo .nome { display: none; font-size: 10px; line-height: 14px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.passo.atual .nome { display: block; color: var(--text); font-weight: 600; }
@media (min-width: 600px) { .passo .nome { display: block; font-size: 11px; } }
.agora { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 24px; overflow-wrap: anywhere; }
.viva { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; flex: none; }
.viva i { width: 3px; height: 14px; border-radius: 2px; background: var(--accent); transform-origin: bottom; animation: onda 1s ease-in-out infinite; }
.viva i:nth-child(2) { animation-delay: 0.15s; }
.viva i:nth-child(3) { animation-delay: 0.3s; }
/* ritmo pela última escrita no log: recente = vivo; minutos sem escrever = devagar; parado = sem animação e com aviso */
.r2 .viva i, .r2 .passo.atual .ponto::after { animation-duration: 2.6s; }
.r3 .viva i { animation: none; transform: scaleY(0.3); background: var(--muted); }
.r3 .passo.atual .ponto::after { animation-duration: 5s; }
.parado { color: var(--warning-500); font-size: 12px; font-weight: 600; }
.agente .meta { font-size: 12px; color: var(--text-2); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-variant-numeric: tabular-nums; }
/* canto inferior do cartão (#419): ícone do modelo da etapa atual + bandeira do país, alinhados à direita */
.agente .canto { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.agente .canto .modelo { width: 22px; height: 22px; font-size: 10px; }
/* selo do modelo (#427): ícone do provedor (arquivo do Luan) ou reserva neutra sem logo, com a inicial no canto */
.selo-prov { position: relative; display: inline-block; width: 22px; height: 22px; flex: none; }
.selo-prov img, .selo-prov .neutro { display: block; width: 100%; height: 100%; object-fit: contain; }
.p-anthropic .neutro { background: var(--warning-500); border-radius: 6px; }
.p-ollama .neutro { background: var(--ink-600); border-radius: 50%; }
.selo-prov .inicial { position: absolute; right: -3px; bottom: -3px; min-width: 12px; height: 12px; padding: 0 1px; border-radius: 3px;
  background: #fff; color: #111; border: 1px solid #555; font: 700 9px/10px var(--font); text-align: center; }
.agente .canto .bandeira { image-rendering: pixelated; border: 1px solid var(--line); border-radius: 2px; }
.agente ol, .lados ol { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.agente li { overflow-wrap: anywhere; }
.subs { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); font-size: 13px; }
.subs li { padding: 3px 0; }
.lados { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.lado { border: 1px solid var(--line); border-radius: var(--r-control); padding: 8px; min-width: 0; font-size: 13px; }
.lado .papel { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.vazio { text-align: center; padding: 20px 8px; color: var(--muted); }
.vazio .logo { height: 28px; opacity: 0.5; display: block; margin: 0 auto 8px; }
.entra { animation: entra 0.35s ease-out both; }
.sai { animation: entra 0.3s ease-in reverse both; }
.mudou::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); opacity: 0; pointer-events: none; animation: clarao 0.9s ease-out; }
@keyframes pulso { from { transform: scale(0.7); opacity: 0.9; } to { transform: scale(2); opacity: 0; } }
@keyframes onda { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes clarao { from { opacity: 0.25; } to { opacity: 0; } }

/* listas de issues: a linha inteira é o alvo de toque */
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { border-top: 1px solid var(--line); }
ul.list li:first-child { border-top: 0; }
ul.list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 0; min-height: 44px; overflow-wrap: anywhere; }
ul.list button:hover { color: var(--accent); }
.why { display: block; font-size: 12px; color: var(--text-2); }
.filtro { display: flex; gap: 8px; align-items: center; padding: 8px 12px; }
.filtro input { flex: 1; min-height: 44px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 6px; }
td { border-bottom: 1px solid var(--line); padding: 6px; vertical-align: top; overflow-wrap: break-word; }
td:first-child { min-width: 9em; }
td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* no celular a tabela vira lista (sem rolagem horizontal) */
@media (max-width: 759px) {
  table.empilha thead { display: none; }
  table.empilha tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.empilha td:first-child { min-width: 0; }
  table.empilha td { display: flex; gap: 8px; justify-content: space-between; border: 0; padding: 2px 0; text-align: right; white-space: normal; }
  table.empilha td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
}
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { display: flex; gap: 8px; padding: 3px 0; }
.timeline .h { font-family: var(--font-mono); color: var(--muted); flex: none; }
.timeline .t { overflow-wrap: anywhere; min-width: 0; }

/* detalhe da issue */
.detalhe .cab { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.detalhe h1 { font-family: var(--font-display); font-size: 20px; line-height: 26px; margin: 0; flex: 1; min-width: 200px; overflow-wrap: anywhere; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
details { border-top: 1px solid var(--line); }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.coment { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-control); padding: 8px 10px; margin: 8px 0; min-width: 0; }
.coment.piloto { border-left-color: var(--line); background: var(--surface-2); }
.coment .quem { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.coment .quem b { color: var(--text); }
.caixa .cont { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.nota { border-left: 3px solid var(--warning-500); padding: 6px 10px; margin: 8px 0; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 0 var(--r-control) var(--r-control) 0; }
.nota.forte { color: var(--text); font-weight: 600; }

/* markdown montado no navegador a partir da árvore do servidor */
.md { overflow-wrap: anywhere; min-width: 0; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md blockquote { margin: 8px 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { font-family: var(--font-display); font-size: 15px; line-height: 20px; margin: 12px 0 4px; color: var(--text); }
.md ul, .md ol { padding-left: 20px; }
.md li.d1 { margin-left: 16px; } .md li.d2 { margin-left: 32px; } .md li.d3 { margin-left: 48px; }
.md code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.md pre { font-family: var(--font-mono); font-size: 12px; line-height: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-control);
  padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.md blockquote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--text-2); margin-left: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); }

/* diálogo de confirmação e avisos passageiros */
.dlg { border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--surface); color: var(--text); padding: 16px; width: min(92vw, 440px); max-height: 90vh; overflow-y: auto; }
.dlg::backdrop { background: rgba(10, 15, 12, 0.7); }
.dlg h2 { font-family: var(--font-display); font-size: 17px; margin: 0 0 8px; }
.dlg p { margin: 8px 0; color: var(--text-2); }
.dlg .bot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.toasts { position: fixed; left: 8px; right: 8px; bottom: 8px; display: grid; gap: 6px; justify-items: center; pointer-events: none; z-index: 5; }
.toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--accent); border-radius: var(--r-control); padding: 10px 14px; box-shadow: var(--shadow);
  max-width: 480px; overflow-wrap: anywhere; animation: entra 0.3s ease-out both; }
.toast.bad { border-color: var(--danger); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login .brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--accent); }
.login .brand .logo { height: 22px; }
.login .brand .wordmark { font-size: 24px; }
.login h1 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; }
.login p { color: var(--text-2); margin: 4px 0 12px; }
.login form button { margin-top: 18px; width: 100%; background: var(--action); border-color: var(--action); color: var(--on-action); font-size: 15px; font-weight: 600; }
.login form button:hover { background: var(--action-hover); }

/* abas, Acesso e Conversa (#373) */
.abas { display: flex; gap: 2px; }
.abas a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: inherit; text-decoration: none; border-radius: var(--r-control); font-size: 13px; opacity: 0.8; }
.abas a.ativa { opacity: 1; font-weight: 600; background: rgba(255, 255, 255, 0.14); }
main.conversa > *, main.acesso > * { grid-column: 1 / -1; }
select { font: inherit; font-size: 16px; min-height: 44px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); color: var(--text); }
.codigo { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: 0.08em; color: var(--text); }
.login .codigo { text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-control); padding: 10px; }
.disp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.disp .codigo { font-size: 15px; }
.chat-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-topo select:first-child { flex: 1 1 200px; min-width: 0; }
.msgs { display: flex; flex-direction: column; gap: 8px; min-height: 30vh; max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 8px; }
.msg { border: 1px solid var(--line); border-radius: var(--r-control); padding: 8px 10px; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.msg.eu { align-self: flex-end; max-width: 88%; background: var(--action); border-color: var(--action); color: var(--on-action); white-space: pre-wrap; }
.msg.agente { border-left: 3px solid var(--accent); }
.msg.acao { font-size: 13px; color: var(--text-2); background: var(--surface-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg.acao.sub { margin-left: 16px; }
.msg pre { flex-basis: 100%; margin: 4px 0 0; font-family: var(--font-mono); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
.msg.resultado { font-size: 12px; color: var(--muted); }
.msg.resultado.erro { border-color: var(--danger); }
.msg.resultado summary { cursor: pointer; min-height: 28px; }
.msg.fim { align-self: center; border: 0; padding: 2px 8px; font-size: 12px; color: var(--muted); }
.msg.trava { border-color: var(--warning-500); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dlg.largo { width: min(96vw, 760px); }
.dlg.largo textarea { min-height: 40vh; font-family: var(--font-mono); font-size: 13px; }

@media (max-width: 480px) { .top .sub, .top .who { display: none; } }
/* sem movimento: quem pediu menos animação (sistema) ou economia de dados (.calmo, posto pelo JS com Save-Data) */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.calmo *, .calmo *::before, .calmo *::after { animation: none !important; transition: none !important; }

/* #398: issue como lugar de trabalho, leituras em frases, print, cartão ao lado na Conversa e paleta de comandos */
.frases { display: grid; gap: 4px 16px; }
@media (min-width: 760px) { .frases { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.frases h3 { margin: 0 0 2px; }
.frases ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.rotulos { margin: 4px 0; }
button.rot { border-radius: var(--r-pill); font-size: 12px; padding: 0 12px; color: var(--muted); border-style: dashed; }
button.rot.on { color: var(--neutral-fg); background: var(--neutral-bg); border-style: solid; font-weight: 600; }
button.rot.on.bad { background: var(--bad-bg); color: var(--bad-fg); }
button.rot.on.warn { background: var(--warn-bg); color: var(--warn-fg); }
button.fraco { opacity: 0.6; }
.mais-rot summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--muted); }
.etapas ol { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.etapas li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.etapas .nome { font-weight: 600; min-width: 84px; }
.etapas meter { flex: 1 1 80px; min-width: 60px; height: 8px; }
.etapas .tempo { font-family: var(--font-mono); font-size: 12px; }
.etapas .modelo, .etapas .selo-prov { width: 20px; height: 20px; font-size: 10px; }
.etapas li.atual { border-left: 3px solid var(--accent); padding-left: 8px; }
.agora-txt { margin: 4px 0; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.nota.gh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
img.print { display: block; max-width: 100%; height: auto; max-height: 70vh; margin: 6px 0; border: 1px solid var(--line); border-radius: var(--r-control); }
.previa { border: 1px dashed var(--line); border-radius: var(--r-control); padding: 8px 10px; margin-top: 8px; min-width: 0; }
.atalhos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.atalhos button { border-radius: var(--r-pill); font-size: 13px; }
.chat-grade { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .chat-grade:has(.lado:not([hidden])) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.lado { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-control); padding: 8px 10px; min-width: 0; max-height: 62vh; overflow-y: auto; animation: entra 0.2s ease-out both; }
.lado h3 { margin: 0 0 4px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.msg.eu a { color: inherit; }
.dlg.cmd { width: min(94vw, 560px); padding: 12px; margin-top: 10vh; animation: entra 0.15s ease-out both; }
.cmd ul { list-style: none; margin: 8px 0 0; padding: 0; }
.cmd li button { width: 100%; text-align: left; border-color: transparent; background: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd li button.sel, .cmd li button:hover { background: var(--surface-2); border-color: var(--accent); }
