:root {
  --color-night: #07122b;
  --color-night-soft: #101c3d;
  --color-purple: #24115a;
  --color-violet: #5b2bbd;
  --color-gold: #f6a623;
  --color-cyan: #35d5f2;
  --color-magenta: #d946ef;
  --color-white: #ffffff;
  --color-lavender: #f3efff;
  --color-soft-page: #f7f3fb;
  --color-soft-panel: #fffaf1;
  --color-soft-blue: #eef8fb;
  --color-ink: #161421;
  --color-muted: #c7c0df;
  --shadow-soft: 0 22px 60px rgba(3, 9, 26, 0.28);
  --header-height: 76px;
  color-scheme: dark light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-ink);
  background: var(--color-soft-page);
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--color-gold);
  color: #1b1305;
  padding: 0.65rem 1rem;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 251, 244, 0.94);
  border-bottom: 1px solid rgba(91, 43, 189, 0.12);
  box-shadow: 0 10px 30px rgba(23, 16, 63, 0.08);
  backdrop-filter: blur(16px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 128px;
  max-width: min(48vw, 320px);
  text-decoration: none;
}

.brand-link img {
  width: clamp(210px, 22vw, 320px);
  height: auto;
}

.brand-text {
  color: var(--color-ink);
  font-size: clamp(0.9rem, 1.5vw, 1.08rem);
  font-weight: 850;
  line-height: 1.1;
}

.language-nav,
.language-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.language-nav {
  justify-content: flex-end;
}

.language-nav a {
  border: 1px solid rgba(91, 43, 189, 0.16);
  border-radius: 999px;
  padding: 0.5rem 0.82rem;
  color: var(--color-ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.74);
}

.language-nav a:hover,
.language-nav a[aria-current="page"] {
  border-color: rgba(246, 166, 35, 0.9);
  background: rgba(246, 166, 35, 0.18);
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--color-soft-page);
}

.hero picture,
.hero img {
  display: block;
  width: 100%;
}

.hero img {
  height: auto;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--color-cyan);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
}

h2 {
  color: var(--color-white);
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.hero-copy p:not(.eyebrow) {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions {
  justify-content: center;
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  padding: 0.72rem 1.05rem;
  font-weight: 850;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 213, 242, 0.8);
  background: rgba(53, 213, 242, 0.16);
}

.button-primary {
  border-color: transparent;
  background: var(--color-gold);
  color: #1f1402;
}

.button-primary:hover {
  border-color: transparent;
  background: #ffc15e;
}

.button-cyan {
  border-color: transparent;
  background: #dff8ff;
  color: #073f56;
}

.button-cyan:hover {
  border-color: rgba(53, 213, 242, 0.72);
  background: #c9f2fb;
}

.section-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.intro-section {
  padding: clamp(2.2rem, 5vw, 3.5rem) 0;
  background: linear-gradient(180deg, #fffaf1 0%, var(--color-soft-page) 100%);
}

.intro-section h2 {
  color: var(--color-ink);
}

.intro-section .eyebrow {
  color: var(--color-violet);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1fr);
  max-width: 980px;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  align-items: start;
}

.intro-section h2 {
  max-width: 14ch;
}

.intro-section .rich-text {
  padding-top: 2.12rem;
}

.rich-text {
  color: #433f58;
  font-size: clamp(1rem, 1.25vw, 1.08rem);
}

.rich-text p {
  margin: 0;
}

.rich-text p + p {
  margin-top: 1rem;
}

.event-strip {
  border-block: 1px solid rgba(91, 43, 189, 0.12);
  background: linear-gradient(90deg, rgba(246, 166, 35, 0.2), rgba(53, 213, 242, 0.18));
  color: var(--color-ink);
}

.event-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.2rem 0;
}

