/* =========================================================================
   DeepChat — style.css
   Cinzas neutros, divisórias em vez de caixas e uma cor por IA:
   azul para o DeepSeek, verde para o ChatGPT. O veredito da revisão é a
   única outra cor (verde, âmbar ou vermelho).
   Seções: 0 fontes · 1 tokens · 2 base · 3 botões e campos · 4 marca ·
   5 início · 6 app e lateral · 7 barra e menu · 8 conversa · 9 markdown ·
   10 revisão · 11 compositor · 12 diálogos · 13 toasts · 14 celular ·
   15 impressão · 16 acessibilidade
   ========================================================================= */

/* ── 0. Fontes ─────────────────────────────────────────────────────────────
   Servidas pelo próprio site (fonts/, licença OFL): nenhuma visita passa
   pelo Google. Arquivos variáveis, nos mesmos recortes do Google Fonts:
   latin e latin-ext, que cobrem o português. */
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-stretch: 85% 100%; font-display: swap;
  src: url('../fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-stretch: 85% 100%; font-display: swap;
  src: url('../fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── 1. Tokens ──────────────────────────────────────────────────────────── */
:root {
  --fonte: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --lateral: 280px;
  --coluna: 720px;
  --barra-h: 56px;
  --dur: .16s;
}

:root,
[data-tema="escuro"] {
  color-scheme: dark;
  --fundo: #141416;
  --fundo-2: #1a1a1d;
  --sup: #1e1e22;
  --sup-2: #26262b;
  --sup-3: #303036;
  --borda: #2a2a30;
  --borda-2: #3a3a42;
  --texto: #ededef;
  --texto-2: #a9a9b3;
  --texto-3: #8a8a94;
  --tinta: #ededef;
  --sobre-tinta: #141416;
  --ds: #8ea2ff;
  --ds-fundo: rgba(142, 162, 255, .14);
  --gpt: #45d3a2;
  --gpt-fundo: rgba(69, 211, 162, .13);
  /* o verde do Correta puxa para o amarelo: não se confunde com o verde do ChatGPT */
  --ok: #8bd36a;       --ok-fundo: rgba(139, 211, 106, .12);
  --parcial: #f2b544;  --parcial-fundo: rgba(242, 181, 68, .13);
  --erro: #ff8a84;     --erro-fundo: rgba(255, 138, 132, .10);
  --foco: #8ea2ff;
  --balao: #26262b;
  --codigo: #101012;
  --rev: #19191c;
  --veu: rgba(8, 8, 10, .62);
  --sombra: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
  /* assinatura AFN, guia da marca v2: 4,5:1 nos fundos escuros (antes #c44a5a e 32%) */
  --pf-afn: #d65f70;
  --pf-sys: rgba(255, 255, 255, .5);
  /* código: cores mais quietas que as do veredito, que continuam as mais fortes da tela */
  --rolagem-sombra: rgba(255, 255, 255, .18);
  --tk-k: #c4a2ff;   /* palavra-chave */
  --tk-s: #e0bf8f;   /* texto */
  --tk-n: #79c9d8;   /* número e literal */
  --tk-p: #eba6c8;   /* chave e propriedade */
  --tk-c: #8a8a94;   /* comentário */
}

[data-tema="claro"] {
  color-scheme: light;
  --fundo: #ffffff;
  --fundo-2: #f6f6f7;
  --sup: #ffffff;
  --sup-2: #f0f0f2;
  --sup-3: #e6e6ea;
  --borda: #e5e5e9;
  --borda-2: #d1d1d8;
  --texto: #18181b;
  --texto-2: #52525b;
  --texto-3: #6b6b75;
  --tinta: #18181b;
  --sobre-tinta: #ffffff;
  --ds: #3651d4;
  --ds-fundo: rgba(54, 81, 212, .09);
  --gpt: #08795a;
  --gpt-fundo: rgba(8, 121, 90, .09);
  --ok: #2f7a1f;       --ok-fundo: #edf6e8;   /* 4,7:1 também sobre o cabeçalho tingido */
  --parcial: #9a5800;  --parcial-fundo: #fcf1dd;
  --erro: #c4302b;     --erro-fundo: #fdeeed;
  --foco: #3651d4;
  --balao: #f0f0f2;
  --codigo: #f7f7f9;
  --rev: #fbfbfc;
  --veu: rgba(24, 24, 27, .38);
  --sombra: 0 16px 40px rgba(24, 24, 32, .14), 0 2px 6px rgba(24, 24, 32, .06);
  --pf-afn: #6b1f2a;
  --pf-sys: #505050;
  --rolagem-sombra: rgba(24, 24, 32, .2);
  --tk-k: #6f35c2;
  --tk-s: #8a5412;
  --tk-n: #0a6a80;
  --tk-p: #a8306a;
  --tk-c: #6b6b75;
}

[data-ia="deepseek"] { --cor-ia: var(--ds);  --cor-ia-fundo: var(--ds-fundo); }
[data-ia="chatgpt"]  { --cor-ia: var(--gpt); --cor-ia-fundo: var(--gpt-fundo); }
[data-veredito="correta"]   { --cor-v: var(--ok);      --cor-v-fundo: var(--ok-fundo); }
[data-veredito="parcial"]   { --cor-v: var(--parcial); --cor-v-fundo: var(--parcial-fundo); }
[data-veredito="incorreta"] { --cor-v: var(--erro);    --cor-v-fundo: var(--erro-fundo); }

/* ── 2. Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 15px/1.55 var(--fonte);
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--foco) 32%, transparent); }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
kbd {
  font: 500 11px/1 var(--mono);
  padding: 3px 5px;
  border: 1px solid var(--borda-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--texto-2);
  background: var(--sup);
}
.ic { width: 20px; height: 20px; flex-shrink: 0; display: block; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pular {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--tinta); color: var(--sobre-tinta); font-weight: 600; text-decoration: none;
}
.pular:focus { top: 12px; }

/* ── 3. Botões e campos ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur), color var(--dur), opacity var(--dur);
}
.btn-pri { background: var(--tinta); color: var(--sobre-tinta); }
.btn-pri:hover { opacity: .88; }
.btn-sec { background: var(--sup); border-color: var(--borda-2); color: var(--texto); }
.btn-sec:hover { background: var(--sup-2); }
.btn-texto { background: none; color: var(--texto-2); padding: 0 10px; }
.btn-texto:hover { background: var(--sup-2); color: var(--texto); }
.btn-texto-perigo, .btn-texto-perigo:hover { color: var(--erro); }
.btn-perigo { background: var(--erro); color: #fff; }
[data-tema="escuro"] .btn-perigo { color: #1d0807; }
.btn-perigo:hover { opacity: .9; }
.btn-largo { width: 100%; }

.btn-icone {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 10px;
  background: none; color: var(--texto-2);
  transition: background var(--dur), color var(--dur);
}
.btn-icone:hover { background: var(--sup-2); color: var(--texto); }
.btn-pequeno { width: 30px; height: 30px; border-radius: 8px; }
.btn-pequeno .ic { width: 16px; height: 16px; }

.btn-mini {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 8px;
  border: 0; border-radius: 8px;
  background: none; color: var(--texto-3);
  font-size: 13px; font-weight: 500;
  transition: background var(--dur), color var(--dur);
}
.btn-mini .ic { width: 16px; height: 16px; }
.btn-mini:hover { background: var(--sup-2); color: var(--texto); }
.btn-mini.feito { color: var(--ok); }

.campo { display: grid; gap: 6px; margin-bottom: 16px; }
.campo > label, .campo-rotulo label { font-size: 13px; font-weight: 600; }
.campo-rotulo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.campo-rotulo a { font-size: 13px; color: var(--texto-2); text-underline-offset: 3px; padding: 8px 0; margin: -8px 0; }
.campo-rotulo a:hover { color: var(--texto); }

input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--borda-2); border-radius: 10px;
  background: var(--sup); color: var(--texto);
  font-size: 15px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
input::placeholder, textarea::placeholder { color: var(--texto-3); opacity: 1; }
input:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--foco);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--foco) 22%, transparent);
}
input[aria-invalid="true"] { border-color: var(--erro); }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px; background-repeat: no-repeat; }

.campo-senha { position: relative; }
.campo-senha input { padding-right: 46px; font-family: var(--mono); font-size: 14px; letter-spacing: .01em; }
.campo-senha .btn-icone { position: absolute; right: 3px; top: 3px; }
.campo-senha .ic { width: 18px; height: 18px; }

.caixa { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; cursor: pointer; }
.caixa input { width: 18px; height: 18px; margin: 0; accent-color: var(--tinta); cursor: pointer; }
.form-erro { color: var(--erro); font-size: 14px; margin: 4px 0 8px; }
.linha-botoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── 4. Marca ───────────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.logo svg { width: 26px; height: 26px; }
.logo circle { fill: none; stroke-width: 2.4; }
.logo-a { stroke: var(--ds); }
.logo-b { stroke: var(--gpt); }

/* AFN Systems (brand guide): rodapé "AFN SYSTEMS | DeepChat" e assinatura no Sobre */
.pf-marca { display: flex; align-items: baseline; }
.pf-afn, .pf-sys, .pf-pipe, .pf-info, .pf-by { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.pf-afn { letter-spacing: 2px; color: var(--pf-afn); -webkit-text-stroke: .3px color-mix(in srgb, var(--pf-afn) 40%, transparent); }
.pf-sys { letter-spacing: 2px; color: var(--pf-sys); }
.pf-gap { width: 4px; display: inline-block; }
.pf-pipe, .pf-info { color: var(--pf-sys); }
.pf-info { letter-spacing: .3px; }
.pf-by { font-size: 8px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--pf-sys); }
.page-footer {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 20px; border-top: 1px solid var(--borda);
}
.page-footer .pf-afn, .page-footer .pf-sys { font-size: 10px; }
.page-footer .pf-pipe { font-size: 13px; }
.page-footer .pf-info { font-size: 11px; }
.pf-assinatura { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pf-assinatura .pf-afn, .pf-assinatura .pf-sys { font-size: 13px; }

/* Marca de cada IA: inicial na cor dela */
.marca-ia {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 7px;
  font: 700 11px/1 var(--fonte);
  color: var(--cor-ia); background: var(--cor-ia-fundo);
}

/* O veredito é o que o DeepChat tem de próprio: a palavra na cor dele, sem
   caixinha. O cartão da revisão e a margem da resposta levam a mesma cor. */
.veredito {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-size: 15px; font-weight: 650; letter-spacing: -.005em; white-space: nowrap;
  color: var(--cor-v);
}
.veredito .ic { width: 18px; height: 18px; stroke-width: 2; }

/* ── 5. Tela de início ──────────────────────────────────────────────────── */
.inicio {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, 1fr);
}
.inicio-apresenta { display: flex; flex-direction: column; min-width: 0; padding: 28px 56px 0; }
.inicio-meio { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 600px; padding: 40px 0 32px; }
.inicio-titulo {
  font-size: clamp(38px, 4.3vw, 58px); line-height: 1.02; letter-spacing: -.035em; font-weight: 650;
  font-stretch: 92%;
  margin-bottom: 20px;
}
.inicio-titulo span { color: var(--texto-3); }
.inicio-texto { font-size: 17px; line-height: 1.6; color: var(--texto-2); max-width: 33em; margin-bottom: 36px; }
.inicio-apresenta .page-footer { margin: 0 -56px; border-top-color: transparent; justify-content: flex-start; padding-left: 56px; }

.amostra { display: grid; gap: 12px; max-width: 520px; font-size: 14px; line-height: 1.5; }
.am-pergunta {
  justify-self: end; max-width: 80%;
  padding: 9px 14px; border-radius: 16px 16px 5px 16px; background: var(--balao);
}
.am-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.am-cab strong { font-size: 13px; font-weight: 600; }
.am-resposta { position: relative; }
.am-resposta p { color: var(--texto-2); padding-left: 30px; }
/* a marca do revisor desce da inicial, ao lado da resposta, na cor do veredito */
.am-resposta::before {
  content: ''; position: absolute; left: 10px; top: 30px; bottom: 3px; width: 2px; border-radius: 2px;
  background: var(--cor-v); transform-origin: top;
}
.am-revisao {
  border: 1px solid color-mix(in srgb, var(--cor-v) 32%, var(--borda)); border-radius: 14px;
  background: color-mix(in srgb, var(--cor-v) 5%, var(--rev)); padding: 12px 14px;
}
.am-revisao .am-cab { margin-bottom: 8px; }
.am-revisao .veredito { margin-left: auto; font-size: 14px; }
.am-revisao p { color: var(--texto-2); }

/* um momento só, ao abrir: a pergunta, a resposta, a revisão e o veredito carimbado */
.amostra > * { animation: entrar .5s cubic-bezier(.2, .7, .2, 1) both; }
.am-pergunta { animation-delay: .15s; }
.am-resposta { animation-delay: .55s; }
.am-revisao  { animation-delay: 1.05s; }
.am-revisao .veredito { animation: carimbo .42s 1.6s cubic-bezier(.3, 1.35, .5, 1) both; }
.am-resposta::before { animation: tracar .6s 1.75s cubic-bezier(.2, .7, .2, 1) both; }
/* a demonstração é a ação principal de quem chega pelo portfólio */
.inicio-demo { align-self: flex-start; margin-top: 28px; height: 46px; padding: 0 20px; font-size: 15px; }

.inicio-form {
  display: flex; align-items: center; justify-content: center;
  padding: 48px; background: var(--fundo-2); border-left: 1px solid var(--borda);
}
#formChaves { width: 100%; max-width: 384px; }
#formChaves h2 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 6px; }
.form-ajuda { color: var(--texto-2); font-size: 14px; margin-bottom: 24px; }
#formChaves .caixa { margin: -4px 0 2px; }
.dica-caixa { margin: 0 0 12px 28px; font-size: 12.5px; line-height: 1.4; color: var(--texto-3); }
#btnComecar { margin-top: 6px; }
.como { margin-top: 24px; border-top: 1px solid var(--borda); padding-top: 14px; font-size: 14px; }
.como summary { cursor: pointer; color: var(--texto-2); font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 32px; }
.como summary::-webkit-details-marker { display: none; }
.como summary::before { content: ''; width: 6px; height: 6px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur); }
.como[open] summary::before { transform: rotate(45deg); }
.como summary:hover { color: var(--texto); }
.como-corpo { color: var(--texto-2); padding: 8px 0 0 14px; display: grid; gap: 10px; }
.como-corpo ol { padding-left: 18px; display: grid; gap: 6px; }
.como-corpo a { color: var(--texto); }

/* Aberto dentro de um iframe de outro site: só o convite para abrir à parte */
.quadro { min-height: 100dvh; display: flex; flex-direction: column; padding: 28px clamp(20px, 6vw, 88px); }
.quadro-meio { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 620px; padding: 40px 0; }
.quadro-titulo {
  font-size: clamp(30px, 4.6vw, 48px); line-height: 1.04; letter-spacing: -.03em; font-weight: 650;
  font-stretch: 92%; margin-bottom: 16px;
}
.quadro-texto { font-size: 17px; line-height: 1.6; color: var(--texto-2); max-width: 34em; margin-bottom: 28px; }

/* ── 6. App e lateral ───────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); height: 100dvh; }
.lateral {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--fundo-2); border-right: 1px solid var(--borda);
}
.lateral-topo { display: flex; align-items: center; justify-content: space-between; height: var(--barra-h); padding: 0 10px 0 18px; flex-shrink: 0; }
.btn-nova {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 12px 8px; height: 40px; padding: 0 10px;
  border: 1px solid var(--borda-2); border-radius: 10px;
  background: var(--sup); color: var(--texto);
  font-size: 14px; font-weight: 600;
  transition: background var(--dur);
}
.btn-nova:hover { background: var(--sup-2); }
.btn-nova-ic .ic { width: 18px; height: 18px; color: var(--texto-2); }
.btn-nova kbd { margin-left: auto; }
.busca { position: relative; margin: 0 12px 6px; }
.busca-ic { position: absolute; left: 11px; top: 10px; color: var(--texto-3); pointer-events: none; }
.busca-ic .ic { width: 16px; height: 16px; }
.busca input { height: 36px; padding-left: 34px; font-size: 14px; border-color: var(--borda); background: var(--fundo); border-radius: 9px; }
.busca input::-webkit-search-cancel-button { cursor: pointer; }

.lista { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 2px 8px 16px; scrollbar-width: thin; }
.grupo-titulo { font-size: 12px; font-weight: 600; color: var(--texto-3); margin: 16px 10px 4px; }
.grupo ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.conv { position: relative; display: flex; align-items: center; }
.conv-abrir {
  flex: 1; min-width: 0; height: 36px; padding: 0 36px 0 10px;
  border: 0; border-radius: 8px; background: none;
  color: var(--texto-2); font-size: 14px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background var(--dur), color var(--dur);
}
.conv:hover .conv-abrir { background: var(--sup-2); color: var(--texto); }
.conv.ativa .conv-abrir { background: var(--sup-3); color: var(--texto); font-weight: 500; }
.conv-excluir { position: absolute; right: 3px; width: 30px; height: 30px; border-radius: 7px; opacity: 0; }
.conv-excluir .ic { width: 16px; height: 16px; }
.conv:hover .conv-excluir, .conv.ativa .conv-excluir, .conv-excluir:focus-visible { opacity: 1; }
.conv-excluir:hover { color: var(--erro); background: var(--sup-3); }
.lista-vazia { padding: 14px 10px; color: var(--texto-3); font-size: 13px; line-height: 1.5; }
.lateral .page-footer { flex-shrink: 0; }

.veu { position: fixed; inset: 0; z-index: 40; background: var(--veu); }
.so-gaveta { display: none; }

/* ── 7. Barra e menu ────────────────────────────────────────────────────── */
.principal { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--fundo); }
.principal.soltando::after {
  content: 'Solte para anexar'; position: absolute; inset: 8px; z-index: 20;
  display: grid; place-items: center; border: 2px dashed var(--borda-2); border-radius: 16px;
  background: color-mix(in srgb, var(--fundo) 88%, transparent); color: var(--texto-2); font-weight: 600;
}
.barra {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: var(--barra-h); padding: 0 10px 0 24px;
  border-bottom: 1px solid var(--borda);
}
.barra-titulo { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* sem caixinha nem cor própria: na tela, a cor forte é a do veredito */
.selo-demo {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--texto-2);
}
.selo-demo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--texto-3); }
.menu-caixa { position: relative; flex-shrink: 0; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 244px; padding: 6px;
  border: 1px solid var(--borda-2); border-radius: 12px;
  background: var(--sup); box-shadow: var(--sombra);
  animation: aparecer .14s ease-out;
}
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--texto); font-size: 14px; text-align: left;
}
.menu button .ic { width: 18px; height: 18px; color: var(--texto-2); }
.menu button:hover, .menu button:focus-visible { background: var(--sup-2); outline: none; }
.menu button[aria-disabled="true"] { color: var(--texto-3); cursor: default; }
.menu button[aria-disabled="true"]:hover { background: none; }
.menu button[aria-disabled="true"] .ic { color: var(--texto-3); }
.menu button[data-menu="excluir"]:not([aria-disabled="true"]) { color: var(--erro); }
.menu button[data-menu="excluir"]:not([aria-disabled="true"]) .ic { color: var(--erro); }
.menu hr { border: 0; border-top: 1px solid var(--borda); margin: 6px 4px; }

