/* ===== Oral Cartórios — estilos ===== */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --radius: 14px;
  --radius-sm: 10px;
  --accent: #f6b928;
  --accent-ink: #3b2a05;
  --blue: #1f5bd8;
  --yellow: #f8c22e;
  --red: #e0352b;
  --liquid: linear-gradient(125deg, #1a46c4 0%, #2f6cf0 34%, #e0352b 72%, #f8b928 100%);
  --glass: rgba(255,255,255,.66);
  --glass-2: rgba(255,255,255,.5);
  --glass-line: rgba(255,255,255,.75);
  --blur: saturate(1.6) blur(18px);
  --t: 180ms cubic-bezier(.2,.7,.2,1);
  --maxw: 1180px;
  --read-size: 1.06rem;
}
[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-2: rgba(226,232,246,.75);
  --surface: rgba(255,255,255,.72);
  --surface-2: rgba(255,255,255,.55);
  --ink: #111a2e;
  --ink-2: #3c4760;
  --ink-3: #66718a;
  --line: rgba(255,255,255,.8);
  --line-2: rgba(160,175,210,.55);
  --brand: #0e1a3a;
  --brand-2: #1f3b7a;
  --primary: #1f55d6;
  --primary-ink: #fff;
  --ok: #17784a;
  --ok-bg: rgba(220,245,232,.85);
  --warn: #9a5f00;
  --warn-bg: rgba(255,240,200,.85);
  --bad: #c62a20;
  --bad-bg: rgba(253,225,222,.85);
  --shadow: 0 1px 1px rgba(20,35,80,.04), 0 10px 30px rgba(30,60,140,.10);
  --case-bg: rgba(255,248,225,.75);
  --blob-op: .55;
}
[data-theme="dark"] {
  --glass: rgba(18,26,44,.62);
  --glass-2: rgba(18,26,44,.45);
  --glass-line: rgba(255,255,255,.09);
  --blob-op: .32;
  --bg: #080d1a;
  --bg-2: rgba(30,42,68,.7);
  --surface: rgba(20,29,48,.68);
  --surface-2: rgba(26,37,60,.6);
  --ink: #e8edf4;
  --ink-2: #b4bfce;
  --ink-3: #8592a5;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.16);
  --brand: #e8edf4;
  --brand-2: #c9d6ea;
  --primary: #5b8dff;
  --primary-ink: #fff;
  --ok: #5fd39a;
  --ok-bg: rgba(18,48,31,.8);
  --warn: #f8c22e;
  --warn-bg: rgba(51,39,15,.8);
  --bad: #ff7b70;
  --bad-bg: rgba(58,23,20,.8);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 34px rgba(0,0,0,.35);
  --case-bg: rgba(40,36,20,.55);
}