.event-strip span {
  color: var(--color-violet);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-strip strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.countdown-section {
  padding: clamp(2.6rem, 6vw, 4.5rem) 0;
  background: linear-gradient(180deg, var(--color-soft-blue) 0%, #fffaf1 100%);
  color: var(--color-ink);
}

.countdown-section h2 {
  max-width: 18ch;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  color: var(--color-ink);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.countdown-box {
  min-height: 116px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 4px solid rgba(246, 166, 35, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 7px rgba(246, 166, 35, 0.14),
    0 14px 34px rgba(91, 43, 189, 0.12);
  padding: 1rem 0.6rem;
}

.countdown-value {
  color: var(--color-violet);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

.countdown-label {
  margin-top: 0.55rem;
  color: #0c5b78;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.countdown-message {
  margin: 1rem 0 0;
  color: #433f58;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 760;
}

.placeholder-section {
  padding: clamp(3rem, 7vw, 5rem) 0;
  background: var(--color-soft-page);
  color: var(--color-ink);
}

.placeholder-section h2 {
  color: var(--color-ink);
}

.placeholder-section .eyebrow {
  color: var(--color-violet);
}

.placeholder-section p:not(.eyebrow) {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: #433f58;
  font-size: 1.08rem;
}

.readings-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.1rem, 2vw, 1.45rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.reading-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(91, 43, 189, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 239, 255, 0.92)),
    var(--color-white);
  box-shadow: 0 18px 38px rgba(23, 16, 63, 0.09);
  padding: 1.05rem;
}

.reading-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.reading-order,
.reading-chapter {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.reading-order {
  background: rgba(53, 213, 242, 0.14);
  color: #0c5b78;
}

.reading-chapter {
  background: rgba(246, 166, 35, 0.2);
  color: #7a4a04;
}

.reading-title {
  margin: 0;
  color: var(--color-ink);
  font-size: clamp(1.22rem, 2vw, 1.52rem);
  line-height: 1.14;
}

.reading-meta {
  margin: 0;
  color: #5a536f;
  font-size: 0.95rem;
  font-weight: 650;
}

.reading-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: auto;
}

.reading-button {
  width: 100%;
  min-height: 42px;
  border-color: rgba(22, 20, 33, 0.16);
  color: var(--color-ink);
  text-align: center;
  white-space: normal;
}

.reading-button:not(.button-primary) {
  background: rgba(91, 43, 189, 0.08);
}

.reading-button.button-cyan {
  background: #dff8ff;
  color: #073f56;
}

.reading-button:not(.button-primary):hover {
  background: rgba(91, 43, 189, 0.14);
  border-color: rgba(91, 43, 189, 0.28);
}

.reading-button.button-cyan:hover {
  border-color: rgba(53, 213, 242, 0.72);
  background: #c9f2fb;
}

.placeholder-section-alt {
  background: #ffffff;
}

.placeholder-section-alt > .section-inner > .eyebrow {
  display: none;
}

.resources-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.resource-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid rgba(91, 43, 189, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(23, 16, 63, 0.08);
  padding: 1rem;
}

.resource-card.is-pending {
  background: linear-gradient(180deg, rgba(243, 239, 255, 0.88), rgba(255, 255, 255, 0.96));
}

.resource-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.resource-type,
.resource-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.resource-type {
  background: rgba(53, 213, 242, 0.14);
  color: #0c5b78;
}

.resource-status {
  background: rgba(246, 166, 35, 0.2);
  color: #7a4a04;
}

.resource-card.is-pending .resource-status {
  background: rgba(91, 43, 189, 0.1);
  color: var(--color-violet);
}

.resource-title {
  margin: 0;
  color: var(--color-ink);
  font-size: clamp(1.14rem, 1.8vw, 1.38rem);
  line-height: 1.15;
}

.resource-description {
  margin: 0;
  color: #5a536f;
  font-size: 0.96rem;
}

.resource-button {
  width: 100%;
  margin-top: auto;
}

.site-footer {
  padding: 1.6rem 1rem;
  text-align: center;
  color: #5a536f;
  background: #fffaf1;
  border-top: 1px solid rgba(91, 43, 189, 0.12);
}

.site-footer p {
  margin: 0;
}

.viewer-page {
  min-height: 100vh;
  color: var(--color-ink);
  background: var(--color-soft-page);
}

.viewer-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(91, 43, 189, 0.12);
  background: rgba(255, 251, 244, 0.94);
  box-shadow: 0 10px 30px rgba(23, 16, 63, 0.08);
  padding: 0.72rem clamp(1rem, 4vw, 2.5rem);
  backdrop-filter: blur(16px);
}

.viewer-brand {
  display: inline-flex;
  align-items: center;
  max-width: min(48vw, 300px);
}

.viewer-brand img {
  width: clamp(180px, 20vw, 280px);
  height: auto;
}

.viewer-language {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.viewer-language a {
  border: 1px solid rgba(91, 43, 189, 0.16);
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  color: var(--color-ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.74);
}

.viewer-language a[aria-current="page"],
.viewer-language a:hover {
  border-color: rgba(246, 166, 35, 0.9);
  background: rgba(246, 166, 35, 0.16);
}

.viewer-shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) 0 2rem;
}

.viewer-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 1rem;
}

