/* ================================================================
   VERDANT — IELTS Simulator Design System v2
   Sage Teal · Deep Ink · Warm Cream
   Fonts: Cormorant Garamond (display) · DM Sans (body) · DM Mono
   ================================================================ */

/* ----------------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------------- */
:root {
  /* Brand */
  --v-teal:       #28786a;
  --v-teal-lt:    rgba(40,120,106,0.1);
  --v-teal-glow:  rgba(40,120,106,0.2);
  --v-ink:        #18273a;
  --v-ink-2:      #3a5068;
  --v-muted:      #5f7489;
  --v-cream:      #faf7f2;
  --v-cream-2:    #f2ede4;
  --v-border:     #e0d9cf;
  --v-warm:       #c07848;
  --v-error:      #c0392b;

  /* Surfaces */
  --bg:       var(--v-cream);
  --surface:  #ffffff;
  --card:     #ffffff;
  --bd:       var(--v-border);

  /* Text */
  --tx:   var(--v-ink);
  --tx-2: var(--v-ink-2);
  --tx-3: var(--v-muted);

  /* Section accent colors */
  --c-listen:  #2563eb;
  --c-read:    #059669;
  --c-write:   #d97706;
  --c-speak:   #7c3aed;

  /* Compat aliases (JS uses these via CSS vars) */
  --text-primary:   var(--tx);
  --text-secondary: var(--tx-2);
  --text-muted:     var(--tx-3);
  --accent-blue:    var(--c-listen);
  --accent-green:   var(--c-read);
  --accent-orange:  var(--c-write);
  --accent-purple:  var(--c-speak);
  --accent-red:     var(--v-error);
  --accent-blue-light:   rgba(37,99,235,0.08);
  --accent-green-light:  rgba(5,150,105,0.08);
  --accent-orange-light: rgba(217,119,6,0.08);
  --accent-purple-light: rgba(124,58,237,0.08);
  --listening-color: var(--c-listen);
  --reading-color:   var(--c-read);
  --writing-color:   var(--c-write);
  --speaking-color:  var(--c-speak);
  --bg-card:    var(--card);
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --border:     var(--bd);
  --border-light: var(--v-border);

  /* Typography */
  --f-display: 'Cormorant Garamond', 'Georgia', 'STSong', serif;
  --f-body:    'DM Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --f-mono:    'DM Mono', 'Consolas', monospace;

  /* Shadows */
  --sh-sm:  0 1px 4px rgba(24,39,58,0.07);
  --sh:     0 2px 10px rgba(24,39,58,0.08), 0 1px 3px rgba(24,39,58,0.05);
  --sh-md:  0 6px 20px rgba(24,39,58,0.1);
  --sh-lg:  0 16px 48px rgba(24,39,58,0.13);

  /* Geometry */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --t:    0.18s ease;
}

/* Dark Mode */
body.dark-mode {
  --bg:       #0f1920;
  --surface:  #172030;
  --card:     #1c2a3c;
  --bd:       rgba(255,255,255,0.08);
  --tx:       #e4edf8;
  --tx-2:     #8fa8c0;
  --tx-3:     #6b8aab;
  --text-primary:   #e4edf8;
  --text-secondary: #8fa8c0;
  --text-muted:     #4e6880;
  --bg-card:    #1c2a3c;
  --bg-primary: #0f1920;
  --bg-secondary: #172030;
  --border:     rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.06);
  --accent-blue-light:   rgba(96,165,250,0.1);
  --accent-green-light:  rgba(52,211,153,0.1);
  --accent-orange-light: rgba(251,191,36,0.1);
  --accent-purple-light: rgba(167,139,250,0.1);
  --c-listen:  #60a5fa;
  --c-read:    #34d399;
  --c-write:   #fbbf24;
  --c-speak:   #a78bfa;
  --accent-blue:   #60a5fa;
  --accent-green:  #34d399;
  --accent-orange: #fbbf24;
  --accent-purple: #a78bfa;
  --listening-color: #60a5fa;
  --reading-color:   #34d399;
  --writing-color:   #fbbf24;
  --speaking-color:  #a78bfa;
  --v-teal: #3aa090;
}

/* ----------------------------------------------------------------
   2. Base
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Accessibility: Skip Nav */
.skip-nav {
  position: absolute; top: -100px; left: 0; z-index: 9999;
  background: var(--v-teal); color: #fff; padding: 8px 16px;
  font-size: 0.9rem; text-decoration: none; border-radius: 0 0 8px 0;
  transition: top 0.2s;
}
.skip-nav:focus { top: 0; }

/* Accessibility: Focus Visible */
:focus-visible {
  outline: 2px solid var(--v-teal);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--v-teal);
  outline-offset: 2px;
}

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--tx);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--t), color var(--t);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }

.page { display: none; }
.page.active { display: block; }

/* ----------------------------------------------------------------
   3. Loading Overlay
   ---------------------------------------------------------------- */
.v-loading {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,25,32,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.v-loading-card {
  background: var(--v-cream);
  border-radius: var(--r-xl);
  padding: 32px 44px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: var(--sh-lg);
}
body.dark-mode .v-loading-card { background: var(--card); }
.v-spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--bd);
  border-top-color: var(--v-teal);
  border-radius: 50%;
  animation: v-spin 0.7s linear infinite;
}
@keyframes v-spin { to { transform: rotate(360deg); } }
.v-loading-msg {
  font-size: 0.87rem; color: var(--tx-2);
}

/* ----------------------------------------------------------------
   4. Auth Page
   ---------------------------------------------------------------- */
#page-auth { height: 100vh; overflow: hidden; }

.v-auth-scene {
  position: relative;
  width: 100%; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(158deg, #0b1a28 0%, #122a3c 25%, #0e2420 55%, #0b1c2a 80%, #0d1520 100%);
  overflow: hidden;
}
.v-auth-glow {
  position: absolute; border-radius: 50%;
  pointer-events: none; filter: blur(90px);
}
.v-auth-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(40,120,106,0.2) 0%, transparent 65%);
  top: -180px; left: -120px;
}
.v-auth-glow-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(20,60,40,0.18) 0%, transparent 65%);
  bottom: -100px; right: -80px;
}
.v-auth-glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(192,120,72,0.1) 0%, transparent 65%);
  bottom: 20%; left: 20%;
}
.v-auth-card {
  position: relative; z-index: 1;
  width: 420px;
  background: var(--v-cream);
  border-radius: var(--r-xl);
  padding: 44px 40px 40px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
  animation: v-card-in 0.7s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes v-card-in {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.v-auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.v-auth-mark {
  width: 46px; height: 46px;
  background: var(--v-ink); color: var(--v-cream);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.06em; flex-shrink: 0;
}
.v-auth-brand-name {
  font-family: var(--f-display); font-size: 1.25rem; font-weight: 700;
  color: var(--v-ink); letter-spacing: -0.01em; line-height: 1.1;
}
.v-auth-brand-sub { font-size: 0.7rem; color: var(--v-muted); margin-top: 3px; letter-spacing: 0.02em; }
.v-auth-tabs {
  display: flex; background: var(--v-cream-2);
  border-radius: 11px; padding: 4px; margin-bottom: 26px;
  border: 1px solid var(--v-border);
}
.v-auth-tab {
  flex: 1; padding: 9px; background: none; border: none;
  border-radius: 8px; font-family: var(--f-body);
  font-size: 0.87rem; font-weight: 500; color: var(--v-muted);
  cursor: pointer; transition: all var(--t);
}
.v-auth-tab.active {
  background: var(--v-cream); color: var(--v-ink); font-weight: 600;
  box-shadow: 0 1px 6px rgba(24,39,58,0.12);
}
.v-auth-form { display: flex; flex-direction: column; }
.v-field { margin-bottom: 15px; }
.v-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--v-ink-2); margin-bottom: 7px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.v-input {
  width: 100%; padding: 11px 14px;
  background: #fff; border: 1.5px solid var(--v-border);
  border-radius: 10px; font-family: var(--f-body);
  font-size: 0.9rem; color: var(--v-ink); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.v-input:focus { border-color: var(--v-teal); box-shadow: 0 0 0 3px var(--v-teal-lt); }
.v-input::placeholder { color: #bbb4aa; }
.v-auth-error { font-size: 0.78rem; color: var(--v-error); min-height: 18px; margin-bottom: 6px; }
.v-auth-submit {
  width: 100%; padding: 13px;
  background: var(--v-ink); color: var(--v-cream); border: none;
  border-radius: 11px; font-family: var(--f-body);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  margin-top: 6px; letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.v-auth-submit::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 60%);
  pointer-events: none;
}
.v-auth-submit:hover {
  background: var(--v-teal); transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--v-teal-glow);
}
.v-auth-submit:active { transform: translateY(0); }

/* ----------------------------------------------------------------
   5. Home Page
   ---------------------------------------------------------------- */
#page-home { min-height: 100vh; background: var(--bg); }

/* Nav */
.hp-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,242,0.92);
  border-bottom: 1px solid var(--bd);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
body.dark-mode .hp-nav { background: rgba(15,25,32,0.92); }

.hp-nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.hp-logo { display: flex; align-items: center; gap: 10px; }
.hp-logo-mark {
  width: 34px; height: 34px;
  background: var(--v-ink); color: var(--v-cream);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.06em; flex-shrink: 0;
}
body.dark-mode .hp-logo-mark { background: var(--v-teal); }
.hp-logo-text {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); letter-spacing: -0.01em;
}
.hp-nav-right { display: flex; align-items: center; gap: 10px; }

/* User badge */
.user-badge {
  font-size: 0.78rem; color: var(--tx-2);
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 20px; padding: 4px 12px;
  font-weight: 500;
}

/* Logout */
.logout-btn {
  font-size: 0.78rem; font-weight: 500; color: var(--tx-3);
  background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 5px 12px; cursor: pointer;
  transition: all var(--t); font-family: var(--f-body);
}
.logout-btn:hover { border-color: var(--v-error); color: var(--v-error); }

/* Theme toggle (shared) */
.theme-toggle {
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: all var(--t); color: var(--tx-2);
}
.theme-toggle:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* Hero */
.hp-hero-wrap {
  background: linear-gradient(180deg, var(--v-cream-2) 0%, var(--v-cream) 100%);
  padding: 64px 32px 80px; text-align: center;
  position: relative; overflow: hidden;
}
body.dark-mode .hp-hero-wrap {
  background: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(40,120,106,0.15) 0%, transparent 70%), var(--bg);
}
.hp-hero-rings { position: absolute; inset: 0; pointer-events: none; }
body.dark-mode .hp-hero-rings::before,
body.dark-mode .hp-hero-rings::after {
  content: ''; position: absolute; border-radius: 50%;
  left: 50%; transform: translateX(-50%); border: 1px solid rgba(40,120,106,0.1);
}
body.dark-mode .hp-hero-rings::before { width: 560px; height: 560px; top: -260px; }
body.dark-mode .hp-hero-rings::after  { width: 860px; height: 860px; top: -390px; }

