:root {
  color-scheme: dark;
  --black: #050608;
  --ink: #0b1015;
  --panel: #101820;
  --panel-2: #16222c;
  --line: #2b3945;
  --text: #fffdfa;
  --muted: #a9b6bf;
  --amber: #f6b53f;
  --teal: #0e7c86;
  --teal-soft: #62c7cf;
  --green: #35c46f;
  --green-dark: #123f2a;
  --red: #ff5c5c;
  --red-dark: #4a171c;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(246, 181, 63, 0.12), transparent 30%),
    linear-gradient(180deg, #080b0f 0%, var(--black) 52%, #070a0d 100%);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(16px, 5vw, 64px);
  background: rgba(5, 6, 8, 0.86);
  border-bottom: 1px solid rgba(246, 181, 63, 0.24);
  backdrop-filter: blur(14px);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 13px;
  min-width: 0;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
}

.brand-mark svg {
  display: block;
  width: 48px;
  height: 48px;
}

.brand-mark rect,
.mini-logo rect,
.footer-mark rect {
  fill: var(--amber);
  stroke: var(--text);
  stroke-width: 7px;
}

.brand-mark path,
.mini-logo path,
.footer-mark path {
  fill: var(--ink);
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-size: clamp(1.08rem, 2vw, 1.42rem);
  line-height: 1.06;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.site-nav {
  gap: 8px;
}

.site-nav a {
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 850;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(246, 181, 63, 0.1);
  color: var(--text);
}

.button,
.site-nav .nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 2px solid var(--amber);
  border-radius: 8px;
  background: var(--amber);
  color: var(--ink);
  padding: 12px 18px;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(246, 181, 63, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.site-nav .nav-action:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(246, 181, 63, 0.14);
}

.button.alt {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  box-shadow: none;
}

.button.topic-cta {
  background: rgba(16, 24, 32, 0.96);
  color: var(--text);
  border-color: rgba(98, 199, 207, 0.86);
  box-shadow: 5px 5px 0 rgba(98, 199, 207, 0.16);
}

.button.topic-cta:hover {
  background: rgba(98, 199, 207, 0.14);
  color: var(--white);
  box-shadow: 7px 7px 0 rgba(98, 199, 207, 0.14);
}

.button.alt:disabled {
  cursor: not-allowed;
  opacity: 0.66;
  transform: none;
}

.button:focus-visible,
.button.finish-ready {
  outline: 4px solid rgba(255, 200, 87, 0.45);
  outline-offset: 4px;
  box-shadow: 0 0 0 5px rgba(246, 181, 63, 0.14), 7px 7px 0 rgba(246, 181, 63, 0.14);
}

.button.finish-ready {
  animation: finishPulse 900ms ease both;
}

@keyframes finishPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.button.full {
  width: 100%;
  min-height: 62px;
  font-size: 1.08rem;
}

.menu-button {
  display: none;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 11px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.menu-button span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 3px 0;
  background: var(--text);
  border-radius: 99px;
}

.home-hero,
.test-hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(14, 124, 134, 0.18), transparent 46%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 18px);
}

.home-hero-grid,
.test-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(48px, 8vw, 88px) 0;
}

.test-hero-grid {
  min-height: 520px;
}

.test-hero h1 {
  max-width: 820px;
  font-size: clamp(2.55rem, 5.4vw, 5rem);
}

.bs-hero {
  background:
    linear-gradient(112deg, rgba(220, 94, 18, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(14, 124, 134, 0.12), transparent 64%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 18px);
}

.bs-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 390px);
}

.book-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.book-hero img {
  display: block;
  width: min(100%, 330px);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

.book-count {
  display: grid;
  gap: 5px;
  width: min(100%, 330px);
  border: 1px solid rgba(246, 181, 63, 0.54);
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.92);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.book-count span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.book-count strong {
  color: var(--amber);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1;
}

.book-count p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.hero-copy {
  max-width: 840px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 18px;
  border: 1px solid rgba(246, 181, 63, 0.36);
  border-radius: 999px;
  background: rgba(246, 181, 63, 0.1);
  color: var(--amber);
  padding: 7px 12px;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal-soft);
}