.viewer-titlebar h1 {
  max-width: 18ch;
  color: var(--color-ink);
  font-size: clamp(1.9rem, 4vw, 3.6rem);
}

.viewer-subtitle {
  margin: 0.65rem 0 0;
  color: #5a536f;
  font-weight: 750;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.viewer-actions .button {
  border-color: rgba(91, 43, 189, 0.18);
  background: rgba(91, 43, 189, 0.08);
  color: var(--color-ink);
}

.viewer-actions .button:hover {
  border-color: rgba(246, 166, 35, 0.75);
  background: rgba(246, 166, 35, 0.18);
}

.viewer-actions .button-primary {
  border-color: transparent;
  background: var(--color-gold);
  color: #1f1402;
}

.pdf-reader {
  overflow: hidden;
  border: 1px solid rgba(91, 43, 189, 0.14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(23, 16, 63, 0.09);
}

.pdf-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(91, 43, 189, 0.14);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.75rem;
}

.tool-button {
  min-height: 38px;
  border: 1px solid rgba(91, 43, 189, 0.18);
  border-radius: 999px;
  background: rgba(91, 43, 189, 0.08);
  color: var(--color-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  padding: 0.48rem 0.76rem;
}

.tool-button:hover:not(:disabled) {
  border-color: rgba(246, 166, 35, 0.75);
  background: rgba(246, 166, 35, 0.18);
}

.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.page-status {
  min-width: 118px;
  color: #433f58;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(91, 43, 189, 0.16);
}

.pdf-stage {
  min-height: min(72vh, 860px);
  overflow: auto;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  background: linear-gradient(180deg, var(--color-soft-page), #fffaf1);
}

.pdf-loading {
  width: fit-content;
  margin: 2rem auto;
  border-radius: 999px;
  background: rgba(91, 43, 189, 0.08);
  color: var(--color-ink);
  padding: 0.7rem 1rem;
  font-weight: 850;
}

.pdf-loading.is-error {
  background: rgba(246, 166, 35, 0.16);
  color: #ffe3ad;
}

#pdf-canvas {
  display: block;
  max-width: none;
  margin: 0 auto;
  border-radius: 6px;
  background: var(--color-white);
  box-shadow: 0 18px 40px rgba(23, 16, 63, 0.16);
}

.gateway {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--color-night), var(--color-purple) 58%, #07122b);
}

.gateway-panel {
  width: min(680px, 100%);
  text-align: center;
}

.gateway-logo {
  width: min(360px, 82vw);
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.32));
}

.gateway h1 {
  max-width: none;
  font-size: clamp(2.4rem, 7vw, 5rem);
}

.gateway-copy {
  max-width: 34rem;
  margin: 1rem auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.1rem;
}

.language-actions {
  justify-content: center;
  margin-top: 1.7rem;
}

.practice-page {
  min-height: 100vh;
  color: var(--color-ink);
  background:
    radial-gradient(circle at top left, rgba(53, 213, 242, 0.16), transparent 34rem),
    linear-gradient(180deg, var(--color-soft-blue) 0%, var(--color-soft-page) 46%, #fffaf1 100%);
}

.practice-header {
  background: rgba(255, 255, 255, 0.94);
}

.practice-back-button {
  border-color: rgba(91, 43, 189, 0.18);
  background: rgba(91, 43, 189, 0.08);
  color: var(--color-ink);
}

.practice-shell {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3.2rem) 0 3rem;
}

.practice-hero {
  max-width: 760px;
  margin-bottom: clamp(1rem, 3vw, 1.7rem);
}

.practice-hero h1,
.practice-panel h2,
.unavailable-panel h1 {
  max-width: none;
  color: var(--color-ink);
}

.practice-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.practice-hero p:not(.eyebrow),
.practice-panel p {
  color: #433f58;
  font-size: 1.05rem;
}

.practice-source {
  margin-top: 0.75rem;
  font-weight: 750;
}