.hp-hero { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.hp-eyebrow {
  display: inline-block; padding: 5px 16px;
  background: var(--v-teal-lt); border: 1px solid rgba(40,120,106,0.2);
  border-radius: 30px; font-size: 0.73rem; font-weight: 500;
  color: var(--v-teal); letter-spacing: 0.04em; margin-bottom: 24px;
  animation: hp-up 0.6s ease both 0.05s;
}
.hp-headline {
  font-family: var(--f-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.02em;
  margin-bottom: 18px; animation: hp-up 0.7s ease both 0.12s;
}
.hp-hl-top { display: block; color: var(--tx); }
.hp-hl-bot { display: block; color: var(--v-teal); font-style: italic; }
body.dark-mode .hp-hl-bot { color: var(--v-teal); }
.hp-sub {
  font-size: 0.97rem; color: var(--tx-2); line-height: 1.65;
  animation: hp-up 0.6s ease both 0.22s;
}
.hp-score-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 20px; padding: 8px 18px;
  background: var(--v-teal-lt); border: 1px solid rgba(40,120,106,0.2);
  border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600;
  color: var(--v-teal); animation: hp-up 0.6s ease both 0.3s;
}

/* Module strip */
.hp-main { max-width: 1200px; margin: 0 auto; padding: 0 32px 80px; }
.hp-modules {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-top: -34px; margin-bottom: 52px;
  position: relative; z-index: 2;
  animation: hp-up 0.7s ease both 0.28s;
}
.hp-mod {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 20px 18px;
  display: flex; align-items: center; gap: 13px;
  box-shadow: var(--sh); transition: transform var(--t), box-shadow var(--t);
  border-top-width: 3px; cursor: pointer;
}
.hp-mod:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.hp-mod-arrow { margin-left: auto; font-size: 1rem; opacity: 0.3; transition: opacity var(--t), transform var(--t); }
.hp-mod:hover .hp-mod-arrow { opacity: 0.9; transform: translateX(3px); }
.hp-mod[data-c="blue"]   { border-top-color: var(--c-listen); }
.hp-mod[data-c="green"]  { border-top-color: var(--c-read); }
.hp-mod[data-c="amber"]  { border-top-color: var(--c-write); }
.hp-mod[data-c="violet"] { border-top-color: var(--c-speak); }
.hp-mod-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.hp-mod-name { font-size: 0.88rem; font-weight: 700; margin-bottom: 4px; }
.hp-mod[data-c="blue"]   .hp-mod-name { color: var(--c-listen); }
.hp-mod[data-c="green"]  .hp-mod-name { color: var(--c-read); }
.hp-mod[data-c="amber"]  .hp-mod-name { color: var(--c-write); }
.hp-mod[data-c="violet"] .hp-mod-name { color: var(--c-speak); }
.hp-mod-detail { font-size: 0.69rem; color: var(--tx-3); line-height: 1.45; }

/* Tests section */
.hp-tests { animation: hp-up 0.7s ease both 0.38s; }
.hp-tests-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.hp-tests-title { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; color: var(--tx); }
.hp-tests-badge {
  font-size: 0.75rem; font-weight: 500; color: var(--tx-3);
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 20px; padding: 3px 12px;
}
.hp-tests-tools { margin: 0 0 14px; }
.hp-tests-search {
  width: 100%; max-width: 420px;
  padding: 10px 14px;
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--tx);
  font-family: var(--f-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.hp-tests-search:focus {
  border-color: var(--v-teal);
  box-shadow: 0 0 0 3px var(--v-teal-lt);
}

/* Test cards (JS-generated) */
#page-home #testsGrid {
  display: grid; grid-template-columns: repeat(5,1fr); gap: 10px;
}
#page-home .test-card {
  position: relative;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r-lg); padding: 18px 15px;
  box-shadow: var(--sh-sm); animation: none;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  text-align: left; cursor: pointer;
}
#page-home .test-card:hover {
  border-color: var(--v-teal);
  box-shadow: 0 0 0 1px var(--v-teal), 0 6px 20px var(--v-teal-glow);
  transform: translateY(-2px);
}
#page-home .test-num {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); margin-bottom: 5px; letter-spacing: -0.02em;
  transition: color var(--t);
}
#page-home .test-card:hover .test-num { color: var(--v-teal); }
#page-home .test-topic {
  font-size: 0.78rem; color: var(--tx-2); margin-bottom: 10px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#page-home .test-status { font-size: 0.68rem; }
#page-home .test-done { color: var(--c-read); font-weight: 600; }
#page-home .test-inprogress { color: var(--c-write); }
#page-home .test-badge {
  position: absolute; top: 9px; right: 9px;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 0.5rem; display: flex; align-items: center; justify-content: center;
}
#page-home .badge-done { background: var(--c-read); color: #fff; }

@keyframes hp-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------
   6. Exam Page
   ---------------------------------------------------------------- */
#page-exam { min-height: 100vh; background: var(--bg); }

/* Exam header */
.exam-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--bd);
  box-shadow: var(--sh-sm);
}
.exam-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-body); font-size: 0.83rem; font-weight: 500;
  color: var(--tx-2); background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 6px 14px; cursor: pointer;
  transition: all var(--t);
}
.back-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }
.exam-title {
  font-family: var(--f-display); font-size: 1.1rem; font-weight: 700;
  color: var(--tx); letter-spacing: -0.01em; margin: 0;
}
.exam-controls { display: flex; align-items: center; gap: 10px; }

/* Timer */
.timer-box {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 4px 16px;
}
.timer-label { font-size: 0.6rem; color: var(--tx-3); letter-spacing: 0.04em; text-transform: uppercase; }
.timer-value {
  font-family: var(--f-mono); font-size: 1.05rem; font-weight: 500;
  color: var(--tx); letter-spacing: 0.04em;
}
.timer-warning { color: var(--v-error) !important; }

/* Section tabs */
.section-tabs {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; gap: 0; border-top: 1px solid var(--bd);
  overflow-x: auto;
}
.tab-btn {
  background: none; border: none; border-bottom: 2.5px solid transparent;
  padding: 11px 22px; font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 500;
  color: var(--tx-3); cursor: pointer; white-space: nowrap;
  transition: all var(--t);
}
.tab-btn:hover { color: var(--tx-2); }
.tab-btn.active { color: var(--v-teal); border-bottom-color: var(--v-teal); font-weight: 600; }

/* Exam main */
.exam-main { max-width: 1200px; margin: 0 auto; padding: 28px 28px 120px; }
.section-panel { display: none; }
.section-panel.active { display: block; animation: panel-in 0.22s ease; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-header { margin-bottom: 28px; }
.panel-header h2 {
  font-family: var(--f-display); font-size: 1.6rem; font-weight: 700;
  color: var(--tx); margin-bottom: 6px;
}
.panel-note { font-size: 0.85rem; color: var(--tx-2); }

/* Listening */
.listening-section {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 20px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.ls-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
}
.ls-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-listen); }
.ls-desc { font-size: 0.8rem; color: var(--tx-3); }
.ls-toolbar { display: flex; align-items: center; gap: 8px; padding: 14px 22px; }
.audio-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--c-listen);
  color: var(--c-listen); padding: 6px 16px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.8rem; font-weight: 600;
  transition: all var(--t);
}
.audio-btn:hover { background: rgba(37,99,235,0.08); }
.audio-btn.audio-playing {
  background: var(--c-listen); color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.75; } }
.transcript-toggle {
  background: none; border: 1px solid var(--bd);
  color: var(--tx-2); padding: 6px 14px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.78rem;
  transition: all var(--t);
}
.transcript-toggle:hover { border-color: var(--v-teal); color: var(--v-teal); }
.ls-transcript {
  margin: 0 22px 16px; padding: 14px 18px;
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-sm); font-size: 0.86rem;
  color: var(--tx-2); line-height: 1.8;
  max-height: 220px; overflow-y: auto;
}
.ls-transcript[hidden] { display: none !important; }
.ls-questions { padding: 4px 22px 20px; }
.ls-range {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tx-2);
  margin-left: 8px;
}

/* One exam unit: Questions X–Y */
.q-block { margin-bottom: 8px; }
.q-block-hd { margin-bottom: 10px; }
.q-block-range {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--tx);
  padding: 4px 10px;
  margin-bottom: 10px;
}
.notes-example-row { margin: 0 0 4px; font-size: 0.86rem; }
.notes-line {
  margin: 0.45em 0;
  line-height: 1.75;
}

/* Listening notes sheet (PDF-like form / note completion) */
.ls-layout { margin-top: 8px; }
.notes-sheet {
  border: 1.5px solid var(--tx);
  background: var(--card);
  padding: 18px 22px 20px;
  margin-bottom: 16px;
  color: var(--tx);
  font-size: 0.92rem;
  line-height: 1.7;
}
.notes-sheet-auto { border-color: var(--bd); }
.notes-instruction {
  margin: 0 0 4px;
  font-size: 0.84rem;
  color: var(--tx-2);
}
.notes-instruction-sub {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--tx-2);
}
.notes-title {
  margin: 6px 0 16px;
  text-align: center;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tx);
}
.notes-heading {
  margin: 14px 0 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--tx);
}
.notes-heading:first-of-type { margin-top: 4px; }
.notes-list {
  margin: 0 0 4px;
  padding-left: 1.25em;
}
.notes-list li {
  margin: 0.35em 0;
  padding-left: 0.15em;
}
.notes-example {
  text-decoration: underline;
  font-weight: 600;
  text-underline-offset: 2px;
}
.notes-blank {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  vertical-align: baseline;
  margin: 0 2px;
  max-width: 100%;
}
.notes-blank-num {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-listen);
  line-height: 1;
  flex-shrink: 0;
}
.notes-blank-input {
  display: inline-block;
  width: 8.5em;
  max-width: 42vw;
  border: none;
  border-bottom: 1.5px dotted var(--tx);
  border-radius: 0;
  background: transparent;
  padding: 1px 4px 2px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--tx);
  outline: none;
  transition: border-color var(--t), background var(--t);
}
.notes-blank-input:focus {
  border-bottom-style: solid;
  border-bottom-color: var(--c-listen);
  background: rgba(37, 99, 235, 0.06);
}
.notes-blank.correct .notes-blank-input {
  border-bottom-color: var(--c-read);
  background: rgba(5, 150, 105, 0.08);
}
.notes-blank.incorrect .notes-blank-input {
  border-bottom-color: var(--v-error);
  background: rgba(192, 57, 43, 0.06);
}
.notes-blank-missing {
  color: var(--v-error);
  font-family: var(--f-mono);
  font-size: 0.8rem;
}
.ls-map {
  margin: 12px 0 16px;
  text-align: center;
}
.ls-map img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--bd);
  background: #fff;
}
.notes-options {
  list-style: none;
  padding-left: 0.5em;
  margin: 6px 0 10px;
}
.notes-options li { margin: 0.2em 0; }
.notes-qlist {
  padding-left: 1.4em;
  margin: 8px 0;
}
.notes-flow {
  border-left: 3px solid var(--bd);
  padding-left: 14px;
  margin: 10px 0 6px;
}
.notes-flow p { margin: 0.4em 0; }
.notes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 0.9rem;
}
.notes-table th, .notes-table td {
  border: 1px solid var(--bd);
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}
.notes-table th { background: var(--bg); font-weight: 700; }
.wt-prompt-box {
  background: var(--bg);
  border: 1px solid var(--bd);
  padding: 12px 14px;
  margin: 10px 0;
  line-height: 1.65;
}
.cue-like { border-width: 2px; }
@media (max-width: 600px) {
  .notes-sheet { padding: 14px 12px 16px; }
  .notes-blank-input { width: 7em; }
}

/* Answer toggle / panel */
.answer-toggle {
  display: inline-block; background: none;
  border: 1px solid var(--bd); color: var(--c-read);
  padding: 5px 14px; border-radius: var(--r-sm);
  cursor: pointer; font-family: var(--f-body);
  font-size: 0.78rem; margin: 0 22px 14px;
  transition: all var(--t);
}
.answer-toggle:hover { background: rgba(5,150,105,0.08); border-color: var(--c-read); }
.answer-toggle-reading { color: var(--c-read); }
.answers-panel {
  margin: 0 22px 16px; padding: 12px 16px;
  background: var(--bg); border-radius: var(--r-sm);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.answers-panel-listening { border: 1px solid rgba(37,99,235,0.3); }
.answers-panel-reading   { border: 1px solid rgba(5,150,105,0.3); }
.answer-row {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 6px; padding: 4px 10px; font-size: 0.8rem;
}
.ar-num { font-weight: 700; color: var(--tx-3); font-size: 0.75rem; font-family: var(--f-mono); }
.ar-ans { color: var(--c-read); font-weight: 600; }

/* Reading */
.reading-passage {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 24px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.rp-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  background: var(--bg);
}
.rp-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-read); }
.rp-title { font-size: 1.05rem; font-weight: 700; color: var(--tx); margin-top: 2px; line-height: 1.35; }
.rp-text {
  padding: 4px 4px 20px; font-size: 0.95rem; line-height: 1.85;
  color: var(--tx);
}
.rp-text p { margin-bottom: 14px; }
.rp-text .para-label { font-weight: 700; color: var(--c-read); margin-right: 4px; }
.rp-questions { padding: 4px 4px 28px; }