.faixa {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px;
  flex-shrink: 0; padding: 8px 16px; font-size: 13px; text-align: center;
  border-bottom: 1px solid var(--borda); background: var(--fundo-2); color: var(--texto-2);
}
.faixa a { color: var(--texto); font-weight: 600; text-underline-offset: 3px; padding: 8px 4px; margin: -8px -4px; }
.faixa-offline { background: var(--parcial-fundo); color: var(--parcial); }

/* ── 8. Conversa ────────────────────────────────────────────────────────── */
.rolagem { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.coluna { max-width: calc(var(--coluna) + 48px); margin: 0 auto; padding: 32px 24px 24px; }

.vazio { padding: clamp(16px, 8vh, 88px) 0 16px; }
.vazio-titulo {
  font-size: clamp(32px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -.03em; font-weight: 650;
  font-stretch: 92%; margin-bottom: 16px;
}
.vazio-titulo span { color: var(--texto-3); }
.vazio-texto { font-size: 16px; line-height: 1.6; color: var(--texto-2); max-width: 34em; margin-bottom: 36px; }
.vazio-texto strong { color: var(--cor-ia); font-weight: 600; }
.exemplos-rotulo { font-size: 13px; font-weight: 600; color: var(--texto-3); margin-bottom: 4px; }
.exemplos ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--borda); }
.exemplo {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  min-height: 52px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--borda);
  background: none; color: var(--texto); font-size: 15px; text-align: left;
  transition: color var(--dur), padding var(--dur);
}
.exemplo .ic { width: 18px; height: 18px; color: var(--texto-3); transition: transform var(--dur), color var(--dur); }
.exemplo:hover { padding-left: 8px; }
.exemplo:hover .ic { transform: translateX(2px); color: var(--texto); }

