/* ============================================================================
   Caderno CFC — folha de estilos
   ----------------------------------------------------------------------------
   IDENTIDADE: "caderno pautado do contador".
   Papel pautado com margem vermelha, réguas duplas de livro-razão, versaletes
   nos rótulos, bolhas de cartão-resposta nas alternativas e carimbo de banca
   no resultado. Modo escuro = LOUSA (giz sobre quadro-verde), não cinza genérico.

   TIPOGRAFIA (auto-hospedada em fonts.css):
     Alegreya          — display/números (Huerta Tipográfica, desenhada p/ leitura longa)
     Alegreya Sans     — texto de interface
     Alegreya Sans SC  — versaletes: rótulos, botões, cabeçalhos de tabela
     Sometype Mono     — cronômetro, cartão-resposta, teclas, dados tabulares

   GEOMETRIA: cantos quase retos (2–4px) e réguas em vez de sombras difusas —
   a página tem cara de impresso, não de cartão flutuante.
   ========================================================================== */

/* ============================== tokens ============================== */
:root {
  /* papel e tinta */
  --page: #f1ece0;         /* papel manilha */
  --surface: #fbf8f1;      /* folha do caderno */
  --surface-2: #f3eee2;
  --ink: #17150f;          /* tinta preta quente */
  --ink-2: #46423a;
  --ink-3: #6a6559;        /* AA sobre --surface */
  --ink-4: #948d7e;        /* decorativo (não-texto) */
  --hair: #ddd6c5;
  --hair-2: #c7bfa9;
  --baseline: #b6ae98;
  --rule-faint: rgba(23, 21, 15, .045);   /* pauta do papel */
  --rule-red: #b4503f;                    /* margem do caderno */

  /* identidade */
  --green: #14523f;        /* verde-tinta (livro-razão) */
  --green-strong: #0b3628;
  --green-soft: #e4ece2;
  --gold: #9a7314;         /* ocre — acento decorativo */
  --gold-ink: #7a5a10;     /* ocre como TEXTO — AA */
  --gold-soft: #f3e8cd;
  --red: #a3372a;          /* óxido — caneta de correção, carimbo */
  --red-soft: #f6e4de;
  --focus: #1a5fb4;

  /* categóricas (frentes) — 6 do EQT + Suficiência */
  --c1: #2f6fb8; --c2: #1f8a5f; --c3: #b8801a;
  --c4: #0f7f86; --c5: #57459c; --c6: #b8402f; --c7: #9c3a76;

  --seq: #2f6fb8;

  /* status */
  --good: #2f7d32;
  --good-text: #1c5c20;
  --warn: #a97b21;
  --crit: #b5372a;
  --crit-text: #93291e;

  /* "sombra" = deslocamento de impresso, não desfoque de vidro */
  --shadow: 1px 1px 0 rgba(23, 21, 15, .05);
  --shadow-lift: 2px 2px 0 rgba(23, 21, 15, .07);
  --shadow-pop: 0 10px 24px rgba(23, 21, 15, .14), 0 30px 70px rgba(23, 21, 15, .20);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 2px; --radius: 3px; --r-lg: 4px;

  --display: 'Alegreya', 'Iowan Old Style', Palatino, Georgia, serif;
  --sans: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --sc: 'Alegreya Sans SC', 'Alegreya Sans', 'Segoe UI', sans-serif;
  --mono: 'Sometype Mono', Consolas, ui-monospace, monospace;
  /* compat: regras antigas que citavam --serif continuam válidas */
  --serif: var(--display);

  /* grão do papel (ruído SVG) e textura de carimbo */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 .09 0 0 0 0 .08 0 0 0 0 .06 0 0 0 -.55 .30'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --ink-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -.85 1.16'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23s)'/%3E%3C/svg%3E");
}

/* ---------------------------------- LOUSA (modo escuro) ------------------- */
[data-theme="dark"] {
  --page: #131e1a;          /* quadro-verde */
  --surface: #1a2723;
  --surface-2: #21302a;
  --ink: #edefe4;           /* giz */
  --ink-2: #c0c6b5;
  --ink-3: #9aa08d;
  --ink-4: #79806d;
  --hair: #2c3d36;
  --hair-2: #3d5148;
  --baseline: #4d6259;
  --rule-faint: rgba(237, 239, 228, .045);
  --rule-red: #d3705c;

  --green: #6ec9a0;
  --green-strong: #93dcbb;
  --green-soft: #1e332b;
  --gold: #dfb45f;
  --gold-ink: #e8c47a;
  --gold-soft: #322a17;
  --red: #e2836e;
  --red-soft: #33211d;
  --focus: #82b4ff;

  --c1: #6ba3e8; --c2: #4cc795; --c3: #d9a441;
  --c4: #45bfc4; --c5: #a294ee; --c6: #ea7a68; --c7: #dd82c0;
  --seq: #6ba3e8;

  --good: #4fbf62; --good-text: #77d585;
  --warn: #dfae4b;
  --crit: #e2604c; --crit-text: #ef8674;

  --shadow: 1px 1px 0 rgba(0, 0, 0, .28);
  --shadow-lift: 2px 2px 0 rgba(0, 0, 0, .34);
  --shadow-pop: 0 12px 30px rgba(0, 0, 0, .55), 0 32px 80px rgba(0, 0, 0, .6);
}

/* ============================== base ============================== */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  color: var(--ink);
  font: 15.5px/1.6 var(--sans);
  background-color: var(--page);
  /* pauta do caderno: linha a cada 28px */
  background-image: repeating-linear-gradient(to bottom,
    transparent 0 27px, var(--rule-faint) 27px 28px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* grão de papel por cima de tudo (não bloqueia cliques) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: var(--grain); opacity: .55; mix-blend-mode: multiply;
}
[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: .3; }

h1, h2, h3, .display { font-family: var(--display); font-weight: 700; }
h1 {
  font-size: clamp(28px, 3.3vw, 36px); line-height: 1.12;
  letter-spacing: -.014em; margin: 0 0 6px; font-weight: 800;
}
h2 { font-size: 21px; letter-spacing: -.006em; margin: 0 0 4px; }
h3 { font-size: 18px; margin: 0 0 4px; }
p { margin: 0 0 10px; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; }
b, strong { font-weight: 700; }
::selection { background: var(--gold-soft); color: var(--ink); }
[data-theme="dark"] ::selection { background: rgba(223, 180, 95, .3); color: #f6f4ea; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.view h1:focus, .view h1:focus-visible, #main:focus, #main:focus-visible { outline: none; }
.group-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }

.app { display: flex; min-height: 100vh; }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 300;
  background: var(--green); color: var(--surface); border: 0; border-radius: 0 0 3px 3px;
  padding: 10px 18px; font-family: var(--sc); font-weight: 700; letter-spacing: .04em;
  cursor: pointer; transition: top .16s;
}
[data-theme="dark"] .skip-link { color: #0d1614; }
.skip-link:focus { top: 0; }
.save-badge {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 260;
  background: var(--crit); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 8px 16px; border-radius: 2px; box-shadow: var(--shadow-lift);
}

/* ============================== sidebar (capa do caderno) ============================== */
.sidebar {
  width: 236px; flex: 0 0 236px;
  background: var(--surface);
  border-right: 1px solid var(--hair-2);
  /* segunda régua = lombada */
  box-shadow: 3px 0 0 -2px var(--hair);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 20px 16px 14px;
  z-index: 20;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 2px 16px; border-bottom: 3px double var(--hair-2); }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; display: block; border-radius: 3px; }
.brand-title { display: block; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand-sub {
  display: block; font-family: var(--mono); font-size: 9px; color: var(--ink-3);
  letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; white-space: nowrap;
}

.nav { display: flex; flex-direction: column; gap: 1px; padding-top: 14px; flex: 1; overflow-y: auto; }
/* rótulo de seção com régua à direita (device editorial) */
.nav-sep {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 4px 5px; font-family: var(--sc); font-size: 12px; font-weight: 700;
  letter-spacing: .11em; color: var(--ink-4);
}
.nav-sep::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 9px; border-radius: 2px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px;
  border-left: 3px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--green-soft); color: var(--green-strong);
  border-left-color: var(--green); font-weight: 700;
}
.nav-ico { width: 17px; text-align: center; font-size: 14px; color: var(--ink-4); }
.nav-item.active .nav-ico, .nav-item:hover .nav-ico { color: var(--green); }

.sidebar-foot { border-top: 1px solid var(--hair); padding-top: 11px; display: flex; flex-direction: column; gap: 8px; }
.foot-note { font-family: var(--mono); font-size: 10px; color: var(--ink-4); line-height: 1.6; padding: 0 3px 2px; letter-spacing: .01em; }

/* ============================== conteúdo ============================== */
.main { flex: 1; min-width: 0; padding: 30px clamp(16px, 4vw, 52px) 72px; }
/* margem vermelha do caderno, acompanhando a coluna de texto */
.view { max-width: 1080px; margin: 0 auto; position: relative; }
.view::before {
  content: ""; position: absolute; left: -28px; top: -14px; bottom: -30px; width: 3px;
  border-left: 1px solid var(--rule-red); border-right: 1px solid var(--rule-red);
  opacity: .34; pointer-events: none;
}
@media (max-width: 1180px) { .view::before { display: none; } }

/* estado de abertura (enquanto o banco de questões carrega) */
.boot { padding: 70px 0; color: var(--ink-3); font-family: var(--display); font-size: 20px; }
.boot p { margin: 14px 0 0; animation: bootFade 1.4s ease-in-out infinite alternate; }
.boot-rule { display: block; width: 64px; height: 2px; background: var(--ink); }
@keyframes bootFade { from { opacity: .45; } to { opacity: 1; } }

.view-head { margin-bottom: 24px; }
.kicker {
  font-family: var(--sc); font-size: 13px; letter-spacing: .13em;
  color: var(--gold-ink); font-weight: 700; margin-bottom: 3px;
}
.lede { color: var(--ink-2); max-width: 66ch; font-size: 16px; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.view.entering > * { animation: rise .38s cubic-bezier(.2,.7,.3,1) both; }
.view.entering > *:nth-child(2) { animation-delay: .04s; }
.view.entering > *:nth-child(3) { animation-delay: .08s; }
.view.entering > *:nth-child(4) { animation-delay: .12s; }
.view.entering > *:nth-child(5) { animation-delay: .16s; }
.view.entering > *:nth-child(6) { animation-delay: .20s; }

.theme-anim, .theme-anim body, .theme-anim .sidebar, .theme-anim .card, .theme-anim .tile,
.theme-anim .q-card, .theme-anim .sim-topbar, .theme-anim .hero { transition: background-color .28s ease, border-color .28s ease, color .28s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .timer.low { animation: none !important; }
}

/* ============================== folhas (cartões) ============================== */
.card {
  background: var(--surface); border: 1px solid var(--hair-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; margin-bottom: 16px;
}
.card-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 9px; margin-bottom: 15px;
  border-bottom: 3px double var(--hair-2);
}
.card-title h2, .card-title h3 {
  margin: 0; font-family: var(--sc); font-weight: 700;
  font-size: 17px; letter-spacing: .045em; color: var(--ink);
}
.card-title .hint { font-size: 12.5px; color: var(--ink-3); }
.card-title .hint[href], a.hint { color: var(--green); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-tiles { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px 22px; }

/* ---- coluna de razão (stat tile): régua grossa em cima, sem caixa ---- */
.tile {
  background: transparent; border: 0; border-top: 2px solid var(--ink);
  border-radius: 0; padding: 10px 0 4px; box-shadow: none;
}
.tile-label {
  font-family: var(--sc); font-size: 12.5px; font-weight: 700; letter-spacing: .07em;
  color: var(--ink-3);
}
.tile-value {
  font-family: var(--display); font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: clamp(30px, 3.5vw, 38px); line-height: 1.05; margin-top: 3px;
  letter-spacing: -.02em;
}
.tile-value small { font-size: 16px; color: var(--ink-3); font-family: var(--sans); font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.tile-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.45; }
.tile-sub.up { color: var(--good-text); }
.tile-sub.down { color: var(--crit-text); }

/* ============================== botões e formulários ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: var(--surface);
  border: 1px solid var(--green); border-radius: var(--r-sm);
  padding: 9px 20px; font-family: var(--sc); font-weight: 700; font-size: 15px;
  letter-spacing: .045em; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s, color .12s;
}
[data-theme="dark"] .btn { color: #0d1614; }
.btn:hover { background: var(--green-strong); border-color: var(--green-strong); box-shadow: var(--shadow-lift); transform: translate(-1px, -1px); }
.btn:active { transform: none; box-shadow: none; }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green-soft); color: var(--green-strong); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--hair-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); box-shadow: none; }
[data-theme="dark"] .btn-ghost { color: var(--ink-2); }
[data-theme="dark"] .btn-ghost:hover { color: var(--ink); }
[data-theme="dark"] .btn-outline { color: var(--green); }
[data-theme="dark"] .btn-outline:hover { color: var(--green-strong); }
.btn-danger { background: var(--crit); color: #fff; border-color: var(--crit); }
[data-theme="dark"] .btn-danger { background: #b5372a; border-color: #b5372a; color: #fff; }
.btn-danger:hover { background: #93291e; border-color: #93291e; }
.btn-sm { padding: 6px 13px; font-size: 13.5px; }
.btn-lg { padding: 12px 28px; font-size: 17px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field > label {
  font-family: var(--sc); font-size: 13px; font-weight: 700;
  color: var(--ink-2); letter-spacing: .06em;
}
select, input[type="text"], input[type="number"], textarea {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hair-2); border-radius: var(--r-sm);
  padding: 9px 12px; font: inherit; width: 100%;
}
select:hover, input[type="text"]:hover { border-color: var(--ink-3); }
textarea { resize: vertical; min-height: 220px; line-height: 1.7; font-size: 15.5px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- seletor segmentado: etiquetas de formulário, não pílulas ---- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg .seg-item {
  border: 1px solid var(--hair-2); background: var(--surface);
  color: var(--ink-2); border-radius: var(--r-sm); padding: 6px 13px;
  font-size: 14px; font-weight: 500; cursor: pointer; line-height: 1.35;
  transition: border-color .13s, color .13s, background .13s;
}
.seg .seg-item:hover { border-color: var(--green); color: var(--green); }
.seg .seg-item.on {
  background: var(--green); border-color: var(--green);
  color: var(--surface); font-weight: 700;
}
[data-theme="dark"] .seg .seg-item.on { color: #0d1614; }

/* ---- frentes agrupadas por certame ----
   Duas provas diferentes moram na mesma lista (EQT e Exame de Suficiência). A
   legenda por cima de cada bloco é o que impede o usuário de achar que
   "Suficiência" é só mais uma frente do EQT. */
.seg-certs { display: block; }
.seg-cert {
  font-family: var(--sc); font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 12px 0 6px; padding-left: 1px;
}
.seg-certs > .seg-cert:first-child { margin-top: 2px; }
.seg-cert::after {
  content: ""; display: block; height: 1px; background: var(--hair);
  margin-top: 5px; max-width: 320px;
}

/* ---- legendas ---- */
.area-dot { display: inline-block; width: 9px; height: 9px; border-radius: 1px; margin-right: 7px; vertical-align: 0; }
.pill {
  display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600;
  border-radius: var(--r-sm); padding: 2px 9px; letter-spacing: .01em;
  background: var(--surface-2); border: 1px solid var(--hair); color: var(--ink-2);
}
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 32%, transparent); }
.pill.green { background: var(--green-soft); color: var(--green-strong); border-color: color-mix(in srgb, var(--green) 28%, transparent); }