/* Reading split layout (CBT-style) — panes scroll independently */
body.exam-reading-layout #page-exam {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.exam-reading-layout .exam-header {
  flex: 0 0 auto;
}
body.exam-reading-layout .exam-main {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px 12px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.exam-reading-layout .exam-footer {
  flex: 0 0 auto;
  position: relative; /* override fixed so flex height math works */
}
body.exam-reading-layout #panel-reading.active {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.exam-reading-layout #panel-reading .panel-header-reading {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  padding: 0 4px;
}
body.exam-reading-layout #panel-reading .panel-header-reading h2 {
  margin: 0;
  font-size: 1rem;
}
body.exam-reading-layout #panel-reading .panel-header-reading .panel-note {
  margin: 0;
  font-size: 0.8rem;
}

.rd-split-root {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.rd-sec-tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rd-sec-tab {
  border: 1px solid var(--bd);
  background: var(--card);
  color: var(--tx-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--f-body);
  cursor: pointer;
  transition: all var(--t);
}
.rd-sec-tab:hover { border-color: var(--c-read); color: var(--c-read); }
.rd-sec-tab.active {
  background: var(--c-read);
  border-color: var(--c-read);
  color: #fff;
}

.reading-passage.rd-split {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d8d8d8;
  box-shadow: none;
  overflow: hidden;
}
.reading-passage.rd-split.active {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.rp-pane {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 28px;
  background: #fff;
}
.rp-pane-text { flex: 1 1 52%; }
.rp-pane-qs {
  flex: 1 1 48%;
  background: #fafafa;
}
.rp-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tx);
  margin: 0 0 14px;
  line-height: 1.35;
}
.rp-splitter {
  flex: 0 0 14px;
  align-self: stretch;
  position: relative;
  cursor: col-resize;
  background: linear-gradient(#e8e8e8, #e8e8e8) center/1px 100% no-repeat;
  touch-action: none;
  user-select: none;
}
.rp-splitter:hover,
.rp-splitter:focus-visible {
  background:
    linear-gradient(rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.35)) center/2px 100% no-repeat,
    #f3f6fb;
  outline: none;
}
.rp-splitter-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #cfd6e0;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}
body.rd-splitting {
  cursor: col-resize !important;
  user-select: none !important;
}
body.rd-splitting iframe { pointer-events: none; }

body.dark-mode .reading-passage.rd-split,
body.dark-mode .rp-pane,
body.dark-mode .rp-pane-qs {
  background: var(--card);
  border-color: var(--bd);
}
body.dark-mode .rp-pane-qs { background: var(--bg); }
body.dark-mode .rp-splitter-grip {
  background: var(--card);
  border-color: var(--bd);
  color: var(--tx-2);
}

@media (max-width: 860px) {
  body.exam-reading-layout #page-exam {
    height: auto;
    overflow: auto;
  }
  body.exam-reading-layout .exam-main {
    overflow: visible;
    padding-bottom: 100px;
  }
  body.exam-reading-layout .exam-footer {
    position: fixed;
  }
  .reading-passage.rd-split.active {
    flex-direction: column;
    min-height: 70vh;
  }
  .rp-pane-text,
  .rp-pane-qs {
    flex: 1 1 50% !important;
    max-height: 45vh;
  }
  .rp-splitter {
    flex: 0 0 10px;
    cursor: row-resize;
    background: linear-gradient(#e8e8e8, #e8e8e8) center/100% 1px no-repeat;
  }
  .rp-splitter-grip { transform: translate(-50%, -50%) rotate(90deg); }
}

/* Reading highlight / notes */
.rd-hl {
  background: rgba(56, 189, 248, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  cursor: text;
}
.rd-hl-note {
  background: rgba(250, 204, 21, 0.4);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.rd-hl-note::after {
  content: '📝';
  font-size: 0.7em;
  margin-left: 2px;
  vertical-align: super;
  opacity: 0.85;
}
.rd-anno-bar {
  position: absolute;
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: #1f2937;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-family: var(--f-body);
  user-select: none;
}
.rd-anno-bar[hidden] { display: none !important; }
.rd-anno-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.rd-anno-btn:hover { background: rgba(255, 255, 255, 0.12); }
.rd-anno-btn-danger { color: #fca5a5; }
.rd-anno-btn + .rd-anno-btn {
  box-shadow: -1px 0 0 rgba(255, 255, 255, 0.12);
  margin-left: 2px;
  padding-left: 12px;
}
.rd-note-panel {
  position: absolute;
  z-index: 12001;
  width: min(320px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
  padding: 12px;
  font-family: var(--f-body);
}
.rd-note-panel[hidden] { display: none !important; }
.rd-note-hd {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 8px;
}
.rd-note-ta {
  width: 100%;
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  min-height: 88px;
  outline: none;
  color: var(--tx);
  background: var(--bg);
}
.rd-note-ta:focus { border-color: var(--c-read); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12); }
.rd-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.rd-note-cancel,
.rd-note-save {
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.rd-note-cancel {
  background: transparent;
  color: var(--tx-2);
  border: 1px solid var(--bd);
}
.rd-note-save {
  background: var(--c-read);
  color: #fff;
}
body.dark-mode .rd-note-panel {
  background: #1e293b;
  border-color: #334155;
}
body.dark-mode .rd-note-ta {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

/* Writing */
.writing-task {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 20px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.wt-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
}
.wt-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-write); }
.wt-badge {
  font-size: 0.74rem; color: var(--c-write);
  background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.2);
  border-radius: 20px; padding: 3px 12px; font-weight: 500;
}
.wt-body { padding: 20px 22px; }
.chart-desc {
  background: var(--bg); border: 1.5px dashed var(--bd);
  border-radius: var(--r-sm); padding: 14px 16px;
  font-size: 0.84rem; color: var(--tx-2); margin-bottom: 16px;
  font-style: italic; line-height: 1.6;
}
.wt-prompt { font-size: 0.9rem; color: var(--tx); margin-bottom: 16px; line-height: 1.75; }
.wt-prompt strong { color: var(--c-write); }
.writing-textarea {
  width: 100%; min-height: 200px;
  background: var(--bg); border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); padding: 14px 16px;
  font-size: 0.9rem; color: var(--tx); font-family: var(--f-body);
  resize: vertical; transition: border-color var(--t); line-height: 1.75;
  outline: none;
}
.writing-textarea:focus { border-color: var(--c-write); box-shadow: 0 0 0 3px rgba(217,119,6,0.1); }
.word-count { font-size: 0.76rem; color: var(--tx-3); margin-top: 6px; text-align: right; font-family: var(--f-mono); }
.wt-tips {
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg); border-radius: var(--r-sm);
  font-size: 0.8rem; color: var(--tx-2); border-left: 3px solid rgba(217,119,6,0.3);
}

/* Speaking */
.speaking-part {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 20px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.sp-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  background: var(--bg);
}
.sp-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-speak); }
.sp-desc { font-size: 0.8rem; color: var(--tx-2); margin-top: 3px; }
.sp-body { padding: 20px 22px; }
.cue-card {
  background: var(--bg); border: 2px solid rgba(124,58,237,0.2);
  border-radius: var(--r-sm); padding: 18px; margin-bottom: 16px;
}
.cue-card h4 { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--c-speak); margin-bottom: 10px; }
.cue-card ul { padding-left: 20px; }
.cue-card ul li { font-size: 0.88rem; margin-bottom: 6px; color: var(--tx); }
.cue-note { font-size: 0.8rem; color: var(--tx-3); margin-top: 10px; font-style: italic; }
.speaking-q-list { list-style: none; padding: 0; }
.speaking-q-item {
  padding: 12px 14px; background: var(--bg);
  border: 1px solid var(--bd); border-radius: var(--r-sm);
  margin-bottom: 10px; font-size: 0.88rem; color: var(--tx);
  display: flex; gap: 12px; align-items: flex-start;
}
.q-num { font-weight: 700; color: var(--c-speak); min-width: 24px; font-family: var(--f-mono); font-size: 0.82rem; }
.speaking-notes {
  width: 100%; min-height: 80px; background: var(--bg);
  border: 1.5px solid var(--bd); border-radius: var(--r-sm);
  padding: 10px 14px; font-size: 0.86rem; color: var(--tx);
  font-family: var(--f-body); resize: vertical; margin-top: 14px;
  transition: border-color var(--t); outline: none;
}
.speaking-notes:focus { border-color: var(--c-speak); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }

/* Questions (shared) */
.question-block {
  margin-bottom: 18px; padding: 16px 18px;
  background: var(--bg); border-radius: var(--r-sm);
  border: 1px solid var(--bd);
}
.question-block.correct { border-color: var(--c-read); background: rgba(5,150,105,0.05); }
.question-block.incorrect { border-color: var(--v-error); background: rgba(192,57,43,0.05); }
.q-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: 7px; letter-spacing: 0.06em;
  font-family: var(--f-mono);
}
.q-text { font-size: 0.9rem; color: var(--tx); margin-bottom: 12px; line-height: 1.65; }
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); cursor: pointer;
  transition: all var(--t); font-size: 0.88rem;
  background: var(--card); color: var(--tx);
}
.q-option:hover { border-color: var(--v-teal); background: var(--v-teal-lt); }
.q-option input[type="radio"] { accent-color: var(--v-teal); flex-shrink: 0; }
.q-option.selected { border-color: var(--v-teal); background: var(--v-teal-lt); }
.q-option.correct-answer { border-color: var(--c-read) !important; background: rgba(5,150,105,0.08) !important; }
.q-option.wrong-answer   { border-color: var(--v-error) !important; background: rgba(192,57,43,0.06) !important; }
.q-input {
  width: 100%; padding: 9px 13px;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); font-size: 0.9rem;
  color: var(--tx); font-family: var(--f-body);
  transition: border-color var(--t); outline: none;
}
.q-input:focus { border-color: var(--v-teal); box-shadow: 0 0 0 3px var(--v-teal-lt); }
.q-feedback { margin-top: 8px; font-size: 0.8rem; font-weight: 600; }
.q-feedback.correct   { color: var(--c-read); }
.q-feedback.incorrect { color: var(--v-error); }

/* Exam footer */
.exam-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-top: 1px solid var(--bd);
  box-shadow: 0 -4px 20px rgba(24,39,58,0.08);
}
.exam-footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 28px; display: flex; justify-content: flex-end;
}
.submit-btn {
  background: var(--v-ink); color: var(--v-cream);
  border: none; padding: 12px 28px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.92rem; font-weight: 600;
  letter-spacing: 0.02em; transition: all var(--t);
  position: relative; overflow: hidden;
}
.submit-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.submit-btn:hover {
  background: var(--v-teal); transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--v-teal-glow);
}

/* ----------------------------------------------------------------
   7. Result Page
   ---------------------------------------------------------------- */
#page-result { min-height: 100vh; background: var(--bg); }

/* Result header reuses site-header styles */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--sh-sm);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 28px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.3rem; }
.logo-text {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); letter-spacing: -0.01em;
}
.header-right { display: flex; align-items: center; gap: 10px; }

.result-main { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; }

