/* CEFS Simulados — folha de estilo única
   Identidade: azul-marinho institucional + dourado das divisas de sargento.
   Elemento-assinatura: as divisas (chevrons) marcam o domínio de cada disciplina. */

:root {
  --paper: #EEF1EC;
  --surface: #FFFFFF;
  --surface-2: #F6F8F4;
  --ink: #14213D;
  --ink-2: #33415C;
  --muted: #5D6878;
  --line: #D6DCD2;
  --blue: #1F4E8C;
  --blue-ink: #FFFFFF;
  --blue-soft: #E3ECF7;
  --gold: #C9A227;
  --gold-soft: #F6EDCB;
  --ok: #2E7D4F;
  --ok-soft: #E2F1E7;
  --err: #B3261E;
  --err-soft: #F8E3E1;
  --warn: #9A5B00;
  --warn-soft: #FBEFD9;
  --shadow: 0 1px 2px rgba(20, 33, 61, .08), 0 4px 14px rgba(20, 33, 61, .06);
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1424; --surface: #152038; --surface-2: #1A2742; --ink: #E7ECF4; --ink-2: #C3CCDB; --muted: #95A2B8;
    --line: #2A3858; --blue: #6E9DE2; --blue-ink: #0D1424; --blue-soft: #1E2E4F; --gold: #D9B44A; --gold-soft: #3A3218;
    --ok: #5DBB84; --ok-soft: #173426; --err: #F07A70; --err-soft: #3D1C1B; --warn: #E6A64A; --warn-soft: #3A2B12;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1424; --surface: #152038; --surface-2: #1A2742; --ink: #E7ECF4; --ink-2: #C3CCDB; --muted: #95A2B8;
  --line: #2A3858; --blue: #6E9DE2; --blue-ink: #0D1424; --blue-soft: #1E2E4F; --gold: #D9B44A; --gold-soft: #3A3218;
  --ok: #5DBB84; --ok-soft: #173426; --err: #F07A70; --err-soft: #3D1C1B; --warn: #E6A64A; --warn-soft: #3A2B12;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
}
a { color: var(--blue); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--blue); color: var(--blue-ink);
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-gold { background: var(--gold); color: #1C1606; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-danger { background: var(--err); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--blue); padding: 0; min-height: 0; font-weight: 600; cursor: pointer; text-decoration: underline; font-size: inherit; }

/* ---------- Formulários ---------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=url],
input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--blue); vertical-align: -3px; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.inline-form { display: inline; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }

/* ---------- Mensagens ---------- */
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border-left: 4px solid; background: var(--surface); }
.flash-success { border-color: var(--ok); background: var(--ok-soft); }
.flash-error { border-color: var(--err); background: var(--err-soft); }
.flash-info { border-color: var(--blue); background: var(--blue-soft); }
.flash-warn { border-color: var(--warn); background: var(--warn-soft); }

.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge-gold { background: var(--gold-soft); color: #7A5F00; border-color: transparent; }
:root[data-theme="dark"] .badge-gold { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-gold { color: var(--gold); } }

/* ---------- Painéis ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-flush { padding: 0; overflow: hidden; }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: .75rem; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1.25rem; overflow: hidden; }
.kpi { padding: 1rem 1.1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.kpi b { display: block; font: 600 2rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .85rem; }

/* tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .82rem; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
.table-empty { padding: 2rem; text-align: center; color: var(--muted); }

/* barras de progresso */
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .4s ease; }
.bar.gold > i { background: var(--gold); }
.bar.ok > i { background: var(--ok); }

