/* Cores e tipografia do Padrão Digital de Governo (gov.br). Só tema claro. */
:root {
  --blue: #1351b4;          /* blue-warm-vivid-70: cor primária */
  --blue-dark: #0c326f;     /* blue-warm-vivid-80: hover */
  --blue-darker: #071d41;   /* blue-warm-vivid-90: títulos */
  --blue-5: #eff4fc;
  --blue-10: #dbe8fb;
  --blue-20: #c5d4eb;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f8f8;
  --text: #333333;
  --muted: #555555;
  --subtle: #888888;
  --border: #cccccc;
  --border-soft: #e6e6e6;
  --accent: var(--blue);
  --accent-soft: var(--blue-10);
  --accent-text: #ffffff;
  --danger: #b71c1c;
  --danger-soft: #fde0db;
  --warning: #ffcd07;       /* yellow-vivid-20: alerta do gov.br */
  --warning-soft: #fff5c2;  /* yellow-vivid-5 */
  --code-bg: #f5f5f5;
  --shadow: 0 1px 2px rgba(7, 29, 65, .06), 0 3px 10px rgba(7, 29, 65, .05);
  --radius: 12px;
  --sans: "Rawline", "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* senão um display:flex de alguma regra anularia o atributo hidden */
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
}

button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #c2850c; outline-offset: 2px; } /* cor de foco do gov.br */