.msg { margin-bottom: 30px; }
.msg-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-bottom: 8px; font-size: 13px; min-width: 0; }
.msg-autor { font-weight: 600; }
.msg-meta { color: var(--texto-3); }
/* legenda da marca na margem: vale mesmo com a revisão fora da vista */
.msg-veredito { color: var(--texto-3); }
/* a legenda fica dentro do texto do .msg-meta: o ponto cola no que vem antes (espaço sem quebra) e, na quebra de linha, nunca abre a linha seguinte */
.msg-veredito::before { content: '\00a0· '; }
.msg-veredito strong { color: var(--cor-v); font-weight: 600; }

.msg-pergunta { display: flex; flex-direction: column; align-items: flex-end; margin-bottom: 26px; }
.balao {
  max-width: min(86%, 600px); padding: 10px 15px;
  border-radius: 18px 18px 6px 18px; background: var(--balao);
}
.texto-usuario { white-space: pre-wrap; overflow-wrap: anywhere; }
.citacao {
  display: grid; gap: 2px; margin: 2px 0 8px; padding: 2px 0 2px 10px;
  border-left: 2px solid var(--borda-2); font-size: 13px;
}
.citacao-autor { font-weight: 600; color: var(--texto-2); }
.citacao-texto { color: var(--texto-3); }
.anexo-chip {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; padding: 6px 10px 6px 8px;
  border-radius: 10px; background: var(--fundo); border: 1px solid var(--borda); font-size: 13px;
}
.anexo-chip .ic { width: 18px; height: 18px; color: var(--texto-2); }
.anexo-nome { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo-tam { color: var(--texto-3); white-space: nowrap; }
.anexo-imagem { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin: 2px 0 8px; }

/* Marca do revisor: a resposta revisada ganha um traço na margem, na cor do
   veredito. Enquanto a revisão chega, o traço cinza vai descendo. */
.msg-resposta > .md { position: relative; }
.msg-resposta > .md::before {
  content: ''; position: absolute; left: -15px; top: .3em; bottom: .3em; width: 2px; border-radius: 2px;
  background-color: var(--cor-v, transparent); transform: scaleY(0); transform-origin: top;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), background-color .45s;
}
.msg-resposta[data-veredito] > .md::before { transform: none; }
.msg-resposta.em-revisao > .md::before { transform: none; background-color: var(--texto-3); animation: tracar 1.6s cubic-bezier(.2, .7, .2, 1) both; }

