/* ============================================================================
   Practice Tests — design system
   A warm, paper-toned, professional aesthetic. Fraunces for display, Inter for
   text. Everything is built from a small set of design tokens.
   ========================================================================== */

:root {
  /* Palette — warm paper + terracotta accent */
  --bg: #f5f2ec;
  --bg-grad: radial-gradient(120% 120% at 50% -10%, #faf8f3 0%, #f3efe7 55%, #eee9df 100%);
  --surface: #fffdf9;
  --surface-2: #f3eee5;
  --surface-3: #ece5d9;
  --ink: #211f1b;
  --ink-2: #3c3933;
  --muted: #6c675e;
  --faint: #9a948a;
  --line: #e6dfd2;
  --line-strong: #d8cfbe;

  --accent: #c4603a;
  --accent-600: #ad5230;
  --accent-700: #8f4426;
  --accent-tint: #f7eae3;
  --accent-tint-2: #f2ddd1;

  --green: #2f8268;
  --green-tint: #e4f1ea;
  --green-line: #bfe0d0;
  --red: #c1483b;
  --red-tint: #f8e7e4;
  --red-line: #eecac4;
  --amber: #b9802a;
  --amber-tint: #f7edd8;
  --blue: #3a6ea5;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radii & shadows */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(33, 31, 27, 0.05), 0 1px 3px rgba(33, 31, 27, 0.04);
  --shadow-md: 0 4px 14px rgba(33, 31, 27, 0.07), 0 2px 6px rgba(33, 31, 27, 0.05);
  --shadow-lg: 0 18px 48px rgba(33, 31, 27, 0.13), 0 6px 16px rgba(33, 31, 27, 0.08);
  --ring: 0 0 0 3px rgba(196, 96, 58, 0.28);

  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----------------------------------------------------------------- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  font-feature-settings: 'cv05', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent-600);
  text-decoration: none;
}
a:hover {
  color: var(--accent-700);
}
.icon {
  flex: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* ------------------------------------------------------------- Layout ----- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
main.container {
  flex: 1 0 auto;
  padding-top: 40px;
  padding-bottom: 72px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
}

/* ------------------------------------------------------------- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 243, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 600;
}
.brand:hover {
  color: var(--ink);
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-700) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand__text {
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: -0.01em;
}
.brand__accent {
  color: var(--accent);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav__link {
  color: var(--ink-2);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.site-nav__link:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.site-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.site-nav__btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-700);
}

/* ------------------------------------------------------------- Footer ----- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.6);
  padding: 28px 0;
  margin-top: auto;
}
.site-footer__inner {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer__muted {
  color: var(--faint);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ------------------------------------------------------------- Buttons ---- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn--primary {
  --btn-bg: linear-gradient(150deg, var(--accent) 0%, var(--accent-600) 100%);
  --btn-fg: #fff;
  --btn-bd: transparent;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn--primary:hover {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-bd: transparent;
  color: var(--ink-2);
}
.btn--ghost:hover {
  --btn-bg: var(--surface-2);
  box-shadow: none;
}
.btn--danger {
  --btn-bg: transparent;
  --btn-fg: var(--red);
  --btn-bd: var(--red-line);
}
.btn--danger:hover {
  --btn-bg: var(--red-tint);
}
.btn--sm {
  padding: 7px 14px;
  font-size: 0.86rem;
}
.btn--lg {
  padding: 14px 28px;
  font-size: 1.02rem;
}
.btn--block {
  width: 100%;
}

/* ------------------------------------------------------------- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge--pass {
  background: var(--green-tint);
  color: var(--green);
  border-color: var(--green-line);
}
.badge--fail {
  background: var(--red-tint);
  color: var(--red);
  border-color: var(--red-line);
}
.badge--progress {
  background: var(--amber-tint);
  color: var(--amber);
  border-color: #ecd9ad;
}
.badge--accent {
  background: var(--accent-tint);
  color: var(--accent-700);
  border-color: var(--accent-tint-2);
}
.badge--dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge__weight {
  margin-left: 7px;
  padding-left: 7px;
  border-left: 1px solid var(--line-strong);
  color: var(--accent-700);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- Cards ------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------- Hero ------- */
.hero {
  text-align: center;
  max-width: 720px;
  margin: 8px auto 44px;
  animation: rise 0.5s var(--ease) both;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-700);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-2);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero p {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--muted);
}