svg.ico {
  width: 24px; height: 24px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------- Cabeçalho gov.br ---------- */

.govbar { background: #fff; border-bottom: 1px solid var(--border-soft); box-shadow: 0 1px 6px rgba(0, 0, 0, .04); }
.govbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.gov-brand { display: flex; align-items: center; gap: 22px; min-width: 0; }
.govbr-logo {
  font: 800 38px/1 var(--sans); letter-spacing: -.045em;
  font-family: "Rawline", "Raleway", Arial, sans-serif;
  user-select: none; white-space: nowrap;
}
.c-blue { color: #1351b4; }
.c-yellow { color: #f9c80e; }
.c-green { color: #168821; }
.gov-divider { width: 1px; height: 36px; background: var(--border-soft); }
.gov-org { font-size: 20px; font-weight: 600; color: var(--blue-darker); white-space: nowrap; }

/* Menu do usuário */
.user-menu { position: relative; min-width: 0; }
.user {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  border: 0; background: transparent; color: inherit; text-align: left;
  padding: 6px 8px; border-radius: 8px;
}
.user:hover { background: var(--blue-5); }
.user .chevron { width: 18px; height: 18px; color: var(--muted); }
.user[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.user-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 260px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--border-soft); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(7, 29, 65, .16); padding: 14px 16px 10px;
}
.user-panel-name { font-weight: 700; color: var(--blue-darker); overflow-wrap: anywhere; }
.user-panel-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.user-panel form { margin: 12px -8px 0; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.logout-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--blue); font-weight: 600; font-size: 14px;
  padding: 8px; border-radius: 6px; text-align: left;
}
.logout-btn:hover { background: var(--blue-5); }
.logout-btn svg.ico { width: 20px; height: 20px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
.avatar svg.ico { width: 22px; height: 22px; }
.user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-name {
  font-size: 14px; font-weight: 600; color: var(--blue-darker);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-unit { font-size: 12px; color: var(--muted); }

/* ---------- Grade: coluna principal + cards ---------- */

.page {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px;
  align-items: start; padding-block: 20px 40px;
}
.main-col { min-width: 0; display: flex; flex-direction: column; position: relative; }

/* Marca d'água da tela inicial. O PNG tem fundo branco opaco: o multiply some com o branco e deixa só o desenho.
   Termina acima do aviso do rodapé, que já tem contraste baixo */
.main-col::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: 150px 0 48px;
  background: url("logo-elaia.png") center / contain no-repeat;
  mix-blend-mode: multiply; opacity: .2;
  transition: opacity .45s ease;
}
.in-conversation .main-col::before { opacity: 0; }
.side-col { display: flex; flex-direction: column; gap: 16px; }

.dept { display: flex; align-items: center; gap: 12px; font-size: 21px; color: var(--text); }
.dept svg.ico { color: var(--blue); }

/* Bloco da ElaIA: grande na tela inicial, compacto durante a conversa */
.hero { display: flex; align-items: center; gap: 24px; margin: 22px 0 28px; }
.elaia-logo { width: 88px; height: 88px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.elaia-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hero-title { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 32px; font-weight: 700; color: var(--blue-darker); letter-spacing: -.01em; }
.badge {
  display: inline-block; padding: 4px 18px; border-radius: 6px;
  background: #fde9dc; color: #d4550f; font-size: 13.5px; font-weight: 600;
}
.hero-sub { margin: 6px 0 0; font-size: 17px; color: var(--muted); }

.in-conversation .hero { gap: 14px; margin: 12px 0 16px; }
.in-conversation .elaia-logo { width: 44px; height: 44px; }
.in-conversation .hero h1 { font-size: 22px; }
.in-conversation .hero-title { gap: 14px; }
.in-conversation .badge { padding: 2px 12px; font-size: 12px; }
.in-conversation .hero-sub { display: none; }

/* ---------- Tela inicial ---------- */

/* Fundos translúcidos na tela inicial, para a marca d'água aparecer por baixo. Sobre o branco, o tom
   é o mesmo de antes: rgba(228, 237, 250, .6) dá exatamente o --blue-5 (#eff4fc) */
.welcome {
  background: rgba(228, 237, 250, .6); border-radius: var(--radius);
  padding: 14px 24px; font-size: 14.5px; line-height: 1.45; color: #1f1f1f;
}
.welcome p { margin: 6px 0; }
.welcome p:last-child { margin-top: 14px; }

.examples-title { margin: 30px 0 14px; font-size: 15px; font-weight: 700; color: var(--text); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chip {
  display: flex; align-items: center; gap: 14px; text-align: left;
  min-height: 46px; padding: 10px 16px;
  border: 1px solid var(--blue); border-radius: 8px;
  background: rgba(255, 255, 255, .6); color: var(--blue); font-size: 13.5px; line-height: 1.35;
}
.chip svg.ico { width: 22px; height: 22px; stroke-width: 1.5; }
.chip:hover { background: var(--blue-5); }
.chip:active { background: var(--blue-10); }

/* ---------- Caixa de pergunta ---------- */

.composer { padding-top: 28px; }
/* na conversa, a caixa fica presa no fim da tela */
.in-conversation .composer {
  position: sticky; bottom: 0; z-index: 4;
  padding-top: 18px;
  background: linear-gradient(to top, #fff 82%, rgba(255, 255, 255, 0));
}
.composer form {
  position: relative;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px 8px 18px;
}
.in-conversation .composer form { background: #fff; }
.composer form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-10); }
.composer textarea {
  display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 15px; padding: 4px 0; max-height: 160px;
}
.composer textarea::placeholder { color: var(--subtle); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }

.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px;
}
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  padding: 2px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.segmented button[aria-pressed="true"] { background: var(--blue); color: #fff; }

.send {
  margin-left: auto; /* fica à direita também quando o seletor de modo some (conversa com skill) */
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--blue);
}
.send:hover:not(:disabled) { background: var(--blue-5); }

/* Lista de skills (ao digitar "/") e aviso de conversa nova: logo acima da caixa */
.skill-menu, .skill-confirm {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 20;
  background: #fff; border: 1px solid var(--border-soft); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(7, 29, 65, .16);
}
.skill-menu { max-height: 280px; overflow-y: auto; padding: 6px; }
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.skill-item:hover, .skill-item.active { background: var(--blue-5); }
.skill-item-name { font-weight: 600; font-size: 14px; color: var(--blue-darker); }
.skill-item-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.skill-message { margin: 6px 10px; font-size: 13.5px; color: var(--muted); }
.skill-confirm {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; font-size: 14px; color: var(--text);
  background: var(--warning-soft); border: 1px solid var(--warning); border-left-width: 6px;
}
.skill-confirm > svg.ico { width: 22px; height: 22px; stroke-width: 2; align-self: flex-start; }
.skill-confirm-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.skill-confirm-text strong { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.skill-confirm-actions { display: flex; align-items: center; gap: 12px; }

.primary {
  border: 0; background: var(--blue); color: #fff;
  padding: 8px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.primary:hover { background: var(--blue-dark); }

.disclaimer {
  display: flex; gap: 6px; align-items: flex-start;
  margin: 8px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--subtle);
}
.disclaimer svg.ico { width: 14px; height: 14px; margin-top: 1px; stroke-width: 2; }

.banner {
  margin-bottom: 10px; padding: 10px 14px; border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500;
}
.banner.info { background: var(--blue-5); color: var(--blue-darker); }

/* ---------- Página de login ---------- */

.login-page { padding-block: 48px 40px; display: flex; justify-content: center; }
.login-card {
  width: 100%; max-width: 620px;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 36px 24px;
}
.login-hero { margin: 0 0 20px; }
.login-text { margin: 0 0 20px; font-size: 15.5px; line-height: 1.5; color: var(--text); }
.login-card .banner { margin-bottom: 18px; }
.login-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 10px 24px; border-radius: 999px;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none;
}
.login-btn:hover { background: var(--blue-dark); }
.login-btn.disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }
.login-card .disclaimer { margin-top: 20px; }

/* ---------- Cards da direita ---------- */

.card {
  display: block; background: #fff; border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px;
}
.card-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.card-head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--blue-darker); flex: 1; }
.card-head > svg.ico { color: var(--blue-darker); }

.link-btn {
  border: 0; background: none; padding: 4px 2px; color: var(--blue);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover:not(:disabled) { text-decoration: underline; }
.new-chat { font-size: 13px; white-space: nowrap; }
.new-chat svg.ico { width: 16px; height: 16px; stroke-width: 2.2; }

/* Manual */
.card.manual {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--blue-5); border-color: var(--blue-20);
  color: inherit; text-decoration: none;
}
.card.manual[href]:hover { border-color: var(--blue); }
.manual-icon {
  width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-10); color: var(--blue);
}
.manual-icon svg.ico { width: 28px; height: 28px; stroke-width: 1.5; }
.manual-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.manual-title { color: var(--blue); font-weight: 700; font-size: 14.5px; }
.manual-sub { color: var(--muted); font-size: 11.5px; }
.manual-ext { color: var(--blue); }

/* Conversas recentes */
.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.recent-item button {
  width: 100%; border: 0; background: transparent; color: var(--text);
  padding: 9px 14px; border-radius: 6px; text-align: left; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-item button:hover:not(:disabled) { background: var(--blue-5); }
.recent-item.active button { background: var(--blue-10); color: var(--blue-darker); font-weight: 500; }
.card-foot { border-top: 1px solid var(--border-soft); margin-top: 12px; padding-top: 10px; }
.side-empty { margin: 4px 14px; font-size: 13.5px; color: var(--muted); }

/* Bases de conhecimento */
.kb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.kb-list li { display: flex; align-items: center; gap: 14px; }
.kb-icon {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.kb-icon svg.ico { width: 22px; height: 22px; }
.kb-icon.green  { background: #e3f4ea; color: #168821; }
.kb-icon.red    { background: #fde5e5; color: #b71c1c; }
.kb-icon.purple { background: #ece8fb; color: #5b3fc4; }
.kb-icon.orange { background: #fdeedb; color: #c25e00; }
.kb-icon.teal   { background: #e0f2f1; color: #00796b; }
.kb-title { display: block; font-size: 14.5px; font-weight: 600; color: var(--blue-darker); }
.kb-sub { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Janela "Todas as conversas" ---------- */

.conv-dialog {
  width: min(620px, calc(100vw - 32px)); max-height: min(80vh, 720px);
  padding: 0; border: 0; border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(7, 29, 65, .25); color: var(--text);
}
.conv-dialog::backdrop { background: rgba(7, 29, 65, .45); }
.dialog-box { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--border-soft);
}
.dialog-head h2 { margin: 0; flex: 1; font-size: 18px; color: var(--blue-darker); }
.icon-btn {
  border: 0; background: transparent; color: var(--muted);
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.dialog-body { overflow-y: auto; padding: 10px 12px 16px; }

.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-item button {
  width: 100%; border: 0; background: transparent; color: var(--text);
  padding: 9px 12px; border-radius: 6px; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
}
.conv-item button:hover:not(:disabled) { background: var(--blue-5); }
.conv-item.active button { background: var(--blue-10); }
.conv-title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.conv-mode { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); }

.ghost {
  border: 1px solid var(--blue); background: #fff; color: var(--blue);
  padding: 6px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.ghost:hover { background: var(--blue-5); }
.more { display: block; margin: 12px auto 0; }

/* ---------- Conversa ---------- */

.thread { display: flex; flex-direction: column; gap: 28px; padding-bottom: 8px; }
.replay-loading { margin: 20px 0; }

/* Topo da conversa com skill */
.skill-head { border-bottom: 1px solid var(--border-soft); padding-bottom: 10px; margin-bottom: -12px; }
.skill-head-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700;
}
.skill-head-name { font-size: 17px; font-weight: 700; color: var(--blue-darker); overflow-wrap: anywhere; }
.skill-head-note { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.turn { display: flex; flex-direction: column; gap: 12px; }

.question {
  align-self: flex-end; max-width: 80%;
  background: var(--accent); color: var(--accent-text);
  padding: 10px 14px; border-radius: 14px 14px 4px 14px;
  white-space: pre-wrap;
}
.turn .mode-tag {
  align-self: flex-end; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-top: -6px;
}

/* Passos (rastro do trabalho do Genie) */
.trace {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.trace-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
}
.trace.collapsed .trace-head { border-bottom: 0; }
.trace.collapsed .steps { display: none; }
.trace-head .status { flex: 1; color: var(--text); font-weight: 500; }
.trace-head .meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.trace-head .toggle {
  border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 4px;
}

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.trace.finished .spinner { animation: none; border-color: #168821; background: #168821; }
.trace.failed .spinner { animation: none; border-color: var(--danger); background: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

.steps { list-style: none; margin: 0; padding: 6px 14px 12px 14px; }
.step {
  position: relative; padding: 10px 0 10px 22px;
  border-left: 2px solid var(--border-soft); margin-left: 6px;
}
.step::before {
  content: ""; position: absolute; left: -6px; top: 16px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--subtle);
}
.step.query::before { border-color: var(--accent); background: var(--accent-soft); }
.step:last-child { border-left-color: transparent; }

/* destaque rápido do passo quando se clica numa citação [N] */
.step.flash { animation: flash 1.8s ease-out; }
@keyframes flash {
  0%, 35% { background: var(--accent-soft); }
  100% { background: transparent; }
}

.step .kind {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700;
}
.step.reasoning .body { color: var(--muted); font-size: 14px; }
.step.reasoning .body p { margin: 4px 0; }
.step.query .title { font-weight: 600; margin: 2px 0 6px; }

details.sql summary {
  cursor: pointer; color: var(--accent); font-size: 13px; width: fit-content;
}
details.sql pre, .code {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--code-bg); border: 1px solid var(--border-soft);
  font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word;
}
.result { margin-top: 8px; }
.result .pending { color: var(--muted); font-size: 13px; }

/* Tabelas */
.table-wrap {
  overflow: auto; max-height: 320px;
  border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface);
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
th {
  position: sticky; top: 0; background: var(--surface-2);
  font-weight: 700; font-size: 12px; color: var(--muted);
}
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.caption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Resposta final */
.report {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px;
}
.report .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.report p { margin: 8px 0; }
.report h3, .report h4, .report h5 { margin: 16px 0 6px; line-height: 1.3; color: var(--blue-darker); }
.report ul, .report ol { padding-left: 22px; }
.report hr { border: 0; border-top: 1px solid var(--border-soft); margin: 16px 0; }
.report blockquote { margin: 10px 0; padding: 2px 14px; border-left: 3px solid var(--blue-20); color: var(--muted); }
.report .table-block { margin: 12px 0; }
.report code, .step code { font-family: var(--mono); font-size: .9em; background: var(--code-bg); padding: 1px 4px; border-radius: 4px; }
.report a { color: var(--accent); }
.report figure.viz { margin: 14px 0; }
.report figure.viz .viz-box { min-height: 48px; display: flex; align-items: center; }
.report figure.viz .viz-box .pending { font-size: 12px; font-style: italic; color: var(--muted); }
.report figure.viz img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--border-soft); border-radius: 8px;
  background: #ffffff;
}
.report figure.viz .viz-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.report figure.viz .viz-title { font-size: 13px; font-weight: 700; }
.viz-tabs {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px;
}
.viz-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 3px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
}
.viz-tabs button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.report figure.viz .viz-foot { margin-top: 6px; }
.report figure.viz .viz-box .table-wrap { width: 100%; }
.report-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}
.export-btn {
  border: 1px solid var(--blue-20); background: var(--surface); color: var(--accent);
  padding: 3px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
}
.export-btn:hover:not(:disabled) { background: var(--blue-5); }
.export-status { font-size: 12.5px; color: var(--muted); }
.export-status.failed { color: var(--danger); }
.linklike {
  border: 0; background: none; padding: 0;
  color: var(--accent); font-size: 12px; text-decoration: underline;
}
sup.cite a {
  display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 1px;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  font-size: 11px; line-height: 16px; text-align: center; text-decoration: none; font-weight: 600;
}

.error {
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius); padding: 12px 16px; font-size: 14px;
}
.notice { color: var(--muted); font-size: 13.5px; font-style: italic; }

/* ---------- Telas menores ---------- */

/* abaixo de 992px (breakpoint do gov.br): uma coluna, cards embaixo */
@media (max-width: 991px) {
  .page { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .govbar-inner { min-height: 60px; }
  .gov-brand { gap: 12px; }
  .govbr-logo { font-size: 28px; }
  .gov-divider { height: 28px; }
  .gov-org { font-size: 15px; }
  .user-text { display: none; }
  .user { padding: 4px; }
  .login-page { padding-block: 20px 32px; }
  .login-card { padding: 22px 18px 18px; }
  .login-hero .hero-sub { font-size: 14.5px; }
  .login-btn { font-size: 15px; padding: 10px 14px; gap: 8px; }
  .dept { font-size: 17px; }
  .hero { gap: 16px; }
  .elaia-logo { width: 64px; height: 64px; }
  .hero h1 { font-size: 26px; }
  .hero-title { gap: 10px; }
  .hero-sub { font-size: 15px; }
  .welcome { padding: 12px 16px; }
  /* no celular a coluna é quase toda texto e a marca ficaria atrás dos exemplos */
  .main-col::before { display: none; }
  .chips { grid-template-columns: 1fr; }
  .question { max-width: 92%; }
}