.practice-panel {
  border: 1px solid rgba(91, 43, 189, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 38px rgba(23, 16, 63, 0.09);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.question-panel {
  position: relative;
  overflow: hidden;
}

.matching-panel {
  position: relative;
  overflow: hidden;
}

.sequence-panel {
  position: relative;
  overflow: hidden;
}

.question-timebar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 8px;
  background: rgba(91, 43, 189, 0.1);
}

.question-timebar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #1b8058, #45c58b);
  box-shadow: 0 0 18px rgba(27, 128, 88, 0.55);
  transition: width 1000ms linear, background 180ms ease, box-shadow 180ms ease;
}

.question-timebar span.is-warning {
  background: linear-gradient(90deg, #b43947, #e05263);
  box-shadow: 0 0 18px rgba(224, 82, 99, 0.58);
}

.question-timebar span.is-expired {
  width: 0%;
  background: #b43947;
  box-shadow: none;
}

.practice-panel + .practice-panel {
  margin-top: 1rem;
}

.practice-panel-heading {
  max-width: 680px;
}

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

.mode-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border: 2px solid rgba(91, 43, 189, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, rgba(243, 239, 255, 0.78));
  color: var(--color-ink);
  cursor: pointer;
  font: inherit;
  padding: 1rem;
  text-align: left;
}

.mode-card:hover,
.mode-card:focus-visible {
  border-color: rgba(246, 166, 35, 0.88);
  box-shadow: 0 0 0 6px rgba(246, 166, 35, 0.13);
}

.mode-card strong {
  color: var(--color-violet);
  font-size: 1.25rem;
  line-height: 1.1;
}

.mode-card span {
  color: #433f58;
}

.mode-card em {
  border-radius: 999px;
  background: rgba(53, 213, 242, 0.14);
  color: #0c5b78;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
  padding: 0.34rem 0.62rem;
}

.question-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.level-pill,
.question-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.34rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 900;
}

.level-pill {
  background: rgba(246, 166, 35, 0.2);
  color: #7a4a04;
}

.question-count {
  background: rgba(91, 43, 189, 0.09);
  color: var(--color-violet);
}

.question-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  border: 3px solid rgba(246, 166, 35, 0.8);
  border-radius: 999px;
  background: #fff8e8;
  color: #7a4a04;
  box-shadow: 0 0 0 6px rgba(246, 166, 35, 0.14);
  padding: 0.34rem 0.5rem 0.34rem 0.8rem;
  font-weight: 900;
}

.question-timer span {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.question-timer strong {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--color-gold);
  color: #1f1402;
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.question-timer.is-warning {
  border-color: rgba(180, 57, 71, 0.85);
  background: #fff0f2;
  color: #8a1f2f;
  box-shadow: 0 0 0 7px rgba(224, 82, 99, 0.14);
}

.question-timer.is-warning strong,
.question-timer.is-expired strong {
  background: #e05263;
  color: #ffffff;
}

.question-timer.is-expired {
  border-color: rgba(180, 57, 71, 0.85);
  background: #ffe6ea;
  color: #8a1f2f;
}

.question-panel h2 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.18;
}

.matching-intro {
  max-width: 760px;
}

.matching-intro h2 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.18;
}

.matching-intro p {
  margin: 0.55rem 0 0;
}

.matching-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  margin-top: 1.25rem;
}

.matching-column {
  border: 1px solid rgba(91, 43, 189, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, rgba(238, 248, 251, 0.55));
  padding: 0.85rem;
}

.matching-column h3 {
  margin: 0 0 0.75rem;
  color: var(--color-violet);
  font-size: 1rem;
}

.matching-list {
  display: grid;
  gap: 0.65rem;
}