/* Result card */
.result-card {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-xl); padding: 48px 40px 40px;
  box-shadow: var(--sh-lg); text-align: center; margin-bottom: 28px;
}
.result-card h2 {
  font-family: var(--f-display); font-size: 1.1rem; font-weight: 600;
  color: var(--tx-3); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.result-band {
  font-family: var(--f-display); font-size: 7rem; font-weight: 700;
  color: var(--v-teal); line-height: 1; margin: 4px 0 6px;
  letter-spacing: -0.04em; font-style: italic;
}
body.dark-mode .result-band { color: var(--v-teal); }

.result-breakdown {
  display: flex; justify-content: center; gap: 14px;
  flex-wrap: wrap; margin: 28px 0 32px;
}
.breakdown-item {
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 16px 24px;
  text-align: center; min-width: 120px;
}
.bd-label { font-size: 0.72rem; color: var(--tx-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--f-mono); }
.bd-score {
  font-family: var(--f-display); font-size: 1.8rem;
  font-weight: 700; font-style: italic; line-height: 1;
}
.bd-listening { color: var(--c-listen); }
.bd-reading   { color: var(--c-read); }
.bd-writing   { color: var(--c-write); }
.bd-speaking  { color: var(--c-speak); }

.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 4px; }
.btn-primary {
  background: var(--v-ink); color: var(--v-cream);
  border: none; padding: 12px 28px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.92rem; font-weight: 600;
  transition: all var(--t);
}
.btn-primary:hover { background: var(--v-teal); box-shadow: 0 6px 20px var(--v-teal-glow); transform: translateY(-1px); }
.btn-secondary {
  background: none; color: var(--tx-2);
  border: 1.5px solid var(--bd); padding: 12px 28px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.92rem; font-weight: 500;
  transition: all var(--t);
}
.btn-secondary:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* AI Feedback */
.ai-feedback-section {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-xl); padding: 32px;
  margin-bottom: 24px; box-shadow: var(--sh-sm);
}
.ai-feedback-section h3 {
  font-family: var(--f-display); font-size: 1.3rem; font-weight: 700;
  color: var(--tx); margin-bottom: 18px;
}
#aiFeedbackContent { font-size: 0.9rem; color: var(--tx-2); line-height: 1.8; }

/* Review area */
#reviewArea { margin-top: 24px; }
.review-section {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 24px; margin-bottom: 16px;
  box-shadow: var(--sh-sm);
}
.review-section h3 {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); margin-bottom: 16px;
}

/* ----------------------------------------------------------------
   8. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .hp-modules { grid-template-columns: repeat(2,1fr); margin-top: 24px; }
  #page-home #testsGrid { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 640px) {
  .hp-nav-inner, .hp-main { padding-left: 20px; padding-right: 20px; }
  .hp-hero-wrap { padding: 48px 20px 60px; }
  .hp-modules { grid-template-columns: repeat(2,1fr); }
  #page-home #testsGrid { grid-template-columns: repeat(3,1fr); }
  .exam-header-inner, .exam-footer-inner, .exam-main { padding-left: 16px; padding-right: 16px; }
  .section-tabs { padding-left: 16px; }
  .tab-btn { padding: 10px 14px; font-size: 0.82rem; }
  .result-card { padding: 36px 24px 32px; }
  .result-band { font-size: 5rem; }
  .v-auth-card { width: calc(100vw - 32px); padding: 36px 24px 32px; }
}
@media (max-width: 420px) {
  #page-home #testsGrid { grid-template-columns: repeat(2,1fr); }
  .result-breakdown { gap: 10px; }
  .breakdown-item { min-width: 90px; padding: 12px 16px; }
}

/* ================================================================
   SPEAKING AI PRACTICE — sa-* components
   ================================================================ */

/* ---- Home CTA Banner ---- */
.hp-speak-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-left: 4px solid var(--c-speak);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--sh);
  animation: fadeUp 0.4s ease both;
}
.hp-speak-cta-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hp-speak-cta-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.hp-speak-cta-title {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-speak);
  margin-bottom: 2px;
}
.hp-speak-cta-sub {
  font-size: 0.82rem;
  color: var(--tx-3);
  line-height: 1.4;
}
.hp-speak-cta-btn {
  flex-shrink: 0;
  background: var(--c-speak);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 10px 20px;
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--t), transform var(--t);
  white-space: nowrap;
}
.hp-speak-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ================================================================
   SPEAKING PAGE — Unified with VERDANT Design System
   ================================================================ */

#page-speak, .sp-page {
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background glows — separate class, position:fixed */
.sp-ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.sp-orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(124,58,237,0.13) 0%, transparent 70%);
  top: -160px; left: -160px;
}
.sp-orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(40,120,106,0.09) 0%, transparent 70%);
  bottom: -180px; right: -160px;
}

/* ---- Header ---- */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--bd);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--t), border-color var(--t);
}
.sp-back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--tx-2);
  cursor: pointer; transition: all var(--t);
  white-space: nowrap; font-family: var(--f-body);
}
.sp-back-btn:hover { background: var(--surface); color: var(--tx); border-color: var(--tx-3); }
.sp-back-btn svg { flex-shrink: 0; }
.sp-header-center {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sp-header-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-speak);
  box-shadow: 0 0 8px rgba(124,58,237,0.8);
  animation: sp-dot 2s ease-in-out infinite;
}
@keyframes sp-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.sp-header-title {
  font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 600;
  color: var(--tx); letter-spacing: 0.04em;
}
.sp-header-right { display: flex; align-items: center; gap: 10px; }
.sp-timer {
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 20px; padding: 4px 12px;
}
.sp-timer-val {
  font-family: var(--f-mono); font-size: 0.82rem; font-weight: 600;
  color: var(--c-speak); letter-spacing: 0.06em;
}
.sp-theme-btn {
  background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 6px 8px;
  cursor: pointer; transition: background var(--t); font-size: 0.85rem;
  color: var(--tx-2);
}
.sp-theme-btn:hover { background: var(--surface); }

/* ---- Setup Screen ---- */
.sp-setup {
  position: relative; z-index: 1;
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px 60px;
}
.sp-setup-inner {
  width: 100%; max-width: 560px;
  animation: sp-up 0.38s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes sp-up { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }

.sp-badge {
  display: inline-block;
  background: var(--accent-purple-light);
  color: var(--c-speak);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 4px 14px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 20px;
}
.sp-setup-heading {
  font-family: var(--f-display);
  font-size: 2.6rem; font-weight: 700; font-style: italic;
  color: var(--tx); line-height: 1.18; margin: 0 0 10px;
}
.sp-setup-sub {
  font-size: 0.88rem; color: var(--tx-3); line-height: 1.65; margin: 0 0 32px;
}
.sp-section { margin-bottom: 24px; }
.sp-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: 10px;
}
.sp-mode-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-mode-btn {
  flex: 1; min-width: 90px;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r); padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; transition: all var(--t); font-family: var(--f-body);
}
.sa-mode-btn:hover { border-color: var(--c-speak); background: var(--accent-purple-light); }
.sa-mode-btn.active { border-color: var(--c-speak); background: var(--accent-purple-light); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.sp-mode-num { font-size: 0.88rem; font-weight: 700; color: var(--tx); }
.sp-mode-sub { font-size: 0.67rem; color: var(--tx-3); }
.sa-mode-btn.active .sp-mode-num { color: var(--c-speak); }
.sa-mode-btn.active .sp-mode-sub { color: var(--c-speak); opacity: 0.8; }

.sp-topic-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.sa-topic-btn {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.78rem; font-weight: 500; color: var(--tx-2);
  cursor: pointer; transition: all var(--t); font-family: var(--f-body);
}
.sa-topic-btn:hover { border-color: var(--c-speak); color: var(--c-speak); }
.sa-topic-btn.selected, .sa-topic-btn.active { background: var(--accent-purple-light); border-color: var(--c-speak); color: var(--c-speak); font-weight: 600; }

.sa-browser-warn {
  background: var(--accent-orange-light); border: 1px solid var(--c-write);
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 0.8rem; color: var(--c-write); margin-bottom: 20px;
}

.sp-start-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--c-speak), #5b21b6);
  color: #fff; border: none; border-radius: var(--r);
  font-family: var(--f-body); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
  letter-spacing: 0.03em;
}
.sp-start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(124,58,237,0.45); }
.sp-start-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---- Session Screen ---- */
.sp-session {
  display: flex;
  height: calc(100vh - 56px);
  position: relative; z-index: 1;
}
.sp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Orb Zone — compact, aligned to top */
.sp-orb-zone {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; padding: 24px 20px 20px;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1117 100%);
}
.sp-sess-tag {
  font-size: 0.7rem; color: var(--c-speak);
  background: var(--accent-purple-light);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 3px 12px; margin-bottom: 20px;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px;
  font-family: var(--f-body);
}
.sp-orb-wrap { position: relative; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; }
.sp-orb-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(124,58,237,0.18); pointer-events: none; }
.sp-ring-1 { width: 190px; height: 190px; animation: sp-ring 4s ease-out infinite; }
.sp-ring-2 { width: 220px; height: 220px; animation: sp-ring 4s ease-out 1.8s infinite; }
@keyframes sp-ring { 0% { transform: scale(0.92); opacity: 0.5; } 100% { transform: scale(1.08); opacity: 0; } }

