/* ==========================================================================
   Drill Simulados 2.0 — Design system (dono: A4 SHELL)
   Cores da logo: azul royal #0C4CA3 + amarelo #FEF102. Tema claro padrão.
   Mobile-first (360 px), alvos de toque >= 48 px, zero fontes externas.
   Seções: 1 tokens · 2 base · 3 shell (app bar, nav, banners) · 4 layout
           5 botões · 6 formulários · 7 cartões/listas · 8 componentes de estudo
           9 progresso · 10 feedback (toast, diálogo, vazio, esqueleto)
           11 professor/tabelas · 12 utilitários · 13 movimento/acessibilidade
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --drill-azul: #0C4CA3;
  --drill-azul-700: #08397A;
  --drill-azul-900: #061F45;
  --drill-azul-50: #E8EFFA;
  --drill-amarelo: #FEF102;
  --drill-amarelo-600: #E5D800;
  --drill-amarelo-texto: #7A6F00;

  --bg: #F4F7FC;
  --surface: #FFFFFF;
  --surface-2: #EEF2F9;
  --text: #1B2333;
  --text-muted: #5B6B85;
  --border: #D9E1EE;
  --ok: #0A7A3D;
  --erro: #C81E1E;
  --aviso: #8A5A00;
  --ok-bg: #E6F5EC;
  --erro-bg: #FDECEC;
  --aviso-bg: #FFF6D6;
  --link: #0C4CA3;
  --on-azul: #FFFFFF;
  --on-amarelo: #061F45;
  --hero-bg: linear-gradient(135deg, #0C4CA3 0%, #08397A 60%, #061F45 100%);
  --skeleton: #E3E9F3;
  --overlay: rgba(6, 31, 69, .55);

  /* tipografia (sistema, zero download) */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Arial Black", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-scale: 1;
  --fs-xs: calc(.75rem * var(--fs-scale));
  --fs-sm: calc(.875rem * var(--fs-scale));
  --fs-md: calc(1rem * var(--fs-scale));
  --fs-q: calc(1.0625rem * var(--fs-scale));
  --fs-lg: calc(1.25rem * var(--fs-scale));
  --fs-xl: calc(1.5rem * var(--fs-scale));
  --fs-2xl: calc(2rem * var(--fs-scale));

  /* espaço, forma, movimento */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(6,31,69,.08), 0 2px 8px rgba(6,31,69,.06);
  --sh-2: 0 4px 12px rgba(6,31,69,.12), 0 12px 32px rgba(6,31,69,.10);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: 200ms;
  --tap: 48px;
  --appbar-h: 56px;
  --nav-h: 64px;
  --content-max: 720px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* cores de faixa (BeltBadge) */
  --belt-branca: #F5F5F5; --belt-branca-borda: #C9CED6;
  --belt-cinza: #8C939D; --belt-amarela: #F2C200; --belt-laranja: #F07C00;
  --belt-verde: #1E9E4A; --belt-azul: #1F5FD1; --belt-roxa: #6B2FA3;
  --belt-marrom: #6B3E1E; --belt-preta: #111111; --belt-ponta-vermelha: #D11F1F;
}

/* tema escuro: preferência explícita ou sistema (data-theme="auto") */
:root[data-theme="dark"] {
  color-scheme: dark;
  --drill-azul-50: #13284D;
  --drill-amarelo-texto: #FEF102;
  --bg: #0B1630; --surface: #122042; --surface-2: #182A52;
  --text: #E8EEF9; --text-muted: #8FA3C7; --border: #22345C;
  --ok: #34D07A; --erro: #FF6B6B; --aviso: #FFD34D;
  --ok-bg: #0F3322; --erro-bg: #3A1515; --aviso-bg: #3A3110;
  --link: #8DB6FF; --skeleton: #1B2D55; --overlay: rgba(0,0,0,.6);
  --hero-bg: linear-gradient(135deg, #0C4CA3 0%, #08397A 55%, #061F45 100%);
  --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
  --sh-2: 0 4px 12px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --drill-azul-50: #13284D;
    --drill-amarelo-texto: #FEF102;
    --bg: #0B1630; --surface: #122042; --surface-2: #182A52;
    --text: #E8EEF9; --text-muted: #8FA3C7; --border: #22345C;
    --ok: #34D07A; --erro: #FF6B6B; --aviso: #FFD34D;
    --ok-bg: #0F3322; --erro-bg: #3A1515; --aviso-bg: #3A3110;
    --link: #8DB6FF; --skeleton: #1B2D55; --overlay: rgba(0,0,0,.6);
    --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
    --sh-2: 0 4px 12px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  }
}
/* "Letra grande" (kids / preferência do perfil) */
:root[data-font="lg"] { --fs-scale: 1.15; }

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 var(--sp-3); line-height: 1.2; font-weight: 800; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 var(--sp-3); }
a { color: var(--link); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--drill-amarelo);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--drill-azul-900);
  border-radius: var(--r-sm);
}
::selection { background: var(--drill-amarelo); color: var(--drill-azul-900); }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.icon--fill { fill: currentColor; stroke: none; }
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 32px; height: 32px; }
.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; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--drill-amarelo); color: var(--drill-azul-900); padding: 12px 16px; border-radius: var(--r-sm); font-weight: 800; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }

/* 3. SHELL ----------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: calc(var(--appbar-h) + var(--safe-t));
  padding: var(--safe-t) var(--sp-2) 0 var(--sp-2);
  background: var(--drill-azul);
  color: var(--on-azul);
  box-shadow: 0 2px 0 var(--drill-amarelo);
}
.appbar__brand { display: flex; align-items: center; justify-content: center; min-width: var(--tap); height: var(--tap); border-radius: var(--r-md); flex: none; }
.appbar__brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.appbar__title {
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: var(--fs-lg); letter-spacing: .01em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar__title small { display: block; font-family: var(--font-ui); font-style: normal; font-weight: 600; font-size: var(--fs-xs); text-transform: none; opacity: .85; letter-spacing: 0; }
.appbar__actions { display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.appbar .icon-btn { color: var(--on-azul); }
.appbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.appbar .btn { min-height: 40px; padding: 0 14px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: var(--safe-b);
  background: var(--drill-azul-900);
  border-top: 3px solid var(--drill-amarelo);
}
.bottomnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--nav-h); min-width: var(--tap);
  color: rgba(255,255,255,.72); text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  position: relative;
}
.bottomnav__item .icon { width: 24px; height: 24px; }
.bottomnav__item[aria-current="page"] { color: var(--drill-amarelo); }
.bottomnav__item[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px;
  background: var(--drill-amarelo); border-radius: 0 0 3px 3px;
}
.bottomnav__item:active { background: rgba(255,255,255,.06); }

.banner {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4); min-height: 44px;
  font-size: var(--fs-sm); font-weight: 600;
}
.banner--offline { background: var(--drill-amarelo); color: var(--drill-azul-900); position: sticky; top: calc(var(--appbar-h) + var(--safe-t)); z-index: 29; }
.banner--update { background: var(--drill-azul-900); color: #fff; }
.banner--update .btn { min-height: 40px; }
.banner__text { flex: 1; min-width: 0; }
.banner .pill { background: var(--drill-azul-900); color: var(--drill-amarelo); }

/* 4. LAYOUT ---------------------------------------------------------------- */
.main { display: block; min-height: 60vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + var(--sp-6)); }
body.no-nav .main { padding-bottom: calc(var(--safe-b) + var(--sp-6)); }
body.no-chrome .main { padding-bottom: var(--safe-b); }
.screen { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-4); }
.screen--wide { max-width: 1120px; }
.screen--flush { padding: 0; }
.screen__head { margin-bottom: var(--sp-4); }
.screen__head h1 { margin-bottom: var(--sp-1); }
.section { margin-top: var(--sp-6); }
.section-title {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-6) 0 var(--sp-3);
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
}
.section-title::before { content: ""; width: 4px; height: 1.1em; background: var(--drill-amarelo); border-radius: 2px; box-shadow: 0 0 0 1px var(--drill-azul); }
.section-title .spacer { flex: 1; }
.stack > * + * { margin-top: var(--sp-3); }
.stack-lg > * + * { margin-top: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--sp-3); }
.grid-2 { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.boot { display: grid; place-items: center; min-height: 60vh; }

/* rodapé fixo na zona do polegar (Próxima, Entregar...) */
.thumb-bar {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--nav-h) + var(--safe-b));
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
body.no-nav .thumb-bar, body.no-chrome .thumb-bar { bottom: 0; padding-bottom: calc(var(--sp-3) + var(--safe-b)); }
.thumb-bar__inner { max-width: var(--content-max); margin: 0 auto; display: flex; gap: var(--sp-3); }
.thumb-bar__inner > .btn { flex: 1; }
.has-thumb-bar { padding-bottom: 96px; }