/* ============================== folha de rosto (hero) ============================== */
.hero {
  background: var(--green-strong);
  color: #f0f4ec; border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 30px 32px 34px; margin-bottom: 20px;
  position: relative; overflow: hidden;
  /* pauta clara sobre o verde */
  background-image: repeating-linear-gradient(to bottom,
    transparent 0 27px, rgba(255,255,255,.045) 27px 28px);
}
[data-theme="dark"] .hero { background: #10231c; border: 1px solid var(--hair-2); }
.hero::after {
  content: "§"; position: absolute; right: 22px; top: -46px;
  font-family: var(--display); font-weight: 800; font-size: 210px;
  color: #fff; opacity: .06; pointer-events: none; line-height: 1;
}
/* régua graduada no pé da folha de rosto */
.hero::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
  background-image: repeating-linear-gradient(to right,
    rgba(255,255,255,.34) 0 1px, transparent 1px 9px);
  opacity: .5;
}
.hero h1 { color: #fff; margin-bottom: 8px; }
.hero .kicker { color: #d9c78e; }
.hero .lede { color: #d5e3da; max-width: 62ch; }
.hero .btn { background: #f6f2e6; color: var(--green-strong); border-color: #f6f2e6; }
[data-theme="dark"] .hero .btn { color: var(--green-strong); }
.hero .btn:hover { background: #fff; border-color: #fff; }
.hero .btn.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn.btn-outline:hover { background: rgba(255,255,255,.13); border-color: #fff; }
.hero .btn-row { margin-top: 18px; }

/* ============================== linhas de frente ============================== */
.area-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.area-row:last-child { border-bottom: 0; }
.area-sep {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sc); font-size: 12.5px; font-weight: 700; letter-spacing: .09em;
  color: var(--ink-4); padding: 14px 0 6px;
}
.area-sep::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.area-sep:first-child { padding-top: 2px; }
.area-row .name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.area-row .name small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.area-row .mini-track { flex: 0 0 130px; }
.area-row .val { flex: 0 0 92px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-3); }

/* barras */
.track { height: 9px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 1px; overflow: hidden; position: relative; }
.track .fill { height: 100%; background: var(--seq); transition: width .55s cubic-bezier(.2,.7,.3,1); }

/* ============================== "o que mais cai" ============================== */
.mc-filters { display: flex; flex-direction: column; gap: 13px; }
.mc-filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.mc-filter-row .lbl-inline {
  font-family: var(--sc); font-size: 13px; font-weight: 700;
  color: var(--ink-3); letter-spacing: .08em;
}
.mc-filter-row .seg { flex-wrap: wrap; }
.mc-filter-row .mini-link { font-family: var(--sc); font-size: 13px; letter-spacing: .05em; color: var(--green); background: none; border: 0; cursor: pointer; padding: 4px 6px; }
.mc-filter-row .mini-link:hover { text-decoration: underline; }
.mc-search { position: relative; flex: 1 1 240px; min-width: 200px; max-width: 460px; }
.mc-search input { padding-right: 30px; }
.mc-search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; }
.mc-search .clear:hover { color: var(--ink); }
.mc-filter-row select { width: auto; min-width: 190px; }
.mc-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin-top: -3px; }
.mc-hint b { color: var(--ink-2); font-weight: 700; }
#mcAreas .seg-item .chk { font-family: var(--mono); font-weight: 500; font-size: 10px; margin-right: 3px; opacity: .85; }
#mcAreas .seg-item:not(.on) .chk { color: var(--ink-4); }
.mc-summary { font-size: 13px; color: var(--ink-3); }
.mc-summary b { color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.mc-brk { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 4px; }
.mc-brk .mc-chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.mc-match-note { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; }
.mc-match-note b { color: var(--ink); font-weight: 700; }

.hbar-row { display: grid; grid-template-columns: minmax(180px, 320px) 1fr 62px; gap: 12px; align-items: center; padding: 5px 0; }
.hbar-row .lbl { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.hbar-row .lbl small { color: var(--ink-3); display: block; font-size: 11.5px; }
.hbar-row .bar-wrap { height: 13px; background: transparent; position: relative; border-bottom: 1px solid var(--hair); }
.hbar-row .bar {
  height: 100%; background: var(--seq); min-width: 2px;
  transition: width .55s cubic-bezier(.2,.7,.3,1);
}
.hbar-row .num { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); text-align: right; }
.hbar-row:hover .bar { filter: brightness(1.1); }

.group-block { border: 1px solid var(--hair-2); border-radius: var(--r-sm); margin-bottom: 10px; overflow: hidden; }
.group-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; background: var(--surface-2);
  border: 0; cursor: pointer; text-align: left; color: var(--ink);
}
.group-head:hover { background: var(--green-soft); }
.group-head .g-name { flex: 1; font-family: var(--sc); font-weight: 700; font-size: 15px; letter-spacing: .035em; }
.group-head .g-count { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.group-head .chev { transition: transform .2s; color: var(--ink-4); }
.group-block.open .chev { transform: rotate(90deg); }
.group-body { padding: 11px 14px; display: none; }
.group-block.open .group-body { display: block; }

/* ============================== questão (caderno de prova) ============================== */
.q-wrap { max-width: 860px; margin: 0 auto; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.q-card {
  background: var(--surface); border: 1px solid var(--hair-2);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px 28px;
}
.q-num {
  font-family: var(--sc); font-size: 14.5px; font-weight: 700;
  color: var(--ink-3); letter-spacing: .12em; margin-bottom: 12px;
  padding-bottom: 9px; border-bottom: 1px solid var(--hair);
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}

.tts-btn {
  border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink-3);
  border-radius: var(--r-sm); padding: 3px 10px; cursor: pointer;
  font-family: var(--sc); font-size: 13px; font-weight: 700; letter-spacing: .05em;
  white-space: nowrap; transition: border-color .13s, color .13s, background .13s;
}
.tts-btn:hover { border-color: var(--green); color: var(--green); }
.tts-btn.on { background: var(--green-soft); border-color: var(--green); color: var(--green-strong); }

.q-text { font-size: 16.5px; line-height: 1.68; letter-spacing: .002em; }
.q-text p { margin: 0 0 12px; }
.q-text .q-item { display: block; padding-left: 20px; text-indent: -20px; margin: 0 0 8px; }

/* ---- alternativas: bolhas de cartão-resposta ---- */
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.opt {
  display: flex; gap: 13px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 1px solid var(--hair-2); border-left: 3px solid var(--hair-2);
  border-radius: var(--r-sm);
  padding: 11px 15px; cursor: pointer; color: var(--ink); font-size: 15.5px; line-height: 1.55;
  transition: border-color .12s, background .12s, transform .12s;
  width: 100%;
}
.opt:hover { border-color: var(--green); background: var(--green-soft); transform: translateX(2px); }
.opt .letter {
  flex: 0 0 27px; height: 27px; border-radius: 50%;
  border: 1.5px solid var(--hair-2); display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 500; font-size: 12.5px;
  transition: background .12s, border-color .12s, color .12s; margin-top: 1px;
  color: var(--ink-3);
}
.opt:hover .letter { border-color: var(--green); color: var(--green); }
.opt.picked { border-color: var(--green); border-left-color: var(--green); background: var(--green-soft); }
.opt.picked .letter { background: var(--green); border-color: var(--green); color: var(--surface); }
[data-theme="dark"] .opt.picked .letter { color: #0d1614; }
.opt.correct { border-color: var(--good); border-left-color: var(--good); background: color-mix(in srgb, var(--good) 11%, var(--surface)); }
.opt.correct .letter { background: var(--good); border-color: var(--good); color: #fff; }
.opt.wrong { border-color: var(--crit); border-left-color: var(--crit); background: color-mix(in srgb, var(--crit) 9%, var(--surface)); }
.opt.wrong .letter { background: var(--crit); border-color: var(--crit); color: #fff; }
.opt[disabled] { cursor: default; transform: none; }
.opt[disabled]:hover { transform: none; }
.opt.dim { opacity: .64; }

.feedback { border-radius: var(--r-sm); padding: 14px 17px; margin-top: 16px; font-size: 14.5px; display: flex; gap: 11px; align-items: flex-start; }
.feedback.ok { background: color-mix(in srgb, var(--good) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 42%, transparent); }
.feedback.err { background: color-mix(in srgb, var(--crit) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--crit) 38%, transparent); }
.feedback .fb-ico { font-size: 19px; line-height: 1.15; }
.feedback.ok .fb-ico { color: var(--good-text); }
.feedback.err .fb-ico { color: var(--crit-text); }

.q-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 18px; }
.kbd-hint { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); letter-spacing: .01em; }
kbd {
  font-family: var(--mono); font-size: 10.5px; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--hair-2); border-bottom-width: 2px; border-radius: 2px; padding: 1px 5px;
}

/* ============================== simulado ============================== */
.sim-topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--hair-2); border-top-width: 3px;
  border-top-color: var(--ink); border-radius: var(--r-sm);
  box-shadow: var(--shadow); padding: 11px 17px; margin-bottom: 18px;
}
.sim-topbar .sim-title { font-family: var(--sc); font-weight: 700; font-size: 16px; letter-spacing: .05em; }
.sim-topbar .spacer { flex: 1; }
.timer {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500;
  font-size: 21px; letter-spacing: .01em; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.timer .t-ico { font-size: 13px; color: var(--ink-4); }
.timer.low { color: var(--crit-text); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* cartão de respostas (OMR) */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.sheet button {
  aspect-ratio: 1; border-radius: 1px; border: 1px solid var(--hair-2);
  background: var(--surface); color: var(--ink-3);
  font-family: var(--mono); font-weight: 400; font-size: 12px;
  cursor: pointer; position: relative;
  transition: background .12s, border-color .12s, color .12s;
}
.sheet button:hover { border-color: var(--green); color: var(--green); }
.sheet button.answered { background: var(--green); border-color: var(--green); color: var(--surface); font-weight: 500; }
[data-theme="dark"] .sheet button.answered { color: #0d1614; }
.sheet button.current { outline: 2px solid var(--ink); outline-offset: 1px; }
.sheet button.flagged::after {
  content: ""; position: absolute; top: 2px; right: 2px; width: 0; height: 0;
  border-top: 7px solid var(--gold); border-left: 7px solid transparent;
}

.flag-btn {
  border: 1px solid var(--hair-2); background: var(--surface); border-radius: var(--r-sm);
  padding: 8px 13px; cursor: pointer; color: var(--ink-2);
  font-family: var(--sc); font-size: 14px; font-weight: 700; letter-spacing: .04em;
}
.flag-btn:hover { border-color: var(--gold); color: var(--gold-ink); }
.flag-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }

/* ---- resultado: carimbo da banca ---- */
.result-hero { text-align: center; padding: 34px 20px 26px; }
.result-hero .verdict { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1.1; }
.result-hero .verdict.ok { color: var(--good-text); }
.result-hero .verdict.fail { color: var(--crit-text); }
/* o carimbo propriamente dito (só no resultado de simulado) */
.verdict-stamp {
  display: inline-block; font-family: var(--sc); font-weight: 700;
  font-size: clamp(30px, 5vw, 46px); line-height: 1; letter-spacing: .14em;
  padding: 12px 26px 10px; margin: 4px 0 2px;
  border: 3px double currentColor; border-radius: 3px;
  transform: rotate(-3.2deg);
  -webkit-mask-image: var(--ink-grain); mask-image: var(--ink-grain);
  -webkit-mask-size: 120px; mask-size: 120px;
  animation: stamp .5s cubic-bezier(.2,1.5,.4,1) both;
}
.result-hero .verdict-stamp.ok { color: var(--good-text); }
.result-hero .verdict-stamp.fail { color: var(--crit-text); }
@keyframes stamp {
  0%   { opacity: 0; transform: rotate(-3.2deg) scale(1.75); }
  55%  { opacity: 1; transform: rotate(-3.2deg) scale(.93); }
  100% { opacity: 1; transform: rotate(-3.2deg) scale(1); }
}
.result-hero .score-line { margin-top: 12px; color: var(--ink-2); font-size: 15.5px; }
.result-hero .score-line b { font-variant-numeric: tabular-nums; }
.strip { display: flex; gap: 2px; margin: 20px auto 6px; max-width: 640px; }
.strip span { flex: 1; height: 15px; border-radius: 1px; background: var(--surface-2); border: 1px solid var(--hair); }
.strip span.h { background: var(--good); border-color: var(--good); }
.strip span.m { background: var(--crit); border-color: var(--crit); }
.strip span.b { background: var(--surface-2); border-color: var(--baseline); }
.strip span.a { background: var(--gold); border-color: var(--gold); }
.strip-legend { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-bottom: 4px; }
.strip-legend b { color: var(--ink-2); font-weight: 700; }

/* ============================== tabelas (livro-razão) ============================== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-family: var(--sc); font-size: 13px; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--ink);
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .num { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.tbl .ok { color: var(--good-text); font-weight: 700; }
.tbl .fail { color: var(--crit-text); font-weight: 700; }

/* ============================== gráfico de linha ============================== */
.chart-line { width: 100%; height: auto; display: block; }
.chart-line .grid-h { stroke: var(--hair); stroke-width: 1; }
.chart-line .axis { stroke: var(--baseline); stroke-width: 1; }
.chart-line .lbl { fill: var(--ink-3); font-size: 10.5px; font-family: var(--mono); }
.chart-line .series { fill: none; stroke: var(--seq); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-line .goal { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-line .goal-lbl { fill: var(--gold-ink); font-size: 10.5px; font-weight: 700; font-family: var(--sc); }
.chart-line .pt { fill: var(--seq); stroke: var(--surface); stroke-width: 2; }
.chart-line .hit-g .halo { fill: transparent; }
.chart-line .hit-g .tip { opacity: 0; pointer-events: none; transition: opacity .12s; }
.chart-line .hit-g:hover .tip { opacity: 1; }
.chart-line .tip-box { fill: var(--ink); rx: 2; }
.chart-line .tip-text { fill: var(--page); font-size: 10.5px; font-weight: 600; font-family: var(--mono); }

/* domínio por tópico */
.dom-row { display: grid; grid-template-columns: minmax(170px, 300px) 1fr 128px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.dom-row:last-child { border-bottom: 0; }
.dom-row .lbl { font-size: 13.5px; line-height: 1.3; }
.dom-row .lbl small { color: var(--ink-3); display: block; font-size: 11.5px; }
.dom-row .stat { font-family: var(--mono); font-size: 11.5px; text-align: right; white-space: nowrap; }
.dom-row .stat .ico { margin-right: 4px; font-family: var(--sans); font-size: 13px; }

/* ============================== discursivas ============================== */
.essay-text { font-family: var(--display); font-size: 17px; line-height: 1.72; }
.essay-tools { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-3); margin: 8px 0; }
.check-item { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--hair-2); font-size: 14px; }
.check-item:last-child { border-bottom: 0; }
.check-item input { margin-top: 4px; accent-color: var(--green); }

/* ============================== toast e diversos ============================== */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--page);
  padding: 11px 20px; border-radius: var(--r-sm); box-shadow: var(--shadow-pop);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 320; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty {
  text-align: center; color: var(--ink-3); padding: 36px 16px; font-size: 14.5px;
  border: 1px dashed var(--hair-2); border-radius: var(--r-sm); background: var(--surface-2);
}
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; color: var(--ink-4); }
.empty .empty-title { font-family: var(--sc); font-weight: 700; letter-spacing: .04em; color: var(--ink-2); font-size: 16px; margin-bottom: 3px; }
.empty .empty-sub { font-size: 13.5px; color: var(--ink-3); }

.note { font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.note b { color: var(--ink-2); font-weight: 700; }
.divider { border: 0; border-top: 1px solid var(--hair); margin: 16px 0; }

.badge-anulada {
  background: var(--gold-soft); color: var(--gold-ink); font-family: var(--sc); font-weight: 700;
  padding: 1px 9px; border-radius: 1px; font-size: 12.5px; letter-spacing: .07em;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}

details.acc { border: 1px solid var(--hair); border-radius: var(--r-sm); margin-bottom: 8px; background: var(--surface); }
details.acc summary { cursor: pointer; padding: 12px 15px; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 9px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::before { content: "▸"; color: var(--ink-4); transition: transform .18s; }
details.acc[open] summary::before { transform: rotate(90deg); }
details.acc[open] summary { border-bottom: 1px solid var(--hair); }
details.acc .acc-body { padding: 14px 15px; font-size: 14.5px; color: var(--ink-2); }

/* ============================== busca (rodapé da sidebar) ============================== */
.cmd-open {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; background: var(--surface-2); border: 1px solid var(--hair-2);
  color: var(--ink-3); border-radius: var(--r-sm); padding: 7px 10px; cursor: pointer;
  font-size: 13.5px; transition: border-color .14s, color .14s;
}
.cmd-open:hover { border-color: var(--green); color: var(--ink); }
.cmd-open kbd { font-size: 9.5px; }

/* ============================== overlays ============================== */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(20, 16, 10, .45); opacity: 0; transition: opacity .16s; }
[data-theme="dark"] .overlay-backdrop { background: rgba(0, 0, 0, .62); }
.overlay.show .overlay-backdrop { opacity: 1; }
.overlay-panel {
  position: relative; margin: auto; background: var(--surface);
  border: 1px solid var(--hair-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  width: min(680px, 94vw); max-height: 86vh; overflow: hidden; display: flex; flex-direction: column;
  opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .16s, transform .16s;
}
.overlay.show .overlay-panel { opacity: 1; transform: none; }
.overlay-top { align-items: flex-start; }
.overlay-top .overlay-panel { margin-top: 8vh; }

/* ---- diálogo de confirmação do próprio app (substitui o confirm() do sistema) ---- */
.overlay-ask .overlay-panel { width: min(430px, 92vw); }
.ask { padding: 22px 24px 18px; }
.ask-title { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0 0 8px; letter-spacing: -.01em; }
.ask-text { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; margin: 0; }
.ask-row { justify-content: flex-end; margin-top: 20px; }
@media (max-width: 460px) {
  .ask-row { flex-direction: column-reverse; }
  .ask-row .btn { width: 100%; }
}

/* ---- treino por norma ---- */
.pill-treino { background: var(--gold-soft); color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.nm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 8px; }
.nm-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hair); border-left: 3px solid var(--hair-2);
  border-radius: var(--r-sm); padding: 10px 13px; cursor: pointer; color: inherit; font: inherit;
  transition: border-color .13s, background .13s;
}
.nm-item:hover { border-color: var(--green); background: var(--green-soft); }
.nm-item.on { border-color: var(--green); border-left-color: var(--green); background: var(--green-soft); }
.nm-chk { font-family: var(--mono); font-size: 12px; color: var(--ink-4); flex: 0 0 14px; }
.nm-item.on .nm-chk { color: var(--green-strong); font-weight: 500; }
.nm-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nm-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.nm-sub { font-size: 11.5px; color: var(--ink-3); }
.nm-nums { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.nm-tr { color: var(--gold-ink); }

/* citação da norma que sustenta o gabarito (só em questão de treino) */
.fundamento { margin-top: 10px; }
.fund-lbl { font-family: var(--sc); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
.fundamento blockquote {
  margin: 4px 0 0; padding: 8px 12px; border-left: 3px solid var(--gold);
  background: var(--gold-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: var(--display); font-size: 14.5px; line-height: 1.55; color: var(--ink-2);
}

/* ---- primeira abertura ---- */
.welcome { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); border-left: 3px solid var(--green); }

/* ---- no aplicativo Android não há teclado físico: os atalhos só ocupam espaço ---- */
.is-app .kbd-hint,
.is-app .cmd-open kbd,
.is-app .cmd-foot .cmd-keys { display: none; }
.is-app .cmd-foot { justify-content: flex-end; }

.cmd { display: flex; flex-direction: column; min-height: 0; }
.cmd-input { border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; padding: 17px 20px; font-size: 17px; background: transparent; font-family: var(--display); }
.cmd-input:focus { outline: 0; }
.cmd-results { overflow-y: auto; padding: 6px; }
.cmd-group { font-family: var(--sc); font-size: 12.5px; letter-spacing: .1em; color: var(--ink-4); padding: 11px 12px 4px; font-weight: 700; }
.cmd-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: var(--r-sm); padding: 9px 12px; cursor: pointer; color: var(--ink); font-size: 14.5px; }
.cmd-item.on { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.cmd-item .cmd-ico { width: 18px; text-align: center; color: var(--ink-4); flex: 0 0 auto; }
.cmd-q { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cmd-q b { font-weight: 700; }
.cmd-q small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-star { margin-left: auto; color: var(--gold); }
.cmd-empty { padding: 24px; text-align: center; color: var(--ink-3); }
.cmd-foot { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--hair); font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); }

.qmodal, .help { display: flex; flex-direction: column; min-height: 0; }
.qmodal-head, .help .qmodal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--hair); }
.qmodal-body { padding: 17px 20px; overflow-y: auto; }
.qmodal-body .opts { margin-top: 14px; }
.qmodal-meta { margin-top: 12px; }
.qmodal-note { min-height: 70px; margin-top: 6px; }
.qmodal-foot { padding: 12px 18px; border-top: 1px solid var(--hair); }
.note-lbl { display: block; font-family: var(--sc); font-size: 13px; font-weight: 700; letter-spacing: .05em; color: var(--ink-3); margin-top: 12px; }
.mark-btn {
  border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink-3);
  border-radius: var(--r-sm); padding: 5px 12px; cursor: pointer;
  font-family: var(--sc); font-size: 14px; font-weight: 700; letter-spacing: .04em;
}
.mark-btn:hover { border-color: var(--gold); color: var(--gold-ink); }
.mark-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.mark-btn.sm { padding: 2px 9px; font-size: 14px; }
.help-tbl { border-collapse: collapse; width: 100%; margin: 8px 4px; }
.help-tbl th { text-align: left; padding: 9px 14px 9px 4px; white-space: nowrap; vertical-align: top; }
.help-tbl td { padding: 9px 4px; color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--hair); }
.help-tbl tr:first-child td { border-top: 0; }