.msg-acoes { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; opacity: 0; transition: opacity var(--dur); }
.msg-pergunta .msg-acoes { margin-top: 4px; }
.msg:hover .msg-acoes, .msg:focus-within .msg-acoes,
.msg-resposta.ultima .msg-acoes, .msg-revisao:last-child .msg-acoes { opacity: 1; }
.msg-resposta:not(.ultima) [data-acao="outra"], .ocupado [data-acao="outra"] { display: none; }

.msg-pensando .msg-meta { display: inline-flex; }
.cronometro { font-variant-numeric: tabular-nums; }
.esqueleto { display: grid; gap: 10px; padding: 4px 0 2px; max-width: 560px; }
.esqueleto span {
  height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--sup-2) 0%, var(--sup-3) 50%, var(--sup-2) 100%);
  background-size: 200% 100%;
  animation: brilho 1.5s ease-in-out infinite;
}
.esqueleto span:nth-child(1) { width: 94%; }
.esqueleto span:nth-child(2) { width: 80%; animation-delay: .12s; }
.esqueleto span:nth-child(3) { width: 52%; animation-delay: .24s; }

.aviso {
  display: flex; gap: 12px; margin-bottom: 30px; padding: 14px 16px;
  border: 1px solid var(--borda); border-radius: 12px; background: var(--fundo-2);
}
.aviso-icone { color: var(--texto-2); padding-top: 1px; }
.aviso-erro { border-color: color-mix(in srgb, var(--erro) 35%, var(--borda)); background: var(--erro-fundo); }
.aviso-erro .aviso-icone { color: var(--erro); }
.aviso-corpo { min-width: 0; }
.aviso-titulo { display: block; font-weight: 600; }
.aviso-texto { color: var(--texto-2); font-size: 14px; margin-top: 2px; }
.aviso-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.aviso-acoes .btn { height: 36px; font-size: 13px; }

