:root {
  --bg: #121212;
  --bg-elevated: #1c1c1e;
  --bg-card: #1e1e20;
  --text: #f2f2f2;
  --text-dim: #9a9a9c;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --border: #2c2c2e;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #f5f5f7;
  --bg-card: #f0f0f2;
  --text: #1a1a1a;
  --text-dim: #6e6e73;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #d8d8dc;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view:not([hidden]) {
  animation: viewIn 0.18s ease;
}

button, select, input { font-family: inherit; }

/* ── Sticky header ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.brand {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.sleep-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.sleep-btn:active { background: var(--accent-soft); }
.sleep-btn.sleep-active { color: var(--accent); }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.theme-toggle:active { background: var(--accent-soft); }

/* ── Player bar ─────────────────────────────────────────── */
.player-bar {
  padding: 12px 20px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl-btn:active { background: var(--accent-soft); }

.ctrl-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  padding: 0;
}
.ctrl-play:active { opacity: 0.85; background: var(--accent); }
.ctrl-play .icon-play { margin-left: 2px; }

/* Progress range input */
.progress-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--pct, 0%),
    var(--border) var(--pct, 0%),
    var(--border) 100%
  );
  outline: none;
  cursor: pointer;
}
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.progress-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
.progress-bar::-moz-range-progress {
  background: var(--accent);
  height: 4px;
  border-radius: 2px;
}

.player-time {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  flex: none;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  padding: 2px 4px;
}
.player-time:hover { color: var(--accent); }

.player-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
}

.player-selects {
  display: flex;
  gap: 6px;
  flex: none;
}

.meta-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  max-width: 110px;
}

.speed-control {
  display: flex;
  align-items: center;
  flex: none;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.speed-arrow {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  width: 30px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background 0.1s, color 0.1s;
}
.speed-arrow:hover { background: var(--accent-soft); color: var(--accent); }
.speed-arrow:active { background: var(--accent); color: #fff; }

#btn-speed-down { border-right: 1px solid var(--border); }
#btn-speed-up   { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.speed-slider {
  width: 100px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  margin: 0 10px;
  flex: none;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.speed-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.speed-input {
  width: 48px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  outline: none;
  padding: 0 6px;
}
.speed-input:focus { background: var(--accent-soft); color: var(--accent); }

/* ── Views ──────────────────────────────────────────────── */
.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* ── Continue banner ────────────────────────────────────── */
.continue-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  cursor: pointer;
}
.continue-banner:active { background: var(--accent-soft); }
.continue-info { flex: 1; min-width: 0; }
.continue-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.continue-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}
.continue-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.continue-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.continue-play {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding-left: 2px;
}

/* ── Module list ────────────────────────────────────────── */
.module {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 10px;
  overflow: hidden;
}

.module-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
}
.module-head:active { background: var(--accent-soft); }