/* ============================== layouts de duas colunas ============================== */
.sim-grid { grid-template-columns: minmax(0,1fr) 252px; align-items: start; }
.sim-sheet-card { position: sticky; top: 78px; }
.ess-grid { grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); align-items: start; }
@media (max-width: 900px) { .sim-grid, .ess-grid { grid-template-columns: 1fr; } .sim-sheet-card { position: static; } }

.sim-paused { max-width: 560px; margin: 60px auto; text-align: center; }
.sim-h1 { font-size: 16px; font-family: var(--sc); letter-spacing: .05em; margin: 0; display: inline; }

/* ============================== linhas clicáveis ============================== */
.hbar-row.clickable, .dom-row.clickable {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid transparent;
  border-radius: var(--r-sm); cursor: pointer;
  text-align: left; font: inherit; color: inherit; transition: background .13s;
}
.dom-row.clickable { border-bottom: 1px solid var(--hair); border-radius: 0; }
.hbar-row.clickable { padding: 5px 8px; margin: 0 -8px; }
.hbar-row.clickable:hover, .dom-row.clickable:hover { background: var(--green-soft); }
.hbar-row .go, .dom-row .go, .prio-row .go { opacity: 0; color: var(--green); font-size: 10px; transition: opacity .13s; }
.hbar-row.clickable:hover .go, .dom-row.clickable:hover .go, .prio-row:hover .go { opacity: 1; }
.prio-row { cursor: pointer; }
.prio-row:hover td { background: var(--green-soft); }