/* ── 9. Markdown ────────────────────────────────────────────────────────── */
.md { font-size: 15px; line-height: 1.68; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > * + * { margin-top: .85em; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { font-weight: 650; line-height: 1.3; letter-spacing: -.01em; margin-top: 1.4em; }
.md h1 { font-size: 1.25em; }
.md h2 { font-size: 1.14em; }
.md h3, .md h4, .md h5, .md h6 { font-size: 1.02em; }
.md ul, .md ol { padding-left: 1.35em; }
.md li + li { margin-top: .35em; }
.md li > ul, .md li > ol { margin-top: .35em; }
.md li::marker { color: var(--texto-3); }
.md strong { font-weight: 650; }
.md a { color: var(--ds); text-underline-offset: 3px; }
.md blockquote { padding-left: 14px; border-left: 3px solid var(--borda-2); color: var(--texto-2); }
.md hr { border: 0; border-top: 1px solid var(--borda); }
.md :not(pre) > code {
  font-family: var(--mono); font-size: .86em;
  padding: .12em .38em; border-radius: 5px; background: var(--sup-2);
}
.md-codigo { border: 1px solid var(--borda); border-radius: 12px; background: var(--codigo); overflow: hidden; }
.md-codigo-cab {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 4px 3px 14px; border-bottom: 1px solid var(--borda);
  font: 500 12px/1 var(--mono); color: var(--texto-3);
}
.md pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); tab-size: 2; }
/* Código mais largo que o bloco: uma sombra suave na borda que ainda tem código avisa
   que dá para rolar para o lado. As capas (local) andam com o texto e escondem a
   sombra (scroll) quando a borda chega ao fim; sem rolagem, nada aparece. */
.md pre {
  background:
    linear-gradient(to right, var(--codigo) 40%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--codigo) 40%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--rolagem-sombra), transparent) left / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--rolagem-sombra), transparent) right / 16px 100% no-repeat scroll,
    var(--codigo);
}
.md code, .md pre { font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'calt' 0; }
.md pre code { font: inherit; }
/* cores do código (js/realce.js) */
.md .tk-k { color: var(--tk-k); }
.md .tk-s { color: var(--tk-s); }
.md .tk-n { color: var(--tk-n); }
.md .tk-p { color: var(--tk-p); }
.md .tk-c { color: var(--tk-c); }
.md .tk-f { font-weight: 500; }
.md-tabela { overflow-x: auto; border: 1px solid var(--borda); border-radius: 12px; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--borda); vertical-align: top; overflow-wrap: normal; word-break: normal; }
.md th { font-weight: 600; color: var(--texto-2); background: var(--fundo-2); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md [align="right"] { text-align: right; }
.md [align="center"] { text-align: center; }
.md input[type="checkbox"] { margin: 0 6px 0 0; vertical-align: -2px; accent-color: var(--tinta); }

/* ── 10. Revisão ────────────────────────────────────────────────────────── */
.rev { border: 1px solid var(--borda); border-radius: 16px; background: var(--rev); overflow: hidden; transition: border-color .45s; }
.rev-cab { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 16px; border-bottom: 1px solid var(--borda); transition: background-color .45s; }
/* com veredito, o cartão inteiro puxa de leve para a cor dele */
.msg-revisao[data-veredito] .rev { border-color: color-mix(in srgb, var(--cor-v) 32%, var(--borda)); }
.msg-revisao[data-veredito] .rev-cab {
  background: color-mix(in srgb, var(--cor-v) 7%, var(--rev));
  border-bottom-color: color-mix(in srgb, var(--cor-v) 20%, var(--borda));
}
/* o veredito chega no meio da revisão: carimba uma vez */
.msg-revisao.escrevendo .veredito { animation: carimbo .42s cubic-bezier(.3, 1.35, .5, 1) both; }
.rev-quem { flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; font-size: 13px; }
/* minmax(0, 1fr): sem isso, um bloco de código largo alarga a coluna e passa
   do cartão (no celular, a versão revisada era cortada) */
.rev-corpo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px 18px 18px; }
.rev-corpo .md { font-size: 14.5px; line-height: 1.65; }
.rev-sec-titulo { font-size: 13px; font-weight: 600; color: var(--texto-2); margin-bottom: 4px; }
.rev-par { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.rev-fortes ul, .rev-melhorar ul { list-style: none; padding-left: 0; }
.rev-fortes li, .rev-melhorar li { position: relative; padding-left: 18px; }
.rev-fortes li::before, .rev-melhorar li::before {
  position: absolute; left: 0; top: 0; font-weight: 700; line-height: inherit;
}
.rev-fortes li::before { content: '+'; color: var(--ok); }
.rev-melhorar li::before { content: '−'; color: var(--parcial); }
.rev-versao { border-top: 1px solid var(--borda); padding-top: 14px; }
.rev-versao summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px;
  cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--texto);
}
.rev-versao summary::-webkit-details-marker { display: none; }
.rev-versao summary::before {
  content: ''; width: 6px; height: 6px; margin: 0 2px;
  border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--dur);
}
.rev-versao[open] summary::before { transform: rotate(45deg); }
.rev-versao[open] summary { margin-bottom: 8px; }
.rev-versao[open] summary span::after { content: ''; }

