/* Layout: trilho lateral fixo (desktop) / barra inferior (celular); conteúdo em coluna de leitura
   com a "folha de respostas" da OAB como motivo visual (bolhas A–D). */
:root {
  /* cor — lavanda pastel, tinta berinjela */
  --bg: #f6f3fb;
  --surface: #ffffff;
  --surface-2: #efe9f8;
  --surface-3: #e6ddf6;
  --ink: #2a2237;
  --ink-2: #554a68;
  --muted: #847a95;
  --line: #e2daef;
  --accent: #8a6ed4;
  --accent-strong: #6a4fbf;
  --accent-soft: #e7defb;
  --accent-ink: #ffffff;
  --lilac: #cdb9f4;
  --pink: #f2c6dc;
  --mint: #bfe8d6;
  --good: #2f8f6b;
  --good-soft: #dcf2e8;
  --bad: #c24d63;
  --bad-soft: #fbe2e7;
  --warn: #a8761f;
  --warn-soft: #f9eed6;
  --shadow: 0 1px 2px rgba(60, 40, 100, .06), 0 8px 24px rgba(60, 40, 100, .06);
  --radius: 14px;
  --radius-sm: 9px;
  /* tipo */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-read: "Newsreader", "Iowan Old Style", Georgia, serif;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.2rem; --fs-xl: 1.6rem; --fs-2xl: 2.25rem; --fs-3xl: 3.2rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15111d; --surface: #1e1829; --surface-2: #271f35; --surface-3: #31283f;
    --ink: #efe9f8; --ink-2: #c6bbd9; --muted: #968aa9; --line: #362c46;
    --accent: #b7a0f3; --accent-strong: #cdbcfa; --accent-soft: #352a52; --accent-ink: #1a1424;
    --lilac: #6f5aa6; --pink: #8a4d6c; --mint: #3f7a63;
    --good: #6fcca5; --good-soft: #1c372d; --bad: #f08ba0; --bad-soft: #42222b; --warn: #e3b55e; --warn-soft: #3a2f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15111d; --surface: #1e1829; --surface-2: #271f35; --surface-3: #31283f;
  --ink: #efe9f8; --ink-2: #c6bbd9; --muted: #968aa9; --line: #362c46;
  --accent: #b7a0f3; --accent-strong: #cdbcfa; --accent-soft: #352a52; --accent-ink: #1a1424;
  --lilac: #6f5aa6; --pink: #8a4d6c; --mint: #3f7a63;
  --good: #6fcca5; --good-soft: #1c372d; --bad: #f08ba0; --bad-soft: #42222b; --warn: #e3b55e; --warn-soft: #3a2f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-md)/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); font-weight: 650; }
h3 { font-size: var(--fs-lg); font-weight: 650; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- casca ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px;
  padding: 28px 18px; border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); font: 700 1rem var(--font-display);
}
.brand-name { font: 700 1.05rem/1.1 var(--font-display); }
.brand-sub { font-size: var(--fs-xs); color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.nav .nav-cta { background: var(--accent); color: var(--accent-ink); margin-bottom: 8px; }
.nav .nav-cta:hover { background: var(--accent-strong); color: var(--accent-ink); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--pink); color: var(--ink); font-weight: 700; font-size: .85rem;
}
.rail-actions { display: flex; gap: 8px; }

.main { min-width: 0; padding-block: 36px 110px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .lead { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }

/* barra inferior no celular */
.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding-block: 20px 150px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
  .mobile-top { display: flex !important; }
  h1 { font-size: 1.8rem; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card-soft { background: var(--surface-2); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card h3 + p, .card h2 + p { margin-top: 6px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  font: 650 var(--fs-sm)/1 var(--font-ui); text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-soft:hover { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { min-height: 36px; padding: 7px 12px; }
.btn-icon { min-height: 38px; width: 38px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill-muted { background: var(--surface-2); color: var(--ink-2); }

.flash { padding: 12px 16px; border-radius: 11px; font-weight: 550; }
.flash-ok { background: var(--good-soft); color: var(--good); }
.flash-erro { background: var(--bad-soft); color: var(--bad); }

/* formulários */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 var(--fs-md) var(--font-ui);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 14px; border-radius: 9px; font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex: none; }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: var(--accent-soft); color: var(--ink);
}
.auth-art h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); max-width: 14ch; }
.auth-art .lead { color: var(--ink-2); max-width: 44ch; margin-top: 14px; font-size: var(--fs-lg); }
.sheet { display: grid; grid-template-columns: repeat(10, auto); gap: 10px 12px; justify-content: start; }
.sheet .q { display: flex; align-items: center; gap: 5px; font: 600 .7rem var(--font-ui); color: var(--muted); }
.sheet .q b { width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.sheet i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--lilac); display: block; }
.sheet i.on { background: var(--accent); border-color: var(--accent); }
.auth-facts { display: flex; flex-wrap: wrap; gap: 26px; }
.auth-facts div { display: flex; flex-direction: column; }
.auth-facts strong { font: 700 var(--fs-xl) var(--font-display); }
.auth-facts span { font-size: var(--fs-sm); color: var(--ink-2); }
.auth-form { display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-form form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 32px 20px; }
  .auth-art .sheet { display: none; }
}