/* Interactive orb */
.sp-orb {
  width: 140px; height: 140px; border-radius: 50%;
  position: relative; overflow: hidden; cursor: pointer;
  animation: sp-orb-idle 5s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(124,58,237,0.45), 0 0 80px rgba(124,58,237,0.18), inset 0 0 30px rgba(0,0,0,0.4);
  transition: box-shadow 0.5s ease;
}
.sp-orb-bg { position: absolute; inset: 0; background: linear-gradient(145deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); }
.sp-blob { position: absolute; border-radius: 50%; filter: blur(18px); mix-blend-mode: screen; opacity: 0.9; }
.sp-b1 { width: 90px; height: 90px; background: radial-gradient(circle, #6366f1 0%, transparent 70%); animation: sp-blob1 7s ease-in-out infinite; }
.sp-b2 { width: 75px; height: 75px; background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); animation: sp-blob2 9s ease-in-out infinite; }
.sp-b3 { width: 65px; height: 65px; background: radial-gradient(circle, #c4b5fd 0%, transparent 70%); animation: sp-blob3 6s ease-in-out infinite; }
.sp-orb-shine { position: absolute; top: 12%; left: 14%; width: 38%; height: 32%; background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 100%); border-radius: 50%; pointer-events: none; }

@keyframes sp-blob1 { 0% { top:5%;left:5%; } 25% { top:45%;left:55%; } 50% { top:65%;left:15%; } 75% { top:20%;left:65%; } 100% { top:5%;left:5%; } }
@keyframes sp-blob2 { 0% { top:55%;left:45%; } 33% { top:10%;left:65%; } 66% { top:35%;left:5%; } 100% { top:55%;left:45%; } }
@keyframes sp-blob3 { 0% { top:25%;left:35%; } 50% { top:65%;left:55%; } 100% { top:25%;left:35%; } }
@keyframes sp-orb-idle { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.sp-page.sp-speaking .sp-orb { animation: sp-orb-speak 0.9s ease-in-out infinite; box-shadow: 0 0 60px rgba(99,102,241,0.7), 0 0 120px rgba(99,102,241,0.35), inset 0 0 30px rgba(0,0,0,0.3); }
.sp-page.sp-speaking .sp-b1 { animation-duration: 2.5s; }
.sp-page.sp-speaking .sp-b2 { animation-duration: 1.8s; }
.sp-page.sp-speaking .sp-b3 { animation-duration: 1.2s; width: 85px; height: 85px; }
.sp-page.sp-speaking .sp-ring-1 { border-color: rgba(99,102,241,0.4); animation-duration: 2s; }
.sp-page.sp-speaking .sp-ring-2 { border-color: rgba(99,102,241,0.25); animation-duration: 2.5s; }
@keyframes sp-orb-speak { 0% { transform:scale(1); } 20% { transform:scale(1.08); } 40% { transform:scale(1.04); } 60% { transform:scale(1.09); } 80% { transform:scale(1.05); } 100% { transform:scale(1); } }

.sp-page.sp-listening .sp-orb { animation: sp-orb-listen 0.6s ease-in-out infinite; box-shadow: 0 0 60px rgba(52,211,153,0.6), 0 0 120px rgba(52,211,153,0.25), inset 0 0 30px rgba(0,0,0,0.3); }
.sp-page.sp-listening .sp-orb-bg { background: linear-gradient(145deg, #064e3b 0%, #065f46 50%, #047857 100%); }
.sp-page.sp-listening .sp-b1 { background: radial-gradient(circle, #10b981 0%, transparent 70%); animation-duration: 1.5s; }
.sp-page.sp-listening .sp-b2 { background: radial-gradient(circle, #34d399 0%, transparent 70%); animation-duration: 1s; }
.sp-page.sp-listening .sp-b3 { background: radial-gradient(circle, #6ee7b7 0%, transparent 70%); animation-duration: 0.7s; }
.sp-page.sp-listening .sp-ring-1 { border-color: rgba(52,211,153,0.35); }
.sp-page.sp-listening .sp-ring-2 { border-color: rgba(52,211,153,0.2); }
@keyframes sp-orb-listen { 0%,100% { transform: scale(1.04); } 50% { transform: scale(1.09); } }

.sp-page.sp-thinking .sp-orb { animation: sp-orb-idle 2s ease-in-out infinite; opacity: 0.7; }
.sp-orb-status { margin-top: 14px; font-size: 0.82rem; color: rgba(255,255,255,0.4); text-align: center; transition: color 0.3s; letter-spacing: 0.02em; font-family: var(--f-body); }
.sp-page.sp-speaking .sp-orb-status { color: #a5b4fc; }
.sp-page.sp-listening .sp-orb-status { color: #6ee7b7; }
.sp-page.sp-thinking .sp-orb-status { color: rgba(255,255,255,0.6); }

/* ---- Transcript ---- */
.sp-transcript { flex: 1; overflow-y: auto; padding: 12px 20px 8px; display: flex; flex-direction: column; gap: 10px; background: #0d1117; min-height: 0; }
.sp-transcript::-webkit-scrollbar { width: 3px; }
.sp-transcript::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 2px; }
.sa-bubble { max-width: 78%; padding: 10px 14px; border-radius: var(--r); font-size: 0.85rem; line-height: 1.6; word-wrap: break-word; animation: sp-up 0.22s ease both; font-family: var(--f-body); }
.sa-bubble-ai { align-self: flex-start; background: var(--card); border: 1px solid var(--bd); border-bottom-left-radius: 4px; color: var(--tx); }
.sa-bubble-user { align-self: flex-end; background: var(--accent-purple-light); border: 1px solid rgba(124,58,237,0.25); border-bottom-right-radius: 4px; color: var(--tx); }
.sa-cue-card { align-self: flex-start; max-width: 88%; background: var(--card); border: 1px solid var(--bd); border-left: 3px solid var(--c-speak); border-radius: var(--r); padding: 14px 16px; animation: sp-up 0.22s ease both; }
.sa-cue-task { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--c-speak); margin-bottom: 8px; }
.sa-cue-prompts { margin: 0; padding-left: 16px; font-size: 0.8rem; color: var(--tx-2); line-height: 1.85; }
.sa-cue-hint { margin-top: 8px; font-size: 0.75rem; color: var(--tx-3); font-style: italic; }

/* ---- Controls ---- */
.sp-ctrl-bar { border-top: 1px solid rgba(255,255,255,0.06); background: #0d1117; padding: 12px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.sp-text-wrap { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.sp-text-input { flex: 1; padding: 10px 15px; background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-sm); color: var(--tx); font-family: var(--f-body); font-size: 0.87rem; }
.sp-text-input:focus { outline: none; border-color: var(--c-speak); }
.sp-text-input::placeholder { color: var(--tx-3); }
.sp-send-btn { padding: 10px 18px; background: var(--c-speak); color: #fff; border: none; border-radius: var(--r-sm); font-family: var(--f-body); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: opacity 0.18s; }
.sp-send-btn:hover { opacity: 0.85; }

.sp-mic-row { display: flex; align-items: center; gap: 16px; }
.sp-end-link { background: none; border: 1px solid var(--bd); border-radius: 20px; padding: 7px 16px; font-size: 0.78rem; font-weight: 600; color: var(--tx-3); cursor: pointer; transition: all var(--t); font-family: var(--f-body); }
.sp-end-link:hover { border-color: var(--v-error); color: var(--v-error); }

.sp-mic-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-speak), #5b21b6);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4); transition: all 0.2s;
  position: relative;
}
.sp-mic-btn:hover { transform: scale(1.07); box-shadow: 0 6px 28px rgba(124,58,237,0.55); }
.sp-mic-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.sa-mic-active { background: linear-gradient(135deg, #059669, #047857) !important; box-shadow: 0 4px 20px rgba(5,150,105,0.5) !important; animation: sp-mic-pulse 1s ease-in-out infinite; }
@keyframes sp-mic-pulse { 0%,100% { box-shadow: 0 4px 20px rgba(5,150,105,0.5); } 50% { box-shadow: 0 4px 32px rgba(5,150,105,0.8); } }
.sp-mic-icon { color: #fff; }
.sp-mic-status { font-size: 0.7rem; color: var(--tx-3); font-family: var(--f-body); }

/* ---- Sidebar ---- */
.sp-sidebar { width: 240px; border-left: 1px solid var(--bd); background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.sp-tips-hd { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); font-family: var(--f-body); }
.sp-tips-list { display: flex; flex-direction: column; gap: 6px; }
.sa-tips-empty { font-size: 0.78rem; color: var(--tx-3); font-style: italic; font-family: var(--f-body); }
.sa-tip-item { font-size: 0.78rem; color: var(--tx-2); padding: 8px 10px; background: var(--card); border: 1px solid var(--bd); border-left: 3px solid var(--c-speak); border-radius: var(--r-sm); line-height: 1.5; font-family: var(--f-body); }

/* ---- Score Overlay ---- */
.sp-score-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(8px); }
.sp-score-card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r-xl); padding: 32px; width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.35); }
.sp-sc-loading { font-size: 0.9rem; color: var(--tx-3); font-family: var(--f-body); text-align: center; padding: 20px; }
.sp-sc-band { font-family: var(--f-display); font-size: 5rem; font-weight: 700; text-align: center; color: var(--c-speak); line-height: 1; margin-bottom: 6px; }
.sp-sc-band-label { text-align: center; font-size: 0.75rem; color: var(--tx-3); margin-bottom: 24px; font-family: var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; }
.sp-sc-criteria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.sp-sc-crit { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r); padding: 12px 10px; text-align: center; }
.sp-sc-crit-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 4px; font-family: var(--f-body); }
.sp-sc-crit-score { font-family: var(--f-display); font-size: 1.9rem; font-weight: 700; color: var(--c-speak); line-height: 1.1; }
.sp-sc-crit-comment { font-size: 0.7rem; color: var(--tx-2); margin-top: 5px; line-height: 1.45; font-family: var(--f-body); }
.sp-sc-summary { font-size: 0.85rem; color: var(--tx-2); line-height: 1.7; margin-bottom: 16px; padding: 14px; background: var(--surface); border-radius: var(--r-sm); border: 1px solid var(--bd); font-family: var(--f-body); }
.sp-sc-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.sp-sc-list-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 8px; font-family: var(--f-body); }
.sp-sc-list-item { font-size: 0.77rem; color: var(--tx-2); line-height: 1.5; padding: 4px 0; border-bottom: 1px solid var(--bd); font-family: var(--f-body); }
.sp-sc-btn { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--c-speak), #5b21b6); color: #fff; border: none; border-radius: var(--r); font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(124,58,237,0.3); }
.sp-sc-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.45); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .sp-session { flex-direction: column; }
  .sp-sidebar { width: 100%; max-height: 160px; flex-direction: row; flex-wrap: wrap; border-left: none; border-top: 1px solid var(--bd); }
  .sp-tips-list { flex: 1; overflow-y: auto; }
}
@media (max-width: 640px) {
  .sp-setup-heading { font-size: 2rem; }
  .sp-orb { width: 120px; height: 120px; }
  .sp-orb-wrap { width: 140px; height: 140px; }
  .sp-ring-1 { width: 165px; height: 165px; }
  .sp-ring-2 { width: 190px; height: 190px; }
  .sa-bubble { max-width: 92%; }
  .sp-sc-criteria { grid-template-columns: 1fr; }
  .sp-sc-lists { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------
   10. Word Hover — Click-to-lookup Dictionary
   ---------------------------------------------------------------- */
.hw-word {
  cursor: pointer;
  border-bottom: 1px dotted transparent;
  border-radius: 2px;
  transition: border-color 0.15s, background-color 0.15s;
}
.hw-word:hover {
  border-bottom-color: var(--v-teal);
}
.hw-word-active {
  background-color: var(--v-teal-lt);
  border-bottom-color: var(--v-teal);
}

/* Tooltip */
.hw-tooltip {
  position: fixed;
  z-index: 10000;
  width: 300px;
  max-width: calc(100vw - 16px);
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  font-family: var(--f-body);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.hw-tt-visible {
  opacity: 1;
}

.hw-tt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.hw-tt-word {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--tx);
  font-family: var(--f-display);
}
.hw-tt-audio {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}
.hw-tt-audio:hover {
  background: var(--v-teal-lt);
}

.hw-tt-phonetic {
  font-size: 0.85rem;
  color: var(--v-muted);
  font-family: var(--f-mono);
  margin-bottom: 4px;
}
.hw-tt-pos {
  font-size: 0.8rem;
  color: var(--v-teal);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 6px;
}
.hw-tt-def {
  font-size: 0.92rem;
  color: var(--tx);
  line-height: 1.5;
  word-break: break-word;
}
.hw-tt-def-en {
  font-size: 0.82rem;
  color: var(--v-muted);
  margin-top: 4px;
  line-height: 1.45;
  word-break: break-word;
}
/* Phrase highlight */
.hw-word-phrase {
  background-color: rgba(217, 119, 6, 0.15);
  border-bottom-color: #d97706;
}
.dark-mode .hw-word-phrase {
  background-color: rgba(217, 119, 6, 0.2);
}

/* Phrase section in tooltip */
.hw-tt-phrase-section {
  margin-bottom: 8px;
}
.hw-tt-phrase-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.hw-tt-phrase-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 2px;
}
.hw-tt-phrase-def {
  font-size: 0.9rem;
  color: var(--tx);
  line-height: 1.45;
}
.hw-tt-divider {
  height: 1px;
  background: var(--bd);
  margin: 8px 0;
}

.hw-tt-loading {
  font-size: 0.88rem;
  color: var(--v-muted);
  text-align: center;
  padding: 8px 0;
  animation: hw-pulse 1.2s ease-in-out infinite;
}
@keyframes hw-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Dark mode adjustments */
.dark-mode .hw-tooltip {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
}

/* Mobile: slightly smaller tooltip */
@media (max-width: 640px) {
  .hw-tooltip {
    width: 260px;
    padding: 12px 14px;
    border-radius: 10px;
  }
  .hw-tt-word { font-size: 1.05rem; }
  .hw-tt-def { font-size: 0.88rem; }
}

/* ----------------------------------------------------------------
   11. Novel Reading Module
   ---------------------------------------------------------------- */

/* Novel CTA on home page */
.hp-novel-cta { border-color: var(--v-teal); }
.hp-novel-cta .hp-speak-cta-btn { background: var(--v-teal); }

/* Header */
.nv-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.nv-header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.nv-back-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--v-teal);
  font: 500 0.88rem var(--f-body); cursor: pointer;
}
.nv-back-btn:hover { text-decoration: underline; }
.nv-header-title {
  font: 600 1.05rem var(--f-display); color: var(--tx);
  flex: 1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nv-header-right { display: flex; align-items: center; gap: 8px; }
.nv-tts-btn {
  background: var(--v-teal-lt); color: var(--v-teal);
  border: none; border-radius: 8px; padding: 6px 14px;
  font: 500 0.82rem var(--f-body); cursor: pointer;
  transition: background 0.15s;
}
.nv-tts-btn:hover { background: var(--v-teal-glow); }
.nv-tts-playing { background: var(--v-teal); color: #fff; }
.nv-tts-playing:hover { background: var(--v-teal); opacity: 0.9; }

/* Chapter nav bar */
.nv-ch-nav {
  max-width: 900px; margin: 0 auto;
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  border-top: 1px solid var(--bd);
}
.nv-nav-btn {
  background: none; border: 1px solid var(--bd);
  border-radius: 6px; padding: 4px 14px;
  font: 500 0.82rem var(--f-body); color: var(--tx);
  cursor: pointer; transition: all 0.15s;
}
.nv-nav-btn:hover:not(:disabled) { border-color: var(--v-teal); color: var(--v-teal); }
.nv-nav-btn:disabled { opacity: 0.3; cursor: default; }
.nv-ch-info { font: 500 0.85rem var(--f-mono); color: var(--v-muted); }

/* Library */
.nv-library-wrap { padding: 0 20px 40px; max-width: 900px; margin: 0 auto; }
.nv-library-hero {
  text-align: center; padding: 48px 0 32px;
}
.nv-lib-badge {
  display: inline-block;
  font: 600 0.72rem var(--f-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--v-teal); background: var(--v-teal-lt);
  padding: 4px 14px; border-radius: 20px; margin-bottom: 14px;
}
.nv-lib-title {
  font: 700 2.2rem var(--f-display); color: var(--tx);
  margin: 0 0 8px;
}
.nv-lib-sub {
  font: 400 0.95rem var(--f-body); color: var(--v-muted);
  max-width: 480px; margin: 0 auto;
}
.nv-library {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px; margin-top: 8px;
}
.nv-lib-home { text-align: center; margin-top: 32px; }
.nv-home-btn {
  background: none; border: 1px solid var(--bd); border-radius: 8px;
  padding: 8px 24px; font: 500 0.88rem var(--f-body); color: var(--v-muted);
  cursor: pointer; transition: all 0.15s;
}
.nv-home-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* Novel card */
.nv-card {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nv-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.nv-card-cover {
  height: 100px; display: flex; align-items: center; justify-content: center;
}
.nv-card-emoji { font-size: 2.8rem; }
.nv-card-body { padding: 16px; }
.nv-card-diff {
  font: 600 0.68rem var(--f-body); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.nv-card-title {
  font: 600 1.1rem var(--f-display); color: var(--tx);
  margin-bottom: 2px;
}
.nv-card-author {
  font: 400 0.82rem var(--f-body); color: var(--v-muted);
  margin-bottom: 8px;
}
.nv-card-desc {
  font: 400 0.82rem var(--f-body); color: var(--v-ink-2);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nv-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bd);
  font: 400 0.78rem var(--f-body); color: var(--v-muted);
}
.nv-card-prog { color: var(--v-teal); font-weight: 500; }

/* Reader */
.nv-reader-wrap {
  max-width: 720px; margin: 0 auto; padding: 0 20px 60px;
}
.nv-reader {
  padding: 24px 0;
}
.nv-loading, .nv-empty {
  text-align: center; padding: 60px 20px;
  color: var(--v-muted); font: 400 0.95rem var(--f-body);
}
.nv-ch-header {
  text-align: center; margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--bd);
}
.nv-ch-num {
  font: 600 0.72rem var(--f-body); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--v-teal); margin-bottom: 6px;
}
.nv-ch-title {
  font: 600 1.6rem var(--f-display); color: var(--tx);
  margin: 0 0 6px;
}
.nv-ch-meta {
  font: 400 0.82rem var(--f-body); color: var(--v-muted);
}

/* Chapter text */
.nv-ch-text {
  font: 400 1.05rem var(--f-body); color: var(--tx);
  line-height: 1.85; letter-spacing: 0.01em;
}
.nv-para {
  margin-bottom: 1.2em;
  transition: background-color 0.3s;
  padding: 4px 8px; border-radius: 6px;
  margin-left: -8px; margin-right: -8px;
}
.nv-para-active {
  background-color: var(--v-teal-lt);
}

/* Moral (for fables) */
.nv-moral {
  margin-top: 28px; padding: 16px 20px;
  background: var(--v-teal-lt); border-radius: 10px;
  border-left: 3px solid var(--v-teal);
}
.nv-moral-badge {
  font: 600 0.7rem var(--f-body); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--v-teal); margin-bottom: 6px;
}
.nv-moral-en {
  font: 500 0.95rem var(--f-body); color: var(--tx);
  font-style: italic; margin-bottom: 4px;
}
.nv-moral-zh {
  font: 400 0.88rem var(--f-body); color: var(--v-muted);
}

/* Mobile */
@media (max-width: 640px) {
  .nv-lib-title { font-size: 1.6rem; }
  .nv-library { grid-template-columns: 1fr; }
  .nv-ch-title { font-size: 1.3rem; }
  .nv-ch-text { font-size: 0.98rem; line-height: 1.75; }
  .nv-header-inner { padding: 10px 14px; }
  .nv-tts-btn { padding: 5px 10px; font-size: 0.78rem; }
}

/* ================================================================
   VOCABULARY PAGE
   ================================================================ */

/* Star button in word-hover tooltip */
.hw-tt-star {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
  color: var(--tx-3);
}
.hw-tt-star:hover { color: #e6a817; transform: scale(1.2); }
.hw-tt-star.hw-tt-starred { color: #e6a817; cursor: default; }

/* Header */
.voc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.voc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
}
.voc-back-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  color: var(--tx-2);
  cursor: pointer;
  font-family: var(--f-body);
}
.voc-back-btn:hover { color: var(--v-teal); }
.voc-header-title {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tx);
  margin: 0;
}
.voc-header-right { display: flex; align-items: center; gap: 8px; }

/* Tabs */
.voc-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 0 24px 12px;
  max-width: 900px;
  margin: 0 auto;
}
.voc-tab {
  background: none;
  border: none;
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tx-3);
  padding: 6px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.voc-tab:hover { color: var(--tx); background: var(--v-teal-lt); }
.voc-tab.active { color: #fff; background: var(--v-teal); }

/* Stats */
.voc-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px 24px;
  max-width: 900px;
  margin: 0 auto;
}
.voc-stat { text-align: center; }
.voc-stat-num {
  display: block;
  font-family: var(--f-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--v-teal);
}
.voc-stat-label {
  font-size: 0.78rem;
  color: var(--tx-3);
  margin-top: 2px;
}

/* Views toggle */
.voc-view { display: none; max-width: 900px; margin: 0 auto; padding: 0 24px 40px; }
.voc-view.active { display: block; }

/* Search */
.voc-search-bar { margin-bottom: 16px; }
.voc-search {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  font-family: var(--f-body);
  font-size: 0.9rem;
  background: var(--card);
  color: var(--tx);
  outline: none;
  transition: border 0.2s;
  box-sizing: border-box;
}
.voc-search:focus { border-color: var(--v-teal); }

/* Word List */
.voc-list { display: flex; flex-direction: column; gap: 8px; }
.voc-empty {
  text-align: center;
  color: var(--tx-3);
  padding: 48px 0;
  font-size: 0.92rem;
}
.voc-item {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 14px 18px;
  transition: box-shadow 0.2s;
}
.voc-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.voc-item-main { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.voc-item-word { font-family: var(--f-display); font-size: 1.1rem; font-weight: 700; color: var(--tx); }
.voc-item-phonetic { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-3); }
.voc-item-pos { font-size: 0.78rem; color: var(--v-teal); font-style: italic; }
.voc-item-def { font-size: 0.88rem; color: var(--tx-2); line-height: 1.5; }
.voc-item-def-en { font-size: 0.82rem; color: var(--tx-3); margin-top: 2px; line-height: 1.4; }
.voc-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--tx-3);
}
.voc-item-ctx {
  background: var(--v-teal-lt);
  color: var(--v-teal);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
}
.voc-item-date { margin-left: auto; }
.voc-item-del {
  background: none;
  border: none;
  color: var(--tx-3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.voc-item-del:hover { color: var(--v-error); background: rgba(192,57,43,0.08); }

/* Flashcard */
.voc-review-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}
.voc-card-container {
  perspective: 800px;
  width: 100%;
  max-width: 420px;
  height: 280px;
  margin-bottom: 24px;
}
.voc-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  cursor: pointer;
}
.voc-card.voc-card-flipped { transform: rotateY(180deg); }
.voc-card-front, .voc-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 1px solid var(--bd);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.voc-card-back { transform: rotateY(180deg); }
.voc-card-word {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 8px;
}
.voc-card-phonetic {
  font-family: var(--f-mono);
  font-size: 0.95rem;
  color: var(--tx-3);
}
.voc-card-hint {
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--tx-3);
  opacity: 0.5;
}
.voc-card-pos {
  font-size: 0.85rem;
  color: var(--v-teal);
  font-style: italic;
  margin-bottom: 10px;
}
.voc-card-def {
  font-size: 1rem;
  color: var(--tx);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 6px;
}
.voc-card-def-en {
  font-size: 0.85rem;
  color: var(--tx-3);
  text-align: center;
  line-height: 1.5;
}
.voc-card-ctx {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--tx-3);
  opacity: 0.6;
}