/* ── 11. Compositor ─────────────────────────────────────────────────────── */
.rodape-pergunta { position: relative; flex-shrink: 0; padding: 0 24px 14px; }
.compositor {
  max-width: var(--coluna); margin: 0 auto; padding: 8px 8px 8px 10px;
  border: 1px solid var(--borda-2); border-radius: 18px; background: var(--sup);
  transition: border-color var(--dur), box-shadow var(--dur);
}
[data-tema="claro"] .compositor { box-shadow: 0 1px 2px rgba(24, 24, 32, .04), 0 6px 20px rgba(24, 24, 32, .05); }
.compositor:focus-within { border-color: color-mix(in srgb, var(--foco) 55%, var(--borda-2)); }
/* o campo não tem contorno próprio: o foco aparece na caixa inteira, como nos outros campos */
.compositor:has(#pergunta:focus-visible) {
  border-color: var(--foco);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--foco) 18%, transparent);
}
#pergunta {
  display: block; width: 100%; min-height: 44px; max-height: 40vh; padding: 10px 6px 4px;
  border: 0; outline: none; resize: none; background: none;
  font-size: 15px; line-height: 1.5;
}
.compositor-barra { display: flex; align-items: center; gap: 6px; }
.compositor-barra .btn-icone { width: 36px; height: 36px; }
.ordem {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  height: 32px; padding: 0 10px; margin-left: 2px;
  border: 1px solid var(--borda); border-radius: 9px; background: none;
  color: var(--texto-3); font-size: 13px; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur);
}
.ordem:hover { background: var(--sup-2); border-color: var(--borda-2); }
.ordem .ic { width: 15px; height: 15px; color: var(--texto-2); margin-left: 2px; }
.ordem-ia { display: inline-flex; align-items: center; gap: 6px; color: var(--texto); font-weight: 600; }
.ordem-ia::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cor-ia); }
.ordem-sep::before { content: '·'; }
.contador { margin-left: auto; font-size: 12px; color: var(--texto-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.contador.no-limite { color: var(--erro); }
.btn-enviar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 36px; height: 36px; border: 0; border-radius: 11px;
  background: var(--tinta); color: var(--sobre-tinta);
  transition: background var(--dur), opacity var(--dur);
}
.btn-enviar:hover:not(:disabled) { opacity: .86; }
.btn-enviar:disabled { background: var(--sup-3); color: var(--texto-3); cursor: default; }
.btn-enviar .ic { width: 18px; height: 18px; stroke-width: 2.1; }
.compositor-extra {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 5px 4px 5px 10px;
  border-radius: 11px; background: var(--sup-2); font-size: 13px;
}
.extra-ic { color: var(--texto-2); }
.extra-ic .ic { width: 16px; height: 16px; }
.extra-ic img { display: block; width: 30px; height: 30px; object-fit: cover; border-radius: 7px; }
.extra-texto { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; color: var(--texto-2); }
.extra-texto > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.extra-texto strong { color: var(--texto); font-weight: 600; }
#citacaoAutor, #anexoTam { flex-shrink: 0; }
.dica { max-width: var(--coluna); margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--texto-3); }
/* Durante a pergunta, a ordem vira o status de quem está trabalhando */
.ordem.status { cursor: default; }
.ordem.status:hover { background: none; border-color: var(--borda); }
.ordem.status .ordem-ia::before { animation: pulsar 1.2s ease-in-out infinite; }
.status-acao { color: var(--texto-2); }
.status-tempo { color: var(--texto-3); font-variant-numeric: tabular-nums; }

/* Ir para o fim: redondo, à direita, alinhado à caixa de pergunta (não cobre a linha que se lê) */
.ir-fim {
  position: absolute; top: -50px; right: max(24px, calc((100% - var(--coluna)) / 2)); z-index: 5;
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--borda-2); border-radius: 50%; background: var(--sup);
  box-shadow: var(--sombra); color: var(--texto);
  animation: aparecer .16s ease-out;
}
.ir-fim:hover { background: var(--sup-2); }
.ir-fim .ic { width: 18px; height: 18px; }
/* a revisão fora da vista: um ponto, cinza enquanto ela chega e na cor do veredito quando fica pronta */
.ir-fim.com-revisao::after {
  content: ''; position: absolute; top: 0; right: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--texto-3); box-shadow: 0 0 0 2px var(--fundo);
}
.ir-fim.com-revisao:not([data-veredito])::after { animation: pulsar 1.2s ease-in-out infinite; }
.ir-fim[data-veredito]::after { background: var(--cor-v); }

/* ── 12. Diálogos ───────────────────────────────────────────────────────── */
.dlg {
  width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 32px));
  padding: 0; border: 1px solid var(--borda-2); border-radius: 18px;
  background: var(--sup); color: var(--texto); box-shadow: var(--sombra);
}
.dlg[open] { display: flex; flex-direction: column; animation: aparecer .18s ease-out; }
.dlg::backdrop { background: var(--veu); }
.dlg-cab {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
  padding: 14px 12px 14px 24px; border-bottom: 1px solid var(--borda);
}
.dlg-cab h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.dlg-corpo { padding: 4px 24px 24px; overflow-y: auto; }
.ajuste-grupo { padding: 20px 0; border-bottom: 1px solid var(--borda); }
.ajuste-grupo:last-child { border-bottom: 0; padding-bottom: 0; }
.ajuste-grupo h3 { font-size: 14px; font-weight: 650; margin-bottom: 14px; }
.ajuste-nota { color: var(--texto-2); font-size: 14px; margin-bottom: 10px; }
.ajuste-nota a { color: var(--texto); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { padding: 0; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.opcoes { display: grid; gap: 8px; }
.opcao {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--borda-2); border-radius: 12px; cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
}
.opcao:hover { background: var(--sup-2); }
.opcao:has(input:checked) { border-color: var(--texto); }
.opcao input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--tinta); }
.opcao span { display: grid; gap: 1px; }
.opcao strong { font-size: 14px; font-weight: 600; }
.opcao small { font-size: 13px; color: var(--texto-2); }
.segmentado { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.segmentado label {
  position: relative; min-width: 0;
  border: 1px solid var(--borda-2); margin-left: -1px; cursor: pointer;
}
.segmentado label:first-of-type { border-radius: 10px 0 0 10px; margin-left: 0; }
.segmentado label:last-of-type { border-radius: 0 10px 10px 0; }
.segmentado input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmentado span { display: grid; place-items: center; height: 40px; padding: 0 4px; font-size: 14px; color: var(--texto-2); text-align: center; line-height: 1.15; }
.segmentado label:has(input:checked) { background: var(--sup-3); z-index: 1; border-color: var(--texto-3); }
.segmentado label:has(input:checked) span { color: var(--texto); font-weight: 600; }
.segmentado label:has(input:focus-visible) { outline: 2px solid var(--foco); outline-offset: 2px; z-index: 2; }

.sobre > p { color: var(--texto-2); margin-top: 16px; }
.sobre h3 { font-size: 14px; font-weight: 650; margin: 24px 0 10px; }
.lista-simples { padding-left: 18px; display: grid; gap: 6px; color: var(--texto-2); font-size: 14px; }
.lista-simples code { font: 500 .9em var(--mono); color: var(--texto); }
.atalhos { display: grid; gap: 0; border-top: 1px solid var(--borda); }
.atalhos div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--borda); font-size: 14px; }
.atalhos dt { color: var(--texto-2); }
.atalhos dd { margin: 0; display: flex; gap: 4px; }
.diag { margin-top: 8px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--erro) 35%, var(--borda)); border-radius: 12px; background: var(--erro-fundo); }
.diag h3 { margin: 0 0 4px; }
.diag p { font-size: 14px; color: var(--texto-2); margin-bottom: 10px; }
.diag-msg { color: var(--texto); font-family: var(--mono); font-size: 13px; }
.sobre-codigo { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 24px; font-size: 14px; }
.sobre-codigo a { color: var(--texto); font-weight: 600; text-underline-offset: 3px; }
.sobre-codigo span { color: var(--texto-3); font-size: 13px; }
.sobre-assinatura { display: flex; justify-content: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--borda); }

