:root {
  color-scheme: light;
  --ink: #071826;
  --ink-soft: #183349;
  --paper: #f4f8fb;
  --surface: #ffffff;
  --line: #d8e4ec;
  --muted: #637789;
  --cyan: #15b7c8;
  --cyan-dark: #087b8a;
  --mint: #4de1c1;
  --correct: #13795b;
  --correct-bg: #e9fbf4;
  --wrong: #b64242;
  --wrong-bg: #fff0ef;
  --amber: #a76305;
  --amber-bg: #fff7df;
  --shadow: 0 24px 70px rgba(7, 24, 38, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(21, 183, 200, 0.14), transparent 30rem),
    linear-gradient(180deg, #edf6fa 0%, var(--paper) 32%, #eef3f7 100%);
}

button, select, input { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar-leading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.theme-toggle {
  min-height: 44px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(7,24,38,.08);
  font-size: .82rem;
  font-weight: 780;
}
.theme-toggle:hover { border-color: var(--cyan); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--mint); background: var(--ink);
  box-shadow: 0 10px 25px rgba(7, 24, 38, 0.18);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand h1 { margin: 0; font-size: clamp(1.1rem, 2.5vw, 1.42rem); letter-spacing: -0.035em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }

.top-actions { display: flex; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 10px; align-items: center; }
.select-wrap { position: relative; }
select {
  min-height: 44px;
  max-width: 290px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--surface);
}

.ghost-button {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.78);
}
.ghost-button:hover { border-color: #9fb7c7; background: white; }
.compact-button { min-height: 44px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.home-page { display: grid; gap: 22px; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 22px;
  padding: clamp(26px, 5vw, 58px);
  border: 1px solid rgba(202, 219, 230, .92);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 12%, rgba(77,225,193,.19), transparent 18rem),
    linear-gradient(135deg, #ffffff 0%, #f5fbfd 64%, #e9f7f7 100%);
  box-shadow: var(--shadow);
}
.home-copy { align-self: center; }
.home-kicker {
  display: inline-block;
  color: var(--cyan-dark);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.home-copy h2 {
  max-width: 690px;
  margin: 10px 0 16px;
  font-size: clamp(2rem, 5vw, 4.15rem);
  line-height: .98;
  letter-spacing: -.065em;
}
.home-copy > p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}
.home-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.home-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 31px; }
.home-stats > div {
  min-width: 118px;
  padding: 13px 15px;
  border: 1px solid rgba(199,216,227,.9);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}
.home-stats strong { display: block; font-size: 1.45rem; line-height: 1; }
.home-stats span { display: block; margin-top: 4px; color: var(--muted); font-size: .79rem; }

.periods-page { display: grid; gap: 22px; }
.periods-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: clamp(27px, 4vw, 44px);
  border: 1px solid rgba(202,219,230,.92);
  border-radius: 26px;
  background:
    radial-gradient(circle at 92% 0%, rgba(77,225,193,.2), transparent 22rem),
    linear-gradient(135deg, #ffffff 0%, #f4fbfd 100%);
  box-shadow: 0 18px 50px rgba(7,24,38,.09);
}
.periods-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4.8vw, 3.9rem);
  line-height: 1;
  letter-spacing: -.06em;
}
.periods-heading > p {
  max-width: 520px;
  margin: 0;
  color: var(--ink-soft);
  font-size: .98rem;
  line-height: 1.65;
}
.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.period-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(202,219,230,.94);
  border-radius: 24px;
  background: rgba(255,255,255,.87);
  box-shadow: 0 14px 34px rgba(7,24,38,.075);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.period-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -52px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background: rgba(21,183,200,.055);
  pointer-events: none;
}
.period-card:hover { transform: translateY(-2px); border-color: #b7cfdd; box-shadow: 0 18px 42px rgba(7,24,38,.1); }
.period-card.available {
  border-color: rgba(21,183,200,.72);
  background:
    radial-gradient(circle at 105% -5%, rgba(77,225,193,.31), transparent 12rem),
    linear-gradient(145deg, #faffff 0%, #e9f9f8 100%);
  box-shadow: 0 18px 45px rgba(8,123,138,.16);
}
.period-card.available::after { background: rgba(21,183,200,.1); }
.period-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.period-number {
  color: var(--cyan-dark);
  font-size: clamp(2.15rem, 4.4vw, 3.45rem);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.07em;
}
.period-status {
  padding: 6px 9px;
  border-radius: 999px;
  color: #075f6a;
  background: rgba(77,225,193,.27);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.period-card-copy { position: relative; z-index: 1; margin-top: 18px; }
.period-card-copy h3 { margin: 0; font-size: clamp(1.12rem, 2.2vw, 1.38rem); letter-spacing: -.035em; }
.period-card-copy p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.period-coming-soon {
  position: relative;
  z-index: 1;
  margin-top: auto;
  color: #8ca0ae;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.period-assessment { position: relative; z-index: 1; margin-top: auto; }
.period-assessment-label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--cyan-dark);
  font-size: .71rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.period-simulado {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 12px 13px 14px;
  border: 1px solid rgba(8,123,138,.25);
  border-radius: 15px;
  color: white;
  background: var(--ink);
  box-shadow: 0 12px 24px rgba(7,24,38,.17);
  text-align: left;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.period-simulado:hover { transform: translateY(-2px); background: #0c2939; box-shadow: 0 16px 30px rgba(7,24,38,.23); }
.period-simulado:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.period-simulado > span { min-width: 0; }
.period-simulado strong { display: block; font-size: .91rem; line-height: 1.25; }
.period-simulado small { display: block; margin-top: 4px; color: #bcd0da; font-size: .66rem; line-height: 1.25; }
.period-simulado svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: var(--mint); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.tpi-launch-row,
.tpi-all-row {
  display: flex;
  justify-content: center;
}
.tpi-period-card { width: min(100%, 360px); }
.tpi-period-card .period-number { letter-spacing: -.045em; }

.tpi-exams-page { display: grid; gap: 22px; }
.tpi-heading { align-items: center; }
.tpi-exam-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tpi-exam-card {
  position: relative;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(202,219,230,.94);
  border-radius: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 105% -10%, rgba(77,225,193,.2), transparent 11rem),
    rgba(255,255,255,.9);
  box-shadow: 0 14px 34px rgba(7,24,38,.075);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tpi-exam-card::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -46px;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: rgba(21,183,200,.08);
  pointer-events: none;
}
.tpi-exam-card:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 20px 46px rgba(8,123,138,.15); }
.tpi-exam-card:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.tpi-exam-kicker {
  position: relative;
  z-index: 1;
  color: var(--cyan-dark);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.tpi-exam-title {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.tpi-exam-meta {
  position: relative;
  z-index: 1;
  max-width: 90%;
  margin-top: auto;
  padding-top: 25px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}
.tpi-exam-arrow {
  position: absolute;
  z-index: 1;
  right: 22px;
  bottom: 20px;
  color: var(--cyan-dark);
  font-size: 1.45rem;
  font-weight: 900;
}
.n1-component-name {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: .86rem;
  line-height: 1.45;
}
.n1-component-card.is-unavailable {
  border-style: dashed;
  box-shadow: none;
  opacity: .72;
}
.n1-component-card.is-unavailable:hover {
  transform: none;
  border-color: rgba(202,219,230,.94);
  box-shadow: none;
}
.n1-empty-card {
  grid-column: 1 / -1;
  padding: clamp(28px, 5vw, 54px);
  border: 1px dashed var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  text-align: center;
}
.n1-empty-card h3 { margin: 8px 0 7px; font-size: 1.6rem; }
.n1-empty-card p { max-width: 620px; margin: 0 auto; color: var(--muted); line-height: 1.6; }
.n1-assessment-shell {
  overflow: hidden;
  border: 1px solid rgba(21,183,200,.54);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 44px rgba(7,24,38,.09);
}
.n1-assessment-shell.is-expanded { border-color: rgba(21,183,200,.78); box-shadow: 0 22px 54px rgba(8,123,138,.13); }
.n2-assessment-shell { margin-top: 24px; }
.n2-assessment-shell > summary { list-style: none; cursor: pointer; }
.n2-assessment-shell > summary::-webkit-details-marker { display: none; }
.n2-assessment-shell[open] .n1-toggle-symbol { transform: rotate(45deg); }
.n1-assessment-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(24px, 4vw, 38px);
  color: white;
  background:
    radial-gradient(circle at 88% 0%, rgba(77,225,193,.28), transparent 19rem),
    linear-gradient(135deg, #071826 0%, #0a3540 100%);
  text-align: left;
}
.n1-assessment-toggle > span:first-child { display: grid; gap: 5px; }
.n1-assessment-toggle small { color: var(--mint); font-size: .72rem; font-style: normal; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.n1-assessment-toggle strong { font-size: clamp(2rem, 5vw, 3.45rem); line-height: 1; letter-spacing: -.055em; }
.n1-assessment-toggle em { color: #c7d9e1; font-size: .84rem; font-style: normal; }
.n1-toggle-symbol {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141,234,217,.42);
  border-radius: 50%;
  color: var(--mint);
  background: rgba(8,74,84,.48);
  font-size: 1.8rem;
  font-weight: 500;
}
.n1-assessment-toggle:hover .n1-toggle-symbol { color: #071826; background: var(--mint); }
.n1-assessment-toggle:focus-visible { outline: 3px solid var(--cyan); outline-offset: -5px; }
.n1-expanded-content { display: grid; gap: 24px; padding: clamp(18px, 4vw, 34px); }
.n1-subject-list { display: grid; gap: 18px; }
.n1-subject-section {
  padding: clamp(18px, 3vw, 26px);
  border: 1px dashed var(--line);
  border-radius: 21px;
  background: rgba(247,251,253,.78);
}
.n1-subject-section.is-available { border-style: solid; border-color: rgba(21,183,200,.34); background: linear-gradient(145deg, #fbffff 0%, #f0fafb 100%); }
.n1-subject-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 17px; }
.n1-subject-heading span { color: var(--cyan-dark); font-size: .67rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.n1-subject-heading h3 { margin: 5px 0 2px; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.045em; }
.n1-subject-heading p { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.45; }
.n1-subject-heading > strong { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--cyan-dark); background: #e7f5f8; font-size: .71rem; }
.n1-inline-exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.n1-inline-exam {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(7,24,38,.055);
  text-align: left;
  transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}
.n1-inline-exam:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 13px 24px rgba(8,123,138,.12); }
.n1-inline-exam:focus-visible { outline: 3px solid rgba(21,183,200,.24); outline-offset: 2px; }
.n1-inline-exam-kicker { color: var(--cyan-dark); font-size: .64rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.n1-inline-exam strong { margin-top: 7px; font-size: 1.35rem; letter-spacing: -.035em; }
.n1-inline-exam small { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: .72rem; }
.medmaia-subtab { margin-top: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.medmaia-subtab > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; color: var(--ink); cursor: pointer; list-style: none; }
.medmaia-subtab > summary::-webkit-details-marker { display: none; }
.medmaia-subtab > summary > span:first-child { display: grid; gap: 6px; }
.medmaia-subtab > summary strong { color: var(--cyan-dark); font-size: .95rem; letter-spacing: .02em; }
.medmaia-subtab > summary small { color: var(--muted); font-size: .77rem; }
.medmaia-subtab > summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 15px; }
.medmaia-subtab-arrow { font-size: 1.5rem; transition: transform .17s ease; }
.medmaia-subtab[open] .medmaia-subtab-arrow { transform: rotate(180deg); }
.medmaia-subtab-content { display: grid; padding: 0 18px 18px; }
.n1-subject-empty { padding: 17px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: var(--surface); font-size: .82rem; text-align: center; }
.n1-period-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 4px; }
.n1-combined-action {
  min-height: 104px;
  padding: 20px;
  border: 1px solid rgba(21,183,200,.52);
  border-radius: 18px;
  color: var(--ink);
  background: #effbfc;
  text-align: left;
}
.n1-combined-action span { display: grid; gap: 7px; }
.n1-combined-action strong { font-size: 1rem; letter-spacing: -.015em; }
.n1-combined-action small { color: var(--muted); font-size: .76rem; line-height: 1.45; }
.n1-combined-action.primary { color: white; border-color: #0e6270; background: linear-gradient(135deg, #071826, #0a3540); }
.n1-combined-action.primary small { color: #c7d9e1; }
.n1-combined-action:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 13px 26px rgba(8,123,138,.13); }
.tpi-all-card {
  width: min(100%, 760px);
  min-height: 220px;
  border-color: rgba(21,183,200,.72);
  color: white;
  background:
    radial-gradient(circle at 86% 0%, rgba(77,225,193,.28), transparent 18rem),
    linear-gradient(135deg, #071826 0%, #0a3540 100%);
  box-shadow: 0 22px 54px rgba(7,24,38,.22);
}
.tpi-all-card .tpi-exam-kicker { color: var(--mint); }
.tpi-all-card .tpi-exam-meta { color: #c7d9e1; }
.tpi-all-card .tpi-exam-arrow { color: var(--mint); }

.leaders-card {
  align-self: stretch;
  padding: 22px;
  border-radius: 22px;
  color: white;
  background: var(--ink);
  box-shadow: 0 22px 46px rgba(7,24,38,.2);
}
.leaders-heading { margin-bottom: 16px; }
.leaders-heading > span { color: var(--mint); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.leaders-heading h3 { margin: 5px 0 0; font-size: 1.22rem; }
.leaders-card ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.leaders-card li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.leader-position {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ink);
  background: var(--mint);
  font-size: .78rem;
  font-weight: 900;
}
.leader-topic { color: #d7e4eb; font-size: .88rem; line-height: 1.35; }
.leaders-card li strong { font-size: 1.15rem; }

.ranking-card {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(202,219,230,.92);
  border-radius: 24px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 18px 50px rgba(7,24,38,.09);
  scroll-margin-top: 18px;
}
.ranking-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 25px;
}
.ranking-heading h2 { margin: 7px 0 0; font-size: clamp(1.55rem, 3.4vw, 2.35rem); letter-spacing: -.04em; }
.ranking-heading > p { max-width: 470px; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.ranking-list { display: grid; }
.ranking-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px;
  gap: 15px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.ranking-position { color: #9aabb8; font-size: .85rem; font-weight: 850; letter-spacing: .08em; }
.ranking-topic-line { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.ranking-topic h3 { margin: 0; font-size: 1rem; line-height: 1.38; }
.ranking-topic-line strong { flex: 0 0 auto; color: var(--ink-soft); font-size: .84rem; }
.ranking-bar { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #e7eff3; }
.ranking-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-dark), var(--mint)); }
.ranking-percentage { color: var(--cyan-dark); font-size: .86rem; font-weight: 850; text-align: right; }
.ranking-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.ranking-footer > span { color: var(--muted); font-size: .88rem; }

.author-credit {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 30px 20px 18px;
  text-align: center;
}
.author-photo-link {
  position: relative;
  width: 132px;
  height: 132px;
  padding: 0;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.96);
  border-radius: 50%;
  cursor: zoom-in;
  background: #080909;
  box-shadow: 0 16px 34px rgba(7,24,38,.2), 0 0 0 1px rgba(7,24,38,.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.author-photo-link:hover {
  transform: translateY(-3px) scale(1.025);
  box-shadow: 0 20px 42px rgba(7,24,38,.25), 0 0 0 1px rgba(7,24,38,.12);
}
.author-photo-link:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 5px;
}
.author-photo-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 38%;
  transform: scale(1.06);
}
.author-photo-link span {
  position: absolute;
  inset: auto 0 0;
  padding: 8px 6px 10px;
  color: white;
  background: linear-gradient(transparent, rgba(2,10,14,.82));
  font-size: .72rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.author-photo-link:hover span,
.author-photo-link:focus-visible span { opacity: 1; transform: translateY(0); }
.author-credit p { margin: 0; color: var(--ink); font-size: 1.08rem; }
.author-credit strong { font-weight: 850; }

.photo-dialog {
  width: auto;
  max-width: min(92vw, 860px);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 20px;
  color: white;
  background: transparent;
}
.photo-dialog::backdrop {
  background: rgba(3,12,18,.82);
  backdrop-filter: blur(7px);
}
.photo-dialog-content {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #080909;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.photo-dialog-content img {
  display: block;
  width: auto;
  max-width: min(92vw, 860px);
  max-height: calc(92vh - 52px);
  object-fit: contain;
}
.photo-dialog-content p {
  margin: 0;
  padding: 14px 18px;
  color: #eef7f8;
  background: #080909;
  font-size: .92rem;
  font-weight: 750;
  text-align: center;
}
.photo-dialog-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  color: white;
  background: rgba(3,12,18,.78);
  box-shadow: 0 5px 18px rgba(0,0,0,.3);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}
.photo-dialog-close:hover { background: rgba(3,12,18,.96); }
.photo-dialog-close:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 22px;
  align-items: start;
}

.question-card {
  border: 1px solid rgba(202, 219, 230, .9);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.progress-track { height: 6px; background: #dce9ef; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--mint)); transition: width .3s ease; }

.question-body { position: relative; padding: clamp(24px, 4vw, 46px); }
.annulled-corner {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  padding: 7px 12px;
  border: 1px solid #d78585;
  border-radius: 999px;
  color: #9f2929;
  background: var(--wrong-bg);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.annulled-corner:hover { border-color: var(--wrong); box-shadow: 0 0 0 3px rgba(182,66,66,.12); }
.annulment-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; }
.annulment-dialog::backdrop { background: rgba(2,12,19,.72); backdrop-filter: blur(4px); }
.annulment-dialog-card { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.annulment-dialog-card h2 { margin: 7px 42px 10px 0; font-size: 1.45rem; }
.annulment-dialog-card p { margin: 0; color: var(--ink-soft); line-height: 1.68; }
.annulment-kicker { color: var(--wrong); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.annulment-dialog-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--paper); font-size: 1.45rem; line-height: 1; }
.annulment-dialog-close:hover { border-color: var(--cyan); }
.question-body:has(.annulled-corner) .eyebrow { padding-right: 88px; }
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-bottom: 20px;
  color: var(--muted); font-size: .82rem; font-weight: 700;
  letter-spacing: .045em; text-transform: uppercase;
}
.pill { padding: 6px 9px; border-radius: 99px; background: #e7f5f8; color: var(--cyan-dark); }
.pill.reconstructed { color: #775105; background: var(--amber-bg); }

.study-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 18px;
  align-items: center;
  margin: 0 0 22px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f7fafc;
}
.marker-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 13px; }
.tool-title { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .84rem; font-weight: 850; }
.tool-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.marker-colors { display: flex; flex-wrap: wrap; gap: 7px; }
.marker-color, .marker-eraser, .clear-highlights {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: .76rem;
  font-weight: 780;
}
.marker-color:hover, .marker-eraser:hover, .clear-highlights:hover:not(:disabled) { border-color: var(--cyan); transform: translateY(-1px); }
.marker-color > span { width: 13px; height: 13px; border: 1px solid rgba(7,24,38,.18); border-radius: 4px; }
.marker-color.yellow > span { background: #ffe16c; }
.marker-color.red > span { background: #ff9f9f; }
.marker-color.green > span { background: #8ee0b4; }
.marker-color.active { color: var(--ink); border-color: var(--cyan-dark); box-shadow: 0 0 0 3px rgba(21,183,200,.13); transform: translateY(-1px); }
.marker-color.yellow.active { background: #fff7cf; }
.marker-color.red.active { background: #ffe5e5; }
.marker-color.green.active { background: #ddf8e9; }
.marker-eraser svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.marker-eraser.active { color: white; border-color: var(--cyan-dark); background: var(--cyan-dark); box-shadow: 0 0 0 3px rgba(21,183,200,.13); transform: translateY(-1px); }
.clear-highlights:disabled { cursor: not-allowed; opacity: .42; }
.tool-message { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.highlightable-text { cursor: text; user-select: text; -webkit-user-select: text; }
.text-highlight { padding: .06em .04em; border-radius: .16em; color: #19242a; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.text-highlight-yellow { background: #ffe27a; }
.text-highlight-red { background: #ffb0b0; }
.text-highlight-green { background: #9ce7bd; }

.question-text {
  margin: 0 0 26px;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.62;
  letter-spacing: -0.012em;
  white-space: normal;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  hyphens: auto;
  overflow-wrap: break-word;
}

.question-content { display: grid; gap: 22px; margin-bottom: 26px; }
.question-content .question-text, .question-content .structured-table, .question-content .question-image { margin: 0; }
.question-instruction {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  color: var(--ink-soft);
  background: #f0f8fa;
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.55;
}
.assertion-set, .statement-list, .subquestion-list { display: grid; gap: 12px; }
.question-citation {
  margin: 18px 0 22px clamp(16px, 5vw, 56px);
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.assertion-item, .statement-item, .subquestion-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 17px;
  border: 1px solid #cbdde7;
  border-radius: 15px;
  color: var(--ink-soft);
  background: #fbfdfe;
}
.assertion-item > span, .statement-item > span, .subquestion-item > span {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--cyan-dark);
  background: #e5f5f7;
  font-size: .86rem;
  font-weight: 900;
}
.assertion-item p, .statement-item p, .subquestion-item p {
  margin: 3px 0 0;
  font-size: 1rem;
  line-height: 1.58;
}
.assertion-connector {
  justify-self: center;
  padding: 6px 13px;
  border-radius: 99px;
  color: #785307;
  background: var(--amber-bg);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .075em;
}
.subquestion-item { border-color: #b9dfe4; background: #f5fbfc; }
.subquestion-item > span { color: white; background: var(--cyan-dark); text-transform: uppercase; }

.question-image {
  margin: -6px 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #edf3f6;
}
.question-image img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.question-image figcaption { padding: 11px 14px 12px; border-top: 1px solid var(--line); color: var(--muted); background: #f8fbfd; font-size: .82rem; line-height: 1.5; }
.question-image figcaption a { color: var(--cyan-dark); font-weight: 700; }

.structured-table { margin: 0 0 26px; }
.structured-table-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.structured-table-heading h3 { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.35; }
.structured-table-heading p { margin: 4px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.structured-table-heading > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; color: var(--cyan-dark); background: #e7f5f8; font-size: .72rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.structured-table-scroll { overflow-x: auto; border: 1px solid #c7d8e3; border-radius: 14px; background: white; box-shadow: 0 8px 22px rgba(7,24,38,.06); scrollbar-color: #9fb9c8 #edf4f7; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.structured-table-scroll:focus-visible { outline: 3px solid rgba(21,183,200,.28); outline-offset: 3px; }
.structured-table table { width: 100%; min-width: 830px; border-collapse: separate; border-spacing: 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.42; }
.structured-table.compact table { min-width: 560px; }
.structured-table th, .structured-table td { padding: 12px 13px; border-right: 1px solid #d5e2ea; border-bottom: 1px solid #d5e2ea; text-align: left; vertical-align: middle; }
.structured-table th:last-child, .structured-table td:last-child { border-right: 0; }
.structured-table tbody tr:last-child > * { border-bottom: 0; }
.structured-table thead th { color: #12344a; background: #e9f4f8; font-size: .875rem; font-weight: 850; letter-spacing: .01em; }
.structured-table thead th:first-child { position: sticky; left: 0; z-index: 2; }
.structured-table tbody th { position: sticky; left: 0; z-index: 1; color: var(--ink); background: #f6fafc; font-weight: 800; box-shadow: 1px 0 0 #d5e2ea; }
.structured-table tbody tr:nth-child(even) td { background: #fbfdfe; }
.feedback-tables { display: grid; gap: 20px; margin-bottom: 24px; }
.feedback-tables .structured-table { margin: 0; }
.reconstruction-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: baseline;
  margin: -4px 0 18px;
  padding: 13px 15px;
  border: 1px solid #f1d99e;
  border-radius: 13px;
  color: #75500d;
  background: var(--amber-bg);
  font-size: .86rem;
  line-height: 1.45;
}
.reconstruction-note strong { white-space: nowrap; }

.options { display: grid; gap: 12px; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; align-items: stretch; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink-soft);
  background: #fbfdfe;
  text-align: left;
  transition: border-color .16s, background .16s, transform .16s;
}
.option:hover:not(:disabled) { border-color: var(--cyan); background: #f2fbfc; transform: translateY(-1px); }
.option:focus-visible, .option-cut:focus-visible, .marker-color:focus-visible, .marker-eraser:focus-visible, .clear-highlights:focus-visible, .theme-toggle:focus-visible, .primary-button:focus-visible, .ghost-button:focus-visible, .dot:focus-visible, .mobile-question-nav summary:focus-visible, select:focus-visible { outline: 3px solid rgba(21,183,200,.28); outline-offset: 2px; }
.option-letter {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-soft); background: #eaf1f5;
  font-weight: 800;
}
.option-copy { padding-top: 5px; font-size: 1rem; line-height: 1.52; white-space: normal; }
.option-structured-list { display: grid; gap: 8px; }
.option-structured-line {
  display: block;
  padding: 7px 9px;
  border-left: 3px solid #b8d3dc;
  border-radius: 0 8px 8px 0;
  background: rgba(231,245,248,.62);
  line-height: 1.45;
}
.discarded-badge { align-self: center; padding: 4px 7px; border-radius: 8px; color: var(--wrong); background: var(--wrong-bg); font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.option-cut {
  width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface);
  font-size: 1.12rem;
  transition: border-color .16s, color .16s, background .16s, transform .16s;
}
.option-cut:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan-dark); transform: translateY(-1px); }
.option-cut.active { border-color: #efa4a4; color: var(--wrong); background: var(--wrong-bg); }
.option-cut:disabled { cursor: not-allowed; opacity: .38; }
.option.eliminated { border-style: dashed; opacity: .6; }
.option.eliminated .option-copy { text-decoration: line-through 2px; text-decoration-color: var(--wrong); }
.option.eliminated.correct { opacity: 1; }

.discursive-response {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid #bfd7e2;
  border-radius: 16px;
  background: #f7fbfd;
}
.discursive-response label { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.discursive-response label strong { color: var(--ink); font-size: 1rem; }
.discursive-response label span { color: var(--muted); font-size: .82rem; line-height: 1.4; text-align: right; }
.discursive-response textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid #b8cfdb;
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: 1rem;
  line-height: 1.58;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.discursive-response textarea::placeholder { color: #94a5b1; }
.discursive-response textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(21,183,200,.16); }
.discursive-response.is-revealed { border-color: #a9d8c6; background: #f3fbf7; }
.discursive-response textarea[readonly] { color: var(--ink-soft); background: #fbfffd; cursor: default; }
.option.selected { border-color: var(--cyan); background: #eefbfd; box-shadow: 0 0 0 2px rgba(21,183,200,.1); }
.option.selected .option-letter { color: white; background: var(--cyan-dark); }
.option.correct { border-color: #7fd4ba; background: var(--correct-bg); }
.option.correct .option-letter { color: white; background: var(--correct); }
.option.wrong { border-color: #efaaa5; background: var(--wrong-bg); }
.option.wrong .option-letter { color: white; background: var(--wrong); }

.action-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 24px; }
.primary-button {
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 13px;
  color: white; background: var(--ink); font-weight: 750;
  box-shadow: 0 10px 24px rgba(7,24,38,.18);
}
.primary-button:hover:not(:disabled) { background: #11344a; }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.keyboard-hint { color: var(--muted); font-size: .82rem; }

.feedback {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  animation: reveal .28s ease both;
}
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.result-banner { display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px; border-radius: 14px; margin-bottom: 22px; }
.result-banner.correct { color: #075640; background: var(--correct-bg); }
.result-banner.wrong { color: #8f2f2f; background: var(--wrong-bg); }
.result-banner.neutral { color: #704504; background: var(--amber-bg); }
.result-banner strong { display: block; margin-bottom: 2px; }
.result-icon { flex: 0 0 auto; width: 25px; height: 25px; }
.original-answer { margin: 0 0 24px; padding: 17px 19px; border-left: 4px solid var(--cyan); border-radius: 0 12px 12px 0; background: #f2f9fb; }
.original-answer h3, .alternatives-review h3 { margin: 0 0 9px; font-size: 1rem; }
.original-answer p { margin: 0; color: var(--ink-soft); line-height: 1.62; white-space: pre-line; }

.update-note { margin: 0 0 24px; padding: 16px 18px; border: 1px solid #f0d694; border-radius: 13px; color: #684706; background: var(--amber-bg); }
.update-note strong { display: block; margin-bottom: 5px; }
.update-note p { margin: 0; line-height: 1.56; }

.alternatives-review { margin-top: 24px; }
.review-section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.review-section-heading h3 { margin-bottom: 4px; }
.review-section-heading p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.48; }
.review-section-heading > span { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; color: var(--cyan-dark); background: #e7f5f8; font-size: .75rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.review-list { display: grid; gap: 10px; }
.review-item { padding: 17px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; }
.review-item.correct-review { border-color: #a9ddcc; background: linear-gradient(180deg, #fbfffd, var(--correct-bg)); }
.review-item.wrong-review { border-color: #efcbc7; }
.review-item-head { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; font-weight: 800; }
.review-letter { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--ink); }
.review-tag { padding: 4px 8px; border-radius: 8px; font-size: .76rem; }
.review-tag.is-correct { color: var(--correct); background: var(--correct-bg); }
.review-tag.is-wrong { color: var(--wrong); background: var(--wrong-bg); }
.review-option-text { margin: 9px 0 14px; padding: 11px 13px; border-radius: 10px; color: var(--ink); background: rgba(222, 234, 241, .52); font-weight: 720; line-height: 1.5; }
.analysis-block { padding-top: 2px; }
.analysis-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .76rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.review-item p { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.65; }
.sources { margin-top: 21px; padding-top: 17px; border-top: 1px dashed var(--line); }
.sources summary { cursor: pointer; color: var(--cyan-dark); font-weight: 750; }
.sources ul { margin: 12px 0 0; padding-left: 20px; }
.sources li + li { margin-top: 7px; }
.sources a { color: var(--cyan-dark); overflow-wrap: anywhere; }

.sidebar { display: grid; gap: 14px; position: sticky; top: 20px; }
.side-card { padding: 20px; border: 1px solid rgba(202,219,230,.92); border-radius: 19px; background: rgba(255,255,255,.84); backdrop-filter: blur(10px); }
.side-title { margin: 0 0 14px; font-size: .86rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.score-box { min-width: 0; padding: 13px 7px; border: 1px solid transparent; border-radius: 13px; color: var(--ink); background: #edf4f7; text-align: center; }
.score-box:hover { border-color: var(--cyan); transform: translateY(-1px); }
.score-box:focus-visible { outline: 3px solid rgba(21,183,200,.24); outline-offset: 2px; }
.score-box strong { display: block; font-size: 1.35rem; line-height: 1; }
.score-box span { color: var(--muted); font-size: .78rem; }
.score-box.hit strong { color: var(--correct); }
.score-box.miss strong { color: var(--wrong); }
.score-box.pending strong { color: var(--amber); }
.performance-dialog { width: min(760px, calc(100% - 28px)); max-height: min(78vh, 760px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; }
.performance-dialog::backdrop { background: rgba(2,12,19,.72); backdrop-filter: blur(4px); }
.performance-dialog-card { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.performance-dialog-card h2 { margin: 7px 44px 18px 0; font-size: clamp(1.35rem, 3vw, 1.75rem); }
.performance-dialog-kicker { color: var(--cyan-dark); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.performance-dialog-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--paper); font-size: 1.45rem; line-height: 1; }
.performance-dialog-close:hover { border-color: var(--cyan); }
.performance-list { display: grid; gap: 9px; max-height: 54vh; margin: 0; padding: 2px 4px 2px 24px; overflow-y: auto; }
.performance-list li::marker { color: var(--muted); font-weight: 800; }
.performance-list button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #f8fbfd; text-align: left; }
.performance-list button:hover { border-color: var(--cyan); background: #f0fafb; }
.performance-question-label { min-width: 0; display: grid; gap: 3px; }
.performance-question-label strong { font-size: .95rem; }
.performance-question-label small { color: var(--muted); overflow-wrap: anywhere; }
.performance-topic { max-width: 245px; padding: 6px 9px; border-radius: 9px; color: var(--cyan-dark); background: #e7f5f8; font-size: .74rem; font-weight: 760; line-height: 1.3; text-align: right; }
.performance-empty { margin: 0; padding: 22px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.custom-quiz-dialog { width: min(860px, calc(100% - 28px)); max-height: min(92vh, 900px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: transparent; }
.custom-quiz-dialog::backdrop { background: rgba(2,12,19,.76); backdrop-filter: blur(5px); }
.custom-quiz-card { position: relative; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.custom-quiz-close { position: absolute; top: 15px; right: 15px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--paper); font-size: 1.5rem; line-height: 1; }
.custom-quiz-close:hover { border-color: var(--cyan); }
.custom-quiz-kicker { color: var(--cyan-dark); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.custom-quiz-card h2 { margin: 7px 48px 8px 0; font-size: clamp(1.55rem, 4vw, 2.15rem); letter-spacing: -.035em; }
.custom-quiz-intro { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.builder-source-fieldset { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 17px; padding: 0; border: 0; }
.builder-source-fieldset legend { width: 100%; margin-bottom: 8px; color: var(--ink-soft); font-size: .84rem; font-weight: 820; }
.builder-source-fieldset label { position: relative; }
.builder-source-fieldset input { position: absolute; opacity: 0; pointer-events: none; }
.builder-source-fieldset span { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: var(--paper); font-size: .86rem; font-weight: 740; cursor: pointer; }
.builder-source-fieldset input:checked + span { border-color: var(--cyan); color: var(--cyan-dark); background: #e7f5f8; box-shadow: 0 0 0 2px rgba(21,183,200,.11); }
.builder-source-fieldset input:focus-visible + span { outline: 3px solid rgba(21,183,200,.22); outline-offset: 2px; }
.builder-exam-section { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #f8fbfd; }
.builder-exam-heading { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 11px; }
.builder-exam-heading > div:first-child { display: grid; gap: 3px; }
.builder-exam-heading > div:first-child > strong { font-size: .88rem; }
.builder-exam-heading > div:first-child > span { color: var(--muted); font-size: .76rem; }
.builder-exam-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 210px; padding: 2px; overflow-y: auto; }
.builder-exam-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.builder-exam-row:hover { border-color: #9fc8d0; }
.builder-exam-row:has(input:checked) { border-color: var(--cyan); background: #effbfc; box-shadow: 0 0 0 2px rgba(21,183,200,.09); }
.builder-exam-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--cyan-dark); }
.builder-exam-row > span { min-width: 0; display: grid; gap: 2px; }
.builder-exam-row strong { overflow: hidden; color: var(--ink-soft); font-size: .8rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.builder-exam-row small { color: var(--muted); font-size: .7rem; }
.builder-topic-toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.builder-search { flex: 1; }
.builder-search input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); }
.builder-search input:focus { outline: 3px solid rgba(21,183,200,.16); border-color: var(--cyan); }
.builder-selection-actions { display: flex; gap: 7px; }
.builder-selection-actions button { min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--paper); font-size: .78rem; font-weight: 740; }
.builder-selection-actions button:hover { border-color: var(--cyan); }
.builder-topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 330px; padding: 3px; overflow-y: auto; }
.builder-topic-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; cursor: pointer; }
.builder-topic-row:hover { border-color: #9fc8d0; }
.builder-topic-row:has(input:checked) { border-color: var(--cyan); background: #effbfc; box-shadow: 0 0 0 2px rgba(21,183,200,.1); }
.builder-topic-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--cyan-dark); }
.builder-topic-name { min-width: 0; color: var(--ink-soft); font-size: .86rem; font-weight: 680; line-height: 1.35; }
.builder-topic-row > strong { min-width: 28px; padding: 5px 7px; border-radius: 8px; color: var(--cyan-dark); background: #e7f5f8; font-size: .76rem; text-align: center; }
.builder-pack-row { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.builder-pack-row label { display: grid; gap: 3px; }
.builder-pack-row label strong { font-size: .92rem; }
.builder-pack-row label span { color: var(--muted); font-size: .78rem; }
.builder-pack-row select { min-width: 190px; }
.builder-footer { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 18px; }
.builder-footer p { margin: 0; color: var(--muted); font-size: .86rem; }
.builder-footer .primary-button { flex: 0 0 auto; }
.stat-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--muted); font-size: .89rem; }
.stat-line + .stat-line { border-top: 1px solid var(--line); }
.stat-line strong { color: var(--ink-soft); }
.question-nav-hint { margin: -6px 0 12px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.question-dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-height: 300px;
  padding: 3px;
  overflow-y: auto;
  scrollbar-color: #aec4d2 transparent;
  scrollbar-width: thin;
}
.dot {
  position: relative;
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px;
  display: grid; place-items: center; color: var(--muted); background: white;
  min-width: 0; padding: 0; font-size: .75rem; font-weight: 750;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}
.annulled-number-mark {
  position: absolute;
  top: 1px;
  right: 4px;
  color: var(--wrong);
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
}
.dot.current .annulled-number-mark { color: #ffceca; }
.question-annulled-mark { margin-left: 2px; color: var(--wrong); font-size: .95em; font-weight: 950; }
.dot:hover { color: var(--cyan-dark); border-color: var(--cyan); background: #eefbfd; transform: translateY(-1px); }
.dot.done { color: var(--correct); border-color: #a5dec9; background: var(--correct-bg); }
.dot.done-wrong { color: var(--wrong); border-color: #efaaa5; background: var(--wrong-bg); }
.dot.current { color: white; border-color: var(--ink); background: var(--ink); box-shadow: 0 0 0 2px white, 0 0 0 4px rgba(7,24,38,.22); transform: scale(1.04); }

.mobile-question-nav { display: none; }
.mobile-question-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--ink-soft);
  font-weight: 800;
}
.mobile-question-nav summary::-webkit-details-marker { display: none; }
.mobile-question-nav summary strong { color: var(--cyan-dark); font-size: .84rem; }
.mobile-question-nav > p { margin: 7px 0 0; color: var(--muted); font-size: .78rem; }
.mobile-question-nav[open] .question-dots { margin-top: 13px; }

.source-note-label { display: block; margin-bottom: 7px; color: var(--cyan-dark); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.source-note strong { font-size: 1.05rem; }
.source-note p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.empty-state, .final-state { padding: clamp(35px, 8vw, 90px) 24px; text-align: center; }
.empty-state h2, .final-state h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 4vw, 2.3rem); }
.empty-state p, .final-state p { max-width: 570px; margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }
.final-score { font-size: clamp(3rem, 9vw, 5.4rem); font-weight: 850; letter-spacing: -.07em; color: var(--cyan-dark); }

@media (max-width: 1000px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .select-wrap { flex: 1; }
  select { width: 100%; max-width: none; }
}

@media (max-width: 860px) {
  .home-hero { grid-template-columns: 1fr; }
  .tpi-exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .periods-heading { align-items: start; flex-direction: column; }
  .leaders-card { max-width: none; }
  .ranking-heading { align-items: start; flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .question-nav-card { display: none; }
  .mobile-question-nav {
    display: block;
    margin: 16px 16px 0;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbfd;
  }
  .mobile-question-nav .question-dots { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); max-height: 240px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 14px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-leading { width: 100%; }
  .theme-toggle { width: 44px; padding: 0; justify-content: center; }
  .theme-toggle > span { display: none; }
  .brand { min-width: 0; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .top-actions > .ghost-button { flex: 1; }
  .select-wrap { flex: 1; }
  select { width: 100%; max-width: none; }
  .question-card { border-radius: 18px; }
  .home-hero, .ranking-card { border-radius: 18px; }
  .periods-heading { padding: 25px 19px; border-radius: 18px; }
  .period-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
  .period-card { padding: 20px; border-radius: 20px; }
  .tpi-period-card { width: 100%; aspect-ratio: auto; min-height: 330px; }
  .tpi-exam-grid { grid-template-columns: 1fr; gap: 12px; }
  .tpi-exam-card { min-height: 190px; padding: 20px; border-radius: 20px; }
  .tpi-all-card { min-height: 215px; }
  .n1-assessment-shell { border-radius: 20px; }
  .n1-assessment-toggle { padding: 23px 19px; }
  .n1-toggle-symbol { width: 42px; height: 42px; }
  .n1-expanded-content { padding: 13px; }
  .n1-subject-section { padding: 16px 13px; border-radius: 17px; }
  .n1-subject-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .n1-inline-exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .n1-period-actions { grid-template-columns: 1fr; }
  .home-hero { padding: 25px 19px; }
  .home-copy h2 { font-size: clamp(2.15rem, 13vw, 3.3rem); }
  .home-actions { align-items: stretch; flex-direction: column; }
  .home-actions > * { width: 100%; }
  .home-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .home-stats > div { min-width: 0; padding: 12px 9px; }
  .home-stats strong { font-size: 1.25rem; }
  .ranking-card { padding: 23px 17px; }
  .ranking-row { grid-template-columns: 35px minmax(0, 1fr); gap: 10px; }
  .ranking-percentage { display: none; }
  .ranking-topic-line { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ranking-footer { align-items: stretch; flex-direction: column; }
  .ranking-footer .primary-button { width: 100%; }
  .mobile-question-nav { margin: 12px 12px 0; }
  .question-body { padding: 22px 17px 25px; }
  .study-tools { grid-template-columns: 1fr; padding: 12px; }
  .marker-tool { align-items: flex-start; flex-direction: column; }
  .marker-colors { width: 100%; }
  .marker-color, .marker-eraser { flex: 1; justify-content: center; min-width: 82px; }
  .clear-highlights { flex: 1; justify-content: center; }
  .assertion-item, .statement-item, .subquestion-item { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; gap: 10px; }
  .assertion-item > span, .statement-item > span, .subquestion-item > span { width: 32px; min-height: 32px; }
  .discursive-response { padding: 14px; }
  .discursive-response label { align-items: flex-start; flex-direction: column; gap: 3px; }
  .discursive-response label span { text-align: left; }
  .performance-dialog-card { padding: 23px 17px; }
  .performance-list { padding-left: 20px; }
  .performance-list button { grid-template-columns: 1fr; gap: 8px; }
  .performance-topic { max-width: none; text-align: left; }
  .custom-quiz-dialog { width: calc(100% - 16px); }
  .custom-quiz-card { padding: 22px 15px; }
  .builder-exam-heading, .builder-topic-toolbar, .builder-pack-row, .builder-footer { align-items: stretch; flex-direction: column; }
  .builder-selection-actions { width: 100%; }
  .builder-selection-actions button { flex: 1; }
  .builder-exam-list { grid-template-columns: 1fr; max-height: 235px; }
  .builder-topic-list { grid-template-columns: 1fr; max-height: 300px; }
  .builder-pack-row select, .builder-footer .primary-button { width: 100%; }
  .option-row { grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; }
  .option { grid-template-columns: 36px minmax(0,1fr) auto; padding: 13px; gap: 10px; }
  .option-letter { width: 32px; height: 32px; }
  .option-cut { width: 42px; min-height: 42px; }
  .discarded-badge { width: 10px; height: 10px; align-self: center; padding: 0; overflow: hidden; border-radius: 50%; color: transparent; }
  .action-row { align-items: stretch; flex-direction: column-reverse; }
  .primary-button { width: 100%; }
  .keyboard-hint { text-align: center; }
  .reconstruction-note { grid-template-columns: 1fr; gap: 3px; }
  .review-section-heading { display: block; }
  .review-section-heading > span { display: inline-block; margin-top: 9px; }
  .review-item { padding: 15px; }
  .sidebar { grid-template-columns: 1fr; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eaf4f8;
  --ink-soft: #c7d7df;
  --paper: #07131d;
  --surface: #102431;
  --line: #294554;
  --muted: #9db1bc;
  --cyan: #42cbd9;
  --cyan-dark: #72d9e3;
  --mint: #4de1c1;
  --correct: #66dab0;
  --correct-bg: #0d3329;
  --wrong: #ff9999;
  --wrong-bg: #3b2026;
  --amber: #f3bc58;
  --amber-bg: #3a2c12;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 0%, rgba(21, 183, 200, .13), transparent 30rem),
    linear-gradient(180deg, #06111a 0%, var(--paper) 38%, #091823 100%);
}
:root[data-theme="dark"] .brand-mark { color: var(--mint); background: #071826; box-shadow: 0 10px 25px rgba(0,0,0,.35); }
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .marker-color,
:root[data-theme="dark"] .marker-eraser,
:root[data-theme="dark"] .clear-highlights,
:root[data-theme="dark"] .option-cut { background: #102431; }
:root[data-theme="dark"] .ghost-button:hover { background: #173442; }
:root[data-theme="dark"] .home-hero {
  border-color: #294554;
  background:
    radial-gradient(circle at 92% 12%, rgba(77,225,193,.12), transparent 18rem),
    linear-gradient(135deg, #102431 0%, #0c202c 64%, #0b292d 100%);
}
:root[data-theme="dark"] .periods-heading {
  border-color: #294554;
  background:
    radial-gradient(circle at 92% 0%, rgba(77,225,193,.12), transparent 22rem),
    linear-gradient(135deg, #102431 0%, #0c202c 100%);
}
:root[data-theme="dark"] .period-card { border-color: #294554; background: rgba(14,32,44,.9); box-shadow: 0 14px 34px rgba(0,0,0,.2); }
:root[data-theme="dark"] .period-card:hover { border-color: #3d6577; }
:root[data-theme="dark"] .period-card.available {
  border-color: #2d8491;
  background:
    radial-gradient(circle at 105% -5%, rgba(77,225,193,.15), transparent 12rem),
    linear-gradient(145deg, #102a36 0%, #0c292d 100%);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
:root[data-theme="dark"] .period-status { color: #9df3db; background: rgba(24,115,101,.42); }
:root[data-theme="dark"] .period-coming-soon { color: #78909e; }
:root[data-theme="dark"] .period-simulado { border-color: #315162; background: #071826; }
:root[data-theme="dark"] .period-simulado:hover { background: #0b3442; }
:root[data-theme="dark"] .tpi-exam-card {
  border-color: #294554;
  color: #f3f8fb;
  background:
    radial-gradient(circle at 105% -10%, rgba(77,225,193,.11), transparent 11rem),
    rgba(14,32,44,.94);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
:root[data-theme="dark"] .tpi-exam-card:hover { border-color: #3d8490; }
:root[data-theme="dark"] .n1-component-name { color: #b8cbd5; }
:root[data-theme="dark"] .n1-component-card.is-unavailable:hover { border-color: #294554; }
:root[data-theme="dark"] .n1-empty-card { border-color: #315162; background: rgba(14,32,44,.78); }
:root[data-theme="dark"] .n1-assessment-shell { border-color: #2d6772; background: rgba(14,32,44,.92); box-shadow: 0 18px 44px rgba(0,0,0,.26); }
:root[data-theme="dark"] .n1-assessment-shell.is-expanded { border-color: #2d8491; }
:root[data-theme="dark"] .n1-assessment-toggle { background: radial-gradient(circle at 88% 0%, rgba(77,225,193,.16), transparent 19rem), linear-gradient(135deg, #06131d, #0a3039); }
:root[data-theme="dark"] .n1-subject-section { border-color: #315162; background: #0b1d29; }
:root[data-theme="dark"] .n1-subject-section.is-available { border-color: #2d5962; background: linear-gradient(145deg, #0b1d29, #0c292d); }
:root[data-theme="dark"] .n1-subject-heading > strong { color: #9ae8ee; background: #153642; }
:root[data-theme="dark"] .n1-inline-exam,
:root[data-theme="dark"] .n1-subject-empty { border-color: #315162; color: var(--ink); background: #102431; }
:root[data-theme="dark"] .n1-inline-exam:hover { border-color: var(--cyan); }
:root[data-theme="dark"] .n1-combined-action { border-color: #315162; color: var(--ink); background: #102b35; }
:root[data-theme="dark"] .n1-combined-action.primary { color: white; border-color: #2d8491; background: linear-gradient(135deg, #06131d, #0a3039); }
:root[data-theme="dark"] .tpi-all-card {
  border-color: #2d8491;
  background:
    radial-gradient(circle at 86% 0%, rgba(77,225,193,.18), transparent 18rem),
    linear-gradient(135deg, #06131d 0%, #0a3039 100%);
}
:root[data-theme="dark"] .home-stats > div { border-color: #294554; background: rgba(17,42,55,.78); }
:root[data-theme="dark"] .leaders-card { color: white; background: #081b27; box-shadow: 0 22px 46px rgba(0,0,0,.34); }
:root[data-theme="dark"] .leader-position { color: #071826; }
:root[data-theme="dark"] .ranking-card,
:root[data-theme="dark"] .question-card { border-color: #294554; background: rgba(14,32,44,.97); }
:root[data-theme="dark"] .annulled-corner { color: #ffc0c0; border-color: #88484e; background: var(--wrong-bg); }
:root[data-theme="dark"] .annulment-dialog-card { border-color: #294554; background: #0d202c; }
:root[data-theme="dark"] .annulment-dialog-close { border-color: #315162; color: var(--ink); background: #17313e; }
:root[data-theme="dark"] .ranking-bar { background: #243d4b; }
:root[data-theme="dark"] .progress-track { background: #243d4b; }
:root[data-theme="dark"] .pill { color: #9ae8ee; background: #153642; }
:root[data-theme="dark"] .pill.reconstructed { color: #ffe0a1; background: var(--amber-bg); }
:root[data-theme="dark"] .study-tools { border-color: #294554; background: #0b1d29; }
:root[data-theme="dark"] .marker-color.active { color: white; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(66,203,217,.16); }
:root[data-theme="dark"] .marker-color.yellow.active { background: #4a411f; }
:root[data-theme="dark"] .marker-color.red.active { background: #512c32; }
:root[data-theme="dark"] .marker-color.green.active { background: #173f35; }
:root[data-theme="dark"] .marker-eraser.active { color: #071826; border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 0 3px rgba(66,203,217,.16); }
:root[data-theme="dark"] .question-instruction { color: var(--ink-soft); background: #102a36; }
:root[data-theme="dark"] .assertion-item,
:root[data-theme="dark"] .statement-item,
:root[data-theme="dark"] .subquestion-item { border-color: #315162; color: var(--ink-soft); background: #0c202c; }
:root[data-theme="dark"] .assertion-item > span,
:root[data-theme="dark"] .statement-item > span { color: #8ce7ed; background: #173743; }
:root[data-theme="dark"] .subquestion-item { border-color: #2d5962; background: #0c252d; }
:root[data-theme="dark"] .subquestion-item > span { color: white; background: #087b8a; }
:root[data-theme="dark"] .question-image { border-color: #294554; background: #091822; }
:root[data-theme="dark"] .question-image figcaption { border-color: #294554; background: #0b1d29; }
:root[data-theme="dark"] .structured-table-heading h3 { color: var(--ink); }
:root[data-theme="dark"] .structured-table-heading > span,
:root[data-theme="dark"] .review-section-heading > span { color: #9ae8ee; background: #153642; }
:root[data-theme="dark"] .structured-table-scroll { border-color: #315162; background: #0d202c; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
:root[data-theme="dark"] .structured-table table { color: var(--ink-soft); }
:root[data-theme="dark"] .structured-table th,
:root[data-theme="dark"] .structured-table td { border-color: #294554; }
:root[data-theme="dark"] .structured-table thead th { color: var(--ink); background: #173542; }
:root[data-theme="dark"] .structured-table tbody th { color: var(--ink); background: #112936; box-shadow: 1px 0 0 #294554; }
:root[data-theme="dark"] .structured-table tbody tr:nth-child(even) td { background: #10232f; }
:root[data-theme="dark"] .reconstruction-note,
:root[data-theme="dark"] .update-note { border-color: #725c27; color: #ffe0a1; background: var(--amber-bg); }
:root[data-theme="dark"] .option { border-color: #294554; color: var(--ink-soft); background: #0d202c; }
:root[data-theme="dark"] .option-structured-line { border-left-color: #2e6977; background: rgba(18,55,67,.72); }
:root[data-theme="dark"] .option:hover:not(:disabled) { border-color: var(--cyan); background: #102b35; }
:root[data-theme="dark"] .option-letter { color: var(--ink-soft); background: #203744; }
:root[data-theme="dark"] .option.selected { border-color: var(--cyan); background: #10313c; box-shadow: 0 0 0 2px rgba(66,203,217,.12); }
:root[data-theme="dark"] .option.selected .option-letter { color: white; background: #087b8a; }
:root[data-theme="dark"] .option.correct { border-color: #367e68; background: var(--correct-bg); }
:root[data-theme="dark"] .option.wrong { border-color: #88484e; background: var(--wrong-bg); }
:root[data-theme="dark"] .discursive-response { border-color: #315162; background: #0b1e29; }
:root[data-theme="dark"] .discursive-response textarea { border-color: #315162; color: var(--ink); background: #0d202c; }
:root[data-theme="dark"] .discursive-response textarea::placeholder { color: #78909e; }
:root[data-theme="dark"] .discursive-response.is-revealed { border-color: #356e5b; background: #0c2822; }
:root[data-theme="dark"] .discursive-response textarea[readonly] { color: var(--ink-soft); background: #10251f; }
:root[data-theme="dark"] .primary-button { color: white; background: #153b50; box-shadow: 0 10px 24px rgba(0,0,0,.26); }
:root[data-theme="dark"] .primary-button:hover:not(:disabled) { background: #1c4b62; }
:root[data-theme="dark"] .result-banner.correct { color: #a9f0d1; }
:root[data-theme="dark"] .result-banner.wrong { color: #ffc0c0; }
:root[data-theme="dark"] .result-banner.neutral { color: #ffe0a1; }
:root[data-theme="dark"] .original-answer { background: #102a36; }
:root[data-theme="dark"] .review-item { border-color: #294554; background: #0d202c; }
:root[data-theme="dark"] .review-item.correct-review { border-color: #356e5b; background: linear-gradient(180deg, #10271f, var(--correct-bg)); }
:root[data-theme="dark"] .review-item.wrong-review { border-color: #694047; }
:root[data-theme="dark"] .review-letter { color: white; background: #173b4d; }
:root[data-theme="dark"] .review-option-text { color: var(--ink); background: rgba(66,91,104,.38); }
:root[data-theme="dark"] .side-card { border-color: #294554; background: rgba(14,32,44,.9); }
:root[data-theme="dark"] .score-box { background: #172e3b; }
:root[data-theme="dark"] .performance-dialog-card { border-color: #294554; background: #0d202c; }
:root[data-theme="dark"] .performance-dialog-close { border-color: #315162; color: var(--ink); background: #17313e; }
:root[data-theme="dark"] .performance-list button { border-color: #294554; color: var(--ink); background: #0b1d29; }
:root[data-theme="dark"] .performance-list button:hover { border-color: var(--cyan); background: #102b35; }
:root[data-theme="dark"] .performance-topic { color: #9ae8ee; background: #153642; }
:root[data-theme="dark"] .custom-quiz-card { border-color: #294554; background: #0d202c; }
:root[data-theme="dark"] .custom-quiz-close,
:root[data-theme="dark"] .builder-selection-actions button { border-color: #315162; color: var(--ink); background: #17313e; }
:root[data-theme="dark"] .builder-source-fieldset span { border-color: #315162; color: var(--ink-soft); background: #102431; }
:root[data-theme="dark"] .builder-source-fieldset input:checked + span { border-color: var(--cyan); color: #9ae8ee; background: #153642; }
:root[data-theme="dark"] .builder-exam-section { border-color: #315162; background: #0b1d29; }
:root[data-theme="dark"] .builder-exam-row { border-color: #294554; background: #102431; }
:root[data-theme="dark"] .builder-exam-row:has(input:checked) { border-color: var(--cyan); background: #102b35; }
:root[data-theme="dark"] .builder-search input { border-color: #315162; color: var(--ink); background: #0b1d29; }
:root[data-theme="dark"] .builder-topic-row { border-color: #294554; background: #0b1d29; }
:root[data-theme="dark"] .builder-topic-row:has(input:checked) { border-color: var(--cyan); background: #102b35; }
:root[data-theme="dark"] .builder-topic-row > strong { color: #9ae8ee; background: #153642; }
:root[data-theme="dark"] .dot { color: var(--muted); background: #102431; }
:root[data-theme="dark"] .dot:hover { color: #9ae8ee; border-color: var(--cyan); background: #12303a; }
:root[data-theme="dark"] .dot.current { color: white; border-color: #315f75; background: #173b4d; box-shadow: 0 0 0 2px #0d202c, 0 0 0 4px rgba(66,203,217,.26); }
:root[data-theme="dark"] .mobile-question-nav { border-color: #294554; background: #0b1d29; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.option-figures { display: block; margin-top: .75rem; }
.option-image { display: block; max-width: 100%; width: min(100%, 36rem); height: auto; margin: .5rem 0; border-radius: .5rem; background: white; }
.exam-documents { margin: 1rem 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); color: var(--ink); }
.exam-documents > summary { cursor: pointer; font-size: 1rem; font-weight: 700; }
.exam-documents p, .exam-documents li { font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.exam-resource { margin: 1rem 0; }
.exam-resource summary { cursor: pointer; font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }
.exam-resource p { white-space: pre-line; }
.written-review-note { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; margin: 0 0 1rem; }