/* ------------------------------------------------------ Section titles ---- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 20px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.section-head__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ------------------------------------------------------- Exam grid -------- */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
}
.exam-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.22s var(--ease),
    border-color 0.2s var(--ease);
  animation: rise 0.5s var(--ease) both;
}
.exam-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-700));
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}
.exam-card:hover::after {
  opacity: 1;
}
.exam-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.exam-card__glyph {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, var(--accent), var(--accent-700));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.exam-card__level {
  font-size: 0.78rem;
}
.exam-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.34rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.exam-card__provider {
  color: var(--accent-700);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 4px;
}
.exam-card__blurb {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 12px;
  flex: 1;
}
.exam-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.exam-card__stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exam-card__stat-main {
  font-weight: 700;
  font-size: 1.05rem;
}
.exam-card__stat-sub {
  color: var(--faint);
  font-size: 0.8rem;
}
.exam-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-700);
  font-weight: 600;
  font-size: 0.92rem;
  transition: gap 0.18s var(--ease);
}
.exam-card:hover .exam-card__cta {
  gap: 10px;
}

/* Mini progress meter on exam card */
.meter {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-600));
  transition: width 0.6s var(--ease);
}
.meter__fill--pass {
  background: linear-gradient(90deg, #36a07e, var(--green));
}

/* ------------------------------------------------------- Breadcrumb ------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--muted);
  font-weight: 500;
}
.breadcrumb a:hover {
  color: var(--accent-700);
}
.breadcrumb__sep {
  color: var(--faint);
}
.breadcrumb__current {
  color: var(--ink-2);
  font-weight: 600;
}

/* ------------------------------------------------------- Exam header ------ */
.exam-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: start;
  padding: 30px 32px;
  margin-bottom: 30px;
  animation: rise 0.45s var(--ease) both;
}
.exam-header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.exam-header__provider {
  color: var(--accent-700);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 8px;
}
.exam-header p {
  color: var(--muted);
  margin-top: 12px;
  max-width: 60ch;
}
.exam-header__domains {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.exam-header__aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 26px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  min-width: 150px;
}
.exam-header__aside .big {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--ink);
}
.exam-header__aside .label {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

/* ------------------------------------------------------- Test list -------- */
.test-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.test-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  transition: transform 0.18s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.18s var(--ease);
  animation: rise 0.45s var(--ease) both;
}
.test-row:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.test-row__num {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: var(--surface-2);
  color: var(--accent-700);
  border: 1px solid var(--line);
}
.test-row__body h3 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.test-row__focus {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 2px;
}
.test-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.test-row__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 130px;
}
.test-row__actions {
  display: flex;
  gap: 8px;
}
.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
}
.score-pill__num {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}
.score-pill__pct {
  font-size: 0.9rem;
  color: var(--muted);
}
.score-pill--none {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--faint);
}

/* History expander */
.history {
  margin-top: 4px;
  border-top: 1px dashed var(--line-strong);
  grid-column: 1 / -1;
  padding-top: 16px;
}
.history__title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-bottom: 12px;
}
.history__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.history__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
    transform 0.16s var(--ease);
}
.history__item:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
}
.history__item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.history__date {
  color: var(--muted);
}

/* expander button */
.disclosure {
  background: none;
  border: none;
  color: var(--accent-700);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}
.disclosure .chev {
  transition: transform 0.2s var(--ease);
}
.disclosure[aria-expanded='true'] .chev {
  transform: rotate(180deg);
}

/* =================================================== Test runner ========== */
.runner {
  max-width: 860px;
  margin: 0 auto;
}

/* Intro / mode selection */
.intro {
  padding: 36px;
  text-align: center;
  animation: rise 0.45s var(--ease) both;
}
.intro__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, var(--accent), var(--accent-700));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.intro h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
}
.intro__focus {
  color: var(--muted);
  margin-top: 6px;
}
.intro__facts {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 24px 0 8px;
  flex-wrap: wrap;
}
.intro__fact {
  display: flex;
  flex-direction: column;
}
.intro__fact .n {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--ink);
}
.intro__fact .l {
  color: var(--muted);
  font-size: 0.85rem;
}
.mode-label {
  margin: 26px 0 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}
.mode-option {
  position: relative;
  display: block;
  cursor: pointer;
}
.mode-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.mode-option__box {
  height: 100%;
  padding: 18px 18px 18px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease);
}
.mode-option__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 6px;
}
.mode-option__check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  margin-left: auto;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.mode-option__check svg {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  color: #fff;
}
.mode-option__desc {
  color: var(--muted);
  font-size: 0.9rem;
}
.mode-option input:checked + .mode-option__box {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: var(--ring);
}
.mode-option input:checked + .mode-option__box .mode-option__check {
  background: var(--accent);
  border-color: var(--accent);
}
.mode-option input:checked + .mode-option__box .mode-option__check svg {
  opacity: 1;
  transform: scale(1);
}