/* ============================== constância ============================== */
.goal-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.goal-ring-wrap { flex: 0 0 auto; }
.goal-info { flex: 1; min-width: 260px; }
.heatmap-wrap { overflow-x: auto; }
.heatmap { max-width: 100%; height: auto; }
.heatmap .hm { fill: var(--surface-2); stroke: var(--hair); stroke-width: .4; opacity: .75; }
.heatmap .hm-1 { fill: color-mix(in srgb, var(--green) 26%, var(--surface-2)); }
.heatmap .hm-2 { fill: color-mix(in srgb, var(--green) 50%, var(--surface-2)); }
.heatmap .hm-3 { fill: color-mix(in srgb, var(--green) 74%, var(--surface)); }
.heatmap .hm-4 { fill: var(--green); }
.heatmap .hm-lbl { fill: var(--ink-4); font-size: 9px; font-family: var(--sc); font-weight: 700; letter-spacing: .06em; }
.goal-ring { width: 78px; height: 78px; }
.goal-ring .gr-track { fill: none; stroke: var(--hair); stroke-width: 8; }
.goal-ring .gr-arc { fill: none; stroke: var(--green); stroke-width: 8; stroke-linecap: butt; transition: stroke-dasharray .55s ease; }
.goal-ring.hit .gr-arc { stroke: var(--good); }
.goal-ring .gr-num { fill: var(--ink); font-size: 20px; font-weight: 800; font-family: var(--display); }
.goal-ring .gr-den { fill: var(--ink-4); font-size: 9px; font-family: var(--mono); }