.matching-card {
  width: 100%;
  min-height: 52px;
  border: 2px solid rgba(91, 43, 189, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--color-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  padding: 0.8rem 0.9rem;
  text-align: left;
}

.matching-term {
  background: linear-gradient(180deg, #fffaf1, #ffffff);
}

.matching-definition {
  background: linear-gradient(180deg, #ffffff, #f3efff);
}

.matching-card:hover:not(:disabled) {
  border-color: rgba(53, 213, 242, 0.72);
  background: #eef8fb;
}

.matching-card.is-selected {
  border-color: rgba(246, 166, 35, 0.94);
  background: #fff2d4;
  box-shadow: 0 0 0 6px rgba(246, 166, 35, 0.14);
}

.matching-card.is-correct {
  border-color: rgba(27, 128, 88, 0.78);
  background: rgba(56, 179, 128, 0.15);
}

.matching-card.is-incorrect {
  border-color: rgba(180, 57, 71, 0.82);
  background: rgba(224, 82, 99, 0.12);
}

.matching-card:disabled {
  cursor: default;
}

.matching-feedback {
  margin-top: 1rem;
}

.sequence-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.sequence-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  border: 2px solid rgba(91, 43, 189, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, rgba(243, 239, 255, 0.72));
  color: var(--color-ink);
  cursor: grab;
  padding: 0.8rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.sequence-card:active {
  cursor: grabbing;
}

.sequence-card.is-dragging {
  border-color: rgba(246, 166, 35, 0.92);
  box-shadow: 0 16px 34px rgba(91, 43, 189, 0.2);
  opacity: 0.72;
  transform: scale(0.99);
}

.sequence-position {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: rgba(246, 166, 35, 0.22);
  color: #7a4a04;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.sequence-card-copy strong {
  display: block;
  color: var(--color-violet);
  font-size: 1.02rem;
}

.sequence-card-copy p {
  margin: 0.25rem 0 0;
  color: #433f58;
  font-size: 0.96rem;
}

.sequence-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.sequence-card.is-correct {
  border-color: rgba(27, 128, 88, 0.78);
  background: rgba(56, 179, 128, 0.13);
  cursor: default;
}

.sequence-card.is-incorrect {
  border-color: rgba(180, 57, 71, 0.76);
  background: rgba(224, 82, 99, 0.1);
  cursor: default;
}

.sequence-feedback {
  margin-top: 1rem;
}

.answer-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.answer-option {
  width: 100%;
  min-height: 52px;
  border: 2px solid rgba(91, 43, 189, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--color-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  padding: 0.85rem 1rem;
  text-align: left;
}

.answer-option:hover:not(:disabled) {
  border-color: rgba(53, 213, 242, 0.72);
  background: #eef8fb;
}

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

.answer-option.is-correct {
  border-color: rgba(27, 128, 88, 0.8);
  background: rgba(56, 179, 128, 0.14);
}

.answer-option.is-incorrect {
  border-color: rgba(180, 57, 71, 0.8);
  background: rgba(224, 82, 99, 0.12);
}

.feedback-box {
  margin-top: 1rem;
  border: 2px solid rgba(91, 43, 189, 0.16);
  border-radius: 8px;
  background: var(--color-soft-page);
  padding: 0.9rem 1rem;
}

.feedback-box.is-correct {
  border-color: rgba(27, 128, 88, 0.5);
  background: rgba(56, 179, 128, 0.12);
}

.feedback-box.is-incorrect {
  border-color: rgba(246, 166, 35, 0.72);
  background: rgba(246, 166, 35, 0.13);
}

.feedback-box strong {
  color: var(--color-ink);
}

.feedback-box p {
  margin: 0.35rem 0 0;
}

.practice-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.result-panel {
  max-width: 720px;
}

.score-line {
  margin: 0.7rem 0;
  color: var(--color-violet) !important;
  font-size: clamp(2rem, 5vw, 3.7rem) !important;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 980px) {
  .readings-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 128px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .language-nav {
    justify-content: flex-start;
  }

  .hero::after {
    background: linear-gradient(0deg, rgba(7, 18, 43, 0.72) 0%, rgba(7, 18, 43, 0.22) 24%, rgba(7, 18, 43, 0) 56%);
  }

  h1 {
    max-width: 11ch;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .intro-section .rich-text {
    padding-top: 0;
  }

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

  .readings-list {
    grid-template-columns: 1fr;
  }

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

  .matching-board {
    grid-template-columns: 1fr;
  }

  .sequence-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sequence-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: calc(42px + 0.8rem);
  }

  .viewer-header,
  .viewer-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer-language,
  .viewer-actions {
    justify-content: flex-start;
  }

  .viewer-brand {
    max-width: 100%;
  }

  .viewer-brand img {
    width: min(240px, 72vw);
  }

  .pdf-toolbar {
    justify-content: flex-start;
  }

  .toolbar-divider {
    display: none;
  }

  .page-status {
    order: -1;
    width: 100%;
    text-align: left;
  }
}

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