.dlg-pequeno { width: min(420px, calc(100vw - 32px)); }
.dlg-pequeno form { padding: 22px 24px 20px; }
.dlg-pequeno h2 { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.dlg-pequeno p { color: var(--texto-2); font-size: 14px; }
.dlg-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ── 13. Toasts ─────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 60; bottom: calc(var(--rodape-h, 120px) + 10px);
  left: calc(var(--lateral) + (100vw - var(--lateral)) / 2); transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center;
  width: max-content; max-width: min(560px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 4px; pointer-events: auto;
  min-height: 44px; padding: 4px 4px 4px 16px; border-radius: 12px;
  background: var(--tinta); color: var(--sobre-tinta); box-shadow: var(--sombra);
  font-size: 14px; animation: subir .2s ease-out;
}
.toast.saindo { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.toast-texto { padding: 8px 6px 8px 0; }
.toast-erro .toast-texto::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--erro); vertical-align: 1px; }
[data-tema="escuro"] .toast-erro .toast-texto::before { background: #d93a33; }
.toast-acao {
  flex-shrink: 0;
  height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: inherit; font-weight: 700; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 3px;
}
.toast-acao:hover { background: color-mix(in srgb, var(--sobre-tinta) 12%, transparent); }
.toast-fechar { flex-shrink: 0; width: 36px; height: 36px; color: inherit; opacity: .7; }
.toast-fechar:hover { opacity: 1; background: color-mix(in srgb, var(--sobre-tinta) 12%, transparent); color: inherit; }
.toast-fechar .ic { width: 16px; height: 16px; }
#telaInicio:not([hidden]) ~ .toasts, dialog .toasts { left: 50%; bottom: 24px; }

/* ── 14. Celular e tablet ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .inicio { grid-template-columns: minmax(0, 1fr) minmax(380px, .9fr); }
  .inicio-apresenta { padding: 24px 40px 0; }
  .inicio-apresenta .page-footer { margin: 0 -40px; padding-left: 40px; }
  .inicio-form { padding: 40px 32px; }
}

@media (max-width: 899px) {
  :root { --barra-h: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(86vw, 320px);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .22s ease, visibility 0s .22s;
    box-shadow: var(--sombra);
  }
  .lateral.aberta { transform: none; visibility: visible; transition: transform .22s ease; }
  .lateral .page-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .so-gaveta { display: inline-grid; }
  .btn-nova kbd { display: none; }
  .barra { padding: 0 6px; gap: 4px; }
  .coluna { padding: 22px 16px 16px; }
  .rodape-pergunta { padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
  .ir-fim { right: 12px; }
  .msg-resposta > .md::before { left: -11px; width: 3px; }
  .toasts { left: 50%; }

  /* início no celular: título, prévia e demonstração na primeira tela; as chaves depois */
  .inicio { display: flex; flex-direction: column; }
  .inicio-apresenta, .inicio-meio { display: contents; }
  .inicio-apresenta > .logo { order: 1; padding: 20px 20px 0; }
  .inicio-titulo { order: 2; padding: 26px 20px 0; margin-bottom: 12px; font-size: clamp(34px, 9.5vw, 44px); }
  .inicio-texto { order: 3; padding: 0 20px; font-size: 16px; margin-bottom: 22px; }
  .amostra { order: 4; padding: 0 20px 20px; max-width: none; }
  .inicio-demo { order: 5; align-self: stretch; margin: 0 20px; }
  .inicio-form { order: 6; padding: 28px 20px 32px; background: none; border: 0; justify-content: flex-start; }
  .inicio-apresenta .page-footer { order: 7; margin: 0; padding: 16px 20px max(16px, env(safe-area-inset-bottom)); justify-content: center; border-top-color: var(--borda); }
  #formChaves { max-width: none; }
  #formChaves h2 { font-size: 19px; }

  .rev-par { grid-template-columns: minmax(0, 1fr); }
  .dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; border-bottom: 0; }
  .dlg[open] { animation: folha .22s ease-out; }
  .dlg-corpo { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .dlg-pequeno { margin: auto; border-radius: 18px; width: min(420px, calc(100vw - 32px)); border-bottom: 1px solid var(--borda-2); }
}

