/* CEFR Diagnostic — King's School Shenzhen branding (KSS shield blue #004e7d) */

/* King's Canterbury-style serif (Trajan substitute), bundled locally so it
   loads reliably without a font CDN (works in mainland China). */
@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/cinzel-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/cinzel-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f3ea;
  --card: #ffffff;
  --text: #152634;
  --text-secondary: #4a5f73;
  --accent: #004e7d;
  --accent-hover: #003a5e;
  --accent-soft: #e8f1f8;
  --border: #d9d2c2;
  --error: #c0392b;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(21, 38, 52, 0.08);
  --font-brand: 'Cinzel', Georgia, 'Times New Roman', serif;
  /* branding-guide-2 block palette */
  --pink: #efa8e2;
  --blue: #4a7ddb;
  --yellow: #f4c542;
  --green: #35cf7f;
  --orange: #f5734a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.47;
  min-height: 100vh;
}

h1,
h2,
.result-badge,
.nav-brand {
  font-family: var(--font-brand);
  letter-spacing: 0.01em;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.nav-shield {
  height: 40px;
  width: auto;
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
}

.nav-right a {
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-right a:hover {
  color: var(--accent);
}

/* ---------- Hero / landing ---------- */

.hero {
  text-align: center;
  padding: 72px 24px 48px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-compact {
  padding: 48px 24px 32px;
}

.hero-kicker {
  font-family: var(--font-brand);
  font-size: 22px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--accent);
}

.hero p.sub {
  margin-top: 14px;
  font-size: 21px;
  color: var(--text-secondary);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Building blocks (branding-guide-2) ---------- */

.block-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  margin-top: 40px;
}

.block {
  display: inline-block;
  width: 44px;
  height: 44px;
}

.block-square {
  border-radius: 12px;
}

.block-circle {
  border-radius: 50%;
}

.block-clover {
  border-radius: 50% 50% 12px 50%;
  transform: rotate(45deg);
}

.block-hex {
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}

.block-pink {
  background: var(--pink);
}

.block-blue {
  background: var(--blue);
}

.block-yellow {
  background: var(--yellow);
}

.block-green {
  background: var(--green);
}

.block-orange {
  background: var(--orange);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 64px;
  width: 100%;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

a.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.1);
}

.card .icon {
  font-size: 34px;
  margin-bottom: 14px;
}

.card h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.card p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ---------- Auth forms ---------- */

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card p.lead {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 78, 125, 0.15);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 13px 20px;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 980px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #dcebf7;
  color: var(--accent);
}

.btn-secondary:hover {
  background: #c8dff0;
}

.btn-auto {
  width: auto;
  padding: 9px 18px;
  font-size: 15px;
}