/* ---------- início ---------- */
.hero-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 860px) { .hero-row { grid-template-columns: minmax(0, 1fr); } }
.hero-card {
  background: var(--accent-soft); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.hero-card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); max-width: 22ch; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font: 700 var(--fs-2xl)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: .45em; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi .l { font-size: var(--fs-sm); color: var(--ink-2); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.meter.good > i { background: var(--good); }
.meter.bad > i { background: var(--bad); }
.meter.warn > i { background: var(--warn); }

/* lista de sessões */
.list { display: flex; flex-direction: column; }
.list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .t { font-weight: 650; overflow-wrap: anywhere; }
.list-item .s { font-size: var(--fs-sm); color: var(--muted); }

/* tabelas */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.bar-cell { min-width: 120px; }

/* ---------- criar sessão ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 760px) { .mode-grid { grid-template-columns: minmax(0, 1fr); } }
.mode { display: flex; flex-direction: column; gap: 16px; }
.mode-head { display: flex; gap: 14px; align-items: flex-start; }
.mode-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-strong); }
.mode-icon svg { width: 24px; height: 24px; }
.mode-icon.pink { background: var(--pink); color: var(--ink); }
.mode-icon.mint { background: var(--mint); color: var(--ink); }
.mode-icon.lilac { background: var(--lilac); color: var(--ink); }
.mode form { display: flex; flex-direction: column; gap: 14px; margin-top: auto; }
.mode-wide { grid-column: 1 / -1; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts svg { width: 15px; height: 15px; color: var(--accent); }

/* ---------- prova ---------- */
.exam { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .exam { grid-template-columns: minmax(0, 1fr); } }
.exam-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.timer { display: inline-flex; align-items: center; gap: 8px; font: 700 var(--fs-lg) var(--font-display); font-variant-numeric: tabular-nums; }
.timer svg { width: 20px; height: 20px; color: var(--accent); }
.timer.low { color: var(--bad); }
.progress-line { flex: 1 1 160px; display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); min-width: 0; }
.progress-line .meter { flex: 1; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 3vw, 34px); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qnum { font: 700 var(--fs-xl) var(--font-display); }
.qtext { font: 400 1.14rem/1.65 var(--font-read); color: var(--ink); max-width: 70ch; }
.qtext p + p { margin-top: .7em; }
.alts { display: flex; flex-direction: column; gap: 10px; max-width: 74ch; }
.alt {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 1.04rem/1.55 var(--font-read); cursor: pointer; transition: border-color .15s, background .15s;
}
.alt:hover:not([disabled]) { border-color: var(--lilac); background: var(--surface-2); }
.alt .bub {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--lilac); display: grid; place-items: center;
  font: 700 .95rem var(--font-ui); color: var(--accent-strong); transition: all .15s;
}
.alt.sel { border-color: var(--accent); background: var(--accent-soft); }
.alt.sel .bub { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.alt.ok { border-color: var(--good); background: var(--good-soft); }
.alt.ok .bub { background: var(--good); border-color: var(--good); color: var(--surface); }
.alt.no { border-color: var(--bad); background: var(--bad-soft); }
.alt.no .bub { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.alt.cut .txt { text-decoration: line-through; color: var(--muted); }
.alt[disabled] { cursor: default; }
.feedback { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-weight: 600; }
.feedback svg { width: 22px; height: 22px; flex: none; }
.feedback.ok { background: var(--good-soft); color: var(--good); }
.feedback.no { background: var(--bad-soft); color: var(--bad); }
.qnav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .side { position: static; } }
.answer-sheet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 6px; }
.as-item {
  display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 0; border-radius: 9px; border: 1px solid transparent;
  background: transparent; cursor: pointer; font: 600 .78rem var(--font-ui); color: var(--ink-2); position: relative;
}
.as-item .d { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--lilac); display: grid; place-items: center; font-size: .68rem; font-weight: 700; }
.as-item.ans .d { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.as-item.cur { border-color: var(--accent); background: var(--accent-soft); }
.as-item.flag::after { content: ""; position: absolute; top: 2px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.as-item.r-ok .d { background: var(--good); border-color: var(--good); color: var(--surface); }
.as-item.r-no .d { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.as-item:hover { background: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); font: 600 .72rem var(--font-ui); color: var(--ink-2); }
.save-state { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.save-state.pending i { background: var(--warn); }
.save-state.err i { background: var(--bad); }

/* ---------- resultado ---------- */
.score-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
@media (max-width: 640px) { .score-hero { grid-template-columns: minmax(0, 1fr); } }
.score-ring { position: relative; width: 168px; height: 168px; }
.score-ring svg { width: 168px; height: 168px; transform: rotate(-90deg); }
.score-ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .big { font: 700 2.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.score-ring .of { font-size: var(--fs-sm); color: var(--muted); }
.review-item { border-top: 1px solid var(--line); }
.review-item summary { list-style: none; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; cursor: pointer; }
.review-item summary::-webkit-details-marker { display: none; }
.review-item .rn { font: 700 var(--fs-md) var(--font-display); font-variant-numeric: tabular-nums; }
.review-item .rs { font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-body { padding: 4px 4px 22px; display: flex; flex-direction: column; gap: 14px; }
.review-body .qtext { font-size: 1.05rem; }

/* ---------- flashcards ---------- */
.flash-stage { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .flash-stage { grid-template-columns: minmax(0, 1fr); } }
.fcard { perspective: 1600px; min-width: 0; }
.fcard-inner { display: grid; transition: transform .6s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; }
.fcard.flipped .fcard-inner { transform: rotateY(180deg); }
.face {
  grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; padding: clamp(20px, 3vw, 34px);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.face.back { transform: rotateY(180deg); }
.face.back.ok { background: var(--good-soft); border-color: var(--good); }
.face.back.no { background: var(--bad-soft); border-color: var(--bad); }
.verdict { display: flex; align-items: center; gap: 14px; }
.verdict .ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.verdict .ic svg { width: 30px; height: 30px; }
.face.ok .verdict .ic { background: var(--good); color: var(--surface); }
.face.no .verdict .ic { background: var(--bad); color: var(--surface); }
.verdict h2 { font-size: var(--fs-2xl); }
.face.ok .verdict h2 { color: var(--good); }
.face.no .verdict h2 { color: var(--bad); }
.answer-box { background: var(--surface); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.answer-box .txt { font: 400 1.04rem/1.55 var(--font-read); }
.level-seg span { min-width: 84px; text-align: center; }
.streak { display: flex; gap: 6px; flex-wrap: wrap; }
.streak i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); }
.streak i.ok { background: var(--good); }
.streak i.no { background: var(--bad); }
@media (prefers-reduced-motion: reduce) { .fcard-inner { transition: none; } }

/* ---------- gráficos ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font: 500 11px var(--font-ui); font-variant-numeric: tabular-nums; }
.chart .ref-line { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-text { fill: var(--warn); font: 700 11px var(--font-ui); }
.chart .series-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: var(--accent); opacity: .12; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .dot.last { fill: var(--accent-strong); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 9px;
  font-size: var(--fs-xs); line-height: 1.4; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow);
}
.tip b { font-size: var(--fs-sm); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 92px; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.hbar .track { position: relative; height: 14px; border-radius: 4px; background: var(--surface-2); }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbar .fill.good { background: var(--good); } .hbar .fill.warn { background: var(--warn); } .hbar .fill.bad { background: var(--bad); }
.hbar .mark50 { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1.5px; background: var(--ink-2); opacity: .45; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 650; }
.hbar .v small { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) { .hbar { grid-template-columns: minmax(0, 1fr) 84px; } .hbar .track { grid-column: 1 / -1; grid-row: 2; } }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); display: block; }
.heat i.l1 { background: var(--lilac); opacity: .55; } .heat i.l2 { background: var(--lilac); } .heat i.l3 { background: var(--accent); } .heat i.l4 { background: var(--accent-strong); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty svg { width: 42px; height: 42px; color: var(--lilac); }

.backdrop { position: fixed; inset: 0; z-index: 99; background: rgba(25, 14, 45, .45); }

/* ---------- contagem regressiva ---------- */
.countdown {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 26px; align-items: center;
  padding: 24px 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.cd-num { display: flex; align-items: baseline; gap: 10px; }
.cd-num strong { font: 700 clamp(3.2rem, 7vw, 4.6rem)/.9 var(--font-display); color: var(--accent-strong); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.cd-num span { font: 650 var(--fs-lg)/1.1 var(--font-display); color: var(--ink-2); }
.cd-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cd-info h2 { font-size: var(--fs-lg); }
.cd-weeks { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.cd-weeks i { width: 12px; height: 12px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--lilac); }
.cd-weeks i.foi { background: var(--accent); border-color: var(--accent); }
.cd-pace { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.cd-pace strong { font: 700 var(--fs-xl) var(--font-display); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .countdown { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; }
  .cd-pace { text-align: left; }
}

/* ---------- bloco de anotações flutuante ---------- */
.np-fab {
  position: fixed; z-index: 60; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 650 var(--fs-sm) var(--font-ui);
  box-shadow: 0 6px 18px rgba(106, 79, 191, .35), 0 2px 4px rgba(60, 40, 100, .12); transition: transform .15s, background .15s;
}
.np-fab:hover { background: var(--accent-strong); transform: translateY(-2px); }
.np-fab svg { width: 22px; height: 22px; }
.np-fab[aria-expanded="true"] { background: var(--accent-strong); }
.np-panel {
  position: fixed; z-index: 61; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 32px)); height: min(520px, calc(100vh - 130px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(50, 30, 90, .22), 0 2px 6px rgba(50, 30, 90, .08); overflow: hidden;
  transform-origin: bottom right; animation: np-in .18s ease-out;
}
.np-panel.wide { width: min(760px, calc(100vw - 32px)); height: min(720px, calc(100vh - 130px)); }
@keyframes np-in { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .np-panel { animation: none; } }
.np-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.np-head h2 { font-size: 1rem; flex: 1; }
.np-head .btn-icon { min-height: 34px; width: 34px; }
.np-tabs { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; flex: none; }
.np-tab {
  position: relative; flex: none; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font: 600 .78rem var(--font-ui); cursor: pointer; white-space: nowrap;
}
.np-tab:hover { background: var(--surface-2); }
.np-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.np-tab.tem::after { content: ""; position: absolute; top: 3px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.np-tab[aria-selected="true"].tem::after { background: var(--accent-ink); }
.np-tab.atual { border-color: var(--warn); }
.np-sug { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; font-size: var(--fs-xs); color: var(--ink-2); background: var(--warn-soft); flex: none; }
.np-sug button { border: 0; background: transparent; color: var(--accent-strong); font: 700 var(--fs-xs) var(--font-ui); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.np-area { flex: 1; min-height: 0; display: flex; }
.np-area textarea {
  flex: 1; width: 100%; resize: none; border: 0; padding: 14px 16px; background: var(--surface); color: var(--ink);
  font: 400 1rem/1.6 var(--font-read); outline: none;
}
.np-area textarea::placeholder { color: var(--muted); font-style: italic; }
.np-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); flex: none; }
@media (max-width: 860px) {
  .np-fab { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); height: 50px; width: 50px; padding: 0; justify-content: center; }
  .np-fab .np-lbl { display: none; }
  .np-panel, .np-panel.wide { right: 8px; left: 8px; width: auto; bottom: calc(140px + env(safe-area-inset-bottom, 0px)); height: min(480px, calc(100vh - 200px)); }
}

/* ---------- fogos ---------- */
.fx-layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.fx-msg {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); z-index: 101; opacity: 0;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(40, 20, 80, .3); border-radius: 22px;
  padding: 26px 30px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(420px, calc(100vw - 32px));
  transition: opacity .4s, transform .4s cubic-bezier(.2, .8, .2, 1.2);
}
.fx-msg.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fx-msg strong { font: 700 3rem/1 var(--font-display); color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.fx-msg h2 { font-size: var(--fs-xl); }