/* Review Buttons */
.voc-review-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.voc-rbtn {
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}
.voc-rbtn-fail { background: #e74c3c; }
.voc-rbtn-fail:hover { background: #c0392b; }
.voc-rbtn-hard { background: #e67e22; }
.voc-rbtn-hard:hover { background: #d35400; }
.voc-rbtn-good { background: var(--v-teal); }
.voc-rbtn-good:hover { background: #1f6357; }
.voc-rbtn-easy { background: #2563eb; }
.voc-rbtn-easy:hover { background: #1d4ed8; }

.voc-review-progress {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--tx-3);
}

.voc-review-empty {
  text-align: center;
  padding: 60px 0;
}
.voc-review-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--v-teal-lt);
  color: var(--v-teal);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.voc-review-empty-text {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 6px;
}
.voc-review-empty-sub {
  font-size: 0.85rem;
  color: var(--tx-3);
}

/* Vocab CTA on home */
.hp-vocab-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #e6a817 0%, #d97706 100%); }

/* Responsive */
@media (max-width: 600px) {
  .voc-header-inner { padding: 12px 16px; }
  .voc-stats { gap: 20px; padding: 16px; }
  .voc-stat-num { font-size: 1.4rem; }
  .voc-view { padding: 0 16px 32px; }
  .voc-card-container { height: 240px; }
  .voc-card-word { font-size: 1.6rem; }
  .voc-review-btns { gap: 6px; }
  .voc-rbtn { padding: 8px 16px; font-size: 0.82rem; }
}

/* ================================================================
   WRONG ANSWERS PAGE
   ================================================================ */
.wa-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.wa-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 900px; margin: 0 auto; padding: 14px 24px;
}
.wa-back-btn {
  background: none; border: none; font-size: 0.9rem;
  color: var(--tx-2); cursor: pointer; font-family: var(--f-body);
}
.wa-back-btn:hover { color: var(--v-teal); }
.wa-header-title {
  font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin: 0;
}
.wa-header-right { display: flex; align-items: center; gap: 8px; }

.wa-filters {
  display: flex; justify-content: center; gap: 6px;
  padding: 0 24px 12px; max-width: 900px; margin: 0 auto; flex-wrap: wrap;
}
.wa-filter {
  background: none; border: 1px solid var(--bd); font-family: var(--f-body);
  font-size: 0.82rem; color: var(--tx-3); padding: 5px 14px;
  border-radius: 16px; cursor: pointer; transition: all 0.2s;
}
.wa-filter:hover { color: var(--tx); border-color: var(--v-teal); }
.wa-filter.active { color: #fff; background: var(--v-teal); border-color: var(--v-teal); }

.wa-stats {
  display: flex; justify-content: center; gap: 32px;
  padding: 20px 24px; max-width: 900px; margin: 0 auto;
}
.wa-stat { text-align: center; }
.wa-stat-num {
  display: block; font-family: var(--f-display);
  font-size: 1.8rem; font-weight: 700; color: var(--v-error);
}
.wa-stat-label { font-size: 0.78rem; color: var(--tx-3); margin-top: 2px; }

.wa-list-wrap { max-width: 900px; margin: 0 auto; padding: 0 24px 40px; }
.wa-list { display: flex; flex-direction: column; gap: 16px; }
.wa-empty { text-align: center; color: var(--tx-3); padding: 48px 0; font-size: 0.92rem; }

.wa-group-hd {
  font-family: var(--f-display); font-size: 1.05rem; font-weight: 700;
  color: var(--tx); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--bd);
}
.wa-group-count { font-size: 0.82rem; font-weight: 400; color: var(--tx-3); margin-left: 8px; }
.wa-group { margin-bottom: 16px; }

.wa-item {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 8px; transition: box-shadow 0.2s;
}
.wa-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.wa-item-mastered { opacity: 0.6; }

.wa-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.wa-item-badge {
  font-size: 0.72rem; font-weight: 600; padding: 2px 10px;
  border-radius: 10px; color: #fff;
}
.wa-badge-listening { background: var(--c-listen); }
.wa-badge-reading { background: var(--c-read); }
.wa-item-qnum { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-2); }
.wa-item-type { font-size: 0.75rem; color: var(--tx-3); }
.wa-item-mastered-tag { font-size: 0.75rem; color: var(--c-read); margin-left: auto; }

.wa-item-q { font-size: 0.88rem; color: var(--tx); line-height: 1.5; margin-bottom: 8px; }
.wa-item-answers { display: flex; gap: 16px; font-size: 0.82rem; flex-wrap: wrap; }
.wa-item-wrong { color: var(--v-error); }
.wa-item-correct { color: var(--c-read); font-weight: 600; }

.wa-master-btn {
  margin-top: 8px; background: none; border: 1px solid var(--c-read);
  color: var(--c-read); font-family: var(--f-body); font-size: 0.78rem;
  padding: 4px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.wa-master-btn:hover { background: var(--c-read); color: #fff; }

.hp-wrong-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }

@media (max-width: 600px) {
  .wa-header-inner { padding: 12px 16px; }
  .wa-stats { gap: 20px; padding: 16px; }
  .wa-list-wrap { padding: 0 16px 32px; }
  .wa-filters { gap: 4px; padding: 0 16px 10px; }
  .wa-filter { padding: 4px 10px; font-size: 0.78rem; }
}

/* ================================================================
   STREAK & WEEKLY RINGS
   ================================================================ */
.hp-streak-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.hp-streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(217,119,6,0.1);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(217,119,6,0.2);
}
.hp-streak-fire { font-size: 1.2rem; }
.hp-streak-num {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #d97706;
}
.hp-streak-label { font-size: 0.78rem; color: var(--tx-3); }

.hp-week-rings { display: flex; gap: 12px; }
.hp-ring-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hp-ring-svg { width: 42px; height: 42px; }
.hp-ring-val {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tx);
  margin-top: -2px;
}
.hp-ring-label { font-size: 0.65rem; color: var(--tx-3); }

@media (max-width: 600px) {
  .hp-streak-row { gap: 16px; flex-wrap: wrap; }
  .hp-ring-svg { width: 36px; height: 36px; }
}

/* ================================================================
   ANALYTICS PAGE
   ================================================================ */
.an-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--bd);
}
.an-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 14px 24px;
}
.an-back-btn {
  background: none; border: none; font-size: 0.9rem;
  color: var(--tx-2); cursor: pointer; font-family: var(--f-body);
}
.an-back-btn:hover { color: var(--v-teal); }
.an-header-title {
  font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin: 0;
}
.an-header-right { display: flex; align-items: center; gap: 8px; }

