@font-face {
  font-family: "Space Grotesk Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Georgia");
  size-adjust: 105%;
  ascent-override: 95%;
  descent-override: 22%;
  line-gap-override: 0%;
}

:root {
  --bg: #f4f4ee;
  --surface: #fffef8;
  --ink: #151515;
  --muted: #5f5c54;
  --accent: #006d77;
  --accent-2: #ef476f;
  --stroke: #d8d4ca;
  --radius: 16px;
  --shadow: 0 12px 24px rgba(21, 21, 21, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Space Grotesk Fallback", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 12%, #fdeccf, transparent 35%),
    radial-gradient(circle at 87% 20%, #cbe7e4, transparent 34%), var(--bg);
  line-height: 1.45;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.9rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

p {
  margin: 0 0 1rem;
}

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

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 260px;
  height: 260px;
  filter: blur(80px);
  opacity: 0.45;
}

.ambient-left {
  top: -30px;
  left: -20px;
  background: #f7a072;
}

.ambient-right {
  right: -40px;
  bottom: 8vh;
  background: #54a0ff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  font-family: "Instrument Serif", "Instrument Serif Fallback", serif;
  font-size: 1.8rem;
  letter-spacing: 0.02em;
}

.topnav {
  display: flex;
  gap: 1rem;
}

.topnav a {
  color: var(--muted);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.66rem 1rem;
  font-weight: 700;
  border: 1px solid var(--ink);
  transition: transform 150ms ease, background-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  border-color: var(--stroke);
  background: transparent;
}

.auth-slot {
  display: flex;
  align-items: center;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-pill.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
}

body.auth-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.hero {
  padding: 3.4rem 0 1rem;
}

.eyebrow {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hero-copy {
  max-width: 760px;
  font-size: 1.04rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.6rem 0 2rem;
}

.stats {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats li {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.stats strong {
  display: block;
  font-size: 1.8rem;
}

.stats span {
  color: var(--muted);
}

.section {
  padding: 2.2rem 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-copy {
  color: var(--muted);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.practice-category-filters {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.practice-category-filters[hidden] {
  display: none;
}

.filter-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.category-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.catalog-tabs,
.mock-view-tabs,
.section-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mock-view-tabs[hidden],
.section-filters[hidden] {
  display: none;
}

.mock-view-tabs:not([hidden]) + .section-filters:not([hidden]) {
  width: 100%;
  padding-top: 0.55rem;
  border-top: 1px solid var(--stroke);
}

.catalog-tab,
.section-filter,
.category-filter {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.catalog-tab.active,
.section-filter.active,
.category-filter.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.category-filter span {
  display: inline-flex;
  min-width: 1.35rem;
  justify-content: center;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(24, 23, 20, 0.08);
  font-size: 0.72rem;
}

.category-filter.active span {
  background: rgba(255, 255, 255, 0.2);
}

.practice-card {
  display: flex;
  flex-direction: column;
}

.practice-card .action-grid {
  margin-top: auto;
  padding-top: 0.75rem;
}

.practice-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.practice-section {
  align-self: flex-start;
  border-radius: 999px;
  background: #f1ede3;
  color: var(--ink);
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.practice-topic-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-dark);
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.practice-topic {
  margin: 0.15rem 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.practice-category {
  margin-bottom: 0;
}

.practice-more {
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

.practice-more[hidden] {
  display: none;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.how-grid article {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.set-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.chip-btn {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: 160ms ease;
}

.chip-btn:hover {
  transform: translateY(-1px);
}

.chip-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.counter {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 0.8rem;
  min-height: 600px;
}

.test-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.test-head h3 {
  font-size: 1rem;
  margin: 0;
}

.id-tag {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #fff;
  padding: 0.5rem 0.65rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.action-link.section {
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf7 0%, #f6f2e8 100%);
}

/* The whole set as one full mock test: its own row above the sections. */
.action-grid > .action-link.full-mock-action {
  grid-column: 1 / -1;
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
}

.action-grid > .action-link.full-mock-action.is-start {
  border-color: #4e7979;
  background: #4e7979;
  color: #ffffff;
}

.action-link.is-start {
  border-color: #b9cfc8;
}

.action-link.is-free {
  border-color: #83b98f;
  background: linear-gradient(180deg, #f6fff5 0%, #e9f7e5 100%);
  color: #2f7a3c;
}

.action-link.is-continue {
  border-color: #8ab8c4;
  background: linear-gradient(180deg, #f4fbfc 0%, #e6f3f5 100%);
  color: #255f85;
}

.action-link.is-completed {
  border-color: #9fc99b;
  background: linear-gradient(180deg, #f3fbf1 0%, #e4f2df 100%);
  color: #2f7a3c;
}

.action-link.is-signin,
.action-link.is-loading,
.action-link.is-locked {
  color: var(--muted);
}

.action-link.is-locked {
  border-color: #d8cfb0;
  background: #fff9ea;
}

.action-link[aria-disabled="true"] {
  cursor: default;
  pointer-events: auto;
}

.action-link.full {
  grid-column: 1 / -1;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.price-card.featured {
  border-color: var(--accent);
}

.chip {
  display: inline-block;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.14rem 0.5rem;
}

.price {
  font-size: 2rem;
  margin: 0.35rem 0 0.5rem;
}

.footer {
  border-top: 1px solid var(--stroke);
  margin-top: 2rem;
  padding: 1rem 0 1.8rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.test-page {
  padding: 2.2rem 0;
}

.test-shell {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.back-link {
  color: var(--accent);
  font-weight: 700;
}

.mode-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
}

.mode-badge.full {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-badge.reading {
  border-color: #9a6d1f;
  color: #9a6d1f;
}

.mode-badge.writing {
  border-color: #b65c38;
  color: #b65c38;
}

.mode-badge.speaking {
  border-color: #255f85;
  color: #255f85;
}

.mode-description {
  color: var(--muted);
}

.mode-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.mode-choice-card {
  display: block;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1.25rem;
  background: #fffdf8;
  color: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.mode-choice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.mode-choice-card.exam {
  background: linear-gradient(145deg, #fff9ea, #f2f8f9);
}

.mode-choice-card h3 { margin: 0.5rem 0 0.35rem; }
.mode-choice-card p { color: var(--muted); min-height: 3.2rem; }
.mode-choice-icon { font-size: 1.8rem; color: var(--accent); }

.exam-timer {
  position: sticky;
  top: 0.5rem;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid #255f85;
  border-radius: 12px;
  background: #f3f9fc;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 5px 18px rgba(37, 95, 133, 0.12);
}

.exam-timer strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.exam-timer.is-urgent { border-color: #b43c32; background: #fff1ef; color: #8d271f; }
.exam-timer.is-paused { border-color: var(--stroke); color: var(--muted); background: #f8f6f0; }

.exam-audio-gate {
  max-width: 660px;
  margin: 1.5rem auto;
  padding: 2rem;
  text-align: center;
}

.exam-audio-gate p { color: var(--muted); }
.listening-gate-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}
.listening-gate-actions[hidden] { display: none; }
.exam-audio-symbol {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0.5rem auto 1rem;
  border-radius: 50%;
  background: #e8f3f7;
  color: #255f85;
  font-size: 2rem;
}

.exam-speaking-auto {
  max-width: 660px;
  margin: 1.5rem auto;
  padding: 2rem;
  text-align: center;
}

.exam-speaking-auto p { color: var(--muted); }
.exam-speaking-auto.phase-recording .exam-audio-symbol {
  color: #b43c32;
  background: #fff1ef;
  animation: exam-record-pulse 1s ease-in-out infinite;
}

.exam-record-countdown {
  margin-top: 1rem;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

@keyframes exam-record-pulse {
  50% { transform: scale(0.9); opacity: 0.65; }
}

@media (max-width: 680px) {
  .mode-choice-grid { grid-template-columns: 1fr; }
  .mode-choice-card p { min-height: 0; }
}

.section-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}

.section-list.listening-content {
  display: block;
}

.section-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.8rem;
  background: #fff;
}

.gate-card {
  max-width: 640px;
  background: linear-gradient(180deg, #fffdf8 0%, #f8f3e9 100%);
  box-shadow: var(--shadow);
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.switch-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.45rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #fff;
}

.switch-grid a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.score-summary {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0.95rem;
  margin-bottom: 0.9rem;
}

.score-summary h3 {
  margin-bottom: 0.35rem;
}

.score-summary p {
  margin: 0.15rem 0;
  color: var(--muted);
}

.listening-part {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0.95rem;
  margin-bottom: 0.9rem;
}

.part-head {
  margin-bottom: 0.6rem;
}

.part-stage {
  display: inline-flex;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.shared-audio {
  margin-bottom: 0.7rem;
}

.shared-audio audio,
.question-audio {
  width: 100%;
}

.transcript-box {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.7rem;
  background: #fffcf4;
}

.transcript-box summary {
  cursor: pointer;
  font-weight: 700;
}

.transcript-box[open] summary {
  margin-bottom: 0.35rem;
}

.transcript-box p {
  margin: 0.45rem 0;
  color: var(--muted);
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.listening-question {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fffef8;
  padding: 0.75rem;
}

.listening-question h4 {
  margin-bottom: 0.35rem;
}

.question-prompt {
  margin: 0.45rem 0;
  color: var(--muted);
}

.choice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.choice-item {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.5rem;
  align-items: start;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
}

.choice-letter {
  font-weight: 700;
  color: var(--muted);
}

.choice-item.is-correct {
  border-color: #84c490;
  background: #eef9f1;
}

.choice-item.is-user-wrong {
  border-color: #d88f8f;
  background: #fff1f1;
}

.choice-item.is-user-correct .choice-letter {
  color: #2f7a3c;
}

.answer-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.answer-row.single {
  justify-content: flex-start;
}

.runner-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.runner-head p {
  margin: 0;
  color: var(--muted);
}

.q-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.q-dot {
  border: 1px solid var(--stroke);
  background: #fff;
  border-radius: 8px;
  width: 2.05rem;
  height: 2.05rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.q-dot.answered {
  border-color: #83b98f;
  background: #eef9f1;
}

.q-dot.correct {
  border-color: #83b98f;
  background: #eef9f1;
}

.q-dot.wrong {
  border-color: #d88f8f;
  background: #fff1f1;
}

.q-dot.empty {
  border-color: #d0c8a5;
  background: #fff9ea;
}

.q-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.runner-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0.95rem;
}

.runner-layout {
  display: block;
}

.runner-layout.with-passage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
  gap: 0.8rem;
}

.runner-main {
  min-width: 0;
}

.runner-passage {
  min-width: 0;
}

.passage-card {
  border: 1px solid #cfae61;
  border-radius: 10px;
  background: #f6e5a9;
  padding: 0.75rem;
}

.passage-card h4 {
  margin: 0 0 0.55rem;
  text-align: center;
  font-size: 1.2rem;
}

.passage-card p {
  margin: 0 0 0.75rem;
  line-height: 1.38;
}

.passage-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 32rem;
  margin: 0 auto 0.8rem;
  object-fit: contain;
}

.email-meta {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.email-row {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 0.45rem;
  align-items: stretch;
}

.email-label,
.email-value {
  border: 1px solid #9f8960;
  background: #fff;
  border-radius: 4px;
  padding: 0.35rem 0.45rem;
}

.email-label {
  font-weight: 700;
}

.email-body {
  border: 1px solid #9f8960;
  border-radius: 4px;
  background: #fff;
  padding: 0.55rem 0.6rem;
}

.email-body p:last-child {
  margin-bottom: 0;
}

.runner-meta {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.runner-audio {
  width: 100%;
  margin: 0.7rem 0 0.55rem;
}

.audio-player {
  width: 100%;
}

.audio-fallback {
  border: 1px solid #e2bd71;
  border-radius: 8px;
  background: #fff8e7;
  padding: 0.65rem 0.75rem;
  margin: -0.15rem 0 0.65rem;
}

.audio-fallback[hidden] {
  display: none;
}

.audio-fallback p {
  margin: 0 0 0.5rem;
  color: #6e4f12;
  font-size: 0.9rem;
  font-weight: 700;
}

.audio-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.audio-fallback-actions .btn {
  padding: 0.42rem 0.7rem;
}

.runner-hint {
  margin: 0.3rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.runner-prompt {
  margin: 0.4rem 0 0.65rem;
}

.runner-choices {
  display: grid;
  gap: 0.45rem;
}

.runner-choice {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fffef8;
  padding: 0.55rem 0.6rem;
  display: grid;
  grid-template-columns: 1rem 1.4rem 1fr;
  gap: 0.45rem;
  align-items: start;
  cursor: pointer;
}

.runner-choice input {
  margin-top: 0.23rem;
}

.runner-choice.selected {
  border-color: var(--accent);
  background: #eef7f8;
}

.runner-choice.is-correct {
  border-color: #84c490;
  background: #eef9f1;
}

.runner-choice.is-wrong {
  border-color: #d88f8f;
  background: #fff1f1;
}

.runner-choice.is-user-correct .runner-letter {
  color: #2f7a3c;
}

.runner-letter {
  font-weight: 700;
  color: var(--muted);
}

.cloze-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.cloze-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fffef8;
  padding: 0.45rem 0.55rem;
  display: grid;
  gap: 0.28rem;
}

.cloze-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.cloze-input {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  font: inherit;
}

.cloze-input:focus {
  outline: 2px solid #b7dadd;
  border-color: var(--accent);
}

.inline-cloze-input {
  display: inline-block;
  width: auto;
  width: calc(var(--blank-ch, 6) * 1ch + var(--blank-ch, 6) * 0.18em);
  margin: 0;
  vertical-align: baseline;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 0.01rem 0.02rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.98em;
  letter-spacing: 0.18em;
  line-height: 1.2;
  box-sizing: content-box;
  text-rendering: geometricPrecision;
  white-space: nowrap;
}

.inline-cloze-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.inline-cloze-input.is-correct {
  border-bottom-color: #4e9b5d;
  background: transparent;
}

.inline-cloze-input.is-wrong {
  border-bottom-color: #c15c5c;
  background: transparent;
}

.inline-cloze-word {
  display: inline-block;
  white-space: nowrap;
}

.inline-blank {
  display: inline-block;
  margin: 0;
  color: #6d7685;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.runner-nav {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.progress-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.progress-tab {
  border: 1px solid var(--stroke);
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.progress-tab small {
  color: var(--muted);
  font-size: 0.76rem;
}

.progress-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.progress-tab.active small {
  color: rgba(255, 255, 255, 0.82);
}

.writing-card {
  background: linear-gradient(180deg, #fffef8 0%, #ffffff 100%);
}

.sentence-builder {
  display: grid;
  gap: 0.75rem;
}

.sentence-board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #fffaf0;
  padding: 0.85rem;
}

.sentence-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sentence-chip,
.sentence-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font: inherit;
  font-weight: 600;
}

.sentence-chip.fixed {
  background: #f4ede1;
  color: #51483a;
}

.sentence-chip.punctuation {
  min-width: 2.2rem;
}

.sentence-chip.movable {
  background: #ffffff;
  cursor: pointer;
}

.sentence-chip.movable.used {
  opacity: 0.45;
}

.sentence-slot {
  min-height: auto;
  min-width: calc(var(--slot-ch, 6) * 0.68ch + 1.2rem);
  padding: 0.1rem 0.2rem 0.2rem;
  border: 0;
  border-bottom: 2px solid #bfb39d;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.sentence-slot.filled {
  border-bottom-color: var(--accent);
  background: transparent;
}

.sentence-slot.targeted,
.sentence-slot.drag-over {
  border-bottom-color: var(--accent);
  background: rgba(194, 91, 53, 0.1);
  outline: 2px solid rgba(194, 91, 53, 0.28);
  outline-offset: 2px;
}

.sentence-slot[draggable="true"] .slot-text {
  cursor: grab;
}

.sentence-chip.dragging,
.sentence-slot.dragging {
  opacity: 0.55;
}

.sentence-slot:disabled {
  opacity: 1;
  cursor: default;
}

.slot-line {
  display: block;
  width: 100%;
  min-width: calc(var(--slot-ch, 6) * 0.68ch + 0.8rem);
  min-height: 1.2rem;
}

.slot-text {
  display: inline-block;
  width: 100%;
  text-align: center;
}

.writing-task {
  display: grid;
  gap: 0.8rem;
}

.writing-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.writing-field {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fffaf0;
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.2rem;
}

.writing-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.writing-value {
  font-weight: 600;
}

.writing-brief {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fffaf0;
  padding: 0.8rem 0.9rem;
}

.writing-brief h4 {
  margin: 0 0 0.4rem;
}

.writing-brief p:last-child {
  margin-bottom: 0;
}

.writing-text-wrap {
  display: grid;
  gap: 0.35rem;
}

.writing-textarea {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.85rem 0.9rem;
  font: inherit;
  resize: vertical;
}

.writing-textarea:focus {
  outline: 2px solid #b7dadd;
  border-color: var(--accent);
}

.writing-word-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.writing-feedback {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.75rem 0.85rem;
}

.writing-feedback p:last-child,
.writing-feedback ul:last-child {
  margin-bottom: 0;
}

.writing-feedback.success {
  border-color: #84c490;
  background: #eef9f1;
}

.writing-feedback.warning {
  border-color: #d9b36c;
  background: #fff7e7;
}

.writing-feedback.info {
  border-color: #b9d8da;
  background: #f3fbfb;
}

.writing-checklist {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.writing-redo-row {
  display: flex;
  justify-content: flex-start;
}

.writing-redo-btn {
  border-color: #d4a174;
  color: #8f4b2a;
  background: #fff7ef;
}

.discussion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.discussion-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fffef8;
  padding: 0.8rem;
}

.discussion-card.professor {
  background: linear-gradient(180deg, #fff4d4 0%, #fffdf7 100%);
}

.discussion-card p:last-child {
  margin-bottom: 0;
}

.discussion-role {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-weight: 700;
}

.speaking-card {
  background: linear-gradient(180deg, #f5fbff 0%, #ffffff 100%);
}

.speaking-main {
  display: grid;
  gap: 0.85rem;
}

.speaking-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.speaking-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--muted);
}

.speaking-chip.type {
  border-color: #b8d6ea;
  background: #edf7fd;
  color: #255f85;
}

.speaking-chip.status.done {
  border-color: #84c490;
  background: #eef9f1;
  color: #2f7a3c;
}

.speaking-chip.status.pending {
  border-color: #d9b36c;
  background: #fff7e7;
  color: #8b5d18;
}

.speaking-chip.time {
  border-color: #d7dbe2;
  background: #f7f9fc;
  color: #4c5b6b;
}

.speaking-checklist,
.speaking-audio-block,
.speaking-record-panel {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0.8rem 0.9rem;
}

.speaking-checklist p:last-child,
.speaking-audio-block p:last-child {
  margin-bottom: 0;
}

.speaking-checklist {
  background: #f8fbff;
}

.speaking-record-panel {
  display: grid;
  gap: 0.75rem;
  background: linear-gradient(180deg, #fffdf7 0%, #f6f8fb 100%);
}

.speaking-record-status {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.recording-live,
.recording-saved,
.recording-idle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.recording-live {
  color: #a63d3d;
  font-weight: 700;
}

.recording-saved {
  color: #2f7a3c;
  font-weight: 700;
}

.recording-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #df4b4b;
  animation: pulse-recording 1.2s ease-in-out infinite;
}

.speaking-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn.is-recording {
  background: #c94747;
  border-color: #c94747;
}

.recording-error {
  margin: 0;
  color: #a63d3d;
  font-size: 0.9rem;
}

.speaking-response-audio {
  margin: 0;
}

.speaking-chip.recording {
  border-color: #a9d3a5;
  background: #f1fbef;
  color: #2f7a3c;
}

.speaking-audio-label {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.speaking-subtitle-box {
  margin: 0.7rem 0 0;
  background: #fffaf0;
}

.speaking-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.review-feedback {
  margin-top: 0.6rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

.review-feedback.fb-ok {
  border-color: #84c490;
  background: #eef9f1;
}

.review-feedback.fb-bad {
  border-color: #d88f8f;
  background: #fff1f1;
}

.review-feedback.fb-empty {
  border-color: #d0c8a5;
  background: #fff9ea;
}

.feedback-label {
  font-weight: 700;
}

.cloze-review {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.35rem;
}

.cloze-row {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  padding: 0.4rem 0.5rem;
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr minmax(8rem, 1.35fr);
  gap: 0.35rem;
  font-size: 0.82rem;
}

.cloze-row.ok {
  border-color: #84c490;
  background: #eef9f1;
}

.cloze-row.bad {
  border-color: #d88f8f;
  background: #fff1f1;
}

.cloze-row.empty {
  border-color: #d0c8a5;
  background: #fff9ea;
}

.explanation-box {
  margin-top: 0.6rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fffcf4;
  padding: 0.5rem 0.6rem;
  font-size: 0.86rem;
}

.explanation-box p {
  margin: 0.35rem 0;
  color: var(--muted);
}

.hl-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e8d58d;
  background: #fff4c8;
  color: #6e5720;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-right: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.hl-hit {
  background: #fff2b8;
  color: inherit;
  padding: 0 0.15rem;
  border-radius: 3px;
  font-weight: 700;
  border-bottom: 2px solid #ca8a04;
}

.runner-complete p {
  color: var(--muted);
  margin: 0.3rem 0;
}

.completion-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.results-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.35rem;
}

.result-row {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  display: grid;
  grid-template-columns: 3rem 1fr 1fr 5rem;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.86rem;
}

.result-q {
  font-weight: 700;
}

.result-label {
  text-align: right;
  font-weight: 700;
}

.result-row.res-ok {
  border-color: #84c490;
  background: #eef9f1;
}

.result-row.res-bad {
  border-color: #d88f8f;
  background: #fff1f1;
}

.result-row.res-empty {
  border-color: #d0c8a5;
  background: #fff9ea;
}

body.reading-mode {
  background: #ffffff;
  color: #1f2530;
}

body.reading-mode .ambient {
  display: none;
}

body.reading-mode .container {
  width: min(1760px, 96vw);
}

body.reading-mode .topbar {
  padding: 0.85rem 0;
  border-bottom: 1px solid #e5e9ef;
}

body.reading-mode .brand {
  font-family: "Space Grotesk", "Space Grotesk Fallback", sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #39424e;
}

body.reading-mode .btn-ghost {
  border-color: #d5dbe5;
  color: #4a5568;
}

body.reading-mode .test-page {
  padding: 1rem 0 2rem;
}

body.reading-mode .back-link {
  color: #5a6678;
}

body.reading-mode .test-shell {
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  box-shadow: none;
}

body.reading-mode .mode-badge {
  border-color: #d2dae5;
  color: #4d5a6d;
  background: #f7f9fc;
}

body.reading-mode .mode-badge.reading {
  border-color: #d2dae5;
  color: #4d5a6d;
}

body.reading-mode .mode-description {
  color: #64748b;
}

body.reading-mode .runner-head {
  margin-bottom: 1rem;
}

body.reading-mode .runner-head p {
  color: #4b5565;
  font-size: 1.1rem;
}

body.reading-mode .runner-card {
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
}

body.reading-mode .runner-meta {
  color: #6b7688;
  font-size: 0.98rem;
  margin-bottom: 0.55rem;
}

body.reading-mode .runner-card h3 {
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  margin-bottom: 0.55rem;
  color: #2f3744;
}

body.reading-mode .runner-question-title {
  font-size: clamp(1.25rem, 1.5vw, 1.6rem);
  margin: 0 0 0.55rem;
  color: #2f3744;
}

body.reading-mode .runner-prompt {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.02rem, 1.18vw, 1.3rem);
  font-weight: 700;
  color: #353d49;
}

body.reading-mode .runner-layout.with-passage {
  grid-template-columns: minmax(420px, 44%) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

body.reading-mode .runner-layout.with-passage .runner-passage {
  order: 1;
}

body.reading-mode .runner-layout.with-passage .runner-main {
  order: 2;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.95rem 1rem;
}

body.reading-mode .passage-card {
  border: 1px solid #c89d3f;
  border-radius: 3px;
  background: #f2d88b;
  padding: 0.6rem;
}

body.reading-mode .passage-card h4 {
  font-size: 2rem;
  margin: 0 0 0.8rem;
  color: #111827;
}

body.reading-mode .passage-card p {
  font-size: 1.05rem;
  line-height: 1.48;
  margin: 0 0 0.9rem;
  color: #111827;
}

body.reading-mode .email-meta {
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

body.reading-mode .email-row {
  grid-template-columns: 6rem 1fr;
}

body.reading-mode .email-label,
body.reading-mode .email-value,
body.reading-mode .email-body {
  border-color: #9d8a61;
  border-radius: 0;
  background: #ffffff;
}

body.reading-mode .email-label {
  font-weight: 700;
}

body.reading-mode .runner-choices {
  gap: 0.8rem;
}

body.reading-mode .runner-choice {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 0.25rem 0.35rem;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.75rem;
  font-size: 1.12rem;
  line-height: 1.45;
  color: #5a6370;
  align-items: flex-start;
}

body.reading-mode .runner-choice .runner-letter {
  display: none;
}

body.reading-mode .runner-choice input {
  margin-top: 0.24rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #0f8a93;
}

body.reading-mode .runner-choice.selected {
  border-color: #bed4ef;
  background: #f5f9ff;
}

body.reading-mode .runner-choice.is-correct {
  border-color: #84c490;
  background: #eef9f1;
}

body.reading-mode .runner-choice.is-wrong {
  border-color: #d88f8f;
  background: #fff1f1;
}

body.reading-mode .inline-cloze-input {
  border: 0;
  background: transparent;
  color: #1f2937;
}

body.reading-mode .inline-blank {
  color: #6c7688;
}

body.reading-mode .runner-nav .btn-primary {
  background: #0b7f89;
  border-color: #0b7f89;
}

body.reading-mode .q-dot.active {
  border-color: #0b7f89;
  background: #0b7f89;
}

body.writing-mode .mode-badge.writing {
  border-color: #b65c38;
  color: #b65c38;
  background: #fff6ef;
}

body.writing-mode .progress-tab.active,
body.writing-mode .q-dot.active {
  background: #b65c38;
  border-color: #b65c38;
}

body.writing-mode .runner-nav .btn-primary {
  background: #b65c38;
  border-color: #b65c38;
}

body.speaking-mode .mode-badge.speaking {
  border-color: #255f85;
  color: #255f85;
  background: #f2f8fc;
}

body.speaking-mode .progress-tab.active {
  background: #255f85;
  border-color: #255f85;
}

body.speaking-mode .runner-nav .btn-primary,
body.speaking-mode #toggleSpeakingBtn.btn-primary {
  background: #255f85;
  border-color: #255f85;
}

body.speaking-mode #recordToggleBtn.btn-primary {
  background: #1f6b77;
  border-color: #1f6b77;
}

body.speaking-mode #recordToggleBtn.btn-primary.is-recording {
  background: #c94747;
  border-color: #c94747;
}

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

@keyframes pulse-recording {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(21, 21, 21, 0.58);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-backdrop.open {
  display: flex;
}

.auth-modal-card {
  position: relative;
  width: min(480px, 100%);
  margin: auto 0;
  flex-shrink: 0;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(21, 21, 21, 0.22);
  padding: 1.15rem;
}

.auth-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.auth-copy {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.auth-label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-input {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0.72rem 0.82rem;
  font: inherit;
  font-size: 1rem;
  touch-action: manipulation;
}

.auth-input:focus {
  outline: 2px solid #b7dadd;
  border-color: var(--accent);
}

.auth-submit {
  margin-top: 0.2rem;
  touch-action: manipulation;
}

.auth-switch-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.auth-switch {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.auth-alert {
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
}

.auth-alert code {
  font-family: "Space Grotesk", "Space Grotesk Fallback", sans-serif;
  font-weight: 700;
}

.auth-alert.error {
  border: 1px solid #dfb4b4;
  background: #fff2f2;
  color: #8c3131;
}

.auth-alert.success {
  border: 1px solid #b9d7be;
  background: #f1faf1;
  color: #2f7a3c;
}

.auth-alert.warning {
  border: 1px solid #d8cfb0;
  background: #fff9ea;
  color: #7a6334;
}

@media (max-width: 940px) {
  .stats,
  .pricing-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topnav {
    order: 3;
    width: 100%;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .section-list,
  .switch-grid {
    grid-template-columns: 1fr;
  }

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

  .writing-field-grid,
  .discussion-grid {
    grid-template-columns: 1fr;
  }

  .speaking-actions {
    align-items: stretch;
  }

  .runner-nav {
    flex-direction: column;
  }

  .runner-layout.with-passage {
    grid-template-columns: 1fr;
  }

  body.reading-mode .runner-layout.with-passage {
    grid-template-columns: 1fr;
  }

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

  .result-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .result-label {
    text-align: left;
  }

  .cloze-row {
    grid-template-columns: 1fr;
  }

  .auth-switch-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 2026 visual refresh ----------------------------------------------------- */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --ink: #10211d;
  --muted: #60716c;
  --accent: #087f68;
  --accent-dark: #075d4f;
  --accent-soft: #dcf7ed;
  --accent-2: #ff7b5c;
  --navy: #102d27;
  --stroke: #dce5e1;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(16, 45, 39, 0.08);
  --shadow-hover: 0 24px 64px rgba(16, 45, 39, 0.14);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  background:
    radial-gradient(circle at 8% 8%, rgba(184, 238, 220, 0.62), transparent 28rem),
    radial-gradient(circle at 94% 16%, rgba(255, 212, 183, 0.38), transparent 24rem),
    linear-gradient(180deg, #fbfdfc 0%, var(--bg) 56%, #f8faf9 100%);
  letter-spacing: -0.012em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(rgba(16, 45, 39, 0.15) 0.55px, transparent 0.55px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 52%);
}

::selection {
  color: #fff;
  background: var(--accent);
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.55rem);
}

a,
button,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(8, 127, 104, 0.28);
  outline-offset: 3px;
}

.container {
  width: min(1180px, calc(100% - 2.5rem));
}

.ambient {
  opacity: 0.18;
  filter: blur(100px);
}

.ambient-left { background: #4ce0b3; }
.ambient-right { background: #ff967d; }

.topbar {
  position: relative;
  z-index: 20;
  min-height: 5.25rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  font-family: "Space Grotesk", "Space Grotesk Fallback", sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  color: var(--navy);
}

.brand::before {
  content: "90";
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px 11px 11px 4px;
  color: #fff;
  background: var(--navy);
  font-size: 0.82rem;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 22px rgba(16, 45, 39, 0.2);
}

.topbar-actions {
  gap: 0.62rem;
}

.btn {
  min-height: 2.75rem;
  border-color: var(--stroke);
  border-radius: 12px;
  padding: 0.72rem 1.08rem;
  font-size: 0.88rem;
  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(16, 45, 39, 0.12);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(8, 127, 104, 0.2);
}

.btn-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.btn-ghost {
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.82);
}

.auth-pill {
  min-height: 2.75rem;
  border-radius: 12px;
  border-color: var(--stroke);
  box-shadow: 0 4px 14px rgba(16, 45, 39, 0.04);
}

.hero {
  padding: clamp(3.2rem, 7vw, 6.8rem) 0 1.8rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.13em;
}

.eyebrow span {
  width: 1.7rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.hero h1 {
  max-width: 780px;
  margin-bottom: 1.35rem;
  font-size: clamp(3rem, 6.2vw, 5.9rem);
  line-height: 0.96;
  letter-spacing: -0.075em;
}

.hero h1 em {
  font-family: "Instrument Serif", "Instrument Serif Fallback", serif;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.045em;
}

.hero-copy {
  max-width: 650px;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  line-height: 1.65;
}

.hero-actions {
  align-items: center;
  margin: 1.8rem 0 0;
}

.hero-actions .btn {
  min-height: 3.2rem;
  padding-inline: 1.35rem;
}

.hero-actions .btn span {
  margin-left: 0.75rem;
  font-size: 1.2rem;
}

.hero-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 45% 55% 52% 48% / 54% 40% 60% 46%;
  background: linear-gradient(145deg, #d7f6ec, #bdebdc);
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 1px rgba(8, 127, 104, 0.08);
}

.score-card {
  position: relative;
  z-index: 2;
  width: min(285px, 82%);
  padding: 2rem 1.8rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(155deg, #143e34, #0c2923);
  box-shadow: 0 30px 70px rgba(16, 45, 39, 0.28);
  transform: rotate(3deg);
}

.score-card::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #7df2ce;
  box-shadow: 0 0 0 5px rgba(125, 242, 206, 0.12);
}

.score-label {
  color: #9fd8c8;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.score-card strong {
  display: block;
  margin: 0.5rem 0 0;
  color: #fff;
  font-family: "Instrument Serif", "Instrument Serif Fallback", serif;
  font-size: 6.2rem;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.score-card strong span { color: #77e2c0; }
.score-card p { color: #c7ddd6; }

.skill-bars {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.skill-bars span {
  position: relative;
  display: block;
  height: 0.38rem;
  margin-left: 1.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.skill-bars span::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--level);
  border-radius: inherit;
  background: linear-gradient(90deg, #42c9a0, #93f0d3);
}

.skill-bars i {
  position: absolute;
  right: calc(100% + 0.65rem);
  top: 50%;
  transform: translateY(-50%);
  color: #8fb7ab;
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 700;
}

.score-orbit {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(8, 127, 104, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 36px rgba(16, 45, 39, 0.12);
  backdrop-filter: blur(10px);
}

.score-orbit-one {
  top: 4.8rem;
  right: -0.5rem;
  width: 4.2rem;
  height: 4.2rem;
}

.score-orbit-one::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
}

.score-orbit-two {
  left: -0.5rem;
  bottom: 5rem;
  width: 5.6rem;
  height: 2.8rem;
}

.score-orbit-two::before {
  content: "READY";
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--navy);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.stats {
  position: relative;
  z-index: 4;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  gap: 1rem;
}

.stats li {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 1.25rem 1.35rem;
  border-color: rgba(220, 229, 225, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(16, 45, 39, 0.06);
}

.stats li::after {
  content: "";
  position: absolute;
  right: -1.7rem;
  bottom: -2.7rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: var(--accent-soft);
}

.stats strong {
  color: var(--navy);
  font-size: 2rem;
  letter-spacing: -0.06em;
}

.stats span {
  font-size: 0.85rem;
  font-weight: 500;
}

.section {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}

.section-head {
  align-items: flex-end;
  padding-bottom: 0.5rem;
}

.section-copy {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

.catalog-toolbar {
  position: sticky;
  top: 0.7rem;
  z-index: 10;
  margin: 1.25rem 0 1.4rem;
  padding: 0.55rem;
  border: 1px solid rgba(220, 229, 225, 0.85);
  border-radius: 16px;
  background: rgba(250, 252, 251, 0.88);
  box-shadow: 0 12px 34px rgba(16, 45, 39, 0.07);
  backdrop-filter: blur(16px);
}

.practice-category-filters {
  border-color: transparent;
  background: transparent;
  padding: 0.35rem 0.2rem 0.15rem;
}

.catalog-tab,
.section-filter,
.category-filter {
  min-height: 2.4rem;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  padding: 0.58rem 0.9rem;
  transition: 160ms ease;
}

.catalog-tab:hover,
.section-filter:hover,
.category-filter:hover {
  color: var(--ink);
  background: #eef3f1;
}

.catalog-tab.active,
.section-filter.active,
.category-filter.active {
  color: var(--surface);
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: 0 7px 18px rgba(16, 45, 39, 0.17);
}

.test-grid {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1rem;
}

.test-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
  border-color: var(--stroke);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(16, 45, 39, 0.055);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.test-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.2rem;
  width: 2.8rem;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--accent);
}

.test-card:hover {
  transform: translateY(-4px);
  border-color: #c7d9d2;
  box-shadow: var(--shadow-hover);
}

.test-head h3 {
  font-size: 1.08rem;
  letter-spacing: -0.035em;
}

.id-tag,
.practice-section {
  border: 0;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.test-head-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef476f, #d9375e);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(239, 71, 111, 0.28);
}

.new-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: #ef476f;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  flex-shrink: 0;
}

.done-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  background: #e6f6ec;
  border: 1px solid #a9dab9;
  color: #1f6c43;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.test-card.is-new::before {
  background: linear-gradient(90deg, #ef476f, var(--accent));
  width: 3.6rem;
}

.test-card.is-completed {
  border-color: #b7dfc4;
}

.test-card.is-completed::before {
  background: linear-gradient(90deg, #1f8a52, #4ec082);
  width: 3.6rem;
}

.action-grid { gap: 0.55rem; }

.action-link {
  gap: 0.4rem;
  min-height: 2.65rem;
  border-radius: 11px;
  border-color: var(--stroke);
  background: #f9fbfa;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.action-link:hover {
  transform: translateY(-1px);
  border-color: #b9cec6;
  box-shadow: 0 8px 18px rgba(16, 45, 39, 0.08);
}

.action-link.section { background: #f9fbfa; }
.action-link.is-free { color: #087357; background: #edfaf5; border-color: #bde7d7; }
.action-link.is-continue { color: #176a85; background: #eef8fc; border-color: #bddde8; }
.action-link.is-completed { color: #2e7b4e; background: #eff9f1; }
.action-link.is-locked { background: #faf8f1; border-color: #e7dfc4; }

.action-link.full {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(8, 127, 104, 0.18);
}

.footer {
  align-items: center;
  margin-top: 3rem;
  padding: 1.6rem 0 2.2rem;
  font-size: 0.86rem;
}

/* Test runner and account surfaces */
.test-page {
  padding: 2.5rem 0 5rem;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--accent-dark);
  font-size: 0.88rem;
}

.test-shell {
  padding: clamp(1.1rem, 2.5vw, 2rem);
  border-color: var(--stroke);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.test-shell > h1 {
  max-width: 900px;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.mode-badge,
.part-stage,
.speaking-chip {
  border-radius: 8px;
  font-weight: 700;
}

.mode-badge {
  padding: 0.35rem 0.65rem;
  background: var(--surface-soft);
}

.mode-badge.full {
  border-color: #b8dfd3;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.mode-choice-card,
.section-item,
.score-summary,
.listening-part,
.runner-card,
.writing-field,
.writing-brief,
.writing-feedback,
.discussion-card,
.speaking-checklist,
.speaking-audio-block,
.speaking-record-panel {
  border-color: var(--stroke);
  border-radius: 16px;
}

.mode-choice-card {
  min-height: 190px;
  padding: 1.5rem;
  background: #fff;
}

.mode-choice-card.exam {
  background: linear-gradient(145deg, #f0faf6, #fff);
}

.runner-card {
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: 0 8px 24px rgba(16, 45, 39, 0.045);
}

.q-palette {
  padding: 0.65rem;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #f7faf9;
}

.q-dot {
  border-radius: 9px;
  transition: transform 150ms ease;
}

.q-dot:hover { transform: translateY(-1px); }
.q-dot.active { border-color: var(--navy); background: var(--navy); }

.runner-choice {
  min-height: 3.2rem;
  align-items: center;
  border-radius: 12px;
  background: #fbfcfc;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.runner-choice:hover {
  transform: translateX(2px);
  border-color: #bcd0c9;
}

.runner-choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.progress-tab {
  border-radius: 10px;
  background: #f7faf9;
}

.progress-tab.active {
  border-color: var(--navy);
  background: var(--navy);
}

.writing-textarea,
.auth-input,
.cloze-input {
  border-color: var(--stroke);
  background: #fbfcfc;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.writing-textarea:focus,
.auth-input:focus,
.cloze-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 127, 104, 0.1);
}

.auth-backdrop {
  background: rgba(7, 29, 24, 0.68);
  backdrop-filter: blur(12px);
}

.auth-modal-card {
  padding: 1.6rem;
  border-radius: 24px;
  box-shadow: 0 36px 90px rgba(7, 29, 24, 0.3);
}

.auth-modal-card h2 { font-size: 2rem; }

.gate-card {
  padding: 1.35rem;
  background: linear-gradient(160deg, #fff, #f0f8f5);
}

.exam-timer {
  top: 0.7rem;
  border-color: #b6d8cf;
  border-radius: 14px;
  background: rgba(238, 249, 245, 0.94);
  backdrop-filter: blur(12px);
}

/* Reading mode keeps the exam layout, while sharing the refreshed chrome. */
body.reading-mode .brand {
  font-size: 1.28rem;
  color: var(--navy);
}

body.reading-mode .topbar {
  border-bottom-color: var(--stroke);
}

body.reading-mode .test-shell,
body.reading-mode .runner-card,
body.reading-mode .runner-layout.with-passage .runner-main {
  border-color: var(--stroke);
  border-radius: 16px;
}

body.reading-mode .runner-nav .btn-primary,
body.reading-mode .q-dot.active {
  border-color: var(--accent);
  background: var(--accent);
}

@media (max-width: 940px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-content { text-align: center; }
  .eyebrow { justify-content: center; }
  .hero-copy { margin-inline: auto; }
  .hero-actions { justify-content: center; }

  .hero-visual {
    min-height: 330px;
  }

  .hero-visual::before {
    width: 290px;
    height: 290px;
  }

  .score-orbit-one { right: 10%; }
  .score-orbit-two { left: 10%; }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    flex-wrap: nowrap;
  }

  .topbar-actions {
    width: auto;
    justify-content: flex-end;
  }

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

@media (max-width: 680px) {
  .container { width: min(100% - 1.25rem, 1180px); }

  .topbar {
    align-items: flex-start;
    min-height: 4.5rem;
  }

  .brand { font-size: 1rem; }
  .brand::before { width: 2rem; height: 2rem; }

  .topbar-actions > .btn { display: none; }
  .auth-controls { justify-content: flex-end; }
  .auth-controls .btn { min-height: 2.25rem; padding: 0.48rem 0.68rem; font-size: 0.72rem; }

  .hero { padding-top: 2.7rem; }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4.2rem); }
  .hero-copy { font-size: 1rem; }
  .hero-note { width: 100%; }

  .hero-visual { min-height: 290px; }
  .hero-visual::before { width: 250px; height: 250px; }
  .score-card { width: 225px; padding: 1.5rem 1.35rem 1.25rem; }
  .score-card strong { font-size: 4.7rem; }
  .score-orbit-one { top: 3.5rem; right: 2%; }
  .score-orbit-two { bottom: 3.3rem; left: 1%; }

  .stats {
    grid-template-columns: 1fr;
    margin-top: 2rem;
  }

  .stats li {
    min-height: 88px;
    padding: 1rem 1.1rem;
  }

  .stats strong { font-size: 1.65rem; }
  .section { padding: 3.2rem 0; }

  .catalog-toolbar {
    top: 0.35rem;
    align-items: stretch;
  }

  .catalog-tabs,
  .mock-view-tabs,
  .section-filters {
    width: 100%;
  }

  .catalog-tab,
  .mock-view-tabs .section-filter {
    flex: 1;
  }
  .section-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.15rem; }
  .section-filter { white-space: nowrap; }

  .test-grid { grid-template-columns: 1fr; }
  .test-card { padding: 1.05rem; }

  .test-shell { border-radius: 18px; padding: 1rem; }
  .test-shell > h1 { font-size: 2rem; }

  .runner-nav .btn { width: 100%; }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
}

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

/* ------------------------------------------------------------------ */
/* AI speaking feedback                                                */
/* ------------------------------------------------------------------ */

.ai-feedback-card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  gap: 0.7rem;
}

.ai-feedback-card.done {
  border-color: #b9d8da;
  background: #f6fcfc;
}

.ai-feedback-card.warning {
  border-color: #d9b36c;
  background: #fff7e7;
}

.ai-feedback-card.loading {
  border-style: dashed;
}

.ai-feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ai-feedback-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-overall {
  font-family: "Instrument Serif", "Instrument Serif Fallback", serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

.ai-overall small {
  font-size: 0.95rem;
  color: var(--muted);
}

.ai-speaking-task-scores {
  display: grid;
  gap: 0.45rem;
}

.ai-speaking-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
}

.ai-speaking-task-row span {
  color: var(--muted);
}

.ai-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-score-pill {
  flex: 1 1 6.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 0.15rem;
}

.ai-score-value {
  font-weight: 700;
  font-size: 1.15rem;
}

.ai-score-value small {
  font-weight: 400;
  color: var(--muted);
}

.ai-score-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.ai-feedback-text {
  margin: 0;
}

.ai-diff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ai-diff {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
}

.ai-diff em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.ai-diff.sub {
  border-color: #d9b36c;
  background: #fff7e7;
}

.ai-diff.del {
  border-color: #e39aa8;
  background: #fdeef1;
}

.ai-diff.ins {
  border-color: #b9d8da;
  background: #f1fafa;
}

.ai-list {
  font-size: 0.92rem;
}

.ai-list ul {
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.2rem;
}

.ai-response-breakdown {
  margin-top: 0.85rem;
  border-top: 1px solid var(--stroke);
  padding-top: 0.7rem;
}

.ai-response-breakdown > summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.ai-response-list {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.ai-response-item {
  border: 1px solid var(--stroke);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  display: grid;
  gap: 0.3rem;
}

.ai-response-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-response-index {
  font-weight: 700;
}

.ai-response-band {
  font-weight: 700;
  font-size: 1.05rem;
}

.ai-response-band.muted {
  color: var(--muted);
  font-weight: 500;
}

.ai-response-band small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}

.ai-response-accuracy {
  font-size: 0.78rem;
  color: var(--muted);
}

.ai-response-prompt,
.ai-response-said,
.ai-response-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ai-response-prompt span,
.ai-response-said span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.3rem;
}

.ai-response-note {
  color: var(--muted);
  font-style: italic;
}

.ai-transcript summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
}

.ai-transcript p {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
}

.ai-cached-note {
  margin: 0;
  font-size: 0.8rem;
}

/* AI writing feedback additions */

.ai-points,
.ai-corrections {
  list-style: none;
  padding-left: 0;
}

.ai-point {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.ai-point em,
.ai-correction em {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.ai-point-mark {
  font-weight: 700;
  line-height: 1.4;
}

.ai-point.met .ai-point-mark {
  color: #2f8f4e;
}

.ai-point.partial .ai-point-mark {
  color: #b8862b;
}

.ai-point.missing .ai-point-mark {
  color: #c0392b;
}

.ai-correction s {
  color: #c0392b;
}

.ai-correction strong {
  color: #00a651;
}

.ai-correction.typo {
  opacity: 0.75;
}

.ai-typo-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

/* Color theme ----------------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  padding: 0.55rem 0.78rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(16, 45, 39, 0.05);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.theme-toggle-icon {
  width: 1rem;
  font-size: 1.05rem;
  line-height: 1;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1210;
  --surface: #121b18;
  --surface-soft: #18231f;
  --ink: #edf5f1;
  --muted: #a2b5ae;
  --accent: #4dd2aa;
  --accent-dark: #72e0be;
  --accent-soft: #173b31;
  --accent-2: #ff967d;
  --navy: #dff8ef;
  --stroke: #2d3d37;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 24px 64px rgba(0, 0, 0, 0.42);
  --positive-soft: #142d23;
  --warning-soft: #332817;
  --danger-soft: #351d20;
  --info-soft: #172b35;
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.reading-mode {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(34, 116, 91, 0.3), transparent 28rem),
    radial-gradient(circle at 94% 16%, rgba(132, 67, 50, 0.22), transparent 24rem),
    linear-gradient(180deg, #0e1714 0%, var(--bg) 56%, #0b1210 100%);
}

html[data-theme="dark"] body::before {
  opacity: 0.22;
  background-image: radial-gradient(rgba(178, 216, 203, 0.22) 0.55px, transparent 0.55px);
}

html[data-theme="dark"] .ambient { opacity: 0.18; }
html[data-theme="dark"] .theme-toggle { box-shadow: none; }

html[data-theme="dark"] :is(
  .auth-pill,
  .btn-ghost,
  .practice-category-filters,
  .category-filter,
  .chip-btn,
  .action-link,
  .mode-choice-card,
  .section-item,
  .switch-grid a,
  .score-summary,
  .listening-part,
  .listening-question,
  .choice-item,
  .q-dot,
  .runner-card,
  .email-value,
  .email-body,
  .runner-choice,
  .cloze-item,
  .progress-tab,
  .writing-card,
  .sentence-chip.movable,
  .writing-textarea,
  .writing-feedback,
  .discussion-card,
  .speaking-card,
  .speaking-chip,
  .speaking-record-panel,
  .review-feedback,
  .cloze-row,
  .result-row,
  .auth-input,
  .q-palette,
  .cloze-input,
  .ai-feedback-card,
  .ai-score-pill,
  .ai-diff,
  .ai-speaking-task-row
) {
  color: var(--ink);
  border-color: var(--stroke);
  background: var(--surface);
}

html[data-theme="dark"] :is(
  .practice-section,
  .sentence-board,
  .writing-field,
  .writing-brief,
  .speaking-subtitle-box,
  .explanation-box,
  .transcript-box,
  .speaking-checklist,
  .exam-timer.is-paused,
  .action-link.section,
  .gate-card
) {
  color: var(--ink);
  border-color: var(--stroke);
  background: var(--surface-soft);
}

html[data-theme="dark"] .practice-topic-tag {
  color: #a8e8c7;
  border-color: rgba(168, 232, 199, 0.28);
  background: rgba(46, 112, 88, 0.28);
}

html[data-theme="dark"] .practice-topic-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

html[data-theme="dark"] :is(.auth-pill.muted, .score-orbit) {
  background: rgba(18, 27, 24, 0.86);
}

html[data-theme="dark"] .catalog-toolbar {
  border-color: var(--stroke);
  background: rgba(18, 27, 24, 0.88);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .catalog-tab:not(.active):hover,
html[data-theme="dark"] .section-filter:not(.active):hover,
html[data-theme="dark"] .category-filter:not(.active):hover {
  color: var(--ink);
  background: var(--surface-soft);
}

html[data-theme="dark"] .category-filter.active {
  color: var(--surface);
  border-color: var(--navy);
  background: var(--navy);
}

html[data-theme="dark"] .category-filter span {
  background: rgba(237, 245, 241, 0.1);
}

html[data-theme="dark"] .category-filter.active span {
  background: rgba(18, 27, 24, 0.14);
}

html[data-theme="dark"] :is(.action-link.is-free, .action-link.is-completed, .done-badge, .choice-item.is-correct, .q-dot.answered, .q-dot.correct, .runner-choice.is-correct, .review-feedback.fb-good, .cloze-row.good, .result-row.res-good, .auth-alert.success, .speaking-chip.recording, .ai-feedback-card.done, .ai-diff.ins) {
  color: #a8e8c7;
  border-color: #2e7058;
  background: var(--positive-soft);
}

html[data-theme="dark"] .test-card.is-completed {
  border-color: #2e7058;
}

html[data-theme="dark"] :is(.action-link.is-continue, .writing-feedback.info, .speaking-chip.status.ready) {
  color: #a9d9eb;
  border-color: #356b80;
  background: var(--info-soft);
}

html[data-theme="dark"] :is(.action-link.is-locked, .q-dot.empty, .writing-feedback.warning, .speaking-chip.status.pending, .review-feedback.fb-empty, .cloze-row.empty, .result-row.res-empty, .auth-alert.warning, .ai-feedback-card.warning, .ai-diff.sub, .audio-fallback, .exam-timer.is-urgent) {
  color: #f0cd8c;
  border-color: #7b5e2d;
  background: var(--warning-soft);
}

html[data-theme="dark"] :is(.choice-item.is-user-wrong, .q-dot.wrong, .runner-choice.is-wrong, .review-feedback.fb-bad, .cloze-row.bad, .result-row.res-bad, .auth-alert.error, .ai-diff.del, .exam-speaking-auto.phase-recording .exam-audio-symbol) {
  color: #f1aaa9;
  border-color: #844448;
  background: var(--danger-soft);
}

html[data-theme="dark"] :is(.passage-card, .discussion-card.professor, .hl-pill, .hl-hit) {
  color: #f2dfb5;
  border-color: #806a39;
  background: #302817;
}

html[data-theme="dark"] :is(.sentence-chip.fixed, .speaking-chip.time) {
  color: var(--muted);
  border-color: var(--stroke);
  background: #202a26;
}

html[data-theme="dark"] body.reading-mode :is(.test-shell, .runner-card, .runner-layout.with-passage .runner-main, .email-body) {
  color: var(--ink);
  border-color: var(--stroke);
  background: var(--surface);
}

html[data-theme="dark"] body.reading-mode :is(.mode-badge, .runner-choice.selected) {
  color: #a9d9eb;
  border-color: #356b80;
  background: var(--info-soft);
}

html[data-theme="dark"] body.reading-mode :is(.reading-instructions, .reading-question-number, .runner-choice, .runner-choice-text, .passage-text) {
  color: var(--ink);
}

html[data-theme="dark"] :is(input, textarea, select) {
  color: var(--ink);
  caret-color: var(--accent);
}

html[data-theme="dark"] :is(input, textarea)::placeholder { color: #82958e; }

@media (max-width: 620px) {
  .theme-toggle {
    width: 2.65rem;
    padding-inline: 0;
  }

  .theme-toggle-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* =========================================================================
   KMF / ETS 2026 Minimal Exam Runner UI (scoped to test.html)
   ========================================================================= */
body.kmf-exam-page,
body.kmf-exam-page.reading-mode {
  background: #f3f5f7;
  color: #17212b;
  letter-spacing: -0.005em;
}

body.kmf-exam-page::before,
body.kmf-exam-page .ambient,
body.kmf-exam-page #backToCatalog {
  display: none;
}

body.kmf-exam-page.exam-in-session #modeDescription {
  display: none;
}

/* Sticky ETS / KMF deep-teal top bar */
body.kmf-exam-page .kmf-exam-topbar,
body.kmf-exam-page.reading-mode .kmf-exam-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  width: 100%;
  min-height: 54px;
  padding: 0.45rem 0;
  background: #0d5c63;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 4px rgba(8, 30, 34, 0.14);
}

.kmf-exam-topbar-inner {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.kmf-exam-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

body.kmf-exam-page .kmf-exam-topbar .brand,
body.kmf-exam-page.reading-mode .kmf-exam-topbar .brand {
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  gap: 0.48rem;
  text-decoration: none;
}

body.kmf-exam-page .kmf-exam-topbar .brand::before {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 7px 7px 7px 3px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.72rem;
  box-shadow: none;
}

.kmf-topbar-divider {
  width: 1px;
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

body.kmf-exam-page .kmf-exam-topbar .mode-badge,
body.kmf-exam-page.reading-mode .kmf-exam-topbar .mode-badge,
body.kmf-exam-page.writing-mode .kmf-exam-topbar .mode-badge,
body.kmf-exam-page.speaking-mode .kmf-exam-topbar .mode-badge {
  flex-shrink: 0;
  margin: 0;
  padding: 0.22rem 0.56rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.kmf-topbar-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.kmf-exam-page .kmf-exam-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

body.kmf-exam-page .kmf-exam-topbar .kmf-topbar-btn,
body.kmf-exam-page .kmf-exam-topbar .auth-pill,
body.kmf-exam-page .kmf-exam-topbar .auth-controls .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.05rem;
  padding: 0.3rem 0.68rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
  transform: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}

body.kmf-exam-page .kmf-exam-topbar .kmf-topbar-btn:hover,
body.kmf-exam-page .kmf-exam-topbar .auth-controls .btn:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
}

body.kmf-exam-page .kmf-exam-topbar .auth-pill.muted {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

/* Exam workspace container */
body.kmf-exam-page .kmf-exam-main,
body.kmf-exam-page.reading-mode .kmf-exam-main {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

body.kmf-exam-page .kmf-exam-shell,
body.kmf-exam-page.reading-mode .kmf-exam-shell {
  padding: 0;
  border: 1px solid #dfe5ea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Mode chooser (before entering an exam session) */
body.kmf-exam-page:not(.exam-in-session) .kmf-exam-shell {
  max-width: 820px;
  margin: 1.8rem auto 0;
  padding: 1.75rem 2rem 2rem;
}

body.kmf-exam-page .mode-description {
  margin: 0 0 1.25rem;
  color: #4b5b67;
  font-size: 0.96rem;
  line-height: 1.5;
}

body.kmf-exam-page .mode-choice-grid {
  gap: 1rem;
}

body.kmf-exam-page .mode-choice-card {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  padding: 1.35rem 1.4rem;
  border: 1px solid #dce3e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

body.kmf-exam-page .mode-choice-card p {
  flex: 1;
  min-height: 0;
  margin-bottom: 1rem;
}

body.kmf-exam-page .mode-choice-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

body.kmf-exam-page .mode-choice-card:hover {
  border-color: #0d5c63;
  background: #f8fbfb;
  transform: none;
  box-shadow: none;
}

body.kmf-exam-page .mode-choice-card.exam {
  background: #f5fbfb;
  border-color: #b5d6d9;
}

body.kmf-exam-page .mode-choice-card .btn-primary {
  background: #0d5c63;
  border-color: #0d5c63;
  box-shadow: none;
}

body.kmf-exam-page .mode-choice-card .btn-primary:hover {
  background: #09484e;
  border-color: #09484e;
}

/* Integrated ETS / KMF timer bar */
body.kmf-exam-page .exam-timer {
  position: static;
  margin: 0;
  padding: 0.52rem 1.35rem;
  border: 0;
  border-bottom: 1px solid #e3e8ec;
  border-radius: 10px 10px 0 0;
  background: #f7f9fa;
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #334155;
}

body.kmf-exam-page .exam-timer-label {
  font-weight: 600;
  color: #475569;
}

body.kmf-exam-page .exam-timer-right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

body.kmf-exam-page .exam-timer-clock {
  font-size: 0.96rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0d5c63;
}

body.kmf-exam-page .exam-timer-toggle {
  padding: 0.22rem 0.58rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

body.kmf-exam-page .exam-timer-toggle:hover {
  border-color: #0d5c63;
  color: #0d5c63;
  background: #f0f9f9;
}

body.kmf-exam-page .exam-timer.is-urgent {
  background: #fef2f2;
  border-bottom-color: #fecaca;
}

body.kmf-exam-page .exam-timer.is-urgent .exam-timer-clock {
  color: #b91c1c;
}

body.kmf-exam-page .exam-timer.is-paused {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

body.kmf-exam-page .exam-timer.is-paused .exam-timer-clock {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 600;
}

/* Sub-header: question progress + palette / part tabs */
body.kmf-exam-page .runner-head,
body.kmf-exam-page.reading-mode .runner-head {
  margin: 0;
  padding: 0.62rem 1.35rem;
  border-bottom: 1px solid #e6ebef;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

body.kmf-exam-page .runner-head:first-child {
  border-radius: 10px 10px 0 0;
}

body.kmf-exam-page .runner-head p,
body.kmf-exam-page.reading-mode .runner-head p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

body.kmf-exam-page .q-palette,
body.kmf-exam-page .progress-tabs {
  margin: 0;
  padding: 0.55rem 1.35rem;
  border: 0;
  border-bottom: 1px solid #e6ebef;
  border-radius: 0;
  background: #ffffff;
  gap: 0.32rem;
}

body.kmf-exam-page .q-dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 6px;
  border: 1px solid #d5dde3;
  background: #ffffff;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  transform: none;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

body.kmf-exam-page .q-dot:hover {
  transform: none;
  border-color: #0d5c63;
  color: #0d5c63;
}

body.kmf-exam-page .q-dot.answered {
  border-color: #8cc5ca;
  background: #ebf7f8;
  color: #0d5c63;
}

body.kmf-exam-page .q-dot.correct {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}

body.kmf-exam-page .q-dot.wrong {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

body.kmf-exam-page .q-dot.empty {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

body.kmf-exam-page .q-dot.active,
body.kmf-exam-page.reading-mode .q-dot.active,
body.kmf-exam-page.writing-mode .q-dot.active,
body.kmf-exam-page.speaking-mode .q-dot.active {
  border-color: #0d5c63;
  background: #0d5c63;
  color: #ffffff;
}

body.kmf-exam-page .progress-tab {
  border-radius: 7px;
  border: 1px solid #d5dde3;
  background: #ffffff;
  color: #334155;
  padding: 0.36rem 0.72rem;
  font-size: 0.82rem;
}

body.kmf-exam-page .progress-tab.active,
body.kmf-exam-page.writing-mode .progress-tab.active,
body.kmf-exam-page.speaking-mode .progress-tab.active {
  border-color: #0d5c63;
  background: #0d5c63;
  color: #ffffff;
}

/* Seamless question body (no nested card shadows or double borders) */
body.kmf-exam-page .runner-card,
body.kmf-exam-page.reading-mode .runner-card,
body.kmf-exam-page .writing-card,
body.kmf-exam-page .speaking-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  padding: 1rem 1.5rem 1.4rem;
}

body.kmf-exam-page .runner-meta,
body.kmf-exam-page.reading-mode .runner-meta {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

body.kmf-exam-page .runner-card h3,
body.kmf-exam-page.reading-mode .runner-card h3,
body.kmf-exam-page .runner-question-title,
body.kmf-exam-page.reading-mode .runner-question-title {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0f172a;
}

body.kmf-exam-page .runner-prompt,
body.kmf-exam-page.reading-mode .runner-prompt {
  margin: 0.25rem 0 1rem;
  font-size: 1rem;
  line-height: 1.58;
  font-weight: 600;
  color: #1e293b;
}

/* Focused single-column measure for Listening, Speaking, Cloze, Sentence Building */
body.kmf-exam-page .runner-layout:not(.with-passage) > .runner-main:not(:has(.writing-split)),
body.kmf-exam-page .runner-card:not(:has(.with-passage)):not(:has(.writing-split)) > .runner-meta,
body.kmf-exam-page .runner-card:not(:has(.with-passage)):not(:has(.writing-split)) > h3,
body.kmf-exam-page .runner-card:not(:has(.with-passage)):not(:has(.writing-split)) > .runner-question-title {
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

/* Reading 50/50 split pane (ETS / KMF layout, zero yellow parchment) */
body.kmf-exam-page .runner-layout.with-passage,
body.kmf-exam-page.reading-mode .runner-layout.with-passage {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 0;
  align-items: stretch;
  margin: 0.7rem -1.5rem -1.4rem;
  border-top: 1px solid #e3e8ec;
}

body.kmf-exam-page .runner-layout.with-passage .runner-passage,
body.kmf-exam-page.reading-mode .runner-layout.with-passage .runner-passage {
  order: 1;
  padding: 1.25rem 1.65rem;
  border-right: 1px solid #e3e8ec;
  background: #ffffff;
  max-height: clamp(320px, calc(100vh - 305px), 680px);
  overflow-y: auto;
}

body.kmf-exam-page .runner-layout.with-passage .runner-main,
body.kmf-exam-page.reading-mode .runner-layout.with-passage .runner-main {
  order: 2;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 1.25rem 1.65rem;
  max-height: clamp(320px, calc(100vh - 305px), 680px);
  overflow-y: auto;
}

body.kmf-exam-page .passage-card,
body.kmf-exam-page.reading-mode .passage-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body.kmf-exam-page .passage-card h4,
body.kmf-exam-page.reading-mode .passage-card h4 {
  margin: 0 0 0.9rem;
  text-align: left;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0f172a;
}

body.kmf-exam-page .passage-card p,
body.kmf-exam-page.reading-mode .passage-card p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.78;
  color: #1e293b;
}

/* Crisp ETS email / notice box inside Reading passages */
body.kmf-exam-page .email-meta,
body.kmf-exam-page.reading-mode .email-meta {
  border: 1px solid #dde3e9;
  border-radius: 8px;
  overflow: hidden;
  gap: 0;
  margin-bottom: 1rem;
  background: #f8fafc;
}

body.kmf-exam-page .email-row,
body.kmf-exam-page.reading-mode .email-row {
  grid-template-columns: 5.5rem 1fr;
  gap: 0;
  border-bottom: 1px solid #e6ebef;
}

body.kmf-exam-page .email-row:last-child,
body.kmf-exam-page.reading-mode .email-row:last-child {
  border-bottom: 0;
}

body.kmf-exam-page .email-label,
body.kmf-exam-page.reading-mode .email-label {
  border: 0;
  border-right: 1px solid #e6ebef;
  border-radius: 0;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
}

body.kmf-exam-page .email-value,
body.kmf-exam-page.reading-mode .email-value {
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
}

body.kmf-exam-page .email-body,
body.kmf-exam-page.reading-mode .email-body {
  border: 1px solid #dde3e9;
  border-radius: 8px;
  background: #ffffff;
  padding: 1rem 1.15rem;
}

/* Clean ETS / KMF radio choice options */
body.kmf-exam-page .runner-choices,
body.kmf-exam-page.reading-mode .runner-choices {
  gap: 0.55rem;
}

body.kmf-exam-page .runner-choice,
body.kmf-exam-page.reading-mode .runner-choice {
  display: grid;
  grid-template-columns: 1.25rem 1.35rem 1fr;
  align-items: start;
  gap: 0.55rem;
  min-height: 0;
  padding: 0.72rem 0.9rem;
  border: 1px solid #dde3e9;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.96rem;
  line-height: 1.5;
  box-shadow: none;
  transform: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

body.kmf-exam-page.reading-mode .runner-choice .runner-letter {
  display: inline;
  font-weight: 700;
  color: #475569;
}

body.kmf-exam-page .runner-choice input,
body.kmf-exam-page.reading-mode .runner-choice input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.22rem;
  accent-color: #0d5c63;
}

body.kmf-exam-page .runner-choice:hover,
body.kmf-exam-page.reading-mode .runner-choice:hover {
  transform: none;
  border-color: #88b8bd;
  background: #f7fbfb;
}

body.kmf-exam-page .runner-choice.selected,
body.kmf-exam-page.reading-mode .runner-choice.selected {
  border-color: #0d5c63;
  background: #edf7f7;
  box-shadow: inset 3px 0 0 #0d5c63;
  color: #0f172a;
}

body.kmf-exam-page .runner-choice.is-correct,
body.kmf-exam-page.reading-mode .runner-choice.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: inset 3px 0 0 #16a34a;
}

body.kmf-exam-page .runner-choice.is-wrong,
body.kmf-exam-page.reading-mode .runner-choice.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: inset 3px 0 0 #dc2626;
}

/* Writing 50/50 split pane (Email & Academic Discussion) */
body.kmf-exam-page .writing-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: 0;
  margin: 0.7rem -1.5rem 1.15rem;
  border-top: 1px solid #e3e8ec;
  border-bottom: 1px solid #e3e8ec;
  align-items: stretch;
}

body.kmf-exam-page .writing-split:last-child {
  margin-bottom: -1.4rem;
  border-bottom: 0;
}

body.kmf-exam-page .writing-pane-prompt {
  padding: 1.25rem 1.55rem;
  border-right: 1px solid #e3e8ec;
  background: #fafbfc;
  display: grid;
  gap: 0.85rem;
  align-content: start;
  max-height: clamp(320px, calc(100vh - 305px), 680px);
  overflow-y: auto;
}

body.kmf-exam-page .writing-pane-editor {
  padding: 1.25rem 1.55rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: clamp(320px, calc(100vh - 305px), 680px);
  overflow-y: auto;
}

body.kmf-exam-page .writing-word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #e6ebef;
  font-size: 0.84rem;
  color: #475569;
}

body.kmf-exam-page .writing-word-metrics {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-variant-numeric: tabular-nums;
}

body.kmf-exam-page .writing-field,
body.kmf-exam-page .writing-brief,
body.kmf-exam-page .discussion-card {
  border: 1px solid #dde3e9;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.8rem 0.95rem;
}

body.kmf-exam-page .discussion-card.professor {
  background: #ffffff;
  border-left: 3px solid #0d5c63;
}

body.kmf-exam-page .discussion-role {
  color: #0d5c63;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.kmf-exam-page .writing-pane-prompt .discussion-grid {
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

body.kmf-exam-page .writing-pane-editor .writing-text-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

body.kmf-exam-page .writing-textarea {
  flex: 1;
  min-height: 230px;
  border: 1px solid #cfd8e0;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.95rem 1.05rem;
  font-size: 0.97rem;
  line-height: 1.68;
  color: #0f172a;
}

body.kmf-exam-page .writing-textarea:focus {
  border-color: #0d5c63;
  box-shadow: 0 0 0 3px rgba(13, 92, 99, 0.12);
}

/* Sentence building clean workspace */
body.kmf-exam-page .sentence-board {
  border: 1px solid #dde3e9;
  border-radius: 8px;
  background: #f8fafc;
  padding: 1rem 1.15rem;
}

body.kmf-exam-page .sentence-chip {
  min-height: 2.3rem;
  padding: 0.42rem 0.78rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.94rem;
}

body.kmf-exam-page .sentence-chip.fixed {
  background: #eef2f6;
  border-color: #dde3e9;
  color: #475569;
}

body.kmf-exam-page .sentence-chip.movable:hover {
  border-color: #0d5c63;
  background: #edf7f7;
}

body.kmf-exam-page .sentence-slot.filled {
  border-bottom-color: #0d5c63;
}

body.kmf-exam-page .sentence-slot.targeted,
body.kmf-exam-page .sentence-slot.drag-over {
  border-bottom-color: #0d5c63;
  background: rgba(13, 92, 99, 0.08);
  outline: 2px solid rgba(13, 92, 99, 0.25);
}

/* Listening & Speaking focused panels */
body.kmf-exam-page .exam-audio-gate,
body.kmf-exam-page .exam-speaking-auto {
  max-width: 560px;
  margin: 2.2rem auto;
  text-align: center;
  padding: 2rem 1.75rem;
  border: 1px solid #e3e8ec;
  border-radius: 10px;
  background: #fafbfc;
}

body.kmf-exam-page .speaking-checklist,
body.kmf-exam-page .speaking-audio-block,
body.kmf-exam-page .speaking-record-panel {
  border: 1px solid #dde3e9;
  border-radius: 8px;
  background: #fafbfc;
}

/* Clean ETS / KMF bottom navigation footer strip */
body.kmf-exam-page .runner-nav {
  margin: 0;
  padding: 0.85rem 1.4rem;
  border-top: 1px solid #e3e8ec;
  border-radius: 0 0 10px 10px;
  background: #f7f9fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

body.kmf-exam-page .runner-nav .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  min-height: 2.45rem;
  padding: 0.48rem 1.15rem;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
  transform: none;
}

body.kmf-exam-page .runner-nav .btn:hover {
  transform: none;
  box-shadow: none;
}

body.kmf-exam-page .runner-nav .btn-primary,
body.kmf-exam-page.reading-mode .runner-nav .btn-primary,
body.kmf-exam-page.writing-mode .runner-nav .btn-primary,
body.kmf-exam-page.speaking-mode .runner-nav .btn-primary {
  background: #0d5c63;
  border-color: #0d5c63;
  color: #ffffff;
}

body.kmf-exam-page .runner-nav .btn-primary:hover,
body.kmf-exam-page.reading-mode .runner-nav .btn-primary:hover,
body.kmf-exam-page.writing-mode .runner-nav .btn-primary:hover,
body.kmf-exam-page.speaking-mode .runner-nav .btn-primary:hover {
  background: #09484e;
  border-color: #09484e;
}

body.kmf-exam-page .runner-nav .btn-ghost {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

body.kmf-exam-page .runner-nav .btn-ghost:hover {
  border-color: #0d5c63;
  color: #0d5c63;
  background: #f0f9f9;
}

/* Dark theme overrides for KMF Exam Runner */
html[data-theme="dark"] body.kmf-exam-page,
html[data-theme="dark"] body.kmf-exam-page.reading-mode {
  background: #0c1215;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .kmf-exam-topbar,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .kmf-exam-topbar {
  background: #092529;
  border-bottom-color: #183d42;
}

html[data-theme="dark"] body.kmf-exam-page .kmf-exam-shell,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .kmf-exam-shell {
  background: #111a1e;
  border-color: #223138;
  box-shadow: none;
}

html[data-theme="dark"] body.kmf-exam-page .mode-description {
  color: #9bb0ba;
}

html[data-theme="dark"] body.kmf-exam-page .mode-choice-card {
  background: #152126;
  border-color: #25363e;
}

html[data-theme="dark"] body.kmf-exam-page .mode-choice-card.exam {
  background: #12282b;
  border-color: #1f5359;
}

html[data-theme="dark"] body.kmf-exam-page .mode-choice-card:hover {
  border-color: #2dd4bf;
  background: #182a30;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer,
html[data-theme="dark"] body.kmf-exam-page .runner-head,
html[data-theme="dark"] body.kmf-exam-page .runner-nav {
  background: #152126;
  border-color: #223138;
  color: #d6e4ea;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer-label,
html[data-theme="dark"] body.kmf-exam-page .runner-head p,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .runner-head p {
  color: #b4c6cf;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer-clock {
  color: #5eead4;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer.is-urgent {
  background: #2b1619;
  border-bottom-color: #5c262d;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer.is-urgent .exam-timer-clock {
  color: #fca5a5;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer-toggle {
  background: #111a1e;
  border-color: #2c4049;
  color: #cfe0e7;
}

html[data-theme="dark"] body.kmf-exam-page .exam-timer-toggle:hover {
  border-color: #5eead4;
  color: #5eead4;
}

html[data-theme="dark"] body.kmf-exam-page .runner-layout.with-passage,
html[data-theme="dark"] body.kmf-exam-page .writing-split {
  border-top-color: #223138;
  border-bottom-color: #223138;
}

html[data-theme="dark"] body.kmf-exam-page .q-palette,
html[data-theme="dark"] body.kmf-exam-page .progress-tabs,
html[data-theme="dark"] body.kmf-exam-page .runner-card,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .runner-card,
html[data-theme="dark"] body.kmf-exam-page .writing-card,
html[data-theme="dark"] body.kmf-exam-page .speaking-card,
html[data-theme="dark"] body.kmf-exam-page .runner-layout.with-passage .runner-passage,
html[data-theme="dark"] body.kmf-exam-page .runner-layout.with-passage .runner-main,
html[data-theme="dark"] body.kmf-exam-page .writing-pane-editor {
  background: #111a1e;
  border-color: #223138;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .writing-pane-prompt,
html[data-theme="dark"] body.kmf-exam-page .exam-audio-gate,
html[data-theme="dark"] body.kmf-exam-page .exam-speaking-auto,
html[data-theme="dark"] body.kmf-exam-page .sentence-board,
html[data-theme="dark"] body.kmf-exam-page .speaking-checklist,
html[data-theme="dark"] body.kmf-exam-page .speaking-audio-block,
html[data-theme="dark"] body.kmf-exam-page .speaking-record-panel {
  background: #152126;
  border-color: #223138;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .passage-card,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .passage-card {
  background: transparent;
  border: 0;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .passage-card h4,
html[data-theme="dark"] body.kmf-exam-page .runner-card h3,
html[data-theme="dark"] body.kmf-exam-page .runner-question-title {
  color: #f1f5f9;
}

html[data-theme="dark"] body.kmf-exam-page .passage-card p,
html[data-theme="dark"] body.kmf-exam-page .runner-prompt,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .runner-prompt {
  color: #dce7ec;
}

html[data-theme="dark"] body.kmf-exam-page .email-meta,
html[data-theme="dark"] body.kmf-exam-page .email-body,
html[data-theme="dark"] body.kmf-exam-page .writing-field,
html[data-theme="dark"] body.kmf-exam-page .writing-brief,
html[data-theme="dark"] body.kmf-exam-page .discussion-card,
html[data-theme="dark"] body.kmf-exam-page .writing-textarea {
  background: #111a1e;
  border-color: #25363e;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .email-row {
  border-bottom-color: #223138;
}

html[data-theme="dark"] body.kmf-exam-page .email-label {
  background: #18252b;
  border-right-color: #223138;
  color: #9bb0ba;
}

html[data-theme="dark"] body.kmf-exam-page .email-value {
  background: #111a1e;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .discussion-card.professor {
  background: #132227;
  border-left-color: #2dd4bf;
}

html[data-theme="dark"] body.kmf-exam-page .discussion-role {
  color: #5eead4;
}

html[data-theme="dark"] body.kmf-exam-page .writing-word-row {
  border-bottom-color: #223138;
  color: #9bb0ba;
}

html[data-theme="dark"] body.kmf-exam-page .q-dot,
html[data-theme="dark"] body.kmf-exam-page .progress-tab {
  background: #152126;
  border-color: #283a43;
  color: #cfe0e7;
}

html[data-theme="dark"] body.kmf-exam-page .q-dot.answered {
  background: #123337;
  border-color: #22666d;
  color: #7ee3da;
}

html[data-theme="dark"] body.kmf-exam-page .q-dot.active,
html[data-theme="dark"] body.kmf-exam-page .progress-tab.active {
  background: #0d747d;
  border-color: #0d747d;
  color: #ffffff;
}

html[data-theme="dark"] body.kmf-exam-page .runner-choice,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .runner-choice {
  background: #152126;
  border-color: #25363e;
  color: #e6eef2;
}

html[data-theme="dark"] body.kmf-exam-page .runner-choice .runner-letter {
  color: #9bb0ba;
}

html[data-theme="dark"] body.kmf-exam-page .runner-choice:hover {
  border-color: #2e6f76;
  background: #182930;
}

html[data-theme="dark"] body.kmf-exam-page .runner-choice.selected,
html[data-theme="dark"] body.kmf-exam-page.reading-mode .runner-choice.selected {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  box-shadow: inset 3px 0 0 #2dd4bf;
  color: #f1f5f9;
}

html[data-theme="dark"] body.kmf-exam-page .runner-choice.is-correct {
  border-color: #2e8b66;
  background: rgba(34, 197, 94, 0.12);
  box-shadow: inset 3px 0 0 #22c55e;
}

html[data-theme="dark"] body.kmf-exam-page .runner-choice.is-wrong {
  border-color: #a84848;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: inset 3px 0 0 #ef4444;
}

html[data-theme="dark"] body.kmf-exam-page .runner-nav .btn-ghost {
  background: #111a1e;
  border-color: #2c4049;
  color: #d6e4ea;
}

html[data-theme="dark"] body.kmf-exam-page .runner-nav .btn-ghost:hover {
  border-color: #5eead4;
  color: #5eead4;
  background: #14272c;
}

html[data-theme="dark"] body.kmf-exam-page .runner-nav .btn-primary {
  background: #0d747d;
  border-color: #0d747d;
  color: #ffffff;
}

html[data-theme="dark"] body.kmf-exam-page .runner-nav .btn-primary:hover {
  background: #0f8a94;
  border-color: #0f8a94;
}

html[data-theme="dark"] body.kmf-exam-page .hl-hit {
  background: rgba(234, 179, 8, 0.24);
  border-bottom-color: #eab308;
  color: #fef08a;
}

/* Responsive layout for KMF Exam Runner */
@media (max-width: 960px) {
  body.kmf-exam-page .runner-layout.with-passage,
  body.kmf-exam-page.reading-mode .runner-layout.with-passage,
  body.kmf-exam-page .writing-split {
    grid-template-columns: 1fr;
  }

  body.kmf-exam-page .runner-layout.with-passage .runner-passage,
  body.kmf-exam-page.reading-mode .runner-layout.with-passage .runner-passage,
  body.kmf-exam-page .writing-pane-prompt {
    border-right: 0;
    border-bottom: 1px solid #e3e8ec;
    max-height: none;
    overflow-y: visible;
  }

  html[data-theme="dark"] body.kmf-exam-page .runner-layout.with-passage .runner-passage,
  html[data-theme="dark"] body.kmf-exam-page .writing-pane-prompt {
    border-bottom-color: #223138;
  }

  body.kmf-exam-page .runner-layout.with-passage .runner-main,
  body.kmf-exam-page.reading-mode .runner-layout.with-passage .runner-main,
  body.kmf-exam-page .writing-pane-editor {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 680px) {
  .kmf-exam-topbar-inner {
    width: calc(100% - 1.25rem);
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
  }

  .kmf-exam-topbar-left {
    gap: 0.5rem;
    padding-right: 0.25rem;
  }

  body.kmf-exam-page .kmf-exam-topbar .topbar-actions {
    width: auto;
    justify-content: flex-end;
  }

  body.kmf-exam-page .kmf-exam-topbar .topbar-actions > .kmf-topbar-btn {
    display: inline-flex;
  }

  .kmf-topbar-divider {
    display: none;
  }

  body.kmf-exam-page .kmf-exam-main,
  body.kmf-exam-page.reading-mode .kmf-exam-main {
    width: calc(100% - 1rem);
    padding: 0.65rem 0 2rem;
  }

  body.kmf-exam-page .runner-card,
  body.kmf-exam-page .runner-layout.with-passage .runner-passage,
  body.kmf-exam-page .runner-layout.with-passage .runner-main,
  body.kmf-exam-page .writing-pane-prompt,
  body.kmf-exam-page .writing-pane-editor {
    padding: 0.95rem 1rem;
  }

  body.kmf-exam-page .runner-layout.with-passage,
  body.kmf-exam-page.reading-mode .runner-layout.with-passage {
    margin: 0.65rem -1rem -0.95rem;
  }

  body.kmf-exam-page .writing-split {
    margin: 0.65rem -1rem 1rem;
  }

  body.kmf-exam-page .writing-split:last-child {
    margin-bottom: -0.95rem;
  }

  body.kmf-exam-page .runner-nav {
    flex-direction: row;
    padding: 0.75rem 1rem;
  }

  body.kmf-exam-page .runner-nav .btn {
    width: auto;
  }

  body.kmf-exam-page:not(.exam-in-session) .kmf-exam-shell {
    margin-top: 0.85rem;
    padding: 1.2rem;
  }
}

/* Dark mode: Complete the Words blanks */
html[data-theme="dark"] .cloze-item {
  background: var(--surface-soft);
  border-color: var(--stroke);
}

html[data-theme="dark"] .cloze-label {
  color: var(--muted);
}

html[data-theme="dark"] .cloze-input {
  background: #0e1714;
  color: var(--ink);
  border-color: var(--stroke);
}

html[data-theme="dark"] .cloze-input:focus {
  background: #0e1714;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 210, 170, 0.22);
  outline: none;
}

html[data-theme="dark"] .inline-cloze-input,
html[data-theme="dark"] body.reading-mode .inline-cloze-input {
  background: rgba(77, 210, 170, 0.12);
  color: #7ff0cc;
  font-weight: 700;
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 3px 3px 0 0;
  padding: 0 0.12rem 0.04rem;
  caret-color: #7ff0cc;
}

html[data-theme="dark"] .inline-cloze-input:focus,
html[data-theme="dark"] body.reading-mode .inline-cloze-input:focus {
  background: rgba(77, 210, 170, 0.22);
  border-bottom-color: #7ff0cc;
  box-shadow: 0 0 0 2px rgba(77, 210, 170, 0.35);
  outline: none;
}

html[data-theme="dark"] .inline-cloze-input:disabled,
html[data-theme="dark"] body.reading-mode .inline-cloze-input:disabled {
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

html[data-theme="dark"] .inline-cloze-input.is-correct,
html[data-theme="dark"] body.reading-mode .inline-cloze-input.is-correct {
  background: rgba(74, 222, 128, 0.15);
  color: #8ff0b5;
  -webkit-text-fill-color: #8ff0b5;
  border-bottom-color: #4ade80;
  opacity: 1;
}

html[data-theme="dark"] .inline-cloze-input.is-wrong,
html[data-theme="dark"] body.reading-mode .inline-cloze-input.is-wrong {
  background: rgba(248, 113, 113, 0.16);
  color: #ff9f9f;
  -webkit-text-fill-color: #ff9f9f;
  border-bottom-color: #f87171;
  opacity: 1;
}

html[data-theme="dark"] .inline-blank,
html[data-theme="dark"] body.reading-mode .inline-blank {
  color: var(--muted);
}

/* Speaking report (engine v4) */
.ai-speaking-report {
  gap: 0.85rem;
  min-width: 0;
  color: var(--ink);
}

.ai-report-header {
  display: grid;
  gap: 0.45rem;
}

.ai-rubric {
  min-width: 0;
}

.ai-rubric-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.65rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: border-color 140ms ease, color 140ms ease;
}

.ai-rubric-toggle::-webkit-details-marker {
  display: none;
}

.ai-rubric-toggle::after {
  content: "▾";
  font-size: 0.72rem;
  line-height: 1;
}

.ai-rubric[open] > .ai-rubric-toggle {
  border-color: var(--accent);
  color: var(--accent);
}

.ai-rubric[open] > .ai-rubric-toggle::after {
  content: "▴";
}

.ai-rubric-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.ai-rubric-list {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 0.42rem;
}

.ai-rubric-item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: baseline;
  font-size: 0.83rem;
  line-height: 1.45;
}

.ai-rubric-band {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.45rem;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--stroke);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ink);
}

.ai-rubric-desc {
  margin: 0;
  color: var(--ink);
}

.ai-report-section {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.ai-report-heading {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-speaking-report .ai-feedback-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}

.ai-word-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  margin: 0.45rem 0 0.15rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.78rem;
}

.ai-word-legend-item {
  display: inline-flex;
  align-items: center;
}

.ai-speaking-report .ai-response-item {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  gap: 0.48rem;
  min-width: 0;
}

.ai-speaking-report .ai-response-head {
  justify-content: space-between;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--stroke);
}

.ai-speaking-report .ai-response-index {
  font-size: 0.9rem;
  color: var(--ink);
}

.ai-response-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ai-speaking-report .ai-response-band {
  display: inline-flex;
  align-items: baseline;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-soft);
  font-size: 0.92rem;
  line-height: 1.3;
}

.ai-response-band.ai-band-high {
  color: #1f9d55;
  border-color: rgba(31, 157, 85, 0.3);
  background: rgba(31, 157, 85, 0.08);
}

.ai-response-band.ai-band-mid {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.32);
  background: rgba(217, 119, 6, 0.09);
}

.ai-response-band.ai-band-low {
  color: #c0392b;
  border-color: rgba(192, 57, 43, 0.3);
  background: rgba(192, 57, 43, 0.08);
}

.ai-response-prompt .ai-word-mark,
.ai-word-mark {
  font-size: 0.94rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  margin-right: 0;
  color: var(--ink);
}

.ai-word-legend .ai-word-mark {
  font-size: 0.78rem;
  font-weight: 600;
}

.ai-response-prompt .ai-word-mark.ai-word-ok,
.ai-word-mark.ai-word-ok {
  color: #1f9d55;
}

.ai-response-prompt .ai-word-mark.ai-word-weak,
.ai-word-mark.ai-word-weak {
  color: #d97706;
  text-decoration: underline dotted 2px;
  text-underline-offset: 3px;
}

.ai-response-prompt .ai-word-mark.ai-word-wrong,
.ai-word-mark.ai-word-wrong {
  color: #c0392b;
  font-weight: 600;
}

.ai-response-prompt .ai-word-mark.ai-word-missing,
.ai-word-mark.ai-word-missing {
  color: #c0392b;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.88;
}

.ai-response-prompt .ai-word-mark.ai-word-plain,
.ai-word-mark.ai-word-plain {
  color: var(--ink);
}

.ai-response-criteria {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.38rem;
  border-top: 1px dashed var(--stroke);
}

.ai-response-criterion {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: break-word;
}

.ai-criterion-label {
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.3rem;
}

.ai-study-note {
  margin-top: 0.15rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0.45rem 0.65rem;
  min-width: 0;
}

.ai-study-note > summary {
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent-dark, var(--accent));
}

.ai-study-body {
  margin-top: 0.48rem;
  padding-top: 0.48rem;
  border-top: 1px solid var(--stroke);
  display: grid;
  gap: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink);
}

.ai-study-row p {
  margin: 0;
}

.ai-study-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.ai-study-keywords {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.18rem;
}

.ai-improved-box {
  margin-top: 0.15rem;
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.ai-improved-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark, var(--accent));
}

.ai-improved-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: var(--ink);
}

.ai-speaking-report .ai-response-prompt,
.ai-speaking-report .ai-response-said {
  overflow-wrap: break-word;
}

html[data-theme="dark"] .ai-speaking-report {
  color: var(--ink);
}

html[data-theme="dark"] .ai-rubric-toggle {
  background: var(--surface);
  border-color: var(--stroke);
  color: var(--muted);
}

html[data-theme="dark"] .ai-rubric-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

html[data-theme="dark"] .ai-rubric[open] > .ai-rubric-toggle {
  border-color: var(--accent);
  color: var(--accent);
}

html[data-theme="dark"] :is(
  .ai-rubric-list,
  .ai-report-section,
  .ai-word-legend
),
html[data-theme="dark"] .ai-speaking-report .ai-response-item {
  background: var(--surface);
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] :is(
  .ai-rubric-band,
  .ai-study-note,
  .ai-improved-box
),
html[data-theme="dark"] .ai-speaking-report .ai-response-band {
  background: var(--surface-soft);
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .ai-speaking-report .ai-response-band.muted {
  color: var(--muted);
}

html[data-theme="dark"] .ai-improved-box {
  border-left-color: var(--accent);
}

html[data-theme="dark"] .ai-speaking-report .ai-response-band.ai-band-high {
  color: #6ee7a8;
  border-color: rgba(110, 231, 168, 0.34);
  background: rgba(110, 231, 168, 0.12);
}

html[data-theme="dark"] .ai-speaking-report .ai-response-band.ai-band-mid {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.12);
}

html[data-theme="dark"] .ai-speaking-report .ai-response-band.ai-band-low {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.12);
}

html[data-theme="dark"] .ai-response-prompt .ai-word-mark.ai-word-ok,
html[data-theme="dark"] .ai-word-mark.ai-word-ok {
  color: #6ee7a8;
}

html[data-theme="dark"] .ai-response-prompt .ai-word-mark.ai-word-weak,
html[data-theme="dark"] .ai-word-mark.ai-word-weak {
  color: #fbbf24;
}

html[data-theme="dark"] .ai-response-prompt .ai-word-mark.ai-word-wrong,
html[data-theme="dark"] .ai-word-mark.ai-word-wrong,
html[data-theme="dark"] .ai-response-prompt .ai-word-mark.ai-word-missing,
html[data-theme="dark"] .ai-word-mark.ai-word-missing {
  color: #f87171;
}

html[data-theme="dark"] .ai-response-prompt .ai-word-mark.ai-word-plain,
html[data-theme="dark"] .ai-word-mark.ai-word-plain {
  color: var(--ink);
}

@media (max-width: 760px) {
  .ai-speaking-report {
    padding: 0.75rem;
    gap: 0.7rem;
  }

  .ai-speaking-report .ai-feedback-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ai-speaking-report .ai-score-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-speaking-report .ai-score-pill {
    min-width: 0;
  }

  .ai-report-section,
  .ai-speaking-report .ai-response-item {
    padding: 0.65rem 0.7rem;
  }

  .ai-speaking-report .ai-response-head {
    gap: 0.35rem;
  }

  .ai-rubric-item {
    grid-template-columns: 1.6rem minmax(0, 1fr);
    gap: 0.45rem;
  }

  .ai-word-legend {
    gap: 0.3rem 0.65rem;
    padding: 0.38rem 0.55rem;
  }
}

/* Mock Interview topic filters & vocabulary panel */
/* Sits below the sticky catalog toolbar (not inside it), so it scrolls away. */
.practice-topic-filters {
  min-width: 0;
  margin: -0.4rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface);
}

.practice-topic-chip {
  font-family: inherit;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.practice-topic-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.vocab-panel {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  min-width: 0;
}

.vocab-panel[hidden] {
  display: none;
}

.vocab-panel.is-hint,
.vocab-panel.is-status {
  padding: 0.72rem 1rem;
  box-shadow: none;
}

.vocab-hint,
.vocab-status,
.vocab-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.vocab-header + .vocab-status {
  margin-top: 0.65rem;
}

.vocab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.vocab-title-wrap {
  min-width: 0;
}

.vocab-title {
  margin: 0;
  font-size: 1.08rem;
  color: var(--ink);
  letter-spacing: -0.025em;
}

.vocab-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.vocab-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vocab-toggle {
  flex-shrink: 0;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0.42rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.vocab-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.vocab-body[hidden] {
  display: none;
}

.vocab-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.85rem 0 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--stroke);
}

.vocab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.vocab-tab {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0.42rem 0.75rem;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.vocab-tab:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.vocab-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.vocab-tab span {
  display: inline-flex;
  min-width: 1.35rem;
  justify-content: center;
  margin-left: 0.3rem;
  padding: 0.04rem 0.36rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.vocab-tab.active span {
  background: rgba(255, 255, 255, 0.22);
  color: var(--surface);
}

html[data-theme="dark"] .vocab-tab.active span {
  background: rgba(18, 27, 24, 0.22);
  color: var(--surface);
}

.vocab-search-wrap {
  flex: 0 1 240px;
  min-width: 0;
}

.vocab-search {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.vocab-search::placeholder {
  color: var(--muted);
}

.vocab-search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.vocab-list-wrap {
  max-height: 26rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.15rem;
}

.vocab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.vocab-item {
  padding: 0.55rem 0.72rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface-soft);
  min-width: 0;
}

.vocab-term-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
}

.vocab-en {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  overflow-wrap: break-word;
}

.vocab-tr {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-dark);
  overflow-wrap: break-word;
}

.vocab-example {
  margin: 0.22rem 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.42;
  overflow-wrap: break-word;
}

@media (max-width: 680px) {
  .practice-topic-filters {
    min-width: 0;
    max-width: 100%;
  }

  .topic-filter-options {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
  }

  .topic-filter-options .category-filter {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .vocab-panel {
    padding: 0.85rem 0.9rem;
  }

  .vocab-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .vocab-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
  }

  .vocab-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .vocab-search-wrap {
    flex: 1 1 auto;
    width: 100%;
  }

  .vocab-list {
    grid-template-columns: 1fr;
  }
}

/* Reading: questions answered in the passage (insert a sentence, select a
   sentence). Colours and sizes are KMF's. */
#runnerRoot {
  --pick-square: #08838f;
  --pick-inserted: #d9f6f8;
  --pick-inserted-ink: #444852;
  --pick-option: #e6faff;
  --pick-selected: #016164;
}

html[data-theme="dark"] #runnerRoot {
  --pick-square: #2aa5b0;
  --pick-inserted: #1d4d53;
  --pick-inserted-ink: #f2fbfc;
  --pick-option: rgba(72, 178, 190, 0.2);
  --pick-selected: #0b8a8e;
}

#runnerRoot .insert-text-panel {
  display: grid;
  gap: 30px;
  margin-bottom: 16px;
  line-height: 1.6;
}

#runnerRoot .insert-text-panel p {
  margin: 0;
}

#runnerRoot .insert-square {
  display: inline-block;
  width: 24px;
  height: 24px;
  min-width: 0;
  min-height: 0;
  margin: 0 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--pick-square);
  vertical-align: middle;
  cursor: pointer;
}

#runnerRoot .insert-square--sample,
#runnerRoot .insert-square:disabled {
  cursor: default;
}

#runnerRoot .insert-square:disabled:not(.is-correct) {
  opacity: 0.45;
}

#runnerRoot .insert-square:focus-visible,
#runnerRoot .select-sentence:focus-visible {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}

#runnerRoot .inserted-sentence,
#runnerRoot .select-sentence {
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

#runnerRoot .inserted-sentence {
  background: var(--pick-inserted);
  color: var(--pick-inserted-ink);
  font-weight: 700;
}

#runnerRoot .select-sentence {
  padding: 2px 4px;
  background: var(--pick-option);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#runnerRoot .select-sentence.is-selected {
  background: var(--pick-selected);
  color: #fff;
}

#runnerRoot .select-sentence[aria-disabled="true"] {
  cursor: default;
}

#runnerRoot .insert-square.is-correct {
  background: #16a34a;
}

#runnerRoot :is(.inserted-sentence, .select-sentence).is-correct {
  background: #15803d;
  color: #fff;
}

#runnerRoot :is(.inserted-sentence, .select-sentence).is-wrong {
  background: #b91c1c;
  color: #fff;
}

#runnerRoot :is(.inserted-sentence, .select-sentence) .hl-hit {
  background: transparent;
  color: inherit;
}

/* Mock Tests random picker & history sections */
.test-grid.is-mock-picker {
  min-height: 0;
  align-content: start;
}

.mock-picker-card {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 1.5rem 1.6rem;
}

.mock-picker-card:hover {
  transform: none;
  border-color: var(--stroke);
  box-shadow: 0 8px 28px rgba(16, 45, 39, 0.055);
}

.mock-picker-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 680px;
}

.mock-picker-copy h3 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  letter-spacing: -0.035em;
  color: var(--ink);
}

.mock-picker-copy .section-copy {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--muted);
}

.mock-picker-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.mock-picker-btn {
  min-height: 2.9rem;
  padding: 0.72rem 1.25rem;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
}

.mock-picker-btn.btn-ghost {
  color: var(--ink);
}

.mock-picker-btn:disabled {
  opacity: 0.72;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.mock-picker-btn.is-locked {
  color: var(--muted);
  border-color: #e7dfc4;
  background: #faf8f1;
  box-shadow: none;
}

.mock-picker-btn.is-locked:hover {
  transform: none;
  box-shadow: none;
}

.mock-picker-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.mock-picker-note[hidden] {
  display: none;
}

.mock-picker-note.is-locked {
  color: #8a6518;
  font-weight: 600;
}

.mock-section-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.25rem;
}

.mock-section-head h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.mock-admin-head {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--stroke);
}

.mock-history-empty {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
}

html[data-theme="dark"] .mock-picker-card:hover {
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .mock-picker-btn.btn-primary {
  color: #0b1210;
}

html[data-theme="dark"] .mock-picker-btn.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-soft);
}

html[data-theme="dark"] .mock-picker-btn.is-locked {
  color: #f0cd8c;
  border-color: #7b5e2d;
  background: var(--warning-soft);
}

html[data-theme="dark"] .mock-picker-note.is-locked {
  color: #f0cd8c;
}

.mock-activity-panel {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mock-activity-wrap {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(16, 45, 39, 0.055);
  overflow-x: auto;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.activity-table thead th {
  padding: 0.72rem 0.95rem;
  text-align: left;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}

.activity-table thead th.activity-col-action {
  text-align: right;
}

.activity-row {
  border-bottom: 1px solid var(--stroke);
  transition: background-color 140ms ease;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-row:hover {
  background: var(--surface-soft);
}

.activity-cell {
  padding: 0.74rem 0.95rem;
  vertical-align: middle;
  color: var(--ink);
}

.activity-cell-date {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.activity-cell-test {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: break-word;
}

.activity-cell-mode {
  white-space: nowrap;
}

.activity-mode {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.activity-cell-status {
  white-space: nowrap;
}

.activity-status {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.activity-status.is-completed {
  color: #1f6c43;
  background: #e6f6ec;
  border-color: #a9dab9;
}

.activity-status.is-incomplete {
  color: #8a5a0b;
  background: #fef5e3;
  border-color: #e9c983;
}

.activity-cell-action {
  text-align: right;
  white-space: nowrap;
}

.activity-action {
  min-height: 2.15rem;
  padding: 0.36rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 9px;
}

.activity-more {
  display: flex;
  justify-content: center;
}

html[data-theme="dark"] .mock-activity-wrap {
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .activity-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .activity-mode {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--stroke);
}

html[data-theme="dark"] .activity-status.is-completed {
  color: #a8e8c7;
  background: var(--positive-soft);
  border-color: #2e7058;
}

html[data-theme="dark"] .activity-status.is-incomplete {
  color: #f0cd8c;
  background: var(--warning-soft);
  border-color: #7b5e2d;
}

@media (max-width: 680px) {
  .mock-picker-card {
    padding: 1.15rem;
  }

  .mock-picker-actions {
    align-items: stretch;
  }

  .mock-picker-btn {
    width: 100%;
  }

  .mock-activity-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .activity-table,
  .activity-table tbody {
    display: block;
    width: 100%;
  }

  .activity-table thead {
    display: none;
  }

  .activity-table tbody {
    display: grid;
    gap: 0.65rem;
  }

  .activity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date status"
      "test test"
      "mode mode"
      "action action";
    align-items: center;
    gap: 0.35rem 0.6rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(16, 45, 39, 0.045);
  }

  .activity-row:last-child {
    border-bottom: 1px solid var(--stroke);
  }

  .activity-row:hover,
  html[data-theme="dark"] .activity-row:hover {
    background: var(--surface);
  }

  html[data-theme="dark"] .activity-row {
    box-shadow: none;
  }

  .activity-cell {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    min-width: 0;
  }

  .activity-cell-date {
    grid-area: date;
    font-size: 0.8rem;
    white-space: normal;
  }

  .activity-cell-status {
    grid-area: status;
    justify-self: end;
  }

  .activity-cell-test {
    grid-area: test;
    font-size: 0.96rem;
    margin-top: 0.1rem;
  }

  .activity-cell-mode {
    grid-area: mode;
  }

  .activity-cell-action {
    grid-area: action;
    margin-top: 0.35rem;
    text-align: left;
  }

  .activity-action {
    width: 100%;
    min-height: 2.5rem;
  }
}