/* desktop: barra inferior vira barra lateral */
@media (min-width: 900px) {
  body.has-nav .bottomnav {
    top: calc(var(--appbar-h) + var(--safe-t)); right: auto; width: 96px;
    grid-auto-flow: row; grid-auto-rows: 76px; align-content: start;
    border-top: 0; border-right: 3px solid var(--drill-amarelo); padding-top: var(--sp-3);
  }
  body.has-nav .bottomnav__item[aria-current="page"]::before { top: 18%; bottom: 18%; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  body.has-nav .main, body.has-nav .banner--offline, body.has-nav #update-banner { margin-left: 96px; }
  body.has-nav .main { padding-bottom: var(--sp-7); }
  body.has-nav .thumb-bar { bottom: 0; left: 96px; padding-bottom: calc(var(--sp-3) + var(--safe-b)); }
  .screen { padding: var(--sp-6); }
  .appbar { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}

/* 5. BOTÕES ---------------------------------------------------------------- */
.btn, .btn-primary {
  --btn-bg: var(--drill-amarelo); --btn-fg: var(--on-amarelo); --btn-bd: var(--drill-amarelo);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-5);
  border: 2px solid var(--btn-bd); border-radius: var(--r-md);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 800; font-size: var(--fs-md); letter-spacing: .01em; line-height: 1.15;
  text-decoration: none; text-align: center;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  user-select: none; -webkit-user-select: none; position: relative;
}
.btn:hover, .btn-primary:hover { box-shadow: var(--sh-1); }
.btn:active, .btn-primary:active { transform: translateY(1px) scale(.99); }
.btn:active:not(.btn-sec):not(.btn-ghost):not(.btn-outline):not(.btn-danger) { --btn-bg: var(--drill-amarelo-600); }
.btn-sec, .btn-blue { --btn-bg: var(--drill-azul); --btn-fg: var(--on-azul); --btn-bd: var(--drill-azul); }
.btn-sec:active, .btn-blue:active { --btn-bg: var(--drill-azul-700); --btn-bd: var(--drill-azul-700); }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--link); --btn-bd: currentColor; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--link); --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--drill-azul-50); box-shadow: none; }
.btn-danger { --btn-bg: var(--erro); --btn-fg: #fff; --btn-bd: var(--erro); }
.btn-ok { --btn-bg: var(--ok); --btn-fg: #fff; --btn-bd: var(--ok); }
:root[data-theme="dark"] .btn-danger, :root[data-theme="dark"] .btn-ok { --btn-fg: #0B1630; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 56px; font-size: var(--fs-lg); padding: 0 var(--sp-6); }
.btn-sm { padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn[disabled], .btn[aria-disabled="true"], .btn-primary[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--btn-fg); border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.btn .icon { width: 20px; height: 20px; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: var(--r-pill); background: transparent; color: inherit; padding: 0;
}
.icon-btn:hover { background: var(--drill-azul-50); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.btn-row > .btn { flex: 1 1 140px; }

/* 6. FORMULÁRIOS ----------------------------------------------------------- */
.field { display: block; margin-bottom: var(--sp-4); }
.field > label, .label { display: block; margin-bottom: 6px; font-weight: 700; font-size: var(--fs-sm); }
.field .req { color: var(--erro); }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, select.input, textarea.input {
  display: block; width: 100%; min-height: var(--tap);
  padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-size: 16px; /* 16px evita zoom no iOS */
  transition: border-color var(--dur) var(--ease);
}
.field textarea, textarea.input { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--drill-azul); outline: none; box-shadow: 0 0 0 3px var(--drill-azul-50); }
.field.has-error input, .field.has-error select, .input.has-error { border-color: var(--erro); }
.field-hint { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.field-error { margin-top: 6px; font-size: var(--fs-sm); color: var(--erro); font-weight: 600; }
.form-error { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--erro-bg); color: var(--erro); font-weight: 600; margin-bottom: var(--sp-4); }
.check {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  min-height: var(--tap); padding: var(--sp-2) 0; cursor: pointer; font-size: var(--fs-md);
}
.check input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--drill-azul); }
.input-group { position: relative; }
.input-group .icon-btn { position: absolute; right: 0; top: 0; color: var(--text-muted); }
.input-group .input, .input-group input { padding-right: 52px; }

/* SearchField */
.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-pill);
  min-height: 52px; padding-left: 14px;
}
.search:focus-within { border-color: var(--drill-azul); box-shadow: 0 0 0 3px var(--drill-azul-50); }
.search > .icon { color: var(--text-muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 8px; font-size: 16px; outline: none; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-btn { color: var(--text-muted); }

/* Chip / ChipGroup / Segmented */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--sp-4)); padding: 2px var(--sp-4); }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 44px; padding: 0 var(--sp-4);
  border: 2px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  font-weight: 700; font-size: var(--fs-sm); white-space: nowrap;
  position: relative;
}
.chip::after { content: ""; position: absolute; inset: -2px 0; } /* amplia a área de toque para 48 px */
.chip[aria-pressed="true"], .chip.is-active, .chip[aria-checked="true"] { background: var(--drill-azul); border-color: var(--drill-azul); color: #fff; }
.chip[aria-pressed="true"]::before, .chip[aria-checked="true"]::before { content: "✓"; font-weight: 900; }
.chip--lg { min-height: var(--tap); font-size: var(--fs-md); padding: 0 var(--sp-5); }
.chip .count { font-weight: 600; opacity: .75; }
.segmented { display: flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: var(--r-pill); border: 1px solid var(--border); }
.segmented > button, .segmented > a {
  flex: 1; min-height: 44px; border: 0; border-radius: var(--r-pill); background: transparent;
  font-weight: 800; color: var(--text-muted); text-decoration: none; display: grid; place-items: center;
}
.segmented > [aria-pressed="true"], .segmented > [aria-selected="true"], .segmented > .is-active { background: var(--drill-azul); color: #fff; box-shadow: var(--sh-1); }

/* Stepper (cadastro em 3 passos) */
.stepper { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); counter-reset: step; list-style: none; padding: 0; }
.stepper li { flex: 1; counter-increment: step; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-align: center; }
.stepper li::before {
  content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto 4px;
  border-radius: 50%; border: 2px solid var(--border); background: var(--surface); font-weight: 900; font-size: var(--fs-sm);
}
.stepper li.is-done::before { content: "✓"; background: var(--drill-azul); border-color: var(--drill-azul); color: #fff; }
.stepper li.is-current { color: var(--text); }
.stepper li.is-current::before { background: var(--drill-amarelo); border-color: var(--drill-azul); color: var(--drill-azul-900); }

/* 7. CARTÕES E LISTAS ------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4); box-shadow: var(--sh-1);
}
.card + .card { margin-top: var(--sp-3); }
.card--flat { box-shadow: none; }
.card--selected, .card.is-selected { background: var(--drill-azul-50); border-color: var(--drill-azul); }
.card__title { font-weight: 800; font-size: var(--fs-md); margin: 0 0 var(--sp-1); }
.card__sub { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
a.card, button.card { display: block; width: 100%; text-align: left; color: inherit; text-decoration: none; font: inherit; }
a.card:active, button.card:active { transform: scale(.99); }

/* Hero esportivo (faixa-alvo, Início) */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: #fff;
  border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4);
  box-shadow: var(--sh-2);
}
.hero::after { /* listras diagonais amarelas */
  content: ""; position: absolute; right: -40px; top: -20px; width: 160px; height: 200%;
  background: repeating-linear-gradient(115deg, rgba(254,241,2,.9) 0 10px, transparent 10px 26px);
  transform: rotate(0deg); opacity: .22; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero__kicker { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--drill-amarelo); margin-bottom: var(--sp-1); }