.an-content { max-width: 960px; margin: 0 auto; padding: 20px 24px 40px; }

.an-sum-row {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.an-sum-item {
  text-align: center; background: var(--card); border: 1px solid var(--bd);
  border-radius: 12px; padding: 14px 20px; min-width: 100px;
}
.an-sum-num {
  display: block; font-family: var(--f-display);
  font-size: 1.5rem; font-weight: 700; color: var(--v-teal);
}
.an-sum-lbl { font-size: 0.78rem; color: var(--tx-3); }
.an-sum-best .an-sum-num { color: var(--c-read); }
.an-sum-worst .an-sum-num { color: var(--v-error); }

.an-charts { display: flex; gap: 20px; flex-wrap: wrap; }
.an-chart-card {
  flex: 1; min-width: 300px; background: var(--card);
  border: 1px solid var(--bd); border-radius: 14px; padding: 18px;
}
.an-chart-small { flex: 0 0 auto; max-width: 380px; }
.an-chart-title {
  font-family: var(--f-display); font-size: 1rem; font-weight: 700;
  color: var(--tx); margin-bottom: 12px;
}
.an-chart-card canvas { width: 100%; height: auto; }

.an-empty { text-align: center; color: var(--tx-3); padding: 60px 0; font-size: 0.92rem; }

.hp-cta-row { display: flex; gap: 16px; }
.hp-cta-half { flex: 1; min-width: 0; }
.hp-analytics-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #2563eb 0%, #059669 100%); }

@media (max-width: 700px) {
  .an-charts { flex-direction: column; }
  .an-chart-small { max-width: 100%; }
  .an-content { padding: 16px; }
  .hp-cta-row { flex-direction: column; }
}

/* ================================================================
   WRITING PRACTICE PAGE
   ================================================================ */
.wp-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.wp-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.wp-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.wp-back-btn:hover { color: var(--v-teal); }
.wp-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.wp-header-right { display: flex; align-items: center; gap: 12px; }
.wp-timer { font-family: var(--f-mono); font-size: 0.9rem; color: var(--tx-2); }

.wp-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.wp-setup-inner { text-align: center; }
.wp-badge { display: inline-block; background: var(--v-teal-lt); color: var(--v-teal); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.wp-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.wp-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 24px; }

.wp-type-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }
.wp-type-btn {
  background: none; border: 1px solid var(--bd); font-family: var(--f-body); font-size: 0.88rem;
  padding: 8px 20px; border-radius: 10px; cursor: pointer; transition: all 0.2s; color: var(--tx-2);
}
.wp-type-btn:hover { border-color: var(--v-teal); color: var(--tx); }
.wp-type-btn.active { background: var(--v-teal); color: #fff; border-color: var(--v-teal); }

.wp-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; text-align: left; margin-bottom: 32px; }
.wp-topic-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px;
  cursor: pointer; transition: all 0.2s;
}
.wp-topic-card:hover { border-color: var(--v-teal); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.wp-topic-num { font-family: var(--f-mono); font-size: 0.75rem; color: var(--v-teal); display: block; margin-bottom: 4px; }
.wp-topic-preview { font-size: 0.82rem; color: var(--tx-2); line-height: 1.4; }

.wp-editor { max-width: 800px; margin: 0 auto; padding: 20px 24px; }
.wp-prompt-box {
  background: var(--card); border: 1px solid var(--bd); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.wp-prompt-label { font-size: 0.82rem; color: var(--v-teal); font-weight: 600; margin-bottom: 8px; }
.wp-prompt-text { font-size: 0.9rem; color: var(--tx); line-height: 1.6; }
.wp-prompt-chart { font-size: 0.85rem; color: var(--tx-2); margin-top: 8px; font-style: italic; }

.wp-textarea {
  width: 100%; min-height: 400px; padding: 16px; border: 1px solid var(--bd);
  border-radius: 12px; font-family: var(--f-body); font-size: 0.92rem;
  line-height: 1.8; color: var(--tx); background: var(--card); resize: vertical;
  outline: none; box-sizing: border-box;
}
.wp-textarea:focus { border-color: var(--v-teal); }

.wp-editor-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.wp-wc { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-3); }
.wp-submit-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.wp-submit-btn:hover { background: #1f6357; }
.wp-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wp-feedback { max-width: 800px; margin: 0 auto; padding: 20px 24px 40px; }
.wp-fb-band {
  text-align: center; font-family: var(--f-display); font-size: 2.5rem;
  font-weight: 700; color: var(--v-teal); margin-bottom: 4px;
}
.wp-fb-wc { text-align: center; font-size: 0.82rem; color: var(--tx-3); margin-bottom: 20px; }
.wp-fb-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.wp-fb-crit {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px;
}
.wp-fb-crit-hd { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--tx); }
.wp-fb-crit-score { color: var(--v-teal); font-family: var(--f-mono); }
.wp-fb-crit-comment { font-size: 0.82rem; color: var(--tx-2); line-height: 1.5; }

.wp-fb-overall {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 14px; font-size: 0.88rem; color: var(--tx); line-height: 1.6; margin-bottom: 16px;
}
.wp-fb-suggestions { font-size: 0.85rem; color: var(--tx-2); line-height: 1.6; }
.wp-fb-suggestions ul { margin: 6px 0 0 18px; padding: 0; }
.wp-fb-suggestions li { margin-bottom: 4px; }

.wp-fb-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.wp-fb-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.wp-fb-btn:hover { background: #1f6357; }
.wp-fb-btn-sec { background: none; border: 1px solid var(--bd); color: var(--tx-2); }
.wp-fb-btn-sec:hover { border-color: var(--v-teal); color: var(--v-teal); background: none; }

.wp-history-section { text-align: left; margin-top: 32px; }
.wp-history-title { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--tx); margin-bottom: 10px; }
.wp-history-list { display: flex; flex-direction: column; gap: 6px; }
.wp-history-empty { color: var(--tx-3); font-size: 0.85rem; }
.wp-history-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--bd); border-radius: 8px; font-size: 0.82rem;
}
.wp-history-type { font-family: var(--f-mono); color: var(--v-teal); font-weight: 600; }
.wp-history-band { font-weight: 600; color: var(--tx); }
.wp-history-wc { color: var(--tx-3); }
.wp-history-date { color: var(--tx-3); margin-left: auto; }

.hp-writing-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #d97706 0%, #c07848 100%); }