.eyebrow.small {
  margin-bottom: 12px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--teal-soft);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  max-width: 870px;
  margin-bottom: 22px;
  font-size: clamp(3.2rem, 7.6vw, 6.8rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
}

.intro,
.setup-copy {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  font-weight: 650;
}

.revision-promise {
  display: grid;
  gap: 8px;
  max-width: 610px;
  margin-top: 22px;
  border-left: 4px solid var(--amber);
  background: rgba(246, 181, 63, 0.1);
  padding: 16px 18px;
}

.revision-promise strong {
  color: var(--amber);
  font-weight: 900;
}

.revision-promise p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.hero-cta {
  width: fit-content;
  margin-top: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 26px;
}

.hero-actions .hero-cta {
  margin-top: 0;
}

.hero-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 390px;
  border: 2px solid rgba(246, 181, 63, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(246, 181, 63, 0.18), rgba(14, 124, 134, 0.14)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 36px);
}

.mini-logo {
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
}

.mini-logo svg {
  width: 116px;
  height: 116px;
}

.line-card {
  min-height: 22px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.16);
}

.line-card.wide {
  width: 100%;
  background: rgba(246, 181, 63, 0.56);
}

.line-card {
  width: 78%;
}

.line-card.short {
  width: 54%;
  background: rgba(14, 124, 134, 0.58);
}

.quiz-picker,
.setup-section,
.content-section {
  padding: clamp(42px, 7vw, 76px) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
}

.quiz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.9fr));
  gap: 16px;
}

.quiz-grid.two-live {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-card,
.quiz-panel,
.test-summary,
.note-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.92);
  box-shadow: var(--shadow);
}

.quiz-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 330px;
  padding: clamp(20px, 3vw, 28px);
}

.quiz-card.live {
  border: 2px solid rgba(246, 181, 63, 0.76);
  background:
    linear-gradient(145deg, rgba(246, 181, 63, 0.16), rgba(16, 24, 32, 0.94) 42%),
    var(--panel);
}

.quiz-card.muted {
  opacity: 0.72;
}

.quiz-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
}

.status {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 18px;
  border: 1px solid rgba(246, 181, 63, 0.7);
  border-radius: 999px;
  background: rgba(246, 181, 63, 0.16);
  color: var(--amber);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.quiet {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-color: var(--line);
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

dl div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--text);
  font-weight: 900;
}

.test-summary {
  display: grid;
  gap: 10px;
  padding: clamp(22px, 4vw, 32px);
  border-color: rgba(14, 124, 134, 0.72);
}

.test-summary span {
  color: var(--teal-soft);
  font-weight: 900;
  text-transform: uppercase;
}