/* intro timed-mode toggle */
.timer-opt {
  display: block;
  cursor: pointer;
  text-align: left;
}
.timer-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.timer-opt__box {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.timer-opt__box > .icon {
  color: var(--accent);
  flex: none;
}
.timer-opt__check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.timer-opt__check .icon {
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.timer-opt input:checked + .timer-opt__box {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.timer-opt input:checked + .timer-opt__box .timer-opt__check {
  background: var(--accent);
  border-color: var(--accent);
}
.timer-opt input:checked + .timer-opt__box .timer-opt__check .icon {
  opacity: 1;
  transform: scale(1);
}
.timer-opt input:focus-visible + .timer-opt__box {
  box-shadow: var(--ring);
}
.timer-opt__text {
  display: flex;
  flex-direction: column;
}
.timer-opt__title {
  font-weight: 600;
}
.timer-opt__desc {
  color: var(--muted);
  font-size: 0.9rem;
}
.timer-opt[data-on='false'] .timer-opt__desc {
  opacity: 0.55;
}

/* Runner toolbar */
.runner-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.runner-bar__progress {
  flex: 1;
}
.runner-bar__count {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 7px;
}
.runner-bar__count b {
  color: var(--ink);
}
.runner-bar__exit {
  flex: none;
}

/* timer widget */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 6px 14px 6px 7px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.timer .icon {
  color: var(--muted);
}
.timer__time {
  min-width: 54px;
  text-align: center;
  letter-spacing: 0.01em;
}
.timer__toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.12s var(--ease);
}
.timer__toggle:hover {
  background: var(--accent-tint);
  color: var(--accent-700);
}
.timer__toggle:active {
  transform: scale(0.92);
}
.timer[data-state='paused'] {
  border-style: dashed;
  color: var(--muted);
}
.timer[data-state='paused'] .timer__time {
  opacity: 0.65;
}
.timer[data-state='over'] {
  border-color: var(--red-line);
  background: var(--red-tint);
  color: var(--red);
  animation: pulse-red 1.8s var(--ease) infinite;
}
.timer[data-state='over'] .icon,
.timer[data-state='over'] .timer__toggle {
  color: var(--red);
}
.timer[data-state='over'] .timer__toggle {
  background: rgba(193, 72, 59, 0.12);
}
@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(193, 72, 59, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(193, 72, 59, 0.14);
  }
}
.progress-track {
  height: 9px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-track__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-600));
  border-radius: var(--r-pill);
  transition: width 0.4s var(--ease);
}

