/* Simulador ABRedes — estilos. Sem dependências externas: as fontes ficam em site/fonts/. */

/* Figtree (títulos) e Open Sans (corpo), subconjunto latin, embutidas a partir do @fontsource
   (SIL OFL 1.1, licenças em fonts/OFL-*.txt). Só os pesos que este CSS usa. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/figtree-latin-400-normal.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: "Figtree";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/figtree-latin-500-normal.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: "Figtree";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/figtree-latin-700-normal.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: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/open-sans-latin-400-normal.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: "Open Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/open-sans-latin-600-normal.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: "Open Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/open-sans-latin-700-normal.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: "Open Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/open-sans-latin-800-normal.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;
}

:root {
  /* paleta do abredes.com.br */
  --abr-roxo: #6a2496;
  --abr-roxo-escuro: #4a1470;
  --abr-ink: #1c1424;
  --abr-texto: #2e2638;
  --abr-texto-2: #4d4557;
  --abr-mudo: #6b6275;
  --abr-lilas: #ece4f2;
  --abr-fundo: #f8f7fb;
  --abr-branco: #ffffff;
  --abr-laranja: #fa6500;     /* só como fundo de botão (texto #1c1424) ou sobre fundo escuro */
  --hero-bg: radial-gradient(circle at 78% 40%, #4a1a6e 0%, #2a0e3d 42%, #1e0a2e 100%);
  --hero-base: #1e0a2e;
  --hero-text: #ffffff;
  --cta: var(--abr-laranja);
  --on-cta: var(--abr-ink);
  /* tokens semânticos (tema claro) */
  --bg: #f8f7fb;
  --surface: #ffffff;
  --surface-2: #ece4f2;
  --text: #2e2638;
  --text-strong: #1c1424;
  --text-2: #4d4557;
  --muted: #6b6275;
  --border: #ece4f2;
  --border-strong: #4a1470;
  --line: #cdbfdb;            /* contorno de controles (alternativas, lacunas, campos) */
  --accent: #6a2496;
  --accent-strong: #4a1470;
  --accent-soft: #ece4f2;
  --on-accent: #ffffff;
  --heading-accent: #6a2496;
  --btn-outline: #6a2496;
  --ok: #1d7a46;
  --ok-soft: #dff3e7;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --warn: #8a4a00;
  --warn-soft: #fdecd9;
  --badge-rev-bg: #ece4f2;
  --badge-rev-fg: #6a2496;
  --badge-ai-bg: #f8f7fb;
  --badge-ai-fg: #4d4557;
  --badge-ai-border: #6b6275;
  --cli-bg: #1c1424;
  --cli-text: #ece4f2;
  --focus: #fa6500;
  --shadow: 0 1px 2px rgba(28, 20, 36, .05), 0 6px 18px rgba(28, 20, 36, .06);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-title: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1424;
    --surface: #2e2638;
    --surface-2: #3a2d48;
    --text: #f8f7fb;
    --text-strong: #ffffff;
    --muted: #c2b6cf;
    --border: #4d4557;
  --line: #6b6275;
    --accent: #cfa8ec;          /* lilás claro: roxo não passa AA sobre fundo escuro */
    --accent-strong: #e2c8f6;
    --accent-soft: #3a2d48;
    --on-accent: #1c1424;
    --heading-accent: #cfa8ec;
    --btn-outline: #f8f7fb;     /* botão secundário no escuro: borda e texto claros */
    --ok: #5fcf8d;
    --ok-soft: #1f3a2c;
    --bad: #ff8a80;
    --bad-soft: #3e2226;
    --warn: #ffb066;
    --warn-soft: #3a2a1c;
    --badge-rev-bg: #4a1470;
    --badge-rev-fg: #f8f7fb;
    --badge-ai-bg: transparent;
    --badge-ai-fg: #e0d8e8;
    --badge-ai-border: #c2b6cf;
    --cli-bg: #120c18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1424;
  --surface: #2e2638;
  --surface-2: #3a2d48;
  --text: #f8f7fb;
  --text-strong: #ffffff;
  --muted: #c2b6cf;
  --border: #4d4557;
  --line: #6b6275;
  --accent: #cfa8ec;          /* lilás claro: roxo não passa AA sobre fundo escuro */
  --accent-strong: #e2c8f6;
  --accent-soft: #3a2d48;
  --on-accent: #1c1424;
  --heading-accent: #cfa8ec;
  --btn-outline: #f8f7fb;     /* botão secundário no escuro: borda e texto claros */
  --ok: #5fcf8d;
  --ok-soft: #1f3a2c;
  --bad: #ff8a80;
  --bad-soft: #3e2226;
  --warn: #ffb066;
  --warn-soft: #3a2a1c;
  --badge-rev-bg: #4a1470;
  --badge-rev-fg: #f8f7fb;
  --badge-ai-bg: transparent;
  --badge-ai-fg: #e0d8e8;
  --badge-ai-border: #c2b6cf;
  --cli-bg: #120c18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-family: var(--font-title); color: var(--text-strong); }
h1 { font-size: 2.1rem; font-weight: 400; letter-spacing: -.01em; }
h1 strong, .title-lower strong { font-weight: 700; color: var(--heading-accent); }
.title-lower { text-transform: lowercase; }
h2 { font-size: 1.3rem; font-weight: 500; }
h3 { font-size: 1.05rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.loading, .noscript { padding: 2rem; text-align: center; color: var(--muted); }

/* ---------- barra superior (escura, como o site) ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; min-height: 60px;
  background: var(--hero-base); color: var(--hero-text);
}
.brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: none; border: 0; color: inherit; cursor: pointer; padding: 2px;
}
.brand-logo { display: block; height: 36px; width: auto; }
.brand-name { font-family: var(--font-title); font-size: 1rem; text-transform: lowercase; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); }
.appbar-exam { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 16px; font-size: .9rem; min-width: 0; }
.appbar-exam .exam-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: auto; }
.appbar-exam .counter { white-space: nowrap; }
.appbar-tools { display: flex; align-items: center; gap: 8px; }
.nav-link { color: var(--hero-text); font-weight: 600; font-size: .9rem; text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.nav-link:hover { background: rgba(255,255,255,.12); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 2px 12px; border-radius: 999px; background: rgba(255,255,255,.14); white-space: nowrap; }
.timer.low { background: #b3261e; color: #fff; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4);
  background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center;
}
.theme-icon::before { content: "☾"; font-size: 18px; }
:root[data-theme="dark"] .theme-icon::before { content: "☀"; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-icon::before { content: "☀"; } }

/* ---------- hero da tela inicial ---------- */
.hero-dark {
  background: var(--hero-bg); background-color: var(--hero-base); color: var(--hero-text);
  border-radius: var(--radius); padding: 36px 28px; margin-bottom: 8px;
}
.hero-dark h1 { color: var(--hero-text); font-size: clamp(2rem, 5vw, 3rem); text-transform: lowercase; margin-bottom: 12px; }
/* laranja sobre o hero: texto grande (>= 24px), AA de texto grande */
.hero-dark h1 .hl { color: var(--abr-laranja); font-weight: 700; }
.hero-dark p { margin: 0; max-width: 46em; color: #ece4f2; }

/* ---------- rodapé ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: .85rem; padding: 24px 16px 32px;
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: grid; gap: 6px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--accent); font-weight: 700; }
.footer-logo { height: 32px; width: auto; margin-bottom: 6px; }
.footer-logo.on-dark { display: none; }
:root[data-theme="dark"] .footer-logo.on-light { display: none; }
:root[data-theme="dark"] .footer-logo.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footer-logo.on-light { display: none; }
  :root:not([data-theme="light"]) .footer-logo.on-dark { display: block; }
}
body.in-exam .site-footer { padding-bottom: 96px; }

/* ---------- selo de revisão (lilás / neutro; nada de cor de alerta) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700;
  padding: 2px 12px; border-radius: 999px; border: 1px solid transparent;
}
.badge.reviewed { color: var(--badge-rev-fg); background: var(--badge-rev-bg); }
.badge.ai-draft { color: var(--badge-ai-fg); background: var(--badge-ai-bg); border-color: var(--badge-ai-border); }

/* ---------- página Sobre ---------- */
.about .counter-big { font-family: var(--font-title); font-size: 2.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.about .progress { height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 10px 0 4px; }
.about .progress > span { display: block; height: 100%; background: var(--accent); }
.about ol li + li { margin-top: 6px; }
.tagline { color: var(--accent); font-weight: 700; }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 96px; outline: none; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 22px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--btn-outline); background: transparent; color: var(--btn-outline); font-weight: 700;
}
.btn:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
/* primário: laranja com texto escuro */
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--on-cta); font-weight: 800; }
.btn.primary:hover { background: #ff7a1f; border-color: #ff7a1f; color: var(--on-cta); }
/* ação em fundo claro: roxo com texto branco */
.btn.action { background: var(--abr-roxo); border-color: var(--abr-roxo); color: #ffffff; }
.btn.action:hover { background: var(--abr-roxo-escuro); border-color: var(--abr-roxo-escuro); color: #ffffff; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row .spacer { flex: 1; }

/* ---------- home ---------- */
.exam-card h2 { margin-bottom: 4px; }
.exam-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.mode-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .mode-list { grid-template-columns: repeat(3, 1fr); } }
.mode {
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px;
  background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px;
}
.mode:hover, .mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.mode strong { font-size: 1rem; }
.mode span { font-size: .85rem; color: var(--muted); }
.options { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.options fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.options legend { font-weight: 600; margin-bottom: 6px; }
.check-grid { display: grid; gap: 6px; }
@media (min-width: 640px) { .check-grid { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.history-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.history-table th, .history-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.history-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- prova ---------- */
.exam-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.exam-layout > *, .question, .answer-area, .subq, .exhibit, .dnd > * { min-width: 0; }
.exam-layout.has-exhibit { grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .exam-layout.has-exhibit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .exhibit-inline { position: sticky; top: 68px; max-height: calc(100vh - 150px); overflow: auto; }
  .exhibit-btn-wrap { display: none; }
}
@media (max-width: 1099px) { .exhibit-inline { display: none; } }
.question-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); border: 1px solid var(--border);
}
.stem { font-size: 1.05rem; margin: 0 0 16px; white-space: pre-wrap; }
.instructions { font-size: .9rem; color: var(--muted); margin: -8px 0 12px; }
.choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.choice:hover { border-color: var(--accent); }
.choice input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.choice .letter { font-weight: 700; min-width: 1.4em; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.choice.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice .why { display: block; font-size: .875rem; color: var(--muted); margin-top: 4px; }
.fill-input {
  width: 100%; max-width: 520px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); font-family: var(--mono);
}
.exam-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.exam-footer .inner { max-width: 1180px; margin: 0 auto; }
.mark-toggle { display: flex; gap: 6px; align-items: center; font-size: .9rem; }

/* exhibit */
.exhibit { display: grid; gap: 12px; }
.exhibit figure { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; overflow: auto; }
.exhibit img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.cli {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--cli-bg); color: var(--cli-text);
  font: 13px/1.45 var(--mono); white-space: pre; overflow-x: auto; tab-size: 4;
}
.exhibit-text { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); white-space: pre-wrap; font-size: .95rem; }
.exhibit-title { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 20, .55);
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.modal {
  background: var(--surface); color: var(--text); border-radius: 12px; width: min(1000px, 100%);
  max-height: calc(100vh - 24px); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.modal.small { width: min(460px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal header h2 { margin: 0; font-size: 1.05rem; }
.modal .modal-body { padding: 16px; overflow: auto; }
.modal footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* drag-and-drop */
.dnd { display: grid; gap: 16px; }
@media (min-width: 720px) { .dnd { grid-template-columns: 1fr 1fr; } }
.dnd h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pool, .slots { display: grid; gap: 8px; align-content: start; }
.pool {
  min-height: 60px; padding: 10px; border: 2px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.pool.drop-hover { border-color: var(--accent); }
.slot {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
}
.slot-label { font-weight: 600; font-size: .95rem; }
.slot-target {
  min-height: 44px; border: 2px dashed var(--line); border-radius: var(--radius-sm); display: flex; align-items: stretch;
  padding: 3px; cursor: pointer; background: var(--surface-2); width: 100%; text-align: left;
}
.slot-target:empty::after, .slot-target .placeholder { content: ""; color: var(--muted); font-size: .85rem; align-self: center; padding: 0 8px; }
.slot-target.drop-hover, .slot-target.armed { border-color: var(--accent); background: var(--accent-soft); }
.slot.is-correct .slot-target { border-color: var(--ok); border-style: solid; }
.slot.is-wrong .slot-target { border-color: var(--bad); border-style: solid; }
.chip {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 12px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent-soft);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font-size: .95rem;
}
.chip::before { content: "⠿"; color: var(--muted); }
.chip.selected { outline: 3px solid var(--focus); outline-offset: 1px; }
.chip.dragging { opacity: .35; }
.drag-ghost {
  position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%) rotate(-1.5deg);
  box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 80vw;
}
.slot-correct { font-size: .85rem; color: var(--ok); }

/* testlet / simlet */
.subq { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.subq-head { font-weight: 700; margin-bottom: 6px; }
.terminal {
  background: var(--cli-bg); color: var(--cli-text); border-radius: var(--radius-sm); font: 13px/1.45 var(--mono);
  display: flex; flex-direction: column; min-height: 260px; max-height: 460px;
  width: 100%; min-width: 0;
}
.term-out { flex: 1; overflow: auto; padding: 12px; white-space: pre; }
.term-in { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid #2a3542; }
.term-in label { white-space: nowrap; color: #8fd18f; }
.term-in input { flex: 1; background: transparent; border: 0; color: inherit; font: inherit; outline: none; min-width: 0; }
.term-devices { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; }
.term-devices button {
  background: #1f2a36; color: #cfe0ef; border: 1px solid #34465a; border-radius: 6px; padding: 2px 10px; cursor: pointer;
  font: 12px var(--mono);
}
.term-devices button[aria-pressed="true"] { background: #2d6f99; color: #fff; }
.cmd-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmd-list button { font: 12px var(--mono); padding: 3px 8px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }

/* feedback (treino) */
.feedback { border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 16px; border: 1px solid; }
.feedback.ok { background: var(--ok-soft); border-color: var(--ok); }
.feedback.bad { background: var(--bad-soft); border-color: var(--bad); }
.feedback.partial { background: var(--warn-soft); border-color: var(--warn); }
.feedback h3 { margin: 0 0 6px; }
.explanation { white-space: pre-wrap; margin: 6px 0 0; }

/* resultado */
.score-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px; }
.score-big { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.verdict { font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.verdict.pass { background: var(--ok-soft); color: var(--ok); }
.verdict.fail { background: var(--bad-soft); color: var(--bad); }
.scale { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); margin: 18px 0 30px; }
.scale .fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: var(--accent); }
.scale .cut { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); }
.scale .cut span { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-size: .75rem; white-space: nowrap; color: var(--muted); }
.domain-bars { display: grid; gap: 12px; }
.domain-bar .label { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.domain-bar .bar { height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 4px; }
.domain-bar .bar > span { display: block; height: 100%; background: var(--accent); }

/* revisão */
.review-item { border-left: 4px solid var(--border); }
.review-item.ok { border-left-color: var(--ok); }
.review-item.bad { border-left-color: var(--bad); }
.review-item.partial { border-left-color: var(--warn); }
.review-item summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; list-style: none; }
.review-item summary::-webkit-details-marker { display: none; }
.review-item summary .status { font-weight: 700; white-space: nowrap; }
.review-item .ok-text { color: var(--ok); }
.review-item .bad-text { color: var(--bad); }
.answer-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 8px; }
.answer-table th, .answer-table td { border-bottom: 1px solid var(--border); padding: 6px; text-align: left; vertical-align: top; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-grid button { width: 40px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.nav-grid button.answered { background: var(--accent-soft); border-color: var(--accent); }
.nav-grid button.marked { box-shadow: inset 0 -3px 0 var(--warn); }
.nav-grid button.current { outline: 2px solid var(--text); }
.adaptive-status { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; }

@media (max-width: 520px) {
  .brand-name { display: none; }
  .brand-logo { height: 30px; }
  .nav-link { padding: 6px 4px; }
  .appbar-exam .exam-title { display: none; }
  main { padding: 14px 10px 110px; }
  .card { padding: 14px; }
  .score-big { font-size: 2.4rem; }
}
@media print {
  .appbar, .exam-footer, .btn { display: none !important; }
}

/* textos longos sem espaço (endereços IPv6, comandos) não podem alargar a página no celular */
.choice > span:last-child, .chip, .slot-label, .slot-correct, .stem, .explanation, .exhibit-text,
.review-item summary span, .answer-table td { min-width: 0; overflow-wrap: anywhere; }
.about .exam-counter + .exam-counter { border-top: 1px solid var(--border); padding-top: 16px; }
.about .exam-counter h3 { margin-bottom: 4px; }