.hero__title { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: var(--fs-xl); line-height: 1.05; margin: 0 0 var(--sp-3); }
.hero__text { opacity: .9; font-size: var(--fs-sm); }
.hero .btn-outline { --btn-fg: #fff; }
.hero .btn-ghost { --btn-fg: #fff; }

/* ListItem clicável (linha >= 56 px) */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--border); }
.list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 60px; padding: var(--sp-3) var(--sp-4); width: 100%;
  background: transparent; border: 0; text-align: left; color: inherit; text-decoration: none; font: inherit;
}
a.list-item:active, button.list-item:active { background: var(--drill-azul-50); }
.list-item__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--drill-azul-50); color: var(--drill-azul); flex: none; }
:root[data-theme="dark"] .list-item__icon { color: var(--drill-amarelo); }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 700; display: block; }
.list-item__sub { color: var(--text-muted); font-size: var(--fs-sm); display: block; }
.list-item__end { flex: none; color: var(--text-muted); display: flex; align-items: center; gap: var(--sp-2); }

/* Atalho grande (Início / Estudar) */
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-3);
  min-height: 116px; padding: var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1);
  color: inherit; text-decoration: none; text-align: left; font: inherit; width: 100%;
  position: relative; overflow: hidden;
}
.tile:active { transform: scale(.98); }
.tile__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--drill-azul); color: var(--drill-amarelo); }
.tile__title { font-weight: 800; font-size: var(--fs-md); line-height: 1.2; }
.tile__sub { font-size: var(--fs-sm); color: var(--text-muted); }
.tile--primary { background: var(--drill-amarelo); border-color: var(--drill-amarelo); color: var(--drill-azul-900); }
.tile--primary .tile__icon { background: var(--drill-azul-900); }
.tile--primary .tile__sub { color: var(--drill-azul-900); opacity: .8; }
.tile--blue { background: var(--drill-azul); border-color: var(--drill-azul); color: #fff; }
.tile--blue .tile__icon { background: var(--drill-amarelo); color: var(--drill-azul-900); }
.tile--blue .tile__sub { color: #fff; opacity: .85; }
.tile .badge-count { position: absolute; top: var(--sp-3); right: var(--sp-3); }

/* Pill / tag / contador */
.pill, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .02em; line-height: 1.4;
  background: var(--drill-azul-50); color: var(--drill-azul); white-space: nowrap;
}
:root[data-theme="dark"] .pill, :root[data-theme="dark"] .tag { color: #CFE0FF; }
.pill--amarelo { background: var(--drill-amarelo); color: var(--drill-azul-900) !important; }
.pill--ok { background: var(--ok-bg); color: var(--ok) !important; }
.pill--erro { background: var(--erro-bg); color: var(--erro) !important; }
.pill--aviso { background: var(--aviso-bg); color: var(--aviso) !important; }
.pill--muted { background: var(--surface-2); color: var(--text-muted) !important; }
.badge-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--r-pill); background: var(--erro); color: #fff; font-size: 12px; font-weight: 900; display: inline-grid; place-items: center; }

/* Alertas inline */
.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--drill-azul-50); font-size: var(--fs-sm); }
.alert .icon { margin-top: 1px; }
.alert--ok { background: var(--ok-bg); color: var(--ok); }
.alert--erro { background: var(--erro-bg); color: var(--erro); }
.alert--aviso { background: var(--aviso-bg); color: var(--aviso); }
.alert--info { color: var(--text); }