/* Question card */
.question {
  padding: 30px 34px 26px;
  animation: fade 0.3s var(--ease) both;
}
.question__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.question__index {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-700);
}
.question__multi {
  font-size: 0.78rem;
  color: var(--muted);
}
.question__prompt {
  font-size: 1.28rem;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.question__prompt code {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 6px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}
.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
    transform 0.12s var(--ease), box-shadow 0.16s var(--ease);
}
.option:hover:not(.is-locked) {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.option input {
  position: absolute;
  opacity: 0;
}
.option__marker {
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
  transition: all 0.16s var(--ease);
}
.option[data-type='single'] .option__marker {
  border-radius: 50%;
}
.option[data-type='multiple'] .option__marker {
  border-radius: 7px;
}
.option__text {
  flex: 1;
  padding-top: 2px;
  color: var(--ink-2);
}
.option.is-selected {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.option.is-selected .option__marker {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.option.is-locked {
  cursor: default;
}
/* graded states */
.option.is-correct {
  border-color: var(--green-line);
  background: var(--green-tint);
}
.option.is-correct .option__marker {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.option.is-wrong {
  border-color: var(--red-line);
  background: var(--red-tint);
}
.option.is-wrong .option__marker {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.option__tag {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.option.is-correct .option__tag {
  color: var(--green);
}
.option.is-wrong .option__tag {
  color: var(--red);
}

/* explanation reveal */
.explain {
  margin-top: 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 18px 20px;
  animation: fade 0.3s var(--ease) both;
}
.explain__head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  margin-bottom: 6px;
}
.explain__head.is-correct {
  color: var(--green);
}
.explain__head.is-wrong {
  color: var(--red);
}
.explain__body {
  color: var(--ink-2);
  font-size: 0.96rem;
}

/* runner footer nav */
.runner-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}
.runner-foot__mid {
  color: var(--muted);
  font-size: 0.88rem;
}

/* question palette */
.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
  padding: 20px 22px;
  justify-content: center;
}
.palette__legend {
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  color: var(--faint);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.pal-dot {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.14s var(--ease);
}
.pal-dot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.pal-dot.is-answered {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-700);
}
.pal-dot.is-current {
  box-shadow: var(--ring);
  border-color: var(--accent);
}
.pal-dot.is-correct {
  background: var(--green-tint);
  border-color: var(--green-line);
  color: var(--green);
}
.pal-dot.is-wrong {
  background: var(--red-tint);
  border-color: var(--red-line);
  color: var(--red);
}

/* =================================================== Results ============== */
.results {
  max-width: 860px;
  margin: 0 auto;
  animation: rise 0.45s var(--ease) both;
}
.results__hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 34px 36px;
  margin-bottom: 26px;
}
.ring {
  --pct: 0;
  --ring-color: var(--accent);
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--ring-color) calc(var(--pct) * 1%),
    var(--surface-3) 0
  );
  position: relative;
  flex: none;
}
.ring::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface);
}
.ring__inner {
  position: relative;
  text-align: center;
  z-index: 1;
}
.ring__pct {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--ink);
}
.ring__label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.results__summary h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
}
.results__verdict {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.results__stats {
  display: flex;
  gap: 26px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.results__stat .n {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
}
.results__stat .l {
  color: var(--muted);
  font-size: 0.84rem;
}
.results__actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* domain breakdown */
.domain-card {
  padding: 24px 28px;
  margin-bottom: 26px;
}
.domain-card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 18px;
}
.domain-card__title .icon {
  color: var(--accent);
}
.domain-row {
  margin-bottom: 16px;
}
.domain-row:last-of-type {
  margin-bottom: 8px;
}
.domain-row__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 0.92rem;
}
.domain-row__name {
  font-weight: 600;
  color: var(--ink-2);
}
.domain-row__wt {
  padding: 2px 8px;
  font-size: 0.72rem;
}
.domain-row__frac {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.domain-card__hint {
  color: var(--faint);
  font-size: 0.82rem;
  margin-top: 14px;
}

/* review */
.review {
  margin-top: 12px;
}
.review-item__domain {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-700);
  margin-bottom: 8px;
}
.review-item {
  padding: 22px 26px;
  margin-bottom: 14px;
  border-left: 4px solid var(--line-strong);
}
.review-item.is-correct {
  border-left-color: var(--green);
}
.review-item.is-wrong {
  border-left-color: var(--red);
}
.review-item.is-skipped {
  border-left-color: var(--amber);
}
.review-item__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.review-item__q {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.review-item__verdict {
  flex: none;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.review-item__verdict.ok {
  color: var(--green);
}
.review-item__verdict.no {
  color: var(--red);
}
.review-item__verdict.skip {
  color: var(--amber);
}
.review-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.94rem;
  margin-top: 8px;
  border: 1px solid transparent;
}
.review-opt .tick {
  flex: none;
  margin-top: 2px;
}
.review-opt.correct {
  background: var(--green-tint);
  border-color: var(--green-line);
  color: var(--ink-2);
}
.review-opt.chosen-wrong {
  background: var(--red-tint);
  border-color: var(--red-line);
  color: var(--ink-2);
}
.review-opt.neutral {
  color: var(--muted);
}
.review-item__explain {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.95rem;
}
.review-item__explain b {
  color: var(--ink);
}

/* history strip on results */
.attempt-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 22px;
  margin-bottom: 26px;
  scrollbar-width: thin;
}
.attempt-chip {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  min-width: 96px;
  transition: all 0.16s var(--ease);
}
.attempt-chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.attempt-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: var(--shadow-sm);
}
.attempt-chip__pct {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
}
.attempt-chip__date {
  font-size: 0.74rem;
  color: var(--muted);
}
.attempt-chip__tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.attempt-chip__tag.pass {
  color: var(--green);
}
.attempt-chip__tag.fail {
  color: var(--red);
}

/* =================================================== Modal =============== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(33, 31, 27, 0.42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fade 0.18s var(--ease) both;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  padding: 28px;
  animation: pop 0.22s var(--ease) both;
}
.modal h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.modal p {
  color: var(--muted);
  margin-bottom: 8px;
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.modal__danger-list {
  margin: 12px 0 4px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}
.modal__danger-list li {
  margin-bottom: 4px;
}

/* =================================================== Empty / misc ========= */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--faint);
}
.loading {
  display: grid;
  place-items: center;
  padding: 80px 20px;
}
.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 120;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =================================================== Animations =========== */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* stagger helper */
.stagger > * {
  animation-delay: calc(var(--i, 0) * 60ms);
}

/* =================================================== Responsive =========== */
@media (max-width: 760px) {
  main.container {
    padding-top: 26px;
  }
  .exam-header {
    grid-template-columns: 1fr;
  }
  .exam-header__aside {
    flex-direction: row;
    justify-content: center;
    gap: 14px;
  }
  .test-row {
    grid-template-columns: 44px 1fr;
  }
  .test-row__score {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    margin-top: 4px;
  }
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .results__hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .results__verdict,
  .results__stats,
  .results__actions {
    justify-content: center;
  }
  .question,
  .results__hero,
  .intro {
    padding-left: 22px;
    padding-right: 22px;
  }
  .site-nav__link {
    display: none;
  }
  /* On narrow screens, let the timer + exit share a row and the progress bar
     take the full width below them. */
  .runner-bar {
    flex-wrap: wrap;
  }
  .runner-bar__progress {
    order: 2;
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
