/* Lexi — claude.ai-inspired theme: warm ivory, terracotta, serif headings. */

:root {
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --surface-2: #F5F4EE;
  --ink: #1F1E1D;
  --ink-soft: #3D3D3A;
  --muted: #87867F;
  --border: #E8E6DD;
  --accent: #D97757;
  --accent-hover: #C6613F;
  --accent-soft: #F8EDE7;
  --green: #7C9885;
  --green-soft: #EDF3EE;
  --red: #C0574F;
  --red-soft: #F9ECEA;
  --gold: #E8B04B;
  --radius: 16px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 3px rgba(31, 30, 29, 0.06), 0 8px 24px rgba(31, 30, 29, 0.05);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .flash-term, .quiz-term, .story-title, .wordmark { font-family: var(--serif); }
h1 { font-size: 2rem; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 1.3rem; font-weight: 600; margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
b { font-weight: 600; }

.container { max-width: 860px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.wordmark {
  font-size: 1.4rem; font-weight: 700; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}
.spark { color: var(--accent); }
.topbar-stats { display: flex; align-items: center; gap: 8px; }
.chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: 0.85rem;
}
.chip-level { background: var(--accent-soft); border-color: #EDD9CE; color: #A05435; font-weight: 600; }
.linklike {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.85rem; font-family: var(--sans); padding: 4px 6px;
}
.linklike:hover { color: var(--ink); }

/* ---------- flash messages ---------- */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.95rem; }
.flash-alert { background: var(--red-soft); color: var(--red); border: 1px solid #EBD2CF; }
.flash-notice { background: var(--green-soft); color: #4E6B58; border: 1px solid #D7E4DA; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  border-radius: 12px; padding: 12px 22px; transition: all 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--border); }
.btn-soft:hover { background: var(--border); }
.btn-small { font-size: 0.85rem; padding: 8px 14px; }
.btn-block { width: 100%; }
.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem; padding: 6px 10px; cursor: pointer; transition: background 0.15s;
}
.icon-btn:hover { background: var(--border); }
.mic-live { background: var(--accent-soft); border-color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

/* ---------- login ---------- */
/* A family photo, barely there, washed into the ivory theme. */
.login-backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center 30%; background-repeat: no-repeat;
  opacity: 0.11; filter: sepia(0.55) saturate(0.8) contrast(0.9);
}
.login-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(250, 249, 245, 0) 30%, rgba(250, 249, 245, 0.9) 100%);
}
.login-page main { position: relative; z-index: 1; }
.login-wrap { min-height: 90vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 44px 40px; width: 100%; max-width: 400px; text-align: center;
}
.login-spark { color: var(--accent); font-size: 2.6rem; line-height: 1; }
.login-title { font-size: 2.6rem; margin: 6px 0 2px; }
.login-sub { color: var(--muted); margin: 0 0 28px; }
.login-form { text-align: left; }
.login-form label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
.login-form input {
  width: 100%; padding: 12px 14px; font-size: 1rem; font-family: var(--sans);
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--ink);
}
.login-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.login-form .btn { margin-top: 22px; }

/* ---------- dashboard ---------- */
.hero { margin-bottom: 30px; }
.hero-sub { color: var(--ink-soft); margin: 0 0 12px; }
.wave { display: inline-block; }
.mastery-bar { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.mastery-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width 0.6s ease; }

.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mode-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 4px;
  transition: all 0.15s ease; box-shadow: var(--shadow);
}
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mode-emoji { font-size: 1.7rem; }
.mode-name { font-weight: 700; font-size: 1.05rem; }
.mode-desc { color: var(--muted); font-size: 0.85rem; }
.mode-disabled { opacity: 0.45; pointer-events: none; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.group-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; text-align: left; font-family: var(--sans);
  display: flex; flex-direction: column; gap: 3px; transition: all 0.15s;
}
.group-card:hover { border-color: var(--accent); }
.group-selected { border-color: var(--accent); background: var(--accent-soft); }
.group-name { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.group-range { color: var(--muted); font-size: 0.78rem; }
.group-bar { height: 5px; background: var(--surface-2); border-radius: 99px; margin-top: 5px; overflow: hidden; display: block; }
.group-bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }

.order-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.order-opt { font-size: 0.9rem; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; cursor: pointer; }
.order-opt input { accent-color: var(--accent); }

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  background: var(--surface); border: 1px solid var(--gold); border-radius: 999px;
  padding: 7px 14px; font-size: 0.88rem; font-weight: 600; box-shadow: var(--shadow);
}
.badge-emoji { font-size: 1rem; }

/* ---------- study shell ---------- */
.study-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.back-link:hover { color: var(--ink); }
.study-progress { flex: 1; height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.study-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.study-count { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

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

/* ---------- flashcards ---------- */
.flashcard { perspective: 1200px; cursor: pointer; height: 320px; outline: none; }
.flashcard-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 30px; text-align: center;
}
.flash-back { transform: rotateY(180deg); background: var(--surface-2); }
.flash-term { font-size: 2.6rem; font-weight: 600; }
.flash-pos { color: var(--muted); font-style: italic; }
.flash-hint { position: absolute; bottom: 14px; color: var(--muted); font-size: 0.75rem; }
.flash-def { font-size: 1.25rem; line-height: 1.45; }
.flash-ex { color: var(--ink-soft); font-style: italic; font-size: 0.95rem; }
.mnemonic { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; font-size: 0.9rem; color: #8A4A2E; }
.flash-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* ---------- quiz ---------- */
.quiz-kind { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.quiz-term { font-size: 2.2rem; font-weight: 600; margin: 8px 0 4px; }
.quiz-def { font-family: var(--serif); font-size: 1.3rem; margin: 10px 0 4px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.quiz-opt {
  text-align: left; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; font-size: 1rem; font-family: var(--sans);
  cursor: pointer; transition: all 0.12s; color: var(--ink);
}
.quiz-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt-right { background: var(--green-soft) !important; border-color: var(--green) !important; }
.opt-wrong { background: var(--red-soft) !important; border-color: var(--red) !important; }

/* ---------- type it / sentence ---------- */
.type-row { display: flex; gap: 10px; margin-top: 18px; }
.type-input, .sentence-input {
  flex: 1; width: 100%; padding: 13px 15px; font-size: 1.05rem; font-family: var(--sans);
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--ink);
}
.type-input:focus, .sentence-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.sentence-input { margin-top: 16px; resize: vertical; line-height: 1.5; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; line-height: 1.45; tab-size: 2; }
.grade .md pre { background: var(--surface); border: 1px solid var(--border); }
.grade .md code { background: var(--surface); }
/* Quest layout: card on the left, Ask Lexi sidebar on the right */
.quest-page { max-width: 1150px; }
.quest-cols { display: flex; gap: 18px; align-items: flex-start; justify-content: center; }
.quest-main { flex: 1 1 auto; min-width: 0; max-width: 760px; }
.quest-side { flex: 0 0 320px; position: sticky; top: 14px; max-height: calc(100vh - 28px); display: flex; }
.ask-quest { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; width: 100%; display: flex; flex-direction: column; min-height: 0; }
.ask-title { margin: 0; font-weight: 700; }
.ask-hint { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }
.ask-quest .ask-input { margin-top: 10px; }
.ask-actions { margin-top: 10px; flex-wrap: wrap; gap: 8px; }
.ask-thread { overflow-y: auto; min-height: 0; margin-top: 4px; }
.ask-row { margin-top: 12px; }
.ask-q { margin: 0 0 4px; color: var(--ink-soft); font-size: 0.9rem; }
.ask-a { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; }
.ask-a pre { background: var(--surface); border: 1px solid var(--border); }
.ask-a code { background: var(--surface); }
@media (max-width: 900px) {
  .quest-cols { flex-wrap: wrap; }
  .quest-side { flex: 1 1 100%; position: static; max-height: none; }
  .ask-thread { max-height: 45vh; }
}
.sentence-def { margin-top: 2px; }
.type-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; flex-wrap: wrap; }
.type-feedback, .sentence-feedback { min-height: 24px; margin-top: 14px; font-size: 1rem; }
.fb-right { color: #4E6B58; font-weight: 600; }
.fb-wrong { color: var(--red); font-weight: 500; }

.grade { background: var(--surface-2); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.grade-stars { color: var(--gold); font-size: 1.5rem; letter-spacing: 3px; }
.grade-fb { margin: 8px 0 0; }
.grade-improved { margin: 10px 0 0; color: var(--ink-soft); }

/* ---------- story ---------- */
.story-loading { text-align: center; padding: 60px 30px; color: var(--muted); }
.spark-spin { color: var(--accent); font-size: 2.4rem; animation: spin 2.2s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.story-title { font-size: 1.6rem; margin: 0 0 14px; }
.story-text { font-family: var(--serif); font-size: 1.15rem; line-height: 1.9; }
.story-blank {
  background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 8px;
  padding: 2px 12px; margin: 0 2px; font-family: var(--serif); font-size: 1.05rem;
  cursor: pointer; color: #8A4A2E; min-width: 80px;
}
.blank-filled { border-style: solid; font-weight: 600; }
.blank-right { background: var(--green-soft); border-color: var(--green); color: #4E6B58; }
.blank-wrong { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.story-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.bank-chip {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; font-size: 0.95rem; font-family: var(--sans); cursor: pointer; transition: all 0.12s;
}
.bank-chip:hover { border-color: var(--accent); }
.chip-used { opacity: 0.25; pointer-events: none; }

/* ---------- end screen ---------- */
.end-card { text-align: center; }
.end-emoji { font-size: 3.4rem; }
.end-score { font-size: 1.2rem; color: var(--ink-soft); }
.end-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---------- toasts & confetti ---------- */
#toast-root { position: fixed; top: 70px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 18px;
  font-size: 0.92rem; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  opacity: 0; transform: translateX(20px); transition: all 0.35s ease; max-width: 300px;
}
.toast-in { opacity: 1; transform: translateX(0); }
.toast-points { background: var(--accent); }
.toast-level { background: var(--gold); color: var(--ink); }
.toast-badgewrap { background: var(--ink); }
.toast-badge { font-size: 1.2rem; }
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 200; display: none; }

@media (max-width: 640px) {
  .container { padding: 16px 14px 60px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .card { padding: 22px 18px; }
  .flash-term { font-size: 2rem; }
  .end-actions, .flash-actions { flex-wrap: wrap; }
}

/* ---------- Annie's lecture lab ---------- */
.container-wide { max-width: none; margin: 0; padding: 14px 18px 20px; }
.annie {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr); gap: 16px;
  height: calc(100vh - 96px); min-height: 520px;
}
.annie-slides, .annie-explain, .annie-chat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0;
}
.annie-slides { padding: 12px 16px 10px; }
.annie-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.annie-back { color: var(--muted); text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.annie-back:hover { color: var(--ink); }
.annie-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annie-nav { display: flex; align-items: center; gap: 8px; }
.annie-nav .btn { padding: 6px 14px; font-size: 1.1rem; line-height: 1; }
.annie-count { font-size: 0.9rem; color: var(--ink-soft); white-space: nowrap; }
.annie-slide-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.annie-slide { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.annie-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding-top: 10px; }
.annie-dot { width: 10px; height: 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); padding: 0; cursor: pointer; }
.annie-dot:hover { border-color: var(--accent); }
.annie-dot-on { background: var(--accent); border-color: var(--accent); }

.annie-right { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; min-height: 0; }
.annie-pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--serif); font-weight: 600; font-size: 1rem;
}
.annie-body { padding: 12px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.annie-log { padding: 12px 16px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.annie-hint { padding: 4px 2px; }
.annie-msg { display: flex; }
.annie-msg-user { justify-content: flex-end; }
.annie-msg-body { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 0.95rem; }
.annie-msg-user .annie-msg-body { background: var(--accent-soft); color: #7A3D22; white-space: pre-wrap; }
.annie-msg-assistant .annie-msg-body { background: var(--surface-2); }
.annie-ask { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.annie-ask textarea {
  flex: 1; resize: none; font-family: var(--sans); font-size: 0.95rem; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--ink);
}
.annie-ask textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.annie-thinking { color: var(--muted); font-style: italic; animation: annie-pulse 1.4s ease-in-out infinite; }
@keyframes annie-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.annie-error { color: var(--red); }

/* markdown inside Annie's panes */
.md { font-size: 0.95rem; line-height: 1.55; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md h1, .md h2, .md h3 { font-size: 1.05rem; margin: 14px 0 6px; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 10px; }
.md li { margin-bottom: 4px; }
.md code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 0.9em; }
.md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
.md .katex-display { margin: 8px 0 12px; overflow-x: auto; overflow-y: hidden; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--ink-soft); }

@media (max-width: 900px) {
  .annie { grid-template-columns: 1fr; height: auto; }
  .annie-slides { min-height: 60vh; }
  .annie-right { grid-template-rows: none; }
  .annie-explain, .annie-chat { min-height: 360px; max-height: 70vh; }
}

/* ---------- family doors (home) ---------- */
.door-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.door {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--border); border-radius: 20px; padding: 26px 22px;
  box-shadow: var(--shadow); transition: all 0.15s ease; min-height: 190px;
}
.door:hover { border-color: var(--accent); transform: translateY(-3px); }
.door-mine { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.door-emoji { font-size: 2.4rem; }
.door-name { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; }
.door-desc { color: var(--muted); font-size: 0.88rem; flex: 1; }
.door-go { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

form.button_to:has(.door-button) { display: contents; }
.door-button { width: 100%; cursor: pointer; font-family: var(--sans); font-size: 1rem; text-align: left; }

/* ---------- study lab ---------- */
.lab-form { display: flex; flex-direction: column; gap: 14px; }
.lab-form-row { display: flex; flex-direction: column; gap: 6px; }
.lab-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.lab-input {
  width: 100%; padding: 11px 13px; font-size: 1rem; font-family: var(--sans);
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--ink);
}
.lab-input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea.lab-input { resize: vertical; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt input { display: none; }
.emoji-opt span {
  display: inline-block; font-size: 1.3rem; padding: 5px 8px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.emoji-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.lab-details summary { cursor: pointer; margin-bottom: 12px; }
.linklike.danger { color: var(--red); }
.mat-list { display: flex; flex-direction: column; gap: 10px; }
.mat-row {
  display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow);
}
.mat-done { border-color: #D7E4DA; background: var(--green-soft); }
.mat-emoji { font-size: 1.5rem; }
.mat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mat-title { font-weight: 700; color: var(--ink); text-decoration: none; }
a.mat-title:hover { color: var(--accent); }
.mat-meta { color: var(--muted); font-size: 0.82rem; }
.annie-progress { font-size: 0.85rem; color: var(--green); font-weight: 600; white-space: nowrap; }
.annie-dot-seen { background: #C9D9CE; border-color: #C9D9CE; }
.annie-text {
  margin: 0; padding: 20px 24px; width: 100%; height: 100%; overflow: auto; white-space: pre-wrap;
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; color: var(--ink); background: var(--surface);
}
.annie-tabs { display: flex; gap: 4px; }
.annie-tab {
  background: none; border: none; cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1rem;
  color: var(--muted); padding: 2px 8px; border-radius: 8px;
}
.annie-tab:hover { color: var(--ink); }
.annie-tab-on { color: var(--ink); background: var(--surface-2); }
.quiz-q .quiz-text { font-size: 1.05rem; margin: 6px 0 10px; }
.quiz-q .quiz-options { margin-top: 10px; }
.quiz-q .quiz-opt { text-align: left; }
.quiz-why { margin-top: 10px; min-height: 20px; }
.quiz-end { text-align: center; padding: 20px 0; }

/* ---------- quests ---------- */
.quest-card { position: relative; }
.quest-stats { color: var(--ink-soft); font-size: 0.8rem; }
.quest-rank { font-weight: 700; color: #A05435; }
.quest-stage { max-width: 1120px; margin: 0 auto; }
.quest-stage > .card { max-width: 760px; margin-left: auto; margin-right: auto; }
.quest-lesson .quest-body { font-size: 1.05rem; line-height: 1.65; }
.quest-stage .md img { max-width: 100%; max-height: 300px; height: auto; display: block; border: 1px solid var(--border); border-radius: 10px; margin: 6px 0 10px; background: #fff; }
.quest-lesson .story-title { margin-top: 6px; }
.quest-stage .quiz-def { font-size: 1.15rem; }
.quest-stage .grade { margin-top: 16px; }

/* ---------- Official PSAT ---------- */
.psat-page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
.psat-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.psat-hero .hero-sub { max-width: 560px; }
.psat-jar { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); min-width: 280px; }
.jar-glass { position: relative; width: 54px; height: 70px; border: 3px solid #C9B98A; border-top-width: 6px; border-radius: 8px 8px 16px 16px; overflow: hidden; background: #FFFDF6; flex: none; }
.jar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #9CC9A2, #5E9A6B); transition: height 0.8s ease; }
.jar-amt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; color: var(--ink); text-shadow: 0 0 4px #fff; }
.jar-text { font-size: 0.92rem; line-height: 1.4; }
.jar-owed { color: #2F7A45; font-weight: 600; }
.duel-invite { display: flex; align-items: center; gap: 14px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap; }
.duel-invite > div { flex: 1; min-width: 200px; }
.duel-swords { font-size: 2rem; }
.h2h { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.h2h-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.h2h-me { border-color: var(--accent); }
.h2h-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.h2h-lead { font-family: var(--sans); font-size: 0.72rem; background: var(--gold); color: #fff; border-radius: 99px; padding: 2px 8px; vertical-align: middle; }
.h2h-race { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 10px; }
.h2h-race span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width 0.6s; }
.h2h-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: var(--ink-soft); margin-top: 4px; }
.psat-tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.psat-test { display: flex; flex-direction: column; gap: 10px; }
.psat-test-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.psat-test-name { font-weight: 700; font-size: 1.05rem; }
.psat-tag { font-size: 0.75rem; font-weight: 700; border-radius: 99px; padding: 3px 10px; background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
.psat-tag-new { background: var(--accent-soft); color: #A05435; }
.psat-tag-done { background: var(--green-soft); color: #3F6B4B; }
.psat-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.psat-start { display: inline; margin: 0; }
.psat-mod-done { color: #3F6B4B; border-color: var(--green); }
.psat-locked { opacity: 0.7; background: var(--surface-2); }
.live-paper-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.live-paper-links { display: flex; gap: 6px; flex-wrap: wrap; }
.live-paper-bundles { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 2px; }
.live-paper-bundles p { margin: 0; }
.live-paper-set { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.live-paper-label { width: 128px; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
.live-paper-chip { min-width: 34px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: 600 0.85rem var(--sans); cursor: pointer; }
.live-paper-chip:hover { border-color: var(--accent); }
.live-paper-chip-done { background: var(--green-soft); border-color: var(--green); color: #3F6B4B; }
.mode-form { display: contents; }
button.mode-card { font-family: var(--sans); text-align: left; cursor: pointer; font-size: 1rem; }
button.mode-card:disabled { opacity: 0.45; cursor: default; transform: none; }
.mode-duel { border-color: var(--accent); background: linear-gradient(135deg, #fff, var(--accent-soft)); }
.psat-list { display: flex; flex-direction: column; gap: 8px; }
.psat-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; color: var(--ink); text-decoration: none; }
a.psat-row:hover { border-color: var(--accent); }
.badge-locked { opacity: 0.35; filter: grayscale(1); border-color: var(--border); box-shadow: none; }
.psat-rules p { max-width: 820px; }
.psat-loading { position: fixed; inset: 0; background: rgba(250, 249, 245, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; font-size: 1.1rem; }
.psat-loading[hidden] { display: none; }
.psat-loading .spark { font-size: 2.4rem; color: var(--accent); }

/* runner */
.psat-runner-page { max-width: 1240px; margin: 0 auto; padding: 10px 16px 60px; }
.pt-loading, .pt-intro { text-align: center; }
.pt-loading { padding: 80px 0; font-size: 2rem; color: var(--accent); }
.pt-intro { max-width: 620px; margin: 30px auto; }
.pt-intro-title { margin-top: 6px; }
.pt-tips { text-align: left; color: var(--ink-soft); font-size: 0.92rem; margin: 10px auto 20px; max-width: 480px; }
.pt-break { background: var(--green-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; text-align: left; }
.pt-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.pt-bar-tools { display: flex; gap: 8px; align-items: center; }
.pt-clock { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; font-weight: 700; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 5px 12px; cursor: pointer; min-width: 84px; }
.pt-clock-low { color: var(--red); border-color: var(--red); animation: pulse 1.2s infinite; }
.pt-cols { display: flex; gap: 18px; align-items: flex-start; }
.pt-main { flex: 1 1 auto; min-width: 0; }
.pt-side { flex: 0 0 310px; }
.pt-stage { display: flex; flex-direction: column; gap: 18px; }
.pt-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.pt-split .pt-passage { padding-right: 22px; border-right: 3px solid var(--border); }
.pt-split .pt-question { padding-left: 22px; }
.pt-passage { font-family: var(--serif); font-size: 1.08rem; line-height: 1.65; }
.pt-passage table, .md table { border-collapse: collapse; margin: 8px 0; font-family: var(--sans); font-size: 0.92rem; }
.pt-passage th, .pt-passage td, .md th, .md td { border: 1px solid var(--border); padding: 5px 10px; }
.pt-passage u, .pt-prompt u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pt-figure { display: block; max-width: 100%; max-height: 380px; margin: 8px auto; background: #fff; border-radius: 8px; }
.pt-qhead { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 8px; padding: 4px 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pt-qnum { background: var(--ink); color: #fff; font-weight: 700; border-radius: 6px; padding: 2px 10px; }
.pt-flag { background: none; border: none; cursor: pointer; font-size: 0.88rem; color: var(--ink-soft); font-family: var(--sans); }
.pt-flag-on { color: var(--red); font-weight: 700; }
.pt-prompt { font-size: 1.04rem; margin-bottom: 10px; }
.pt-choices { display: flex; flex-direction: column; gap: 9px; }
.pt-choice-row { display: flex; align-items: center; gap: 8px; }
.pt-choice { flex: 1; display: flex; gap: 12px; align-items: center; padding: 11px 14px; }
.pt-letter { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.pt-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.pt-selected .pt-letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt-struck .pt-choice-text { text-decoration: line-through; opacity: 0.45; }
.pt-struck { opacity: 0.75; }
.pt-elim { background: none; border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; color: var(--muted); flex: none; }
.pt-choice:disabled { cursor: default; }
.pt-spr { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pt-spr-input { max-width: 180px; font-size: 1.15rem; }
.pt-spr-preview { font-weight: 600; }
.pt-foot { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--border); margin-top: 22px; padding-top: 12px; }
.pt-grid-pop { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(440px, 92vw); }
.pt-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-grid-big { margin: 14px 0 20px; }
.pt-cell { width: 38px; height: 38px; border: 1px dashed var(--muted); background: var(--surface); border-radius: 6px; cursor: pointer; font-weight: 600; position: relative; font-family: var(--sans); }
.pt-cell-done { border: 1px solid var(--ink); background: var(--surface-2); }
.pt-cell-flag::after { content: "🚩"; position: absolute; top: -9px; right: -6px; font-size: 0.7rem; }
.pt-cell-right { background: var(--green-soft); border-color: var(--green); }
.pt-cell-wrong { background: var(--red-soft); border-color: var(--red); }
.pt-cell-here { outline: 2px solid var(--accent); }
.pt-review { max-width: 640px; margin: 20px auto; }
.pt-confirm { margin: 6px 0 0; width: 100%; text-align: right; }
.pt-extras { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pt-hint { background: #FFF8E6; border: 1px solid var(--gold); border-radius: 10px; padding: 8px 12px; font-size: 0.93rem; margin-bottom: 6px; }
.pt-explain { width: 100%; }
.pt-verdict { font-weight: 700; font-size: 1.05rem; margin: 4px 0 8px; }
.pt-right { color: #3F6B4B; }
.pt-wrong { color: var(--red); }
.pt-details { background: var(--surface-2); border-radius: 10px; padding: 8px 14px; font-size: 0.93rem; }
.pt-details summary { cursor: pointer; font-weight: 600; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; width: 100%; }
.pt-why { width: 100%; font-size: 0.93rem; display: flex; flex-direction: column; gap: 8px; }
.pt-dispute { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.pt-desmos { position: fixed; right: 16px; top: 70px; width: min(480px, 94vw); height: min(560px, 75vh); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,0.18); z-index: 40; display: flex; flex-direction: column; overflow: hidden; resize: both; }
.pt-desmos[hidden] { display: none; }
.pt-desmos-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.pt-desmos iframe { flex: 1; border: 0; width: 100%; }

/* results */
.pt-results-hero { display: flex; gap: 30px; flex-wrap: wrap; align-items: center; margin: 12px 0 18px; }
.pt-big-score { font-family: var(--serif); font-size: 3.6rem; font-weight: 700; line-height: 1.05; color: var(--accent); }
.pt-of { font-size: 1.8rem; color: var(--muted); }
.pt-sub-scores { color: var(--ink-soft); }
.pt-gains { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 260px; }
.pt-gain { font-size: 1rem; }
.pt-payday { display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, #EAF6EC, #FFF8E6); border: 2px solid #5E9A6B; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.pt-payday-cash { font-size: 3rem; animation: pulse 1.4s infinite; }
.pt-payday-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: #2F7A45; }
.pt-new-badges { margin-bottom: 18px; }
.pt-new { color: var(--accent); font-size: 0.75rem; }
.pt-results-cols { display: flex; gap: 18px; align-items: flex-start; }
.pt-results-main { flex: 1 1 auto; min-width: 0; }
.pt-results-cols .pt-side { position: sticky; top: 14px; max-height: calc(100vh - 28px); display: flex; }
.pt-report { display: flex; flex-direction: column; gap: 10px; }
.pt-headline { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: 0; }
.pt-rep-part ul { margin: 4px 0 0; padding-left: 20px; }
.pt-rep-focus { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.pt-rep-skill { font-weight: 700; }
.pt-rep-next { background: var(--accent-soft); border-radius: 10px; padding: 8px 14px; }
.pt-skills { display: flex; flex-direction: column; gap: 6px; }
.pt-skill { display: grid; grid-template-columns: minmax(150px, 260px) 1fr 50px; gap: 10px; align-items: center; font-size: 0.9rem; }
.pt-skill-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.pt-skill-bar span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.pt-skill-bar span.pt-full { background: var(--green); }
.pt-skill-bar span.pt-low { background: var(--red); }
.pt-skill-n { text-align: right; font-weight: 600; }
.pt-rev { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.pt-rev-head { width: 100%; display: flex; gap: 12px; align-items: center; background: none; border: none; padding: 10px 14px; cursor: pointer; text-align: left; font-family: var(--sans); font-size: 0.95rem; flex-wrap: wrap; }
.pt-rev-mark { font-weight: 800; }
.pt-rev-body { padding: 4px 16px 16px; }
.pt-twin { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  .pt-cols, .pt-results-cols { flex-wrap: wrap; }
  .pt-side { flex: 1 1 100%; }
  .pt-results-cols .pt-side { position: static; max-height: none; }
  .pt-split { display: flex; flex-direction: column; gap: 16px; }
  .pt-split .pt-passage { padding-right: 0; border-right: 0; border-bottom: 3px solid var(--border); padding-bottom: 16px; }
  .pt-split .pt-question { padding-left: 0; }
  .pt-skill { grid-template-columns: 1fr 1fr 44px; }
}
.psat-door { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--ink); background: linear-gradient(135deg, #fff 40%, var(--accent-soft)); border: 2px solid var(--accent); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); transition: transform 0.15s; }
.psat-door:hover { transform: translateY(-2px); }
.psat-door-emoji { font-size: 2.6rem; }
.psat-door-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.psat-door-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.psat-door-alert { color: var(--accent-hover); font-weight: 700; font-size: 0.9rem; }
.psat-door-jar { font-weight: 800; font-size: 1.4rem; color: #2F7A45; text-align: center; display: flex; flex-direction: column; }
.psat-door-jar small { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.act-door { background: linear-gradient(135deg, #fff 40%, var(--green-soft)); border-color: var(--green); }
.psat-door-go { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
/* ACT English passages: every numbered portion underlined, the question's own highlighted. */
.pt-passage mark { background: #FFE58F; padding: 0 2px; border-radius: 3px; box-shadow: 0 0 0 2px #FFE58F; }
.pt-passage sup { font-family: var(--sans); font-size: 0.68rem; font-weight: 700; color: var(--accent-hover); margin-left: 1px; }
.pt-passage img.pt-figure { display: block; max-width: 100%; margin: 10px auto; }

/* ---------- PSAT sprints: one quiet column ---------- */
.sprint-page { max-width: 760px; margin: 0 auto; padding: 14px 16px 80px; }
.sp-top { display: flex; align-items: center; gap: 12px; padding: 6px 2px 10px; }
.sp-back { color: var(--muted); text-decoration: none; font-size: 1.2rem; }
.sp-title { flex: 1; font-weight: 600; color: var(--ink-soft); }
.sp-tools { display: flex; gap: 14px; align-items: center; }
.sp-combo { font-weight: 700; color: var(--accent); }
.sp-link { background: none; border: 0; padding: 0; font: inherit; font-size: 0.92rem; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 4px; }
.sp-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.sp-link:disabled { color: var(--muted); cursor: default; }
.sp-dots { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 2px 18px; }
.sp-dot { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: var(--border); cursor: pointer; }
.sp-dot-extra { width: 8px; height: 8px; }
.sp-dot-right { background: var(--green); }
.sp-dot-wrong { background: var(--red); }
.sp-dot-here { outline: 2px solid var(--ink); outline-offset: 2px; }
.sp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; }
.sp-kind { font-size: 0.82rem; font-weight: 600; color: var(--accent-hover); letter-spacing: 0.01em; }
.sp-prompt { font-size: 1.05rem; }
.sp-card .pt-passage { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sp-feedback { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.sp-verdict { font-weight: 700; font-size: 1.05rem; }
.sp-right { color: #3F6B4B; }
.sp-wrong { color: var(--red); }
.sp-idea { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.sp-idea span { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 2px; }
.sp-idea .md p { margin: 0; }
.sp-why summary { cursor: pointer; color: var(--ink-soft); font-size: 0.92rem; }
.sp-why .md { font-size: 0.93rem; padding-top: 6px; }
.sp-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-left { display: flex; gap: 18px; flex-wrap: wrap; }
.sp-chat { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.sp-thread { display: flex; flex-direction: column; gap: 12px; }
.sp-turn { display: flex; flex-direction: column; gap: 6px; }
.sp-q { align-self: flex-end; background: var(--accent-soft); border-radius: 12px 12px 2px 12px; padding: 7px 12px; margin: 0; max-width: 85%; font-size: 0.93rem; }
.sp-a { font-size: 0.93rem; }
.sp-a p:first-child { margin-top: 0; }
.sp-ask { display: flex; gap: 8px; align-items: flex-end; }
.sp-ask textarea { flex: 1; resize: vertical; min-height: 40px; }
.sp-origin { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 10px 0 0; }
.sp-done { align-items: center; text-align: center; padding: 40px 28px; }
.sp-score { font-family: var(--serif); font-size: 4rem; font-weight: 700; line-height: 1; color: var(--ink); }
.sp-score span { font-size: 1.8rem; color: var(--muted); }
.sp-lines p { margin: 4px 0; color: var(--ink-soft); }
.sp-again { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.sp-again form { margin: 0; }
.sp-review { font-size: 0.88rem; }
@media (max-width: 640px) {
  .sp-card { padding: 18px 16px; }
}

/* sprint launcher on the arena */
.sprint-launch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 30px; display: flex; flex-direction: column; gap: 14px; }
.sprint-launch h2 { margin: 0; }
.sprint-launch p { margin: 0; color: var(--ink-soft); max-width: 620px; }
.sprint-go { display: flex; gap: 10px; flex-wrap: wrap; }
.sprint-go form { margin: 0; }
.sprint-go .btn { min-width: 150px; }
.sprint-week { font-size: 0.85rem; color: var(--muted); }

/* ---------- LivePaper: four panes, real paper questions ---------- */
.paper-page { max-width: 1400px; margin: 0 auto; padding: 10px 16px 24px; }
.lp-top { display: flex; align-items: center; gap: 12px; padding: 4px 2px 10px; flex-wrap: wrap; }
.lp-count { font-size: 0.85rem; color: var(--muted); }
.lp-dots { margin: 0; }
.lp-grid {
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1.3fr) auto minmax(0, 1fr);
  grid-template-areas: "ul ur" "ul mr" "ll lr";
  height: calc(100vh - 150px); min-height: 560px;
}
.lp-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.lp-ul { grid-area: ul; }
.lp-ll { grid-area: ll; }
.lp-ur { grid-area: ur; }
.lp-lr { grid-area: lr; }
.lp-mr { grid-area: mr; flex-direction: row; align-items: center; justify-content: space-between; padding: 6px 10px 6px 16px; overflow: visible; }
.lp-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lp-ul .pt-passage { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.lp-wait { color: var(--muted); font-size: 0.92rem; margin: 0; }
.lp-why-head { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.lp-why .md { font-size: 0.93rem; }
.lp-thread { flex: 1; overflow-y: auto; min-height: 0; }
@media (max-width: 900px) {
  .lp-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "ul" "ll" "ur" "mr" "lr"; height: auto; min-height: 0; }
  .lp-pane { overflow: visible; }
  .lp-lr { min-height: 260px; }
}