/* ============================== confiança e anotação ============================== */
.conf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--hair-2); }
.conf-lbl { font-family: var(--sc); font-size: 13.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); }
.conf-btn {
  border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 5px 14px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.conf-btn:hover { border-color: var(--green); }
.conf-btn.on { background: var(--green); border-color: var(--green); color: var(--surface); font-weight: 700; }
[data-theme="dark"] .conf-btn.on { color: #0d1614; }
.conf-btn.chute.on { background: var(--gold-ink); border-color: var(--gold-ink); color: #fff; }
[data-theme="dark"] .conf-btn.chute.on { color: #241c00; }
.fb-note { margin-top: 12px; }
.fb-note-ta { min-height: 56px; }

/* ============================== marcadas ============================== */
.mk-card { padding: 15px 19px; }
.mk-note {
  margin-top: 9px; padding: 9px 13px; background: var(--gold-soft);
  border-left: 3px solid var(--gold); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px; color: var(--ink-2);
}

/* ============================== encartes (espaços de publicação) ==============================
   Tratados como o encarte destacável de uma revista: borda picotada no topo,
   faixa da cor da ferramenta à esquerda e rótulo em versalete. Ficam claramente
   separados do conteúdo de estudo — informam sem se disfarçar de funcionalidade. */
.publi { background: var(--surface-2); }
.publi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); gap: 14px; }
.publi-card {
  --pub-base: var(--green);
  --pub: var(--pub-base);
  display: grid; grid-template-columns: 44px 1fr; gap: 15px; align-items: start;
  background: var(--surface); color: inherit; text-decoration: none;
  border: 1px solid var(--hair-2); border-left: 3px solid var(--pub);
  border-top: 1px dashed var(--hair-2);          /* picote do encarte */
  border-radius: var(--r-sm); padding: 16px 18px 15px;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
/* na lousa, o acento da marca é clareado para manter contraste de giz */
[data-theme="dark"] .publi-card { --pub: color-mix(in srgb, var(--pub-base) 52%, #eef0e6); }
.publi-card:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-lift); border-color: var(--pub); }
.publi-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.publi-mark { color: var(--pub); }
.publi-mark svg { width: 40px; height: 40px; display: block; }
.publi-body { display: flex; flex-direction: column; min-width: 0; }
.publi-kicker {
  font-family: var(--sc); font-size: 12.5px; font-weight: 700; letter-spacing: .1em;
  color: var(--pub);
}
.publi-name { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.15; margin: 1px 0 5px; letter-spacing: -.01em; }
.publi-pitch { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.publi-why {
  font-size: 12.5px; color: var(--ink-3); font-style: italic;
  margin-top: 7px; padding-left: 10px; border-left: 2px solid var(--hair-2);
}
.publi-cta {
  font-family: var(--sc); font-size: 14px; font-weight: 700; letter-spacing: .04em;
  color: var(--pub); margin-top: 11px;
}
.publi-card:hover .publi-cta { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 460px) {
  .publi-card { grid-template-columns: 1fr; gap: 9px; }
  .publi-mark svg { width: 32px; height: 32px; }
}

/* ============================== conteúdo (biblioteca) ============================== */
.ct-form { margin-top: 4px; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 10px; }
.ct-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 11px 13px; background: var(--surface); }
.ct-card:hover { border-color: var(--hair-2); box-shadow: var(--shadow); }
.ct-kind {
  flex: 0 0 40px; height: 40px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--hair);
}
.ct-kind.kind-video, .ct-kind.kind-youtube, .ct-kind.kind-vimeo { background: color-mix(in srgb, var(--c6) 15%, var(--surface)); color: var(--c6); border-color: color-mix(in srgb, var(--c6) 30%, transparent); }
.ct-kind.kind-audio { background: color-mix(in srgb, var(--c5) 15%, var(--surface)); color: var(--c5); border-color: color-mix(in srgb, var(--c5) 30%, transparent); }
.ct-kind.kind-image { background: color-mix(in srgb, var(--c2) 16%, var(--surface)); color: var(--c2); border-color: color-mix(in srgb, var(--c2) 30%, transparent); }
.ct-kind.kind-pdf, .ct-kind.kind-slides { background: color-mix(in srgb, var(--c1) 15%, var(--surface)); color: var(--c1); border-color: color-mix(in srgb, var(--c1) 30%, transparent); }
.ct-info { flex: 1; min-width: 0; }
.ct-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-sub { font-size: 12.5px; color: var(--ink-3); }
/* materiais por link dependem de rede — o resto do app é offline */
.ct-online { color: var(--gold-ink); font-weight: 600; }
.ct-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.ct-viewer video, .ct-viewer audio, .ct-viewer img { display: block; border-radius: var(--r-sm); }
.ct-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.ct-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--r-sm); }
.ct-pdf { width: 100%; height: 72vh; border: 1px solid var(--hair); border-radius: var(--r-sm); }
.overlay-wide .overlay-panel { width: min(920px, 95vw); }