/* 8. COMPONENTES DE ESTUDO ------------------------------------------------- */
/* BeltBadge: faixa desenhada em CSS */
.belt {
  --belt-main: var(--belt-branca); --belt-stripe: var(--belt-main); --belt-tip: var(--belt-preta);
  --belt-w: 120px; --belt-h: 20px;
  display: inline-flex; width: var(--belt-w); height: var(--belt-h); flex: none;
  border-radius: 4px; overflow: hidden; vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.15);
}
.belt--sm { --belt-w: 64px; --belt-h: 12px; border-radius: 3px; }
.belt--md { --belt-w: 120px; --belt-h: 20px; }
.belt--lg { --belt-w: 220px; --belt-h: 32px; border-radius: 6px; }
.belt--block { --belt-w: 100%; --belt-h: 28px; display: flex; }
.belt__body {
  flex: 1;
  background:
    linear-gradient(to bottom, transparent 0 34%, var(--belt-stripe) 34% 66%, transparent 66% 100%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 6px),
    var(--belt-main);
}
.belt--branca { box-shadow: inset 0 0 0 1px var(--belt-branca-borda), 0 1px 2px rgba(0,0,0,.12); }
.belt__tip {
  width: 30%; max-width: 64px; min-width: 20px; flex: none;
  background: var(--belt-tip);
  display: flex; align-items: stretch; justify-content: flex-start; gap: 12%;
  padding: 0 10%;
  margin-right: 8%; /* ponta não encosta na extremidade, como na faixa real */
}
.belt__tip i { display: block; width: 12%; min-width: 2px; background: #fff; }
.belt--sm .belt__tip i { min-width: 2px; }
.belt-row { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* ReadinessGauge */
.gauge {
  --p: 0; --g-color: var(--drill-azul); --g-size: 132px;
  width: var(--g-size); height: var(--g-size); border-radius: 50%; flex: none;
  background: conic-gradient(var(--g-color) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center; position: relative;
}
.gauge[data-level="3"] { --g-color: var(--ok); }
.gauge[data-level="2"] { --g-color: var(--drill-azul); }
.gauge[data-level="1"] { --g-color: #E89B00; }
.gauge[data-level="0"] { --g-color: var(--text-muted); }
.gauge__inner {
  width: calc(100% - 22px); height: calc(100% - 22px); border-radius: 50%;
  background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6px;
}
.gauge__num { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-2xl); line-height: 1; }
.gauge__label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); line-height: 1.15; margin-top: 4px; }
.gauge--sm { --g-size: 88px; }
.gauge--sm .gauge__num { font-size: var(--fs-xl); }
.gauge--sm .gauge__inner { width: calc(100% - 16px); height: calc(100% - 16px); }
.hero .gauge__inner { background: var(--drill-azul-900); color: #fff; }
.hero .gauge { --g-color: var(--drill-amarelo); background: conic-gradient(var(--g-color) calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.hero .gauge__label { color: rgba(255,255,255,.85); }

/* StreakFlame */
.flame { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-size: var(--fs-lg); }
.flame .icon { width: 28px; height: 28px; color: #F07C00; fill: currentColor; stroke: none; }
.flame.is-off .icon { color: var(--text-muted); opacity: .5; }
.flame small { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }

/* QuestionCard + OptionButton */
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--sh-1); }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); font-weight: 700; }
.q-meta .q-num { font-family: var(--font-display); font-style: italic; font-weight: 900; color: var(--text); font-size: var(--fs-sm); margin-right: 4px; }
.q-diff { display: inline-flex; gap: 2px; }
.q-diff i { width: 6px; height: 12px; border-radius: 2px; background: var(--border); }
.q-diff i.on { background: var(--drill-azul); }
:root[data-theme="dark"] .q-diff i.on { background: var(--drill-amarelo); }
.q-text { font-size: var(--fs-q); line-height: 1.5; font-weight: 600; margin: 0 0 var(--sp-4); }
.q-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: var(--sp-3); }
.q-progress > span { display: block; height: 100%; background: var(--drill-azul); border-radius: 3px; transition: width var(--dur) var(--ease); }
.options { display: grid; gap: var(--sp-2); list-style: none; padding: 0; margin: 0; }
.option {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  width: 100%; min-height: 56px; padding: var(--sp-3);
  border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); text-align: left; font-size: var(--fs-md); line-height: 1.4;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.option__letter {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: var(--fs-sm);
  background: var(--surface-2); color: var(--text); border: 2px solid var(--border);
}
.option__text { flex: 1; min-width: 0; padding-top: 4px; }
.option__mark { flex: none; padding-top: 4px; }
.option:hover:not([disabled]) { border-color: var(--drill-azul); }
.option.is-selected, .option[aria-pressed="true"] { border-color: var(--drill-azul); background: var(--drill-azul-50); }
.option.is-selected .option__letter, .option[aria-pressed="true"] .option__letter { background: var(--drill-azul); border-color: var(--drill-azul); color: #fff; }
.option.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.option.is-correct .option__letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.is-wrong { border-color: var(--erro); background: var(--erro-bg); }
.option.is-wrong .option__letter { background: var(--erro); border-color: var(--erro); color: #fff; }
.option.is-correct .option__mark { color: var(--ok); }
.option.is-wrong .option__mark { color: var(--erro); }
.option[disabled] { cursor: default; }
.option[disabled]:not(.is-correct):not(.is-wrong):not(.is-selected) { opacity: .62; }

/* FeedbackPanel */
.feedback { margin-top: var(--sp-4); border-radius: var(--r-lg); padding: var(--sp-4); border: 2px solid; animation: rise var(--dur) var(--ease); }
.feedback--ok { background: var(--ok-bg); border-color: var(--ok); }
.feedback--erro { background: var(--erro-bg); border-color: var(--erro); }
.feedback__title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 900; font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.feedback--ok .feedback__title { color: var(--ok); }
.feedback--erro .feedback__title { color: var(--erro); }
.feedback__text { color: var(--text); font-size: var(--fs-md); line-height: 1.5; margin: 0; }

/* Flashcard com virada 3D */
.flashcard { perspective: 1200px; width: 100%; min-height: 300px; display: block; border: 0; padding: 0; background: none; text-align: center; color: inherit; }
.flashcard__inner { position: relative; width: 100%; min-height: 300px; transition: transform 420ms var(--ease); transform-style: preserve-3d; }
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-5); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: auto;
}
.flashcard__front { background: var(--hero-bg); color: #fff; border-bottom: 6px solid var(--drill-amarelo); }
.flashcard__back { background: var(--surface); border: 2px solid var(--drill-azul); transform: rotateY(180deg); }
.flashcard__kicker { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.flashcard__front .flashcard__kicker { color: var(--drill-amarelo); }
.flashcard__term { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-xl); line-height: 1.15; }
.flashcard__sub { font-size: var(--fs-md); opacity: .9; }
.flashcard__hint { font-size: var(--fs-xs); opacity: .75; margin-top: var(--sp-2); }
.flashcard__def { font-size: var(--fs-q); line-height: 1.5; }
.fc-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.fc-actions .btn { padding: 0 6px; flex-direction: column; gap: 0; min-height: 56px; font-size: var(--fs-sm); }
.fc-actions .btn small { font-weight: 600; font-size: 11px; opacity: .85; }
.btn-errei { --btn-bg: var(--erro); --btn-bd: var(--erro); --btn-fg: #fff; }
.btn-dificil { --btn-bg: var(--surface); --btn-bd: var(--drill-azul); --btn-fg: var(--link); }
.btn-acertei { --btn-bg: var(--ok); --btn-bd: var(--ok); --btn-fg: #fff; }
:root[data-theme="dark"] .btn-errei, :root[data-theme="dark"] .btn-acertei { --btn-fg: #0B1630; }

/* GlossaryItem */
.gloss-item {
  display: block; padding: var(--sp-3) var(--sp-4); min-height: 64px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  color: inherit; text-decoration: none;
}
.gloss-item + .gloss-item { margin-top: var(--sp-2); }
.gloss-item__name { font-weight: 800; font-size: var(--fs-lg); line-height: 1.2; }
.gloss-item__ja { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-lg); line-height: 1.2; letter-spacing: .01em; }
.gloss-item__pt { font-weight: 700; color: var(--text-muted); }
.gloss-item__aka { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.gloss-item__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-2); align-items: center; }
.gloss-item__def { font-size: var(--fs-sm); color: var(--text); margin-top: var(--sp-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: var(--drill-amarelo); color: var(--drill-azul-900); border-radius: 2px; padding: 0 1px; }

/* 9. PROGRESSO ------------------------------------------------------------- */
.catbar { margin-bottom: var(--sp-3); }
.catbar__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 700; margin-bottom: 6px; }
.catbar__pct { font-family: var(--font-display); font-weight: 900; }
.catbar__track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.catbar__fill { height: 100%; border-radius: 6px; background: var(--drill-azul); transition: width 400ms var(--ease); }
.catbar__fill[data-level="low"] { background: var(--erro); }
.catbar__fill[data-level="mid"] { background: #E89B00; }
.catbar__fill[data-level="high"] { background: var(--ok); }
.catbar__sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }
.progress { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--drill-amarelo); box-shadow: inset 0 0 0 1px rgba(6,31,69,.15); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3); }
.stat__value { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-xl); line-height: 1.1; }
.stat__label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.heatmap { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.heatmap > span { aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); }
.heatmap > span[data-l="1"] { background: #BFD3F2; }
.heatmap > span[data-l="2"] { background: #6F9BE0; }
.heatmap > span[data-l="3"] { background: var(--drill-azul); }
.heatmap > span[data-l="4"] { background: var(--drill-amarelo); box-shadow: inset 0 0 0 2px var(--drill-azul); }
:root[data-theme="dark"] .heatmap > span[data-l="1"] { background: #1E3C78; }
:root[data-theme="dark"] .heatmap > span[data-l="2"] { background: #2E5CB8; }

.timer { font-family: var(--font-mono); font-weight: 800; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.timer.is-low { color: var(--erro); }
.score-big { font-family: var(--font-display); font-weight: 900; font-size: 3.5rem; line-height: 1; }

/* Cadeado de plano */
.lock { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-lg); border: 2px dashed var(--border); background: var(--surface); }
.lock .icon { color: var(--drill-amarelo-texto); }
.lock__title { font-weight: 800; }
.lock__sub { font-size: var(--fs-sm); color: var(--text-muted); }

/* InstallCard */
.install-card { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--drill-azul-900); color: #fff; }
.install-card img { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.install-card__title { font-weight: 800; }
.install-card__sub { font-size: var(--fs-sm); opacity: .85; }

/* 10. FEEDBACK ------------------------------------------------------------- */
#toast-root { position: fixed; left: 0; right: 0; z-index: 60; bottom: calc(var(--nav-h) + var(--safe-b) + var(--sp-3)); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); pointer-events: none; padding: 0 var(--sp-4); }
body.no-nav #toast-root, body.no-chrome #toast-root { bottom: calc(var(--safe-b) + var(--sp-4)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--sp-3);
  max-width: 520px; width: 100%; min-height: 48px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-radius: var(--r-md); background: var(--drill-azul-900); color: #fff; box-shadow: var(--sh-2);
  font-weight: 600; font-size: var(--fs-sm); animation: rise var(--dur) var(--ease);
  border-left: 5px solid var(--drill-amarelo);
}
.toast--ok { border-left-color: #34D07A; }
.toast--erro { border-left-color: #FF6B6B; }
.toast__msg { flex: 1; padding: 6px 0; }
.toast .btn { min-height: 40px; padding: 0 12px; font-size: var(--fs-sm); }
.toast .icon-btn { color: #fff; width: 40px; height: 40px; }

.dialog {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  width: min(440px, calc(100vw - 32px)); box-shadow: var(--sh-2);
}
.dialog::backdrop { background: var(--overlay); }
.dialog__body { padding: var(--sp-5) var(--sp-5) var(--sp-3); font-size: var(--fs-md); }
.dialog__title { font-weight: 900; font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.dialog__actions { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5) var(--sp-5); flex-wrap: wrap-reverse; }
.dialog__actions .btn { flex: 1 1 120px; }

.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--text-muted); }
.empty__icon { width: 64px; height: 64px; margin: 0 auto var(--sp-3); border-radius: 50%; display: grid; place-items: center; background: var(--drill-azul-50); color: var(--drill-azul); }
.empty__msg { font-size: var(--fs-md); font-weight: 600; color: var(--text); margin-bottom: var(--sp-4); }

.skeleton { border-radius: var(--r-md); background: var(--skeleton); position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.3s infinite; }
.skeleton--line { height: 14px; margin-bottom: 10px; }
.skeleton--card { height: 84px; margin-bottom: var(--sp-3); }
.skeleton--hero { height: 160px; margin-bottom: var(--sp-4); border-radius: var(--r-lg); }

.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--drill-azul-50); border-top-color: var(--drill-azul); animation: spin .8s linear infinite; }

.error-screen { text-align: center; padding: var(--sp-8) var(--sp-4); }

/* Tela de login/cadastro sem chrome */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--hero-bg); }
.auth-top { padding: calc(var(--sp-6) + var(--safe-t)) var(--sp-4) var(--sp-5); text-align: center; color: #fff; }
.auth-top img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto var(--sp-3); box-shadow: 0 0 0 3px var(--drill-amarelo); }
.auth-top h1 { font-family: var(--font-display); font-style: italic; text-transform: uppercase; font-size: var(--fs-xl); margin: 0; }
.auth-top p { margin: 4px 0 0; opacity: .85; font-size: var(--fs-sm); }
.auth-card { flex: 1; background: var(--bg); border-radius: 24px 24px 0 0; padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + var(--safe-b)); }
.auth-card > * { max-width: 440px; margin-left: auto; margin-right: auto; }