@media (max-width: 600px) {
  .wp-setup { padding: 20px 16px; }
  .wp-editor { padding: 16px; }
  .wp-feedback { padding: 16px; }
  .wp-fb-criteria { grid-template-columns: 1fr; }
  .wp-topics { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   DICTATION PAGE
   ================================================================ */
.dc-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.dc-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.dc-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.dc-back-btn:hover { color: var(--v-teal); }
.dc-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.dc-header-right { display: flex; align-items: center; gap: 8px; }

.dc-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.dc-setup-inner { text-align: center; }
.dc-badge { display: inline-block; background: rgba(37,99,235,0.1); color: var(--c-listen); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.dc-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.dc-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 20px; }

.dc-speed-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; }
.dc-speed-label { font-size: 0.85rem; color: var(--tx-2); }
.dc-speed-btn {
  background: none; border: 1px solid var(--bd); font-family: var(--f-mono); font-size: 0.82rem;
  padding: 4px 14px; border-radius: 8px; cursor: pointer; color: var(--tx-2); transition: all 0.2s;
}
.dc-speed-btn.active { background: var(--c-listen); color: #fff; border-color: var(--c-listen); }

.dc-tests { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.dc-test-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px;
}
.dc-test-title { font-size: 0.9rem; font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.dc-test-sections { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-sec-btn {
  background: var(--accent-blue-light); border: none; color: var(--c-listen); font-family: var(--f-body);
  font-size: 0.8rem; font-weight: 500; padding: 5px 14px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.dc-sec-btn:hover { background: var(--c-listen); color: #fff; }

.dc-session { max-width: 700px; margin: 0 auto; padding: 20px 24px; }
.dc-progress-bar {
  height: 4px; background: var(--bd); border-radius: 2px; margin-bottom: 24px; overflow: hidden;
}
.dc-progress-fill { height: 100%; background: var(--c-listen); border-radius: 2px; transition: width 0.3s; width: 0; }

.dc-sentence-box { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dc-sent-num { font-family: var(--f-mono); font-size: 0.85rem; color: var(--tx-3); }
.dc-play-btn, .dc-replay-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 8px 18px;
  border-radius: 8px; font-family: var(--f-body); font-size: 0.85rem;
  cursor: pointer; transition: background 0.2s;
}
.dc-play-btn:hover, .dc-replay-btn:hover { background: #1d4ed8; }
.dc-replay-btn { background: none; border: 1px solid var(--c-listen); color: var(--c-listen); }

.dc-input-area { display: flex; gap: 10px; margin-bottom: 16px; }
.dc-input {
  flex: 1; padding: 12px; border: 1px solid var(--bd); border-radius: 10px;
  font-family: var(--f-body); font-size: 0.9rem; color: var(--tx); background: var(--card);
  resize: none; outline: none; box-sizing: border-box;
}
.dc-input:focus { border-color: var(--c-listen); }
.dc-check-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 12px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; align-self: flex-end;
}

.dc-diff {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 14px; margin-bottom: 16px;
}
.dc-diff-label { font-size: 0.78rem; color: var(--tx-3); margin-bottom: 8px; }
.dc-diff-words { font-size: 0.9rem; line-height: 1.8; }
.dc-w-ok { color: var(--c-read); }
.dc-w-wrong { color: var(--v-error); text-decoration: underline; cursor: help; }
.dc-w-miss { color: var(--tx-3); text-decoration: line-through; }

.dc-next-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 10px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; display: block; margin: 0 auto;
}

.dc-result { max-width: 500px; margin: 60px auto; text-align: center; }
.dc-result-inner {
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 40px;
}
.dc-result-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(37,99,235,0.1); color: var(--c-listen);
  font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.dc-result-title { font-family: var(--f-display); font-size: 1.4rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.dc-result-accuracy { font-family: var(--f-mono); font-size: 1.2rem; color: var(--c-listen); margin-bottom: 6px; }
.dc-result-stats { font-size: 0.85rem; color: var(--tx-3); margin-bottom: 24px; }
.dc-result-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
}

.hp-dictation-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }

@media (max-width: 600px) {
  .dc-setup { padding: 20px 16px; }
  .dc-session { padding: 16px; }
  .dc-input-area { flex-direction: column; }
}

/* ================================================================
   TIMED READING PAGE
   ================================================================ */
.tr-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.tr-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.tr-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.tr-back-btn:hover { color: var(--v-teal); }
.tr-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.tr-header-right { display: flex; align-items: center; gap: 12px; }
.tr-timer { font-family: var(--f-mono); font-size: 0.95rem; color: var(--c-read); font-weight: 600; }

.tr-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.tr-setup-inner { text-align: center; }
.tr-badge { display: inline-block; background: rgba(5,150,105,0.1); color: var(--c-read); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.tr-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.tr-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 24px; }

.tr-passages { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.tr-test-card { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px; }
.tr-test-title { font-size: 0.9rem; font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.tr-test-passages { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-pass-btn {
  background: var(--accent-green-light); border: none; color: var(--c-read);
  font-family: var(--f-body); font-size: 0.8rem; font-weight: 500;
  padding: 5px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.tr-pass-btn:hover { background: var(--c-read); color: #fff; }
.tr-pass-wc { font-family: var(--f-mono); font-size: 0.72rem; opacity: 0.7; margin-left: 4px; }

.tr-reading { max-width: 800px; margin: 0 auto; padding: 20px 24px; }
.tr-passage-box {
  background: var(--card); border: 1px solid var(--bd); border-radius: 14px;
  padding: 24px; margin-bottom: 20px;
}
.tr-pass-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin-bottom: 12px; }
.tr-pass-text { font-size: 0.92rem; color: var(--tx); line-height: 1.8; }
.tr-pass-text p { margin-bottom: 10px; }
.tr-reading-footer { text-align: center; }
.tr-done-btn {
  background: var(--c-read); color: #fff; border: none; padding: 12px 32px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.92rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.tr-done-btn:hover { background: #047857; }

.tr-quiz { max-width: 700px; margin: 0 auto; padding: 20px 24px; }
.tr-quiz-info {
  text-align: center; font-size: 0.9rem; color: var(--tx-2); margin-bottom: 20px;
  padding: 12px; background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
}
.tr-quiz-qs { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.tr-q-item { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 14px; }
.tr-q-text { font-size: 0.9rem; color: var(--tx); margin-bottom: 10px; font-weight: 500; }
.tr-q-opts { display: flex; flex-direction: column; gap: 6px; }
.tr-q-opt { font-size: 0.85rem; color: var(--tx-2); cursor: pointer; padding: 4px 0; }
.tr-q-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--bd); border-radius: 8px;
  font-family: var(--f-body); font-size: 0.88rem; color: var(--tx); background: var(--surface);
  outline: none; box-sizing: border-box;
}
.tr-quiz-submit {
  display: block; margin: 0 auto; background: var(--c-read); color: #fff; border: none;
  padding: 10px 28px; border-radius: 10px; font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}

.tr-result { max-width: 500px; margin: 40px auto; padding: 0 24px; }
.tr-result-inner {
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px;
  padding: 40px; text-align: center;
}
.tr-res-wpm {
  font-family: var(--f-display); font-size: 3.5rem; font-weight: 700; color: var(--c-read);
}
.tr-res-wpm-label { font-size: 0.82rem; color: var(--tx-3); margin-bottom: 4px; }
.tr-res-level { font-size: 1rem; font-weight: 600; color: var(--tx); margin-bottom: 16px; }

.tr-res-bar {
  position: relative; height: 12px; background: var(--bd); border-radius: 6px;
  margin-bottom: 4px; overflow: visible;
}
.tr-res-bar-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #d97706, #059669); border-radius: 6px; }
.tr-res-bar-target {
  position: absolute; top: -18px; transform: translateX(-50%);
  font-size: 0.7rem; color: var(--tx-3); font-family: var(--f-mono);
}
.tr-res-bar-target::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%); width: 1px; height: 18px; background: var(--tx-3);
}
.tr-res-bar-labels {
  display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--tx-3);
  font-family: var(--f-mono); margin-bottom: 16px;
}

.tr-res-comp { font-size: 0.92rem; color: var(--tx); margin-bottom: 6px; }
.tr-res-time { font-size: 0.82rem; color: var(--tx-3); margin-bottom: 24px; }
.tr-res-actions { display: flex; gap: 12px; justify-content: center; }
.tr-res-btn {
  background: var(--c-read); color: #fff; border: none; padding: 10px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
}
.tr-res-btn-sec { background: none; border: 1px solid var(--bd); color: var(--tx-2); }

.hp-tread-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #059669 0%, #047857 100%); }

@media (max-width: 600px) {
  .tr-setup { padding: 20px 16px; }
  .tr-reading { padding: 16px; }
  .tr-result { margin: 20px auto; }
}

/* ----------------------------------------------------------------
   CBT Gate — computer-delivered check-in simulation
   ---------------------------------------------------------------- */
#page-cbt-gate {
  min-height: 100vh;
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
}
#page-cbt-gate.active { display: flex; }

.cbt-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 28, 48, 0.35) 0%, rgba(12, 28, 48, 0.15) 40%, rgba(20, 60, 40, 0.25) 100%),
    radial-gradient(ellipse at 50% 0%, #7eb6d9 0%, #4a7fa3 35%, transparent 60%),
    linear-gradient(180deg, #8ec5e8 0%, #c5dff0 28%, #dce9c8 55%, #6b9b4a 78%, #3d6b2e 100%);
  z-index: 0;
}
.cbt-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 70%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 65%, rgba(255, 220, 120, 0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 45% 80%, rgba(255, 255, 255, 0.1) 0 2px, transparent 3px);
  opacity: 0.7;
  pointer-events: none;
}

.cbt-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1a1a1a;
}

.cbt-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4a9fd8;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.cbt-close {
  border: none;
  background: #e25555;
  color: #fff;
  width: 22px;
  height: 20px;
  line-height: 18px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.cbt-close:hover { background: #c94444; }

.cbt-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid #d8d8d8;
  background: #f7f7f7;
}
.cbt-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
  padding: 6px 10px 8px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.72rem;
  cursor: default;
  border-bottom: 2px solid transparent;
}
.cbt-tab.active {
  color: #1a6fb5;
  border-bottom-color: #1a6fb5;
  font-weight: 600;
}
.cbt-tab-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e4e4e4;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: #555;
}
.cbt-tab.active .cbt-tab-ico {
  background: #d6ebf8;
  color: #1a6fb5;
}
.cbt-tabs-trail {
  margin-left: auto;
  display: flex;
  gap: 10px;
  padding-bottom: 10px;
  opacity: 0.55;
  font-size: 0.9rem;
}

.cbt-body {
  padding: 28px 36px 20px;
  min-height: 340px;
}
.cbt-h {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}
.cbt-sub {
  margin: 0 0 22px;
  color: #666;
  font-size: 0.92rem;
}
.cbt-field {
  display: grid;
  grid-template-columns: 88px minmax(160px, 280px) 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cbt-field label {
  font-size: 0.95rem;
  color: #333;
}
.cbt-input {
  height: 34px;
  border: 1px solid #bdbdbd;
  border-radius: 2px;
  padding: 0 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.cbt-input:focus {
  outline: 2px solid #4a9fd8;
  outline-offset: 1px;
  border-color: #4a9fd8;
}
.cbt-hint {
  color: #8a8a8a;
  font-size: 0.88rem;
}
.cbt-warn {
  color: #d32f2f;
  font-size: 0.88rem;
  margin: 18px 0 10px;
  line-height: 1.5;
}
.cbt-center-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.cbt-btn {
  min-width: 120px;
  height: 36px;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  background: #ececec;
  color: #333;
  font-size: 0.95rem;
  cursor: pointer;
}
.cbt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cbt-btn:not(:disabled):hover {
  background: #e0e0e0;
}
.cbt-btn-next {
  border-radius: 18px;
  padding: 0 22px;
  min-width: 96px;
}

.cbt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #ddd;
  background: #fafafa;
}
.cbt-skip-link {
  border: none;
  background: none;
  color: #1a6fb5;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.cbt-skip-link:hover { color: #0d4f86; }

.cbt-status-red {
  color: #d32f2f;
  font-size: 0.9rem;
  font-weight: 600;
}
.cbt-info-box {
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  padding: 0 0 20px;
}
.cbt-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e5e5;
  background: #f9f9f9;
  font-size: 0.95rem;
}
.cbt-video-mock {
  margin: 18px 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  padding: 28px 24px;
  text-align: left;
}
.cbt-video-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 18px;
}
.cbt-tips {
  font-size: 0.92rem;
  color: #333;
  line-height: 1.55;
}
.cbt-tips ul {
  margin: 6px 0 12px 1.2em;
  padding: 0;
}
.cbt-confirm-prompt {
  text-align: center;
  margin: 8px 20px 14px;
  color: #444;
}
.cbt-confirm-btn {
  display: block;
  margin: 0 auto;
  min-width: 140px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #2f2f2f;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.cbt-confirm-btn:hover { background: #1f1f1f; }

@media (max-width: 720px) {
  .cbt-body { padding: 20px 16px; min-height: 280px; }
  .cbt-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .cbt-tabs-trail { display: none; }
}