.ct-done { color: var(--good-text); font-weight: 700; }
.ct-card.is-done { border-color: color-mix(in srgb, var(--good) 40%, var(--hair)); border-left: 3px solid var(--good); }
.ct-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ct-hist-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 14px; flex-wrap: wrap; }
.ct-hist-row:last-of-type { border-bottom: 0; }
.ct-hist-when { color: var(--ink-4); font-family: var(--mono); font-size: 11px; flex: 0 0 96px; }
.ct-hist-what { flex: 1; min-width: 200px; }

/* ============================== responsivo ============================== */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  /* No celular o cabeçalho ROLA junto: se ele ficasse fixo, cobriria a barra do
     simulado (cronômetro e "Entregar prova"), que precisa estar sempre acessível. */
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    padding: 10px 14px 6px; border-right: 0; border-bottom: 1px solid var(--hair-2);
    box-shadow: 0 3px 0 -2px var(--hair);
  }
  .brand { border-bottom: 0; padding-bottom: 8px; }
  .nav {
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 4px; gap: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-sep { display: none; }
  .nav-item {
    white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent;
    border-radius: 2px 2px 0 0; padding: 7px 11px; font-size: 14px;
  }
  .nav-item.active { border-left: 0; border-bottom-color: var(--green); background: transparent; }
  .main { padding: 20px 15px 64px; }
  .view::before { display: none; }
  .hero { padding: 22px 20px 26px; }
  .hero::after { font-size: 150px; right: 6px; top: -30px; }
  .hbar-row { grid-template-columns: 1fr 62px; }
  .hbar-row .bar-wrap { grid-column: 1 / -1; order: 3; }
  .dom-row { grid-template-columns: 1fr 118px; }
  .dom-row .track { grid-column: 1 / -1; order: 3; }
  .sidebar-foot { display: flex; flex-direction: row; align-items: center; gap: 8px; border-top: 1px solid var(--hair); padding-top: 8px; }
  .sidebar-foot .cmd-open { flex: 1; }
  .foot-note { display: none; }
  .sim-grid { grid-template-columns: 1fr !important; }
  .ess-grid { grid-template-columns: 1fr !important; }
  .card { padding: 15px 16px; }
  .q-card { padding: 18px 17px 20px; }
  .q-text { font-size: 16px; }
  .sim-topbar { padding: 9px 13px; gap: 10px; }
  .sim-topbar .sim-title { flex: 1 0 100%; }
  .timer { font-size: 19px; }
  .grid-tiles { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px 16px; }
  .tile-value { font-size: 28px; }
  .verdict-stamp { letter-spacing: .09em; padding: 10px 16px 8px; }
}
@media (max-width: 460px) {
  .sheet { grid-template-columns: repeat(auto-fill, minmax(33px, 1fr)); }
  .btn-lg { padding: 11px 20px; font-size: 16px; }
  .result-hero { padding: 24px 12px 20px; }
}