/* 11. PROFESSOR / TABELAS -------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: var(--sp-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--drill-azul-50); }
/* < 600 px: linhas viram cartões (td precisa de data-label) */
@media (max-width: 599px) {
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards thead { display: none; }
  .table-wrap:has(.table--cards) { border: 0; background: transparent; overflow: visible; }
  .table--cards tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); box-shadow: var(--sh-1); }
  .table--cards td { display: flex; justify-content: space-between; gap: var(--sp-3); border: 0; padding: 6px 0; text-align: right; }
  .table--cards td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); text-align: left; flex: none; }
  .table--cards td[data-label=""]::before { content: none; }
}

/* 12. UTILITÁRIOS ---------------------------------------------------------- */
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.center { text-align: center; }
.bold { font-weight: 800; }
.display { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; }
.text-ok { color: var(--ok); } .text-erro { color: var(--erro); } .text-amarelo { color: var(--drill-amarelo-texto); }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); }
.w-100 { width: 100%; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--border); margin: var(--sp-4) 0; }
.kbd { font-family: var(--font-mono); font-size: var(--fs-xs); padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.prose { line-height: 1.6; }
.prose h2 { margin-top: var(--sp-6); }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 6px; }

/* 13. MOVIMENTO / ACESSIBILIDADE ------------------------------------------ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.anim-pop { animation: pop 300ms var(--ease); }
.screen { animation: rise 180ms var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .flashcard__inner { transition: none; }
}
/* sem suporte a 3D: verso aparece sem animação */
@supports not (backface-visibility: hidden) {
  .flashcard__back { display: none; transform: none; }
  .flashcard.is-flipped .flashcard__front { display: none; }
  .flashcard.is-flipped .flashcard__back { display: flex; }
  .flashcard.is-flipped .flashcard__inner { transform: none; }
}
@media (forced-colors: active) {
  .option.is-correct, .option.is-wrong, .chip[aria-pressed="true"] { border-width: 4px; }
}
@media print {
  .appbar, .bottomnav, .banner, #toast-root, .thumb-bar { display: none !important; }
  .main { padding: 0; }
}