.form-error {
  background: #fff0f0;
  border: 1px solid #ffc9cc;
  color: var(--error);
  font-size: 14px;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.auth-alt {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-alt a {
  color: var(--accent);
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

/* ---------- Dashboard ---------- */

.dash {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 32px 80px;
  flex: 1;
}

.dash h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 16px 0 6px;
}

.dash p.lead {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 32px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state .icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto 20px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: #dcebf7;
  border-radius: 980px;
  padding: 4px 12px;
}

/* CEFR level badges — block palette coding */
.level-a1 { background: var(--pink); color: #5c2a52; }
.level-a2 { background: var(--blue); color: #fff; }
.level-b1 { background: var(--green); color: #0d4a2a; }
.level-b2 { background: var(--yellow); color: #5c440a; }
.level-c1 { background: var(--orange); color: #fff; }
.level-c2 { background: #152634; color: #fff; }

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---------- Phase 2: classes & rosters ---------- */

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-head .btn {
  margin-top: 24px;
  flex-shrink: 0;
}

.card-grid.wide {
  max-width: 980px;
  padding-bottom: 40px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid #dde9f2;
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.cred-user {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 14px;
}

.cred-pass {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reveal {
  background: #fff8e6;
  border: 1px solid #f0e0b0;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  margin-bottom: 20px;
}

.reveal code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-danger {
  background: var(--error);
}

.btn-danger:hover {
  background: #b5000f;
}

/* ---------- Print (credential sheets) ---------- */

@media print {
  .nav,
  .footer,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 12px;
  }

  .panel,
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .dash {
    padding: 0;
  }
}

/* ---------- Phase 4: test engine ---------- */

.test-info {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.test-info li {
  background: #f0f6fb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-secondary);
}

.honesty-banner {
  background: #fff8e6;
  border: 1px solid #f0e0b0;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  color: #5c4b1e;
  margin-bottom: 20px;
}

.quiz-feedback-item {
  border-left: 3px solid var(--border, #d0d7de);
  padding: 12px 0 12px 14px;
  margin: 12px 0;
}

.quiz-feedback-item.is-correct {
  border-left-color: #1a7f4b;
}

.quiz-feedback-item.is-wrong {
  border-left-color: #b42318;
}

.quiz-feedback-item .badge {
  margin-left: 8px;
}

.quiz-feedback-item code {
  font-size: 0.95em;
}

.test-dash {
  max-width: 760px;
}

.level-section {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 2rem 0 1rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--border);
}

.level-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.test-timer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.test-timer.over-time {
  border-color: var(--error);
  background: #fff5f5;
}

.test-timer.over-time .timer-value {
  color: var(--error);
}

.timer-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.timer-value {
  display: block;
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.question-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.question-prompt {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 18px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover {
  border-color: var(--accent);
  background: #f0f6fc;
}

.option input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.option span {
  font-size: 16px;
  line-height: 1.4;
}

.written-answer {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
}

.written-answer:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 78, 125, 0.15);
}

.test-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.result-panel {
  text-align: center;
  padding: 32px;
}

.result-level {
  margin-bottom: 16px;
}

.result-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.result-badge {
  display: inline-block;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.result-detail p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 6px 0;
}

.result-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-secondary);
}

.response-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.response-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.response-card.correct {
  border-color: #34c759;
  background: #f2fff5;
}

.response-card.partial {
  border-color: #ff9500;
  background: #fffbf2;
}

.response-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.response-score {
  margin-left: auto;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

.response-prompt {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.response-answer {
  font-size: 15px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ---------- Reading passages & overtime ---------- */

.reading-passage {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border-left: 4px solid var(--accent);
}

.reading-passage p {
  font-size: 17px;
  line-height: 1.7;
  margin-top: 12px;
}

.reading-passage .passage-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
}

.overtime-flag {
  background: #fff0f0;
  border: 1px solid #ffc9cc;
  color: var(--error);
  font-size: 14px;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

/* ---------- Listening & dictation ---------- */

.listening-passage {
  border-left-color: #af52de;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.audio-player audio {
  flex: 1;
  min-width: 220px;
  height: 40px;
}

.plays-left {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.question-card .audio-player {
  margin: 4px 0 14px;
}

/* ---------- Phase 6: analytics ---------- */

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.panel-title {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 16px;
}

.panel-subtitle {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.bar-label {
  flex: 0 0 90px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.bar {
  flex: 1;
  height: 10px;
  background: #dcebf7;
  border-radius: 980px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 980px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.bar-fill.ok {
  background: #34c759;
}

.bar-fill.weak {
  background: #ff9500;
}

.bar-detail {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gap-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  background: #fff5f5;
  border: 1px solid #ffc9cc;
  color: var(--error);
  border-radius: 980px;
  padding: 5px 14px;
}

.level-badge {
  background: var(--accent);
  color: #fff;
}

.result-badge-inline {
  color: var(--accent);
}

.response-answer.expected {
  color: #1e7e34;
}

.ai-feedback {
  margin-top: 10px;
  font-size: 14px;
  color: #5b2ea6;
  background: #f7f2ff;
  border: 1px solid #e3d5ff;
  border-radius: 10px;
  padding: 10px 14px;
}

.score-kind {
  font-style: normal;
  font-weight: 400;
  color: var(--text-secondary);
}

.missed-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.missed-list li {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #dde9f2;
}

.missed-list li:last-child {
  border-bottom: none;
}

/* ---------- Phase 3: onboarding ---------- */

.auth-card.wide {
  max-width: 560px;
}

.form-section {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 26px 0 4px;
}

.form-section:first-of-type {
  margin-top: 0;
}

.form-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-row .field {
  flex: 1;
}

.field-row .field-narrow {
  flex: 0 0 110px;
}

.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 17px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3e%3cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 78, 125, 0.15);
}

/* ---------- Mr Pares's English Studio: hubs & stories ---------- */

.card-disabled {
  opacity: 0.65;
  cursor: default;
}

.card-disabled h2 {
  color: var(--text-secondary);
}

.krashen-panel {
  margin-bottom: 28px;
  border-left: 4px solid var(--green);
}

.krashen-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.krashen-steps li {
  margin-bottom: 10px;
}

.krashen-steps strong {
  color: var(--text);
}

.story-card {
  margin-bottom: 20px;
}

.story-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.story-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.story-zhtitle {
  color: var(--text-secondary);
}

.story-downloads {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
  font-size: 14px;
}

.story-downloads-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.story-downloads a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.story-downloads a:hover {
  border-bottom-color: var(--accent);
}

.zh-toggle {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  border-radius: 980px;
  padding: 6px 14px;
  cursor: pointer;
}

.zh-toggle:hover {
  background: #d4e6f2;
}

.story-text {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.story-text p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--text);
}

.story-zh p {
  color: var(--text-secondary);
}

/* ---------- Responsive: iPad & mobile ---------- */

@media (max-width: 1024px) {
  .dash,
  .nav {
    padding-left: 24px;
    padding-right: 24px;
  }
  .hero h1 {
    font-size: 46px;
  }
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    padding: 12px 16px;
  }
  .nav-brand {
    font-size: 16px;
  }
  .hero {
    padding: 48px 18px 32px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .hero-kicker {
    font-size: 18px;
  }
  .hero p.sub {
    font-size: 17px;
  }
  .block-row {
    gap: 12px;
    margin-top: 28px;
  }
  .block {
    width: 32px;
    height: 32px;
  }
  .card-grid {
    padding: 0 16px 48px;
    grid-template-columns: 1fr;
  }
  .card {
    padding: 26px 22px;
  }
  .dash {
    padding: 16px 16px 64px;
  }
  .dash h1 {
    font-size: 26px;
  }
  .panel {
    padding: 20px 16px;
  }
  .auth-card {
    padding: 26px 20px;
  }
  .table-wrap,
  .panel {
    overflow-x: auto;
  }
  .table {
    min-width: 560px;
  }
  .btn {
    font-size: 16px;
  }
  .test-head {
    flex-direction: column;
  }
  .test-timer {
    align-self: flex-start;
  }
  .question-card {
    padding: 18px 16px;
  }
  .question-prompt {
    font-size: 16px;
  }
  .option {
    padding: 16px 14px;
  }
  .option span {
    font-size: 16px;
  }
  .audio-player audio {
    min-width: 0;
    width: 100%;
  }
  .test-actions .btn {
    width: 100%;
  }
  .story-title {
    font-size: 20px;
  }
  .story-downloads {
    gap: 10px;
  }
  .result-badge {
    font-size: 36px;
  }
  .actions .btn,
  .actions form {
    width: 100%;
  }
  .actions .btn {
    text-align: center;
  }
}

/* ---------- Karaoke live reader ---------- */

/* Difficulty pills — story ordering within a band */
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 980px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

.pill-easier { background: var(--green); color: #0d4a2a; }
.pill-harder { background: var(--orange); color: #fff; }

.band-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.player-bar .speed-label {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.player-bar select {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

.story-body p {
  line-height: 2;
}

.story-body-title {
  font-weight: 700;
}

.word {
  border-radius: 4px;
  padding: 1px 2px;
  margin: 0 -1px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.word.sentence-active {
  background: var(--accent-soft);
}

.word.active {
  background: var(--accent);
  color: #fff;
}

.sync-note {
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px 0 0;
}