@media (max-width: 520px) {
  .ordem-papel { display: none; }
  .ordem-sep::before { content: '→'; color: var(--texto-3); }
  .balao { max-width: 92%; }
  .rev-cab { flex-wrap: wrap; padding: 12px 14px; }
  .rev-cab .veredito { order: 3; margin-left: 30px; }
  .rev-quem { flex-basis: calc(100% - 32px); }
  .rev-corpo { padding: 14px 14px 16px; }
  .md pre { padding: 12px; font-size: 12.5px; }
  .md th, .md td { padding: 8px 10px; }
  .vazio-texto { font-size: 15px; margin-bottom: 28px; }
  .exemplo { font-size: 15px; }
  .linha-botoes .btn { flex: 1; }
  .selo-demo, .faixa-longa { display: none; }
  .toasts { width: calc(100vw - 24px); }
  .toast { flex-wrap: wrap; width: 100%; }
  .toast-texto { flex: 1 1 0; min-width: 0; }
  .toast:has(.toast-acao) .toast-texto { flex-basis: calc(100% - 44px); }
  .toast:has(.toast-acao) .toast-acao { order: 3; margin-left: auto; }
  .toast:has(.toast-acao) .toast-fechar { order: 2; }
}

/* 320 a 360 px: a ordem das IAs cabe ao lado do clipe e do Enviar */
@media (max-width: 360px) {
  .ordem { gap: 4px; padding: 0 7px; font-size: 12px; margin-left: 0; }
  .ordem-ia { gap: 4px; }
  .ordem .ic { display: none; }
  .faixa { font-size: 12px; gap: 2px 8px; padding: 6px 10px; }
}
@media (min-width: 521px) { .faixa-curta { display: none; } }

/* toque: campos com 16 px (o iPhone não dá zoom) e ações sempre à vista */
@media (pointer: coarse) {
  input[type="text"], input[type="password"], input[type="search"], select, #pergunta { font-size: 16px; }
  .campo-senha input { font-size: 16px; }
  .btn-pequeno { width: 38px; height: 38px; }
  .conv-excluir { width: 40px; height: 40px; right: 2px; }
  .como-corpo a { display: inline-block; padding: 6px 0; margin: -6px 0; }
  .msg-acoes { opacity: 1; }
  .msg-pergunta .msg-acoes { display: none; }
  .conv-excluir { opacity: 1; }
  .conv-abrir { height: 44px; }
  .caixa { min-height: 44px; }
  .compositor-barra .btn-icone { width: 40px; height: 40px; }
  .btn-mini { height: 36px; }
}
@media (hover: none) {
  .msg-acoes { opacity: 1; }
}
@media (pointer: coarse) { .dica { display: none; } }

/* celular deitado e janelas baixas: mais altura para a conversa */
@media (max-height: 480px) {
  :root { --barra-h: 46px; }
  .faixa { padding: 4px 12px; font-size: 12px; }
  .faixa-demo { display: none; }
  .dica { display: none; }
  .coluna { padding-top: 14px; }
  .rodape-pergunta { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .compositor { padding: 4px 6px 4px 8px; border-radius: 14px; }
  #pergunta { min-height: 36px; padding: 6px 6px 2px; }
  .compositor-barra .btn-icone, .btn-enviar { width: 34px; height: 34px; }
  .ir-fim { top: -42px; width: 34px; height: 34px; }
}

/* telas largas: coluna um pouco mais larga */
@media (min-width: 1600px) { :root { --coluna: 780px; } }

/* ── 15. Impressão ──────────────────────────────────────────────────────── */
.impressao-cab { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  :root, [data-tema] {
    --fundo: #fff; --fundo-2: #f5f5f5; --sup: #fff; --sup-2: #f2f2f2; --sup-3: #e8e8e8; --rev: #fff;
    --borda: #d4d4d8; --borda-2: #c4c4cc; --texto: #000; --texto-2: #3f3f46; --texto-3: #52525b;
    --balao: #f2f2f4; --codigo: #f7f7f8;
    --ds: #2f47b8; --gpt: #066b4f; --ok: #2f7a1f; --parcial: #8a4f00; --erro: #a8251f;
    --tk-k: #5f2aa8; --tk-s: #7a4a10; --tk-n: #0a5e70; --tk-p: #93285c; --tk-c: #52525b;
    --ok-fundo: #fff; --parcial-fundo: #fff; --erro-fundo: #fff;
  }
  html, body { height: auto; background: #fff; }
  body { font-size: 11pt; }
  .pular, #telaInicio, .lateral, .veu, .barra, .faixa, .rodape-pergunta, .msg-acoes, .toasts, .aviso, .msg-pensando, .md-codigo-cab button { display: none !important; }
  .app, .principal { display: block; height: auto; }
  .rolagem { overflow: visible; }
  .coluna { max-width: none; padding: 0; }
  .impressao-cab { display: block; margin-bottom: 18pt; padding-bottom: 10pt; border-bottom: 1px solid #000; }
  .impressao-cab h1 { font-size: 16pt; font-weight: 650; }
  .impressao-cab p { font-size: 9pt; color: #52525b; margin-top: 2pt; }
  .msg { break-inside: auto; margin-bottom: 16pt; }
  .msg-cab, .rev-cab, .balao { break-inside: avoid; break-after: avoid; }
  .msg-pergunta { align-items: stretch; }
  .balao { max-width: none; border: 1px solid #d4d4d8; }
  .rev { border-color: #a1a1aa; }
  .veredito { padding: 1px 6px; border: 1px solid currentColor; border-radius: 6px; }
  .md pre { white-space: pre-wrap; overflow: visible; }
  .md-tabela { overflow: visible; }
  .rev-par { grid-template-columns: 1fr 1fr; }
  .rev-versao summary::before, .rev-versao summary span { display: none; }
  .rev-versao summary::after { content: 'Versão revisada'; }
  a { color: inherit; }
}

/* ── 16. Movimento e contraste ──────────────────────────────────────────── */
@keyframes aparecer { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes subir    { from { opacity: 0; transform: translateY(8px); }  to { opacity: 1; transform: none; } }
@keyframes folha    { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes brilho   { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes entrar   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes carimbo  { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: none; } }
@keyframes tracar   { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pulsar   { 50% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .esqueleto span { background: var(--sup-2); }
}

@media (forced-colors: active) {
  .btn, .btn-icone, .btn-mini, .btn-nova, .compositor, .ordem, .rev, .aviso, .toast, .veredito, .menu, .dlg { border: 1px solid CanvasText; }
  .marca-ia, .ordem-ia::before { forced-color-adjust: none; }
}