/* ===== Fundo líquido (azul, amarelo, vermelho e branco) ===== */
.liquid { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); pointer-events: none; }
.liquid i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-op); mix-blend-mode: normal; will-change: transform; }
.liquid .b1 { width: 58vmax; height: 58vmax; left: -18vmax; top: -22vmax; background: radial-gradient(circle at 35% 35%, #3b7bff, #1a46c4 60%, transparent 70%); animation: drift1 26s ease-in-out infinite alternate; }
.liquid .b2 { width: 46vmax; height: 46vmax; right: -14vmax; top: -10vmax; background: radial-gradient(circle at 50% 50%, #ffd44d, #f6b31e 55%, transparent 70%); animation: drift2 30s ease-in-out infinite alternate; }
.liquid .b3 { width: 50vmax; height: 50vmax; right: -10vmax; bottom: -26vmax; background: radial-gradient(circle at 50% 50%, #ff5a4a, #d6281e 55%, transparent 70%); animation: drift3 34s ease-in-out infinite alternate; }
.liquid .b4 { width: 40vmax; height: 40vmax; left: 10vmax; bottom: -18vmax; background: radial-gradient(circle at 50% 50%, #ffffff, rgba(255,255,255,.6) 50%, transparent 70%); opacity: calc(var(--blob-op) + .25); animation: drift2 38s ease-in-out infinite alternate-reverse; }
[data-theme="dark"] .liquid .b4 { background: radial-gradient(circle at 50% 50%, #3d5fbf, transparent 70%); }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.12) rotate(20deg); } }
@keyframes drift2 { to { transform: translate(-12vmax, 14vmax) scale(.9) rotate(-15deg); } }
@keyframes drift3 { to { transform: translate(-16vmax, -10vmax) scale(1.15) rotate(25deg); } }

/* superfícies de vidro sobre o fundo líquido */
.panel, .paper, .content-card, .materia, .mode-card, .kpi, .qitem, .start-card, .result-hero, .quesito, .tbl, .dialog, .icon-btn, .btn:not(.primary):not(.accent):not(.danger), .tabs, .chip:not(.active), .input, .select {
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.panel, .paper, .content-card, .materia, .mode-card, .kpi, .qitem, .start-card, .result-hero, .tbl { border-color: var(--glass-line); }
.dialog { background: color-mix(in srgb, var(--bg) 82%, transparent); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.55; font-size: 16px; min-height: 100vh;
  background: transparent;
}
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ===== Topbar ===== */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); background: var(--glass-2); border-bottom: 1px solid var(--glass-line); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--liquid); opacity: .85; }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); }
.brand-mark { color: var(--brand); display: grid; }
[data-theme="dark"] .brand-mark svg rect { fill: #233149; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: var(--ink-3); font-size: .74rem; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 7px 12px; border-radius: 999px; font-size: .93rem; transition: background var(--t), color var(--t); }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); transition: var(--t); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

main { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 80px; outline: none; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--ink-3); padding: 60px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--ink); transition: transform var(--t), background var(--t), border-color var(--t), box-shadow var(--t); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #2f6cf0, #1a46c4 60%, #15389e); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(31,85,214,.32), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.primary:hover { filter: brightness(1.08) saturate(1.1); }
.btn.accent { background: linear-gradient(135deg, #ffd44d, #f6b31e); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 18px rgba(246,179,30,.3); }
.btn.danger { background: linear-gradient(135deg, #ff5a4a, #d6281e); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 13px; }
.btn.sm { padding: 6px 11px; font-size: .85rem; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { flex: none; }
.btn.on { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

/* ===== Home ===== */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: stretch; margin-bottom: 30px; }
.hero-copy { padding: 8px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: var(--ink-3); font-weight: 700; }
.hero h1 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin: 8px 0 12px; }
.hero p { color: var(--ink-2); max-width: 56ch; margin: 0 0 18px; }
.hero-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.5rem; }
.hero-stats span { color: var(--ink-3); font-size: .85rem; }
.mode-cards { display: grid; gap: 14px; }
.mode-card { position: relative; text-align: left; padding: 20px 20px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: transform var(--t), border-color var(--t); display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.mode-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.mode-card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.mode-card.featured { background: var(--liquid); background-size: 180% 180%; animation: flow 14s ease-in-out infinite alternate; color: #fff; border-color: transparent; box-shadow: 0 16px 40px rgba(31,85,214,.28); }
.mode-card.featured .ic { background: rgba(255,255,255,.22); color: #fff; }
.mode-card.featured small { color: rgba(255,255,255,.88); }
@keyframes flow { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
.hero h1 .grad { background: var(--liquid); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mode-card h3 { margin: 0 0 2px; font-size: 1.08rem; }
.mode-card small { color: var(--ink-3); display: block; }
.mode-card .go { opacity: .6; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.section-title h2 { font-size: 1.2rem; margin: 0; }
.section-title span { color: var(--ink-3); font-size: .9rem; }

.materias { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.materia { position: relative; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.materia::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c, var(--primary)); }
.materia-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.materia h3 { font-size: 1.04rem; margin: 0; }
.materia .meta { color: var(--ink-3); font-size: .85rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.bar { height: 7px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c, var(--primary)); border-radius: inherit; transition: width .5s; }
.materia-actions { display: flex; gap: 8px; margin-top: auto; }
.materia-actions .btn { flex: 1; }

.tips { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tip { padding: 16px; border-radius: var(--radius); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: .92rem; }
.tip b { color: var(--ink); display: block; margin-bottom: 4px; }

/* ===== Exam ===== */
.exam-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.crumb { font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); border: 1px solid transparent; }
.crumb.done { background: var(--ok-bg); color: var(--ok); }
.crumb.cur { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow); }
.exam-top .spacer { flex: 1; }

.exam { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.paper-head { padding: 22px 28px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.paper-head .kicker { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.paper-head h2 { font-size: 1.3rem; margin: 6px 0 0; }
.qtag { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; }
.qtag .qnum { background: var(--brand); color: var(--bg); font-weight: 800; letter-spacing: .06em; font-size: .8rem; padding: 6px 14px 6px 12px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
[data-theme="dark"] .qtag .qnum { background: #2a3a55; color: #fff; }
.paper-body { padding: 24px 28px 28px; font-family: var(--font-read); font-size: var(--read-size); line-height: 1.7; }
.paper-body p { margin: 0 0 .9em; }
.case { background: var(--case-bg); border-left: 4px solid var(--accent); padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 18px; }
.case p { text-indent: 1.6em; margin: 0 0 .6em; }
.case p:first-child { text-indent: 0; }
.case p:last-child { margin-bottom: 0; }
.comando { font-weight: 600; margin: 4px 0 12px; }
ol.perguntas { margin: 0; padding: 0; list-style: none; counter-reset: q; }
ol.perguntas li { counter-increment: q; position: relative; padding: 10px 12px 10px 48px; border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--line); }
ol.perguntas li::before { content: counter(q); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font); font-weight: 800; font-size: .85rem; background: var(--brand); color: var(--bg); }
[data-theme="dark"] ol.perguntas li::before { background: #2a3a55; color: #fff; }
.topicos { margin-top: 18px; font-family: var(--font); font-size: .82rem; color: var(--ink-3); border-top: 1px dashed var(--line-2); padding-top: 12px; }

.side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin: 0 0 12px; }

.timer { display: grid; place-items: center; position: relative; margin: 4px auto 10px; width: 190px; height: 190px; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer .track { stroke: var(--bg-2); }
.timer .prog { stroke: url(#liq); transition: stroke-dashoffset .25s linear, stroke .3s; stroke-linecap: round; }
.timer.warn .prog { stroke: var(--yellow); }
.timer.crit .prog { stroke: var(--red); }
.timer .digits { font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; }
.timer .lbl { position: absolute; bottom: 46px; font-size: .78rem; color: var(--ink-3); }
.timer.crit .digits { color: var(--bad); animation: pulse 1s ease-in-out infinite; }
.timer.paused .digits { opacity: .55; }
@keyframes pulse { 50% { opacity: .55; } }
.side .row { display: flex; gap: 8px; }
.side .row .btn { flex: 1; }
.side .stack { display: grid; gap: 8px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; animation: pulse 1s infinite; }
.hint { font-size: .82rem; color: var(--ink-3); margin: 10px 0 0; }

/* start overlay */
.start-card { max-width: 640px; margin: 30px auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 40px 32px; }
.start-card .big-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--warn); }
.start-card h2 { font-size: 1.6rem; }
.start-card p { color: var(--ink-2); }
.start-card ul { text-align: left; color: var(--ink-2); margin: 18px auto 24px; max-width: 440px; padding-left: 20px; }
.start-card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Gabarito ===== */
.gab { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.tabs { display: flex; gap: 4px; padding: 6px; background: var(--bg-2); border-radius: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { flex: 1 1 auto; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: .9rem; white-space: nowrap; }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.content-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; }
.content-card .read { font-family: var(--font-read); font-size: var(--read-size); line-height: 1.75; }
.content-card .read p { margin: 0 0 1em; text-align: justify; hyphens: auto; }
.fund { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; background: var(--surface-2); }
.fund-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.fund-type { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.fund-type.lei { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.fund-type.juris { background: var(--warn-bg); color: var(--warn); }
.fund-type.doutrina { background: var(--ok-bg); color: var(--ok); }
.fund-ref { font-weight: 700; font-size: .92rem; }
.fund-text { font-family: var(--font-read); font-size: .98rem; color: var(--ink-2); white-space: pre-line; }
.fund.lei .fund-text { border-left: 3px solid var(--line-2); padding-left: 12px; }
ol.roteiro { padding-left: 22px; margin: 0; }
ol.roteiro li { margin-bottom: 10px; font-family: var(--font-read); font-size: var(--read-size); }
.roteiro-note { color: var(--ink-3); font-size: .88rem; margin-bottom: 14px; }
.revisit { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.revisit summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

.sheet { position: sticky; top: 76px; }
.score-box { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--liquid); background-size: 180% 180%; animation: flow 14s ease-in-out infinite alternate; color: #fff; margin-bottom: 14px; box-shadow: 0 14px 34px rgba(31,85,214,.25); text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.score-box .n { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.score-box .n small { font-size: 1rem; opacity: .7; font-weight: 600; }
.score-box .verdict { font-size: .85rem; opacity: .9; }
.score-box .verdict b { display: block; font-size: 1rem; }
.quesito { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.quesito-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.quesito-head b { font-size: .92rem; }
.quesito-head span { font-size: .78rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.conceitos { display: grid; gap: 6px; }
.conceito { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; text-align: left; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .85rem; color: var(--ink-2); transition: border-color var(--t), background var(--t); }
.conceito:hover { border-color: var(--line-2); }
.conceito .c { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--bg-2); color: var(--ink-2); font-size: .82rem; }
[data-theme="dark"] .conceito { background: rgba(8,13,26,.6); color: var(--ink-2); }
[data-theme="dark"] .conceito .c { background: rgba(255,255,255,.08); }
.conceito.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--ink); }
.conceito.sel .c { background: var(--primary); color: var(--primary-ink); }
.sheet-group { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 800; margin: 16px 2px 8px; display: flex; justify-content: space-between; }
.sheet-actions { display: grid; gap: 8px; margin-top: 14px; }
.audio-box { margin-top: 12px; }
.audio-box audio { width: 100%; }

/* ===== Lists / tables ===== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.input, .select { padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); min-width: 0; }
.input { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.chip.active { background: var(--brand); color: var(--bg); border-color: var(--brand); }
[data-theme="dark"] .chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.qlist { display: grid; gap: 10px; }
.qitem { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.qitem .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.qitem h4 { margin: 0; font-size: .98rem; }
.qitem p { margin: 2px 0 0; color: var(--ink-3); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.qitem .acts { display: flex; gap: 6px; align-items: center; }
.empty { text-align: center; color: var(--ink-3); padding: 40px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi span { color: var(--ink-3); font-size: .82rem; }
.kpi b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); font-size: .92rem; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }

.result-hero { text-align: center; padding: 32px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.result-hero .n { font-size: 3.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; background: var(--liquid); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qtag .qnum, ol.perguntas li::before { background: linear-gradient(135deg, #1a46c4, #2f6cf0) !important; color: #fff !important; }
.case { border-left: 4px solid; border-image: linear-gradient(#f8b928, #e0352b) 1; border-radius: 0; }
.bar > i { background: linear-gradient(90deg, var(--c, var(--primary)), color-mix(in srgb, var(--c, var(--primary)) 55%, #fff)); }
.chip.active { background: linear-gradient(135deg, #2f6cf0, #1a46c4) !important; color: #fff !important; border-color: transparent !important; }
.result-hero p { color: var(--ink-2); }

/* ===== Dialog / toast ===== */
.dialog { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); width: min(520px, 94vw); }
.dialog::backdrop { background: rgba(10,15,25,.5); backdrop-filter: blur(3px); }
.dialog-body { padding: 24px; display: grid; gap: 14px; }
.dialog-body h2 { margin: 0 0 4px; font-size: 1.25rem; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; }
.field input[type=number], .field select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); }
.field small { color: var(--ink-3); font-size: .8rem; }
.check { display: flex; gap: 10px; align-items: center; font-size: .93rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--brand); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: var(--t); z-index: 50; box-shadow: var(--shadow); }
[data-theme="dark"] .toast { background: #e8edf4; color: #0d131c; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* reading highlight */
.speaking { outline: 2px dashed color-mix(in srgb, var(--accent) 80%, transparent); outline-offset: 4px; border-radius: 6px; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .exam, .gab { grid-template-columns: 1fr; }
  .side, .sheet { position: static; }
  .exam .side { display: contents; }
  .exam .side .panel:first-child { order: -1; position: sticky; top: 62px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
  .exam .side .panel:first-child h3, .exam .side .panel:first-child .lbl { display: none; }
  .exam .side .panel:first-child .timer { width: 78px; height: 78px; margin: 0; flex: none; }
  .exam .side .panel:first-child .timer .digits { font-size: 1.2rem; }
  .exam .side .panel:first-child .stack { flex: 1; grid-template-columns: 1fr auto; align-items: center; }
  .exam .side .panel:first-child .stack .btn.lg { padding: 11px 14px; font-size: .95rem; }
  .exam .side .panel:not(:first-child) { order: 1; }
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 6px; }
  .exam .side .panel:first-child { top: 100px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  main { padding: 18px 14px 70px; }
  .paper-head, .paper-body, .content-card { padding-left: 18px; padding-right: 18px; }
  .qitem { grid-template-columns: auto 1fr; }
  .qitem .acts { grid-column: 1 / -1; }
  .brand-text small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .topbar, .side, .sheet, .tabs { display: none !important; } .gab, .exam { grid-template-columns: 1fr; } }