/* ============================== impressão (prova corrigida) ============================== */
@media print {
  .sidebar, .sim-topbar, .btn, .toast, .skip-link, .overlay, .save-badge, .view::before { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  body::after { display: none; }
  .card, .q-card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .card-title { border-bottom-color: #999; }
  details.acc .acc-body { display: block !important; }
  details.acc summary::before { display: none; }
  .verdict-stamp { -webkit-mask-image: none; mask-image: none; }
  a { text-decoration: none; color: #000; }
}

/* ============================================================================
   PORTÃO DE ACESSO — só na versão web (github.io)
   ----------------------------------------------------------------------------
   No aplicativo Android e no uso local por duplo clique isto nunca aparece: o
   banco já está no aparelho. Na web o banco vem cifrado, e esta é a folha em
   que a pessoa digita o código que decifra.
   ========================================================================== */
body.travado { overflow: hidden; }
body.travado .app { filter: blur(3px) saturate(.6); pointer-events: none; user-select: none; }

.portao {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px 64px;
  background: var(--page);
  background-image: var(--grain),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule-faint) 31px 32px);
}
.pt-folha {
  width: 100%; max-width: 470px; background: var(--surface);
  border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 34px 34px 26px;
  border-left: 3px solid var(--rule-red);
}
.pt-marca { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; text-decoration: none; color: inherit; }
.pt-marca img { border-radius: var(--r-sm); }
.pt-titulo { display: block; font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.pt-sub {
  display: block; font-family: var(--sc); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 2px;
}
.pt-h1 { font-size: 27px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.01em; }
.pt-h2 { font-size: 17px; margin: 0 0 6px; }
.pt-lede { color: var(--ink-2); margin: 0 0 20px; font-size: 15.5px; line-height: 1.55; }
.pt-form { display: flex; flex-direction: column; gap: 13px; }
.pt-campo { display: flex; flex-direction: column; gap: 5px; }
.pt-campo label {
  font-family: var(--sc); font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-2);
}
.pt-campo input {
  font: 16px/1.4 var(--sans); color: var(--ink);
  background: var(--page); border: 1px solid var(--hair-2);
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
}
.pt-campo input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
#ptCod { font-family: var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.pt-erro { color: var(--red); font-size: 14.5px; margin: 12px 0 0; min-height: 1.2em; }
.pt-ok {
  color: var(--good-text); font-size: 15px; line-height: 1.55; margin: 0;
  background: var(--green-soft); border-left: 3px solid var(--green);
  padding: 13px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.pt-fio { border: 0; border-top: 1px solid var(--hair); margin: 26px 0 20px; }
.pt-nota { font-size: 15px; color: var(--ink-2); margin: 0; line-height: 1.55; }
.pt-rodape { font-size: 12.5px; color: var(--ink-3); margin: 24px 0 0; }
.portao .btn { align-self: flex-start; }
@media (max-width: 520px) {
  .portao { padding: 20px 14px 44px; }
  .pt-folha { padding: 26px 22px 22px; }
  .pt-h1 { font-size: 24px; }
  .portao .btn { align-self: stretch; text-align: center; }
}
