:root {
  color-scheme: light;
  --bg: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #4f46e5;
  --primary-2: #4338ca;
  --good: #16a34a;
  --bad: #ef4444;
  --warn: #f59e0b;
  --navy: #0f172a;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.13);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "Yu Gothic", "Meiryo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 88% 10%, rgba(79, 70, 229, .18), transparent 34%),
    radial-gradient(circle at 10% 86%, rgba(14, 165, 233, .16), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  color: var(--ink);
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell {
  width: min(1480px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-columns: 270px 1fr;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 6px 8px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  font-weight: 900; font-size: 24px;
}
.brand h1 { margin: 0; font-size: 24px; line-height: 1.1; }
.brand p { margin: 4px 0 0; color: #94a3b8; font-size: 13px; }
.level-card, .today-card {
  background: rgba(30, 41, 59, .92);
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 22px;
  padding: 18px 20px;
}
.level-card span, .today-card span { color: #94a3b8; font-size: 13px; display: block; }
.level-card strong, .today-card strong { display: block; margin-top: 6px; font-size: 22px; }
.level-card small, .today-card small { display: block; margin-top: 8px; color: #34d399; }

.sync-card {
  background: rgba(30, 41, 59, .92);
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 22px;
  padding: 16px 18px;
  margin-top: 8px;
}
.sync-card span { color: #94a3b8; font-size: 13px; display: block; }
.sync-input-group { margin-top: 10px; }
#syncCodeInput {
  width: 100%; padding: 8px 12px; border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: #1e293b; color: #fff; font-size: 13px;
  text-align: center; font-weight: 700;
}
#syncCodeInput::placeholder { color: #64748b; font-weight: 400; }
.sync-divider {
  margin: 12px 0; border-top: 1px dashed rgba(148, 163, 184, .15);
}
.sync-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.sync-btn-small {
  border: 0; background: #334155; color: #fff; font-size: 12px; font-weight: 700;
  padding: 8px 10px; border-radius: 12px; text-align: center; cursor: pointer;
  transition: background .18s;
}
.sync-btn-small:hover { background: #475569; }

.side-nav { display: grid; gap: 8px; }
.nav-item {
  border: 0;
  width: 100%;
  text-align: left;
  border-radius: 18px;
  padding: 15px 18px;
  color: #e2e8f0;
  background: transparent;
  transition: .18s ease;
}
.nav-item b { display: block; font-size: 16px; }
.nav-item span { display: block; margin-top: 4px; color: #94a3b8; font-size: 12px; }
.nav-item.active, .nav-item:hover {
  background: #eef2ff;
  color: var(--primary);
}
.nav-item.active span, .nav-item:hover span { color: #64748b; }
.today-card { margin-top: auto; }

.main {
  padding: 30px 34px 38px;
  overflow: auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.eyebrow { margin: 0 0 4px; color: var(--primary); font-weight: 800; letter-spacing: .08em; }
.topbar h2 { margin: 0; font-size: clamp(26px, 3vw, 40px); }
.topbar p { margin: 8px 0 0; color: var(--muted); }
.mode-switch {
  display: flex; gap: 8px; padding: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}
.mode-pill {
  border: 0; border-radius: 999px; padding: 10px 16px; color: var(--muted); background: transparent; font-weight: 800;
}
.mode-pill.active { color: #fff; background: var(--primary); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric-card, .timer-card {
  border-radius: 22px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 98px;
}
.metric-card span, .timer-card span { color: var(--muted); font-size: 14px; }
.metric-card strong, .timer-card strong { display: block; font-size: 32px; margin-top: 6px; }
.metric-card small { color: var(--muted); }
.metric-card.indigo { background: #eef2ff; }
.metric-card.indigo strong { color: var(--primary); }
.metric-card.red { background: #fee2e2; }
.metric-card.red strong { color: var(--bad); }
.metric-card.amber { background: #fef3c7; }
.metric-card.amber strong { color: var(--warn); }
.timer-card { display: flex; align-items: center; justify-content: space-between; }
.timer-card.exam { background: #fff1f2; border-color: #fecdd3; }
.timer-card.exam strong { color: #be123c; }

.collections {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 18px;
}
.collection-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  white-space: nowrap;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}
.collection-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, .9fr);
  gap: 18px;
  align-items: stretch;
}
.question-card, .explanation-card, .answer-sheet-card, .utility-panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .06);
}
.question-card { padding: 24px; }
.question-head, .explanation-head, .sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
}
.chip {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 4px 10px;
  border-radius: 999px;
  color: var(--primary); background: #eef2ff;
  font-size: 13px; font-weight: 900;
}
.question-head h3 { margin: 8px 0 0; font-size: 26px; }
.favorite-btn, .ghost-btn, .secondary-btn, .primary-btn {
  border-radius: 14px; border: 1px solid var(--line); padding: 10px 14px; font-weight: 900;
}
.favorite-btn { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.favorite-btn.active { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.ghost-btn { background: #fff; color: var(--primary); }
.secondary-btn { background: #f1f5f9; color: #475569; }
.primary-btn { background: var(--primary); color: #fff; border-color: var(--primary); }
.primary-btn:hover { background: var(--primary-2); }
.prompt {
  margin: 22px 0 18px;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.55;
  font-weight: 850;
  white-space: pre-line;
  max-height: 44vh;
  overflow: auto;
  padding-right: 6px;
}
.prompt-target {
  display: inline-block;
  padding: 0 0.08em 0.06em;
  border-bottom: 3px solid currentColor;
  text-underline-offset: 0.14em;
}
.prompt-blank {
  display: inline-flex;
  min-width: 4.4em;
  justify-content: center;
  border-bottom: 3px solid var(--ink);
  line-height: 1.25;
  margin: 0 0.12em;
}
.prompt-slot {
  display: inline-block;
  min-width: 4em;
  border-bottom: 3px solid var(--ink);
  color: transparent;
  margin: 0 0.14em;
  transform: translateY(-0.08em);
}
.prompt-star {
  display: inline-grid;
  place-items: center;
  min-width: 1.45em;
  height: 1.45em;
  margin: 0 0.12em;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-weight: 1000;
}
.options { display: grid; gap: 12px; }
.option-btn {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: 36px 1fr;
  gap: 12px; align-items: start;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  font-size: 19px;
  font-weight: 800;
  transition: .15s ease;
  white-space: pre-line;
}
.option-btn:hover { border-color: #a5b4fc; background: #f8faff; }
.option-index {
  width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center;
  background: #f1f5f9; color: #475569; font-size: 14px;
}
.option-btn.selected { border-color: var(--primary); background: #eef2ff; }
.option-btn.selected .option-index { background: var(--primary); color: #fff; }
.option-btn.correct { border-color: #22c55e; background: #ecfdf5; }
.option-btn.correct .option-index { background: #16a34a; color: #fff; }
.option-btn.incorrect { border-color: #fb7185; background: #fff1f2; }
.option-btn.incorrect .option-index { background: #e11d48; color: #fff; }
.question-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }

.explanation-card { padding: 24px; }
.explanation-card.locked { opacity: .68; }
.explanation-head h3 { margin: 0; font-size: 24px; }
.answer-badge {
  padding: 7px 12px; border-radius: 999px;
  color: #166534; background: #dcfce7;
  font-size: 13px; font-weight: 900;
}
.explanation-body { margin-top: 18px; color: #1f2937; line-height: 1.8; font-size: 16px; }
.explanation-body h4 { margin: 14px 0 8px; color: var(--primary); }
.explanation-body ul { padding-left: 18px; }
.online-note {
  margin-top: 18px; padding: 14px; border-radius: 18px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  color: #1e3a8a; line-height: 1.7; font-size: 14px;
}

.answer-sheet-card { margin-top: 18px; padding: 22px; }
.sheet-head h3 { margin: 0; }
.sheet-head p { margin: 6px 0 0; color: var(--muted); }
.sheet-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 5px; }
.dot.done { background: #6366f1; } .dot.wrong { background: #ef4444; } .dot.current { background: #f59e0b; }
.answer-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; margin-top: 18px; }
.sheet-btn {
  height: 38px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 900; color: #475569;
}
.sheet-btn.answered { background: #eef2ff; color: var(--primary); border-color: #c7d2fe; }
.sheet-btn.wrong { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.sheet-btn.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.sheet-btn.favorite { box-shadow: inset 0 -4px 0 #fbbf24; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.utility-panel { padding: 22px; }
.utility-panel h3 { margin: 0 0 8px; }
.utility-panel p { color: var(--muted); line-height: 1.7; }
#audioPlayer { width: 100%; margin: 12px 0; }
.audio-list { max-height: 220px; overflow: auto; display: grid; gap: 8px; }
.audio-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); }
.audio-item button { border: 0; color: var(--primary); background: #eef2ff; border-radius: 999px; padding: 6px 10px; font-weight: 900; }
.insight-list { display: grid; gap: 10px; }
.insight { padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: #f8fafc; }
.insight b { display: block; }
.insight span { color: var(--muted); font-size: 13px; }

.mobile-nav { display: none; }
.result-dialog {
  border: 0; border-radius: 26px; padding: 26px; width: min(520px, calc(100% - 30px));
  box-shadow: var(--shadow);
}
.result-dialog::backdrop { background: rgba(15,23,42,.42); backdrop-filter: blur(4px); }
.result-breakdown { display: grid; gap: 8px; margin: 18px 0; }
.result-row { display: flex; justify-content: space-between; background: #f8fafc; padding: 10px 12px; border-radius: 12px; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 22px 18px 96px; }
  .workspace { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body { background: #f8fafc; }
  .app-shell {
    width: 100%; margin: 0; min-height: 100vh; border-radius: 0; border: 0; box-shadow: none;
  }
  .topbar { display: block; }
  .mode-switch { margin-top: 16px; width: 100%; }
  .mode-pill { flex: 1; padding: 11px 8px; }
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .timer-card { grid-column: 1 / -1; min-height: 76px; }
  .metric-card { min-height: 78px; padding: 13px; }
  .metric-card strong, .timer-card strong { font-size: 22px; }
  .metric-card small { display: none; }
  .collections { margin-inline: -18px; padding-inline: 18px; }
  .question-card, .explanation-card, .answer-sheet-card, .utility-panel { border-radius: 22px; }
  .question-card { padding: 20px; }
  .prompt { font-size: 23px; max-height: none; }
  .option-btn { font-size: 18px; padding: 13px 14px; }
  .question-actions { position: sticky; bottom: calc(64px + var(--safe-bottom)); background: rgba(248,250,252,.92); padding: 8px 0; backdrop-filter: blur(10px); }
  .answer-sheet { grid-template-columns: repeat(7, 1fr); }
  .sheet-legend { display: none; }
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(64px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px);
  }
  .mobile-tab { border: 0; background: transparent; color: #94a3b8; font-weight: 900; }
  .mobile-tab.active { color: var(--primary); }
}

.corrupt-data-alert {
  padding: 16px 20px; border-radius: 18px;
  background: #fef2f2; border: 1px solid #fecaca;
  color: #991b1b; text-align: center;
  font-size: 15px; font-weight: 700;
  width: 100%; margin: 12px 0;
}

/* === 2026 UI refresh: clean top-nav JLPT practice layout === */
body {
  background: #f7f9fc;
  font-family: "Inter", "Microsoft YaHei", "Yu Gothic", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
}
.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: 1fr;
  background: #f7f9fc;
  overflow: visible;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 92px;
  padding: 18px 30px;
  background: rgba(255,255,255,.96);
  color: #0f172a;
  border-bottom: 1px solid #e8edf5;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .04);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  backdrop-filter: blur(14px);
}
.brand { padding: 0; gap: 18px; }
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: linear-gradient(145deg, #1976ff, #0057e7);
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 95, 231, .22);
  font-size: 0;
}
.brand-mark::after { content: "N2"; font-size: 24px; font-weight: 900; }
.brand h1 { font-size: 28px; letter-spacing: .01em; }
.brand p { color: #7b8798; font-weight: 700; font-size: 14px; }
.level-card, .today-card, .sync-card { display: none; }
.side-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}
.nav-item {
  width: auto;
  border-radius: 16px;
  padding: 10px 12px;
  color: #111827;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-item b { font-size: 17px; white-space: nowrap; }
.nav-item span { display: none; }
.nav-item.active, .nav-item:hover { background: #f1f6ff; color: #0068ff; }
.nav-extra { display: none; }
.main {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 46px;
  overflow: visible;
}
.topbar, .dashboard-grid { display: none; }
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}
.question-card, .explanation-card, .answer-sheet-card, .utility-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.question-card {
  padding: 0;
  min-height: 760px;
  overflow: hidden;
}
.question-head {
  min-height: 84px;
  padding: 22px 34px;
  border-bottom: 1px solid #e8edf5;
  align-items: center;
}
.question-progress-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
}
.question-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.question-head h3::first-letter { color: inherit; }
.question-progress {
  width: 340px;
  max-width: 30vw;
  height: 10px;
  border-radius: 999px;
  background: #e6ebf2;
  overflow: hidden;
}
.question-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #086cff;
  transition: width .25s ease;
}
.level-chip {
  min-width: 72px;
  justify-content: center;
  color: #22a04a;
  background: #ecfdf3;
  border: 1px solid #76d490;
  font-size: 22px;
}
.result-strip {
  margin: 14px 34px 0;
  padding: 14px 18px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
}
.result-strip.incorrect { background: #fff3f2; border: 1px solid #ffb9b3; }
.result-strip.correct { background: #f0fdf4; border: 1px solid #86efac; }
.result-side { display: inline-flex; align-items: center; gap: 8px; }
.bad-mark { color: #c81923; }
.good-mark { color: #15803d; }
.question-body-label {
  margin: 48px 46px 0;
  color: #006cff;
  font-size: 30px;
  font-weight: 1000;
}
.prompt {
  margin: 22px 52px 34px 96px;
  max-height: none;
  overflow: visible;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.9;
  font-weight: 650;
  letter-spacing: .08em;
  color: #0b1220;
}
.prompt-target { border-bottom-width: 2px; }
.prompt-blank { border-bottom-width: 2px; min-width: 5.2em; }
.options {
  padding: 0 46px 34px;
  gap: 18px;
}
.option-btn {
  min-height: 92px;
  grid-template-columns: 60px 1fr;
  align-items: center;
  gap: 18px;
  border: 1.5px solid #dfe6ef;
  border-radius: 10px;
  background: #fff;
  padding: 18px 22px;
  color: #111827;
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 650;
  letter-spacing: .04em;
  box-shadow: none;
}
.option-btn:hover { border-color: #bcd2ff; background: #fbfdff; }
.option-index {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: #f3f7ff;
  color: #14213d;
  border: 1.5px solid #c9dcff;
  font-size: 22px;
  font-weight: 900;
}
.option-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.option-status {
  font-style: normal;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}
.user-pick { color: #ef2b2d; }
.right-pick { color: #16a34a; }
.option-btn.selected { border-color: #0b6fff; background: #f7fbff; }
.option-btn.selected .option-index { background: #0b6fff; border-color: #0b6fff; color: #fff; }
.option-btn.correct { border-color: #35c46a; background: #f1fff6; }
.option-btn.correct .option-index { background: #22c55e; border-color: #22c55e; color: #fff; }
.option-btn.incorrect { border-color: #ff4d4f; background: #fff8f7; }
.option-btn.incorrect .option-index { background: #ff3b30; border-color: #ff3b30; color: #fff; }
.question-actions {
  margin-top: 0;
  padding: 22px 46px;
  border-top: 1px solid #e8edf5;
  display: grid;
  grid-template-columns: 220px 220px minmax(220px, 1fr) 170px;
  gap: 18px;
  background: #fff;
}
.favorite-btn, .ghost-btn, .secondary-btn, .primary-btn {
  min-height: 64px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 900;
}
.secondary-btn { background: #fff; border-color: #dbe4ef; color: #0f172a; }
.primary-btn { background: #006cff; border-color: #006cff; }
.favorite-btn { background: #fff; color: #0f172a; border-color: #dbe4ef; }
.favorite-btn.active { background: #fff7ed; color: #d97706; border-color: #fbbf24; }
.right-rail {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 112px;
}
.explanation-card, .answer-sheet-card { margin-top: 0; padding: 26px 28px; }
.explanation-card.locked { opacity: 1; }
.explanation-head { align-items: center; }
.explanation-head h3, .sheet-head h3 { font-size: 22px; }
.info-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 12px;
  border-radius: 999px;
  background: #1d72f3;
  color: #fff;
}
.answer-badge { display: none; }
.explanation-body { margin-top: 22px; font-size: 18px; }
.info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 22px;
  color: #475569;
}
.info-row span { min-width: 88px; }
.info-row b { color: #334155; font-weight: 800; }
.stars { color: #fbbf24 !important; letter-spacing: .08em; }
.mini-explain {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid #e8edf5;
  color: #475569;
}
.answer-sheet { grid-template-columns: repeat(5, 1fr); gap: 14px; }
.sheet-btn {
  width: 42px;
  height: 42px;
  justify-self: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dfe7f1;
  color: #1f2937;
  font-size: 16px;
}
.sheet-btn.answered { background: #fff; color: #16a34a; border-color: #22c55e; }
.sheet-btn.wrong { background: #fff5f5; color: #ef4444; border-color: #fecaca; }
.sheet-btn.current { background: #fff; color: #006cff; border: 2px solid #006cff; }
.sheet-btn.favorite { box-shadow: none; }
.sheet-legend {
  justify-content: space-between;
  margin-top: 22px;
  font-size: 15px;
}
.dot.done { background: #55c878; }
.dot.current { background: transparent; border: 2px solid #006cff; }
.dot.muted-dot { background: #d8dee8; }
.wrongbook-link {
  position: relative;
  margin-top: 28px;
  width: 100%;
  min-height: 86px;
  border-radius: 10px;
  border: 1px solid #f2c56b;
  background: #fffaf0;
  color: #111827;
  text-align: left;
  padding: 18px 52px 18px 20px;
  font-size: 18px;
  font-weight: 900;
}
.wrongbook-link small {
  display: block;
  margin-top: 8px;
  color: #475569;
  font-size: 15px;
  font-weight: 600;
}
.wrongbook-link b {
  position: absolute;
  right: 20px;
  top: 26px;
  font-size: 32px;
}
.panel-grid { width: min(1480px, 100%); }
@media (max-width: 1080px) {
  .sidebar { display: flex; position: sticky; padding: 14px 18px; justify-content: space-between; }
  .side-nav { gap: 8px; }
  .nav-item b { font-size: 14px; }
  .workspace { grid-template-columns: 1fr; }
  .right-rail { position: static; grid-template-columns: 1fr; }
  .question-progress { max-width: 34vw; }
}
@media (max-width: 700px) {
  .sidebar { min-height: 76px; }
  .brand-mark { width: 44px; height: 44px; }
  .brand h1 { font-size: 18px; }
  .brand p { font-size: 12px; }
  .side-nav { display: none; }
  .main { width: 100%; padding: 14px 10px 86px; }
  .question-card { min-height: auto; }
  .question-head { padding: 16px; min-height: 68px; }
  .question-progress-wrap { gap: 12px; }
  .question-head h3 { font-size: 16px; }
  .question-progress { width: 130px; max-width: 38vw; height: 8px; }
  .level-chip { min-width: 56px; font-size: 18px; }
  .result-strip { margin: 10px 14px 0; font-size: 14px; padding: 10px; }
  .question-body-label { margin: 26px 22px 0; font-size: 24px; }
  .prompt { margin: 14px 22px 24px 54px; font-size: 24px; line-height: 1.75; letter-spacing: .04em; }
  .options { padding: 0 14px 18px; gap: 12px; }
  .option-btn { min-height: 74px; grid-template-columns: 48px 1fr; padding: 14px; font-size: 19px; }
  .option-index { width: 40px; height: 40px; font-size: 18px; }
  .option-content { align-items: flex-start; flex-direction: column; gap: 8px; }
  .question-actions {
    position: sticky;
    bottom: calc(64px + var(--safe-bottom));
    grid-template-columns: 1fr 1fr;
    padding: 12px 14px;
    gap: 10px;
  }
  .primary-btn { grid-column: 1 / -1; order: -1; }
  .favorite-btn, .secondary-btn, .primary-btn { min-height: 50px; font-size: 16px; }
  .answer-sheet { grid-template-columns: repeat(5, 1fr); }
  .mobile-nav { display: grid; }
}

/* === Reading split-screen layout styling === */
.prompt.split-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 34px;
  margin: 22px 46px 34px;
  align-items: start;
}
.prompt-passage-pane {
  background: #f8fafc;
  border-right: 1px dashed #cbd5e1;
  padding-right: 28px;
  max-height: 52vh;
  overflow-y: auto;
  line-height: 1.95;
  font-size: clamp(19px, 1.8vw, 24px);
  color: #1e293b;
}
.prompt-question-pane {
  padding-left: 6px;
  line-height: 1.8;
}
.prompt-question-pane .question-body-label {
  margin: 0 0 14px;
  font-size: 24px;
}

@media (max-width: 1080px) {
  .prompt.split-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .prompt-passage-pane {
    border-right: 0;
    border-bottom: 1px dashed #cbd5e1;
    padding-right: 0;
    padding-bottom: 24px;
    max-height: none;
    overflow-y: visible;
  }
}

/* === Restored collections bar styled in modern card-deck style === */
.collections {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 30px 20px;
  margin: 0 -30px 14px;
  border-bottom: 1px solid #e8edf5;
  background: #fff;
  align-items: center;
  /* hide scrollbar on clean view */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.collections::-webkit-scrollbar {
  display: none;
}
.collection-chip {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(15,23,42,.02);
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.collection-chip small {
  background: #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
}
.collection-chip:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.collection-chip.active {
  background: #006cff;
  border-color: #006cff;
  color: #fff;
}
.collection-chip.active small {
  background: rgba(255,255,255,.25);
  color: #fff;
}

@media (max-width: 700px) {
  .collections {
    padding: 8px 14px 16px;
    margin: 0 -14px 10px;
    border-bottom: 1px solid #e8edf5;
  }
}