.test-summary strong {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.test-summary p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.setup-section {
  background: rgba(14, 124, 134, 0.08);
  border-top: 1px solid var(--line);
}

.content-section {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.content-copy {
  display: grid;
  gap: 16px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
}

.content-copy p {
  margin: 0;
}

.text-link {
  width: fit-content;
  border-bottom: 2px solid rgba(246, 181, 63, 0.72);
  color: var(--text);
  font-weight: 900;
}

.text-link:hover {
  color: var(--amber);
}

.source-copy {
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: start;
}

.source-copy .text-link {
  grid-column: 2;
}

.source-thumbnail {
  display: block;
  width: 148px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
}

.orange-book-thumb {
  border-radius: 3px;
}

.topic-section {
  padding: clamp(42px, 7vw, 76px) 0;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(14, 124, 134, 0.06)),
    rgba(5, 6, 8, 0.84);
}

.feature-section {
  padding: clamp(32px, 5vw, 58px) 0;
  border-top: 1px solid var(--line);
  background: rgba(246, 181, 63, 0.06);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-item {
  display: grid;
  gap: 10px;
  min-height: 190px;
  border: 1px solid rgba(246, 181, 63, 0.34);
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.9);
  padding: clamp(18px, 3vw, 24px);
}

.feature-icon {
  display: grid;
  width: fit-content;
  place-items: center;
  border: 1px solid rgba(98, 199, 207, 0.6);
  border-radius: 8px;
  background: rgba(98, 199, 207, 0.11);
  color: var(--teal-soft);
  padding: 9px;
}

.feature-icon svg {
  display: block;
  width: 26px;
  height: 26px;
}

.feature-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-item h3 {
  margin: 0;
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  line-height: 1.12;
}

.feature-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.section-head.centred {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
}

.amendment-note {
  color: var(--amber);
  font-weight: 950;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.topic-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 18px;
  gap: 14px;
  align-items: center;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.94);
  color: var(--text);
  padding: 18px;
  text-align: left;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.topic-card:hover,
.topic-card:focus-visible {
  border-color: rgba(246, 181, 63, 0.72);
  background: rgba(22, 34, 44, 0.98);
  transform: translateY(-2px);
  outline: none;
}

.topic-card:disabled,
.topic-card.is-coming-soon {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.topic-card:disabled:hover,
.topic-card.is-coming-soon:hover {
  border-color: var(--line);
  background: rgba(16, 24, 32, 0.94);
  transform: none;
}

.topic-card strong,
.topic-card small {
  display: block;
}

.topic-card strong {
  font-size: 1rem;
  line-height: 1.18;
}

.topic-card small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}

.topic-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 8px;
  background: rgba(246, 181, 63, 0.16);
  color: var(--amber);
  font-weight: 950;
}

.topic-icon.orange-book {
  background: rgba(246, 181, 63, 0.18);
  color: var(--amber);
  font-size: 1.45rem;
}

.topic-icon.amendment {
  background: rgba(246, 181, 63, 0.22);
  color: var(--amber);
  border: 1px solid rgba(246, 181, 63, 0.42);
  font-size: 0.95rem;
  letter-spacing: 0;
}

.topic-icon.bolt {
  background: rgba(255, 92, 92, 0.14);
  color: #ff8a73;
}

.topic-icon.clipboard {
  background: rgba(98, 199, 207, 0.14);
  color: var(--teal-soft);
}

.topic-icon.book {
  background: rgba(53, 196, 111, 0.13);
  color: var(--green);
}