.module-name { font-weight: 600; font-size: 14px; }
.module-meta {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}
.module-chev {
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.module.open .module-chev { transform: rotate(90deg); }

.module-progress-track {
  height: 2px;
  background: var(--border);
}
.module-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.module-episodes {
  display: none;
  border-top: 1px solid var(--border);
}
.module.open .module-episodes { display: block; }

.episode-row {
  display: grid;
  grid-template-columns: 22px 1fr 28px 36px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.episode-row:first-child { border-top: none; }
.episode-row:active { background: var(--accent-soft); }

.ep-index { font-size: 13px; color: var(--text-dim); }
.ep-index.ep-done { color: #22c55e; font-weight: 700; font-size: 15px; }
.ep-row-done .ep-title { color: var(--text-dim); }
.ep-main { min-width: 0; }
.ep-title {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ep-progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.ep-progress-fill { height: 100%; background: var(--accent); width: 0%; }

.ep-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ep-play::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent var(--accent);
  margin-left: 2px;
}

/* ── Episode view ───────────────────────────────────────── */
.episode-heading {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 16px;
  line-height: 1.3;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.tab-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.markdown-body {
  font-size: 16px;
  line-height: 1.75;
}
.markdown-body p { margin: 0 0 1em; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5 {
  line-height: 1.3;
  margin: 1.6em 0 0.5em;
  font-weight: 700;
}
.markdown-body h1 { font-size: 1.5em; }
.markdown-body h2 { font-size: 1.25em; }
.markdown-body h3 { font-size: 1.1em; }

.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin: 0 0 1em; }
.markdown-body li { margin-bottom: 0.3em; }

.markdown-body blockquote {
  margin: 1em 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
}

/* Code blocks */
.markdown-body pre {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 1em 0;
  overflow: hidden;
}
.markdown-body pre code {
  display: block;
  padding: 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  background: transparent;
  border-radius: 0;
  /* Custom scrollbar for code */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.markdown-body pre code::-webkit-scrollbar { height: 4px; }
.markdown-body pre code::-webkit-scrollbar-track { background: transparent; }
.markdown-body pre code::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Inline code */
.markdown-body code:not(pre code) {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.875em;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  font-family: var(--font);
}
.markdown-body pre:hover .copy-btn,
.markdown-body pre:focus-within .copy-btn { opacity: 1; }
/* Always visible on touch devices */
@media (hover: none) { .copy-btn { opacity: 0.55; } }
.copy-btn:hover { opacity: 1; }
.copy-btn:active { background: var(--accent); color: #fff; border-color: var(--accent); }
.copy-btn.copied { background: #16a34a; color: #fff; border-color: #16a34a; opacity: 1; }

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
}
.markdown-body th, .markdown-body td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.markdown-body th { background: var(--bg-card); font-weight: 600; }
.markdown-body tr:nth-child(even) td { background: var(--bg-card); }

.markdown-body img { max-width: 100%; border-radius: 8px; }

/* ── Icon buttons (stats, queue) ────────────────────────── */
.icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.icon-btn:active { background: var(--accent-soft); }

.queue-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ── Episode row enhancements ───────────────────────────── */
.ep-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ep-title-row .ep-title { flex: 1; }
.ep-duration {
  font-size: 11px;
  color: var(--text-dim);
  flex: none;
  white-space: nowrap;
}

.ep-queue-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.ep-queue-btn:active { background: var(--accent-soft); }
.ep-queue-btn.in-queue {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-size: 12px;
}

/* ── Auto-advance toast ─────────────────────────────────── */
.advance-toast {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  z-index: 50;
  min-width: 280px;
  max-width: calc(100vw - 32px);
}
.advance-info { flex: 1; min-width: 0; }
.advance-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}
.advance-title {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.advance-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.advance-countdown {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  min-width: 20px;
  text-align: center;
}
.advance-cancel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.advance-cancel:active { background: var(--accent-soft); }

/* ── Stats overlay ──────────────────────────────────────── */
.stats-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.stats-panel {
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 20px 36px;
}
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.stats-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.stats-close {
  background: var(--bg-card);
  border: none;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.stats-content { font-size: 14px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 480px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stats-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.stats-module { margin-bottom: 14px; }
.stats-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}
.stats-module-count { color: var(--text-dim); font-size: 12px; }
.stats-module-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.stats-module-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Quiz ───────────────────────────────────────────────── */

.quiz-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.quiz-picker-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
}
.qps-count { color: var(--text-dim); }
.qps-score { color: var(--accent); font-weight: 600; }
.qps-due {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.quiz-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 420px) {
  .quiz-modes { grid-template-columns: 1fr; }
}

.quiz-mode-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.quiz-mode-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.quiz-mode-btn:active { background: var(--accent-soft); }
.quiz-mode-btn.qmb-disabled { opacity: 0.45; cursor: default; }
.quiz-mode-btn.qmb-disabled:hover { border-color: var(--border); background: var(--bg-card); }

.qmb-icon { font-size: 28px; margin-bottom: 10px; }
.qmb-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.qmb-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.quiz-exit-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}
.quiz-exit-btn:hover { color: var(--text); }
.quiz-progress-text { font-size: 12px; color: var(--text-dim); }

.quiz-progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 24px;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quiz-q-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 20px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-option {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
  transition: border-color 0.12s, background 0.12s;
}
.quiz-option:not([disabled]):hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quiz-option:not([disabled]):active { background: var(--accent-soft); }
.quiz-option.opt-correct {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  font-weight: 600;
}
.quiz-option.opt-wrong {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.10);
  color: #dc2626;
}
.quiz-option.opt-dim { opacity: 0.4; }

.quiz-feedback {
  margin-top: 4px;
  animation: viewIn 0.18s ease;
}
.quiz-feedback-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.feedback-verdict {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.verdict-correct { color: #16a34a; }
.verdict-wrong { color: #dc2626; }
.feedback-explanation {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}

.quiz-next-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.quiz-next-btn:active { opacity: 0.85; }

.quiz-summary {
  padding: 20px 0 40px;
  text-align: center;
}
.quiz-summary-score { margin-bottom: 32px; }
.summary-emoji { font-size: 52px; margin-bottom: 10px; }
.summary-fraction { font-size: 42px; font-weight: 700; color: var(--accent); }
.summary-pct { font-size: 16px; color: var(--text-dim); margin-top: 4px; }

.quiz-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.quiz-action-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.quiz-action-btn:active { opacity: 0.85; }
.quiz-action-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.quiz-action-ghost {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