/* paginação e abas */
.pager { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.pager a, .pager span { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; background: var(--surface); }
.pager .current { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--gold); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.filters .field.grow { flex: 3 1 240px; }

/* ---------- Divisas (assinatura visual) ---------- */
.chev { display: inline-flex; flex-direction: column; gap: 2px; vertical-align: middle; }
.chev i { display: block; width: 22px; height: 7px; background: var(--line);
  clip-path: polygon(0 100%, 50% 15%, 100% 100%, 100% 55%, 50% -30%, 0 55%); }
.chev i.on { background: var(--gold); }
.chev-lg i { width: 34px; height: 10px; }
.logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.logo .chev i { background: var(--gold); }
.logo strong { font: 700 1.35rem/1 var(--font-display); letter-spacing: .02em; }
.logo small { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }

/* ---------- Layout público ---------- */
.pub-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem); }
.pub-header nav { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.pub-header nav a.navlink { color: var(--ink); text-decoration: none; padding: .4rem .6rem; font-weight: 600; }
.pub-main { padding: 0 clamp(1rem, 4vw, 3rem) 4rem; max-width: 1180px; margin: 0 auto; }
.pub-footer { border-top: 1px solid var(--line); padding: 1.5rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: clamp(1.5rem, 5vw, 4rem) 0; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); font-weight: 700; line-height: 1.02; letter-spacing: -.01em; margin-bottom: .35em; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-card { background: var(--ink); color: #E7ECF4; border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; background: var(--gold); opacity: .12;
  clip-path: polygon(0 100%, 50% 15%, 100% 100%, 100% 70%, 50% -15%, 0 70%); }
.hero-card .q-meta { color: #AFC0DC; font-size: .82rem; }
.hero-card .q-stem { font-size: 1.02rem; margin: .7rem 0 1rem; }
.hero-card .h-opt { display: flex; gap: .6rem; padding: .55rem .7rem; border: 1px solid #2E4068; border-radius: 8px; margin-bottom: .4rem; font-size: .92rem; }
.hero-card .h-opt b { font-family: var(--font-display); color: var(--gold); }
.hero-card .h-opt.is-ok { border-color: #5DBB84; background: rgba(93, 187, 132, .12); }
.hero-card .why { font-size: .86rem; color: #C9D4E6; border-top: 1px dashed #2E4068; padding-top: .7rem; margin-top: .8rem; }

.matrix { margin: 2rem 0 3rem; }
.matrix h2 { font-size: 1.9rem; }
.matrix-list { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--line); }
.matrix-list li { display: grid; grid-template-columns: 10px 1fr auto; gap: 1rem; align-items: baseline; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.matrix-list .sw { width: 10px; height: 10px; border-radius: 2px; align-self: center; }
.matrix-list strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.matrix-list p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.method { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem 2.5rem; margin: 2rem 0 3rem; }
.method h3 { font-size: 1.35rem; margin-bottom: .3rem; }
.method p { color: var(--ink-2); margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.plan.featured { border: 2px solid var(--gold); }
.plan .price { font: 700 2.3rem/1 var(--font-display); }
.plan .price small { font: 400 .9rem var(--font-body); color: var(--muted); }
.plan .per-day { color: var(--muted); font-size: .85rem; }
.plan form, .plan .btn { margin-top: auto; }

.auth-wrap { max-width: 460px; margin: 2rem auto; }
.auth-wrap .panel { padding: 1.75rem; }
.auth-alt { text-align: center; margin-top: 1rem; font-size: .93rem; }

/* ---------- Layout do app (assinante e admin) ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #D8E0EE; padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
:root[data-theme="dark"] .side { background: #0A101D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side { background: #0A101D; } }
.side .logo { color: #fff; padding: .2rem .5rem 1.2rem; }
.side .logo small { color: #9FB0CC; }
.side nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .7rem; border-radius: 8px; color: #D8E0EE; text-decoration: none; font-weight: 500; font-size: .96rem; }
.side nav a:hover { background: rgba(255, 255, 255, .06); }
.side nav a.active { background: rgba(201, 162, 39, .16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.side .nav-group { font-size: .74rem; color: #8494B0; padding: 1rem .7rem .3rem; font-weight: 600; }
.side .side-foot { margin-top: auto; padding: .8rem .7rem 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; color: #9FB0CC; }
.side .side-foot a { color: #D8E0EE; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 1.5rem; margin: 0; }
.topbar .who { display: flex; align-items: center; gap: .7rem; font-size: .9rem; }
.content { padding: clamp(1rem, 3vw, 2rem); max-width: 1200px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 42px; height: 42px; color: var(--ink); cursor: pointer; }
.status-strip { padding: .6rem clamp(1rem, 3vw, 2rem); background: var(--gold-soft); border-bottom: 1px solid var(--line); font-size: .92rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* barra inferior no celular */
.tabbar { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .hero { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; font-size: .7rem; color: var(--muted); text-decoration: none; }
  .tabbar a.active { color: var(--blue); }
  .tabbar svg { width: 21px; height: 21px; }
  .has-tabbar .content { padding-bottom: 5.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Painel do aluno ---------- */
.next-step { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; background: var(--ink); color: #E7ECF4; border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.25rem; }
.next-step h2 { margin: 0 0 .25rem; font-size: 1.55rem; color: #fff; }
.next-step p { margin: 0; color: #B9C6DC; }
@media (max-width: 600px) { .next-step { grid-template-columns: 1fr; } }
.disc-rows { list-style: none; margin: 0; padding: 0; }
.disc-rows li { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.disc-rows li:last-child { border-bottom: 0; }
.disc-rows .name { font-weight: 600; }
.disc-rows .meta { font-size: .82rem; color: var(--muted); }
.disc-rows .bar { margin-top: .35rem; }
.heat { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; overflow-x: auto; padding-bottom: .3rem; }
.heat i { width: 12px; height: 12px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line); }
.heat i.l1 { background: #C7D6EC; border-color: transparent; }
.heat i.l2 { background: #86A7D6; border-color: transparent; }
.heat i.l3 { background: #3F6DAE; border-color: transparent; }
.heat i.l4 { background: var(--gold); border-color: transparent; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 600 1.4rem var(--font-display); }
.calib { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.calib div { border: 1px solid var(--line); border-radius: 8px; padding: .7rem; text-align: center; }
.calib b { display: block; font: 600 1.5rem var(--font-display); }

/* ---------- Escolha de simulado ---------- */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.mode { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .5rem; border-top: 4px solid var(--blue); }
.mode.m-vfm { border-top-color: var(--gold); }
.mode.m-rev { border-top-color: var(--ok); }
.mode.m-err { border-top-color: var(--err); }
.mode h3 { margin: 0; }
.mode p { color: var(--ink-2); font-size: .93rem; margin: 0; }
.mode form { margin-top: auto; display: grid; gap: .6rem; }

/* ---------- Simulado (runner) ---------- */
.quiz-shell { max-width: 820px; margin: 0 auto; padding: 1rem clamp(.8rem, 3vw, 1.5rem) 7rem; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem clamp(.8rem, 3vw, 1.5rem); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.quiz-top .title { font: 600 1.15rem var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer { font: 600 1.3rem var(--font-display); font-variant-numeric: tabular-nums; padding: .2rem .7rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.timer.low { background: var(--err-soft); color: var(--err); border-color: transparent; }
.q-progress { display: flex; gap: 3px; margin: .9rem 0 1.2rem; flex-wrap: wrap; }
.q-progress button { width: 26px; height: 26px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); font: 600 .72rem var(--font-body); color: var(--muted); cursor: pointer; padding: 0; }
.q-progress button.ans { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.q-progress button.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.q-progress button.no { background: var(--err-soft); color: var(--err); border-color: transparent; }
.q-progress button.cur { outline: 2px solid var(--gold); outline-offset: 1px; }
.q-progress button.flag { box-shadow: inset 0 -3px 0 var(--warn); }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.6rem); }
.q-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: .8rem; }
.q-meta .dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.q-stem { font-size: 1.08rem; line-height: 1.65; margin-bottom: 1.2rem; white-space: pre-line; }
.opts { display: grid; gap: .55rem; }
.opt { display: grid; grid-template-columns: 34px 1fr; gap: .7rem; align-items: start; text-align: left; width: 100%;
  padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.opt:hover:not([disabled]) { border-color: var(--blue); }
.opt .lt { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 1rem var(--font-display); background: var(--surface-2); border: 1px solid var(--line); }
.opt.sel { border-color: var(--blue); background: var(--blue-soft); }
.opt.sel .lt { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .lt { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { border-color: var(--err); background: var(--err-soft); }
.opt.wrong .lt { background: var(--err); color: #fff; border-color: var(--err); }
.opt.struck .txt { text-decoration: line-through; opacity: .5; }
.opt .cm { grid-column: 2; font-size: .86rem; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: .4rem; margin-top: .2rem; }
.opt[disabled] { cursor: default; }
.confidence { margin: 1.1rem 0 .2rem; }
.confidence p { font-size: .88rem; color: var(--muted); margin-bottom: .4rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: .5rem .85rem; font: 600 .88rem var(--font-body); color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.feedback { margin-top: 1.2rem; border-radius: 9px; padding: 1rem 1.1rem; border-left: 4px solid; }
.feedback.ok { background: var(--ok-soft); border-color: var(--ok); }
.feedback.no { background: var(--err-soft); border-color: var(--err); }
.feedback h3 { margin: 0 0 .4rem; }
.feedback .ref { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.quiz-actions { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: .7rem clamp(.8rem, 3vw, 1.5rem) calc(.7rem + env(safe-area-inset-bottom)); z-index: 20; }
.quiz-actions .in { max-width: 820px; margin: 0 auto; display: flex; gap: .6rem; justify-content: space-between; align-items: center; }
.quiz-actions .left, .quiz-actions .right { display: flex; gap: .5rem; align-items: center; }
.kbd { font: 600 .72rem var(--font-body); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; color: var(--muted); }

/* resultado */
.result-head { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.grade { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; text-align: center; border: 6px solid var(--line); }
.grade b { display: block; font: 700 2.6rem/1 var(--font-display); }
.grade small { color: var(--muted); }
.grade.c-mb { border-color: var(--ok); } .grade.c-b { border-color: var(--blue); } .grade.c-r { border-color: var(--warn); } .grade.c-i { border-color: var(--err); }
@media (max-width: 560px) { .result-head { grid-template-columns: 1fr; justify-items: start; } }
.review-q { border-top: 1px solid var(--line); padding: 1.2rem 0; }
.review-q:first-child { border-top: 0; }

/* ranking */
.rank-table td.pos { font: 600 1.25rem var(--font-display); width: 60px; }
.rank-table tr.top1 td.pos { color: var(--gold); }
.rank-table tr.me { background: var(--gold-soft); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; align-items: end; }
.podium div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.podium div.p1 { border: 2px solid var(--gold); padding-top: 1.6rem; }
.podium b { display: block; font: 600 1.3rem var(--font-display); overflow-wrap: anywhere; }
.podium .hits { font: 700 1.9rem var(--font-display); color: var(--blue); }

/* guia */
.guide { max-width: 760px; }
.guide h2 { margin-top: 2rem; }
.guide li { margin-bottom: .45rem; }
.guide .callout { border-left: 4px solid var(--gold); background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.2rem 0; }

/* geração IA */
.gen-progress { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface-2); margin-top: 1rem; }
.gen-progress .bar { height: 12px; margin: .5rem 0; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.4rem; text-align: center; background: var(--surface-2); }
.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem 1.25rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.copy-key { font: 700 1.3rem ui-monospace, monospace; letter-spacing: .12em; padding: .4rem .8rem; background: var(--surface-2); border: 1px dashed var(--gold); border-radius: 8px; }
.text-preview { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; max-height: 520px; overflow: auto; font-size: .9rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h3 { color: var(--ink); }
details summary { cursor: pointer; font-weight: 600; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 1rem; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { text-align: right; }