.topic-icon.check {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.topic-icon.map {
  background: rgba(246, 181, 63, 0.12);
  color: #ffb067;
}

.topic-arrow {
  display: block;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  transform: rotate(45deg);
}

.site-footer {
  border-top: 1px solid rgba(246, 181, 63, 0.24);
  background: rgba(5, 6, 8, 0.92);
  padding: 24px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.footer-brand,
.coffee-link {
  display: inline-flex;
  align-items: center;
  font-weight: 900;
}

.footer-brand {
  gap: 10px;
}

.footer-mark,
.footer-mark svg {
  display: block;
  width: 38px;
  height: 38px;
}

.footer-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 650;
}

.footer-grid p a {
  color: var(--text);
  font-weight: 900;
  border-bottom: 1px solid rgba(246, 181, 63, 0.72);
}

.footer-grid p a:hover {
  color: var(--amber);
}

.coffee-link {
  min-height: 42px;
  border: 1px solid rgba(246, 181, 63, 0.72);
  border-radius: 8px;
  background: rgba(246, 181, 63, 0.12);
  color: var(--text);
  padding: 9px 12px;
}

.coffee-link:hover {
  background: var(--amber);
  color: var(--ink);
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 480px);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.quiz-panel {
  display: grid;
  gap: 22px;
  padding: clamp(20px, 3vw, 30px);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.choice-grid,
.choice-row {
  display: grid;
  gap: 10px;
}

.choice-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.select-label {
  display: block;
}

.select-label select {
  width: 100%;
  min-height: 62px;
  border: 2px solid rgba(246, 181, 63, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(246, 181, 63, 0.12), rgba(255, 255, 255, 0.035)),
    var(--panel-2);
  color: var(--text);
  padding: 0 44px 0 16px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(246, 181, 63, 0.08);
}

.select-label select:focus {
  outline: 4px solid rgba(246, 181, 63, 0.28);
  border-color: var(--amber);
}

label {
  cursor: pointer;
}

label.is-disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

label span {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 13px 12px;
  font-size: clamp(0.94rem, 1.3vw, 1.05rem);
  font-weight: 900;
  text-align: center;
}

input[type="radio"]:checked + span {
  border-color: var(--amber);
  background: rgba(246, 181, 63, 0.18);
  color: var(--amber);
  box-shadow: 0 0 0 3px rgba(246, 181, 63, 0.08);
}

.range-control {
  display: grid;
  gap: 16px;
}

.range-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.range-value strong {
  color: var(--amber);
  font-size: 3rem;
  line-height: 1;
}

.range-value span {
  color: var(--muted);
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
  cursor: pointer;
}

.range-ticks {
  position: relative;
  display: block;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.range-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.range-ticks .tick-5 {
  left: 0;
  transform: translateX(0);
}

.range-ticks.max-10 .tick-10,
.range-ticks.max-20 .tick-20,
.range-ticks.max-30 .tick-30,
.range-ticks.max-40 .tick-40,
.range-ticks.max-50 .tick-50,
.range-ticks.max-60 .tick-60 {
  left: 100%;
  transform: translateX(-100%);
}

.range-ticks.max-20 .tick-10 { left: 33.333%; }
.range-ticks.max-30 .tick-10 { left: 20%; }
.range-ticks.max-30 .tick-20 { left: 60%; }
.range-ticks.max-40 .tick-10 { left: 14.286%; }
.range-ticks.max-40 .tick-20 { left: 42.857%; }
.range-ticks.max-40 .tick-30 { left: 71.429%; }
.range-ticks.max-50 .tick-10 { left: 11.111%; }
.range-ticks.max-50 .tick-20 { left: 33.333%; }
.range-ticks.max-50 .tick-30 { left: 55.556%; }
.range-ticks.max-50 .tick-40 { left: 77.778%; }
.range-ticks.max-60 .tick-10 { left: 9.091%; }
.range-ticks.max-60 .tick-20 { left: 27.273%; }
.range-ticks.max-60 .tick-30 { left: 45.455%; }
.range-ticks.max-60 .tick-40 { left: 63.636%; }
.range-ticks.max-60 .tick-50 { left: 81.818%; }

.switch-control {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  overflow: hidden;
  isolation: isolate;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-thumb {
  display: none;
}

#feedback-end:checked ~ .switch-thumb {
  transform: translateX(100%);
}

.switch-control[data-selected="end"] .switch-thumb,
.switch-control[data-selected="book"] .switch-thumb {
  transform: translateX(100%);
}

.switch-control label {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 50px;
  color: var(--text);
  padding: 10px;
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  font-weight: 900;
  text-align: center;
  border-radius: 999px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

#feedback-end:checked ~ label[for="feedback-end"] {
  color: var(--ink);
}

#feedback-each:checked ~ label[for="feedback-each"] {
  color: var(--ink);
}

.switch-control[data-selected="end"] label[for="feedback-end"],
.switch-control[data-selected="per-question"] label[for="feedback-each"],
.order-switch[data-selected="book"] label[for="order-book"],
.order-switch[data-selected="random"] label[for="order-random"] {
  color: var(--ink);
  background: linear-gradient(180deg, #ffc857 0%, var(--amber) 100%);
  box-shadow: 0 0 0 3px rgba(246, 181, 63, 0.2), 0 10px 24px rgba(246, 181, 63, 0.18);
}

.note-panel {
  display: grid;
  gap: 8px;
  border-color: rgba(14, 124, 134, 0.72);
  background: rgba(14, 124, 134, 0.14);
  padding: 18px;
}

.note-panel strong {
  color: var(--teal-soft);
  font-size: 1rem;
  font-weight: 900;
}

.note-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 650;
}

.form-message {
  display: grid;
  gap: 3px;
  min-height: 1.4em;
  margin: 0;
  color: var(--teal-soft);
  font-size: 0.96rem;
  font-weight: 800;
}

.form-message small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.quiz-runner {
  padding: clamp(42px, 7vw, 76px) 0;
  border-top: 1px solid var(--line);
}

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

.question-card,
.quiz-progress {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.94);
  box-shadow: var(--shadow);
}

.question-card {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
}

.question-content {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.question-content.slide-from-right {
  animation: slideFromRight 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-content.slide-from-left {
  animation: slideFromLeft 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-card h2 {
  max-width: 980px;
  font-size: clamp(1.18rem, 2.2vw, 1.85rem);
  line-height: 1.22;
}

.answer-list {
  display: grid;
  gap: 9px;
}

.question-diagrams {
  display: grid;
  gap: 12px;
  margin: 8px 0 18px;
}

.question-diagram {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 10, 14, 0.42);
  padding: 12px;
}

.question-diagram img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.question-diagram figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.answer-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.96rem;
  line-height: 1.34;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 250ms ease, border-color 250ms ease, box-shadow 250ms ease, transform 250ms ease;
}

.answer-button.selected {
  border-color: var(--amber);
  background: rgba(246, 181, 63, 0.13);
}

.answer-button:focus-visible {
  outline: 3px solid rgba(98, 199, 207, 0.5);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(98, 199, 207, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .answer-button:hover {
    border-color: var(--amber);
    background: rgba(246, 181, 63, 0.13);
  }
}

.answer-button.committing {
  border-color: var(--amber);
  background: rgba(246, 181, 63, 0.28);
  box-shadow: inset 0 0 0 2px rgba(255, 253, 250, 0.2);
}

.answer-button.touch-releasing {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  transition-duration: 250ms;
}

.answer-button:disabled {
  cursor: default;
}

.question-card sub,
.answer-button sub,
.feedback-panel sub,
.results-list sub {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: sub;
}

.answer-button span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 900;
}

.feedback-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(14, 124, 134, 0.72);
  border-radius: 8px;
  background: rgba(14, 124, 134, 0.14);
  padding: 18px;
}

.feedback-panel.correct {
  border-color: rgba(53, 196, 111, 0.72);
  background: rgba(53, 196, 111, 0.14);
}

.feedback-panel.incorrect {
  border-color: rgba(255, 92, 92, 0.72);
  background: rgba(255, 92, 92, 0.13);
}

.feedback-panel strong {
  color: var(--teal-soft);
  font-size: 1.1rem;
  font-weight: 900;
}

.feedback-panel.correct strong {
  color: var(--green);
}

.feedback-panel.incorrect strong {
  color: var(--red);
}

.feedback-panel p {
  margin: 0;
  color: var(--text);
  font-weight: 650;
}

.feedback-panel small,
.review-item small {
  color: var(--muted);
  font-weight: 800;
}

.question-actions {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 12px;
}

.question-actions .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.quiz-progress {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 8px;
  padding: 20px;
}

.quiz-progress span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-progress strong {
  color: var(--amber);
  font-size: 2.8rem;
  line-height: 1;
}

.quiz-progress p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.result-card {
  gap: 26px;
}

.score-display {
  display: grid;
  gap: 6px;
  width: fit-content;
  border: 1px solid rgba(246, 181, 63, 0.72);
  border-radius: 8px;
  background: rgba(246, 181, 63, 0.13);
  padding: 18px 22px;
}

.result-card.passed .score-display {
  border-color: rgba(53, 196, 111, 0.72);
  background: rgba(53, 196, 111, 0.14);
}

.result-card.failed .score-display {
  border-color: rgba(255, 92, 92, 0.72);
  background: rgba(255, 92, 92, 0.13);
}

.score-display strong {
  color: var(--amber);
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 0.92;
}

.result-card.passed .score-display strong {
  color: var(--green);
}

.result-card.failed .score-display strong {
  color: var(--red);
}

.score-display span,
.result-copy {
  color: var(--muted);
  font-weight: 800;
}

.section-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.section-results div,
.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.section-results div {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.section-results div.passed {
  border-color: rgba(53, 196, 111, 0.62);
  background: rgba(53, 196, 111, 0.1);
}

.section-results div.failed {
  border-color: rgba(255, 92, 92, 0.62);
  background: rgba(255, 92, 92, 0.1);
}

.section-results span,
.section-results small {
  color: var(--muted);
  font-weight: 800;
}

.section-results em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
}

.section-results strong {
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-item {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-left-width: 5px;
}

.review-item.correct {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(53, 196, 111, 0.1), rgba(255, 255, 255, 0.045) 22%);
}

.review-item.incorrect {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(255, 92, 92, 0.1), rgba(255, 255, 255, 0.045) 22%);
}

.review-item h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.review-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.review-item b {
  color: var(--text);
}

@keyframes slideFromRight {
  from {
    transform: translateX(84px);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideFromLeft {
  from {
    transform: translateX(-84px);
  }
  to {
    transform: translateX(0);
  }
}

@media (max-width: 920px) {
  .menu-button {
    display: grid;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    left: 16px;
    display: none;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: grid;
  }

  .site-nav a {
    padding: 14px;
  }

  .site-nav .nav-action {
    width: 100%;
  }

  .home-hero-grid,
  .test-hero-grid,
  .section-head,
  .content-grid,
  .quiz-runner-grid {
    grid-template-columns: 1fr;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .home-hero-grid {
    min-height: auto;
  }

  .test-hero-grid {
    min-height: auto;
  }

  .quiz-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .source-copy {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .source-thumbnail {
    width: 92px;
  }

  .source-copy .text-link {
    grid-column: 1 / -1;
  }

  .quiz-card {
    min-height: auto;
  }

  .quiz-progress {
    position: static;
  }
}

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    min-height: 70px;
    padding-inline: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark,
  .brand-mark svg {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-subtitle {
    display: none;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.7rem);
  }

  h2 {
    font-size: clamp(2.1rem, 10vw, 3.1rem);
  }

  .home-hero-grid,
  .test-hero-grid {
    padding: 38px 0;
  }

  .setup-grid {
    display: flex;
    flex-direction: column;
  }

  .setup-grid > div:first-child {
    display: contents;
  }

  .setup-grid .quiz-panel {
    order: 1;
  }

  .setup-grid .eyebrow {
    order: 0;
    margin-bottom: 10px;
  }

  .setup-grid h2 {
    order: 0;
    margin-bottom: 14px;
    font-size: clamp(1.9rem, 9vw, 2.55rem);
  }

  .setup-copy,
  .revision-promise {
    order: 2;
  }

  .setup-copy {
    margin-top: 18px;
    font-size: 1rem;
  }

  .revision-promise {
    margin-top: 14px;
    padding: 13px 14px;
  }

  .revision-promise p {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .hero-panel {
    min-height: 260px;
  }

  .choice-row,
  .choice-grid.two,
  dl,
  .section-results,
  .question-actions {
    grid-template-columns: 1fr;
  }

  .answer-button {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 62px;
  }

  .answer-button span {
    width: 36px;
    height: 36px;
  }

  .quiz-runner {
    padding-bottom: 112px;
  }

  .quiz-progress {
    display: none;
  }
}
