:root {
  --bg: #05070d;
  --bg2: #07101d;
  --surface: rgba(12, 16, 30, 0.92);
  --surface2: rgba(255, 255, 255, 0.03);
  --line: rgba(146, 168, 255, 0.12);
  --line-strong: rgba(146, 168, 255, 0.2);
  --text: #eef2ff;
  --muted: #9aa3bf;
  --muted2: #697392;
  --accent: #6f83ff;
  --cyan: #4fc6ff;
  --green: #35d6a0;
  --amber: #f2ad56;
  --red: #ff7c7c;
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-sans: "DM Sans", "Manrope", "Inter", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, monospace;
  --content: min(1440px, calc(100vw - 32px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 14% 14%, rgba(111, 131, 255, 0.16), transparent 20%),
    radial-gradient(circle at 88% 16%, rgba(79, 198, 255, 0.12), transparent 16%),
    radial-gradient(circle at 50% 104%, rgba(242, 173, 86, 0.08), transparent 20%),
    linear-gradient(180deg, #05070d 0%, #050912 46%, #060b16 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(148, 164, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 164, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 96%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.84);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: var(--content);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7e5bff, #54cbff 55%, #48d0a8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px rgba(87, 123, 255, 0.32);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.eyebrow {
  margin: 0;
  color: var(--muted2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-title,
.brand-copy h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.breadcrumb {
  margin: 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(120, 137, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: #dbe2ff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pill,
.button,
.button-ghost,
.nav-link,
.action-link {
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.pill:hover,
.button:hover,
.button-ghost:hover,
.nav-link:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 137, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.pill-accent {
  background: linear-gradient(180deg, rgba(111, 131, 255, 0.22), rgba(111, 131, 255, 0.1));
  color: #dbe2ff;
}

.countdown {
  border-color: rgba(242, 173, 86, 0.24);
  background: linear-gradient(180deg, rgba(242, 173, 86, 0.16), rgba(242, 173, 86, 0.08));
  color: #ffe2b3;
}

.button,
.button-ghost,
.action-link {
  border: 1px solid rgba(120, 137, 255, 0.18);
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button {
  padding: 12px 16px;
  background: linear-gradient(180deg, #6f83ff, #4d62eb);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(78, 97, 235, 0.28);
}

.button-ghost,
.action-link {
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #e6ebff;
}

.shell {
  width: var(--content);
  margin: 0 auto;
  padding: 18px 0 24px;
  display: grid;
  gap: 20px;
}

.topics-shell {
  grid-template-columns: 340px minmax(0, 1fr);
}

.practice-shell {
  grid-template-columns: minmax(0, 1fr) 388px;
}

.progress-shell {
  grid-template-columns: 1fr;
}

.sidebar,
.panel,
.card,
.rail-card,
.markscheme-block,
.hero-card,
.stat-card,
.topic-card,
.practice-part,
.coverage-card,
.skill-card,
.calendar-card,
.focus-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 18, 33, 0.94), rgba(8, 11, 20, 0.92));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
}

.sidebar-section + .sidebar-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(146, 168, 255, 0.1);
}

.section-label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted2);
}

.sidebar-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(146, 168, 255, 0.12);
  background:
    radial-gradient(circle at top left, rgba(111, 131, 255, 0.14), transparent 38%),
    rgba(255, 255, 255, 0.02);
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.progress-copy h2,
.section-title {
  margin: 0;
  letter-spacing: -0.05em;
}

.progress-copy h2 {
  font-size: 14px;
}

.progress-value {
  font-size: 14px;
  font-weight: 800;
}

.progress-bar {
  margin: 12px 0 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.progress-fill,
.bar::after {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  animation: grow 900ms ease both;
}

.progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(146, 168, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: #cdd4f5;
  font-size: 12px;
  font-weight: 700;
}

.nav-link.is-active {
  border-color: rgba(111, 131, 255, 0.32);
  background: linear-gradient(180deg, rgba(111, 131, 255, 0.18), rgba(255, 255, 255, 0.02));
  color: #eef2ff;
}

.nav-link small {
  color: var(--muted2);
  font-size: 11px;
  font-weight: 700;
}

.content {
  display: grid;
  gap: 18px;
}

.home-content {
  gap: 16px;
}

.hero-card {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: rgba(111, 131, 255, 0.2);
  background:
    radial-gradient(circle at top left, rgba(111, 131, 255, 0.18), transparent 36%),
    radial-gradient(circle at top right, rgba(79, 198, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(15, 19, 35, 0.98), rgba(7, 10, 18, 0.96));
}

.hero-copy {
  max-width: 760px;
}

.hero-copy h2,
.hero-copy h3 {
  margin: 8px 0 10px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy p {
  margin: 0;
  max-width: 62ch;
  color: #b7bfdc;
  font-size: 14px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-meta {
  display: grid;
  gap: 10px;
  min-width: 216px;
}

.meta-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(146, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.meta-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 700;
}

.meta-value {
  font-size: 14px;
  font-weight: 800;
}

.meta-copy {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.calm-note {
  display: grid;
  gap: 8px;
}

.stats-grid {
  display: grid;
  gap: 14px;
}

.stats-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 18px;
}

.stat-label {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 700;
}

.stat-value {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.stat-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.stat-note.up {
  color: #8ce3bd;
}

.stat-note.warn {
  color: #ffd090;
}

.section {
  display: grid;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  font-size: 12px;
  color: var(--muted);
}

.topic-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-panel,
.topic-list-panel {
  padding: 0;
  overflow: hidden;
}

.focus-row,
.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  color: inherit;
}

.focus-row + .focus-row,
.topic-row + .topic-row {
  border-top: 1px solid rgba(146, 168, 255, 0.08);
}

.focus-row:hover,
.topic-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.topic-row-copy,
.rec-body {
  min-width: 0;
}

.topic-row-meta {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 210px;
}

.topic-row-progress {
  display: grid;
  grid-template-columns: minmax(132px, 180px) auto;
  align-items: center;
  gap: 10px;
}

.topic-row-progress span {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.topic-card {
  padding: 16px;
  min-height: 150px;
  display: grid;
  gap: 12px;
}

.topic-card[data-state="active"] {
  border-color: rgba(111, 131, 255, 0.3);
  background:
    radial-gradient(circle at top left, rgba(111, 131, 255, 0.18), transparent 40%),
    rgba(255, 255, 255, 0.028);
}

.topic-card[data-state="done"] {
  border-color: rgba(53, 214, 160, 0.24);
}

.topic-head,
.practice-part-head,
.markscheme-head,
.rail-head,
.context-line,
.timeline-item,
.focus-item,
.rec-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topic-name,
.rec-title,
.focus-title,
.timeline-title,
.markscheme-title,
.guidance-title,
.practice-part-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.topic-sub,
.rec-copy,
.focus-copy,
.timeline-note,
.guidance-copy,
.markscheme-copy,
.practice-part-title p,
.rail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.freq,
.mark-allocation,
.part-chip,
.status-chip,
.score-chip,
.timeline-chip,
.code-chip,
.feedback-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.freq {
  background: rgba(242, 173, 86, 0.12);
  color: #ffd79f;
}

.freq.low {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.track,
.recommended-list,
.guidance-list,
.markscheme-list,
.focus-list,
.timeline,
.answer-fields {
  display: grid;
  gap: 10px;
}

.track-row,
.coverage-row,
.skill-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 56px 64px;
  gap: 10px;
  align-items: center;
}

.track-row .label,
.coverage-row .name,
.skill-row .name {
  font-size: 12px;
  color: #dce2ff;
  font-weight: 700;
}

.track-row .value,
.coverage-row .meta,
.skill-row .meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  font-family: var(--font-mono);
}

.bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.bar.green::after { background: linear-gradient(90deg, var(--green), #77efbb); }
.bar.amber::after { background: linear-gradient(90deg, var(--amber), #ffd07d); }
.bar.red::after { background: linear-gradient(90deg, var(--red), #ff9d9d); }
.bar.blue::after { background: linear-gradient(90deg, var(--accent), var(--cyan)); }

.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--value, 0%);
  border-radius: inherit;
  animation: grow 900ms ease both;
}

.recommended-list,
.guidance-list,
.markscheme-list,
.focus-list,
.timeline {
  gap: 10px;
}

.rec-item,
.focus-item,
.timeline-item,
.guidance-item,
.markscheme-item {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(146, 168, 255, 0.11);
  background: rgba(255, 255, 255, 0.028);
}

.rank,
.part-letter,
.code-tag {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: #dce2ff;
  font-size: 11px;
  font-weight: 800;
}

.code-tag {
  font-family: var(--font-mono);
}

.code-tag.m1,
.feedback-score.is-good { background: rgba(53, 214, 160, 0.14); color: #98ebca; }
.code-tag.a1,
.feedback-score.is-warning { background: rgba(242, 173, 86, 0.14); color: #ffd79f; }
.code-tag.r,
.feedback-score.is-bad { background: rgba(255, 124, 124, 0.14); color: #ffb6b6; }

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.lesson-stage {
  position: relative;
  min-height: 700px;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(111, 131, 255, 0.16);
  background:
    radial-gradient(circle at 50% 20%, rgba(111, 131, 255, 0.18), transparent 28%),
    radial-gradient(circle at 12% 10%, rgba(242, 173, 86, 0.12), transparent 16%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.98), rgba(8, 11, 19, 0.96));
  overflow: hidden;
}

.lesson-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(123, 147, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 147, 255, 0.11) 1px, transparent 1px);
  background-size: 76px 76px;
  opacity: 0.5;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 85%);
  pointer-events: none;
}

.stage-topbar,
.question-head,
.rail-head,
.context-line {
  position: relative;
  z-index: 1;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(146, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.stage-switch {
  min-width: 50px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.stage-switch.is-active {
  background: rgba(111, 131, 255, 0.18);
  color: #eef2ff;
}

.stage-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-note {
  position: relative;
  z-index: 1;
  max-width: 470px;
  margin: 26px auto 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(242, 173, 86, 0.22);
  background: linear-gradient(180deg, rgba(242, 173, 86, 0.16), rgba(255, 255, 255, 0.03));
  text-align: center;
  color: #ffe1b3;
  box-shadow: 0 20px 60px rgba(242, 173, 86, 0.12);
}

.stage-note strong {
  display: block;
  margin-bottom: 5px;
  color: #fff4dc;
  font-size: 14px;
}

.stage-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.scene-grid {
  position: absolute;
  inset: 140px 36px 160px;
  pointer-events: none;
  opacity: 0.32;
  background:
    linear-gradient(transparent 94%, rgba(123, 147, 255, 0.25) 100%),
    linear-gradient(90deg, transparent 94%, rgba(123, 147, 255, 0.25) 100%);
  background-size: 80px 80px;
  transform: perspective(1600px) rotateX(66deg) scale(1.3) translateY(28px);
  transform-origin: center top;
}

.stage-focus {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: min(740px, 100%);
  height: 430px;
  border-radius: 30px;
  border: 1px solid rgba(146, 168, 255, 0.14);
  background:
    radial-gradient(circle at 50% 25%, rgba(111, 131, 255, 0.22), transparent 22%),
    radial-gradient(circle at 50% 70%, rgba(242, 173, 86, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 20px 70px rgba(0, 0, 0, 0.34);
}

.stage-rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.problem-step,
.given-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(146, 168, 255, 0.1);
}

.step-index {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(111, 131, 255, 0.16);
  color: #dbe2ff;
  font-size: 11px;
  font-weight: 800;
}

.step-index.is-done {
  background: rgba(53, 214, 160, 0.18);
  color: #93ebcb;
}

.step-index.is-active {
  background: rgba(242, 173, 86, 0.18);
  color: #ffd59a;
}

.step-copy strong,
.given-copy strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.step-copy span,
.given-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.practice-question {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.question-head h2 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.06em;
}

.question-head p {
  margin: 0;
  max-width: 70ch;
  color: #b7bfdc;
  line-height: 1.7;
  font-size: 14px;
}

.question-parts {
  display: grid;
  gap: 12px;
}

.practice-part {
  padding: 16px;
}

.practice-part-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.part-letter {
  background: rgba(111, 131, 255, 0.15);
  color: #dce2ff;
}

.mark-allocation {
  background: rgba(242, 173, 86, 0.13);
  color: #ffd89c;
}

.part-chip {
  background: rgba(255, 255, 255, 0.05);
  color: #d9e1ff;
}

.answer-fields {
  margin-top: 14px;
}

.answer-field {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(146, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.028);
}

.answer-field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: #dce2ff;
  font-weight: 800;
}

.answer-field input,
.answer-field textarea {
  width: 100%;
  border: 1px solid rgba(146, 168, 255, 0.14);
  border-radius: 14px;
  background: rgba(5, 8, 15, 0.74);
  color: #eef2ff;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
}

.answer-field input::placeholder,
.answer-field textarea::placeholder {
  color: #7680a0;
}

.answer-field[data-state="correct"] input,
.answer-field[data-state="correct"] textarea {
  border-color: rgba(53, 214, 160, 0.28);
}

.answer-field[data-state="partial"] input,
.answer-field[data-state="partial"] textarea {
  border-color: rgba(242, 173, 86, 0.28);
}

.answer-field[data-state="wrong"] input,
.answer-field[data-state="wrong"] textarea {
  border-color: rgba(255, 124, 124, 0.28);
}

.question-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bridge-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(79, 198, 255, 0.18);
  background:
    radial-gradient(circle at top left, rgba(79, 198, 255, 0.16), transparent 32%),
    rgba(255, 255, 255, 0.02);
}

.bridge-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  letter-spacing: -0.04em;
}

.bridge-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.practice-rail {
  display: grid;
  gap: 14px;
  align-content: start;
}

.rail-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(146, 168, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.rail-tab {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rail-tab.is-active {
  background: rgba(111, 131, 255, 0.18);
  color: #eef2ff;
}

.practice-rail-panel {
  display: grid;
  gap: 14px;
}

.practice-feedback-status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(146, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #dfe6ff;
  font-size: 12px;
  line-height: 1.55;
}

.practice-feedback-status.hidden {
  display: none;
}

.practice-feedback-status.is-warn {
  border-color: rgba(242, 173, 86, 0.26);
  background: rgba(242, 173, 86, 0.08);
  color: #ffd89c;
}

.practice-feedback-status.is-good {
  border-color: rgba(53, 214, 160, 0.28);
  background: rgba(53, 214, 160, 0.08);
  color: #b4f2da;
}

.ask-actions {
  display: grid;
  gap: 10px;
}

.rail-card,
.markscheme-block {
  padding: 16px;
}

.feedback-score {
  width: 34px;
  height: 34px;
}

.context-list,
.markscheme-list {
  display: grid;
  gap: 8px;
}

.markscheme-head .total {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(242, 173, 86, 0.14);
  color: #ffd89c;
  font-size: 11px;
  font-weight: 800;
}

.markscheme-item,
.guidance-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(146, 168, 255, 0.11);
  background: rgba(255, 255, 255, 0.028);
}

.feedback-score.is-good { background: rgba(53, 214, 160, 0.14); color: #98ebca; }
.feedback-score.is-warning { background: rgba(242, 173, 86, 0.14); color: #ffd79f; }
.feedback-score.is-bad { background: rgba(255, 124, 124, 0.14); color: #ffb6b6; }

.context-line strong {
  color: #dfe6ff;
}

.sticky-bottom {
  position: sticky;
  bottom: 16px;
  z-index: 2;
  margin-top: auto;
  padding: 0 2px 2px;
}

.sticky-bottom .button {
  width: 100%;
  justify-content: space-between;
}

.footer-note {
  font-size: 11px;
  color: var(--muted2);
  line-height: 1.6;
}

.progress-panels {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.coverage-card,
.skill-card,
.calendar-card {
  padding: 18px;
}

.topic-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 20px;
}

.topic-table th,
.topic-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(146, 168, 255, 0.1);
}

.topic-table th {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 700;
}

.topic-table td {
  font-size: 12px;
  color: #dbe1f7;
}

.score-chip,
.status-chip,
.timeline-chip {
  background: rgba(111, 131, 255, 0.14);
  color: #d6ddff;
}

.score-chip.warn {
  background: rgba(242, 173, 86, 0.14);
  color: #ffd69f;
}

.timeline-chip.is-exam {
  background: rgba(255, 124, 124, 0.14);
  color: #ffb4b4;
}

.timeline-chip.is-practice {
  background: rgba(242, 173, 86, 0.14);
  color: #ffd79f;
}

.timeline-chip.is-mock {
  background: rgba(53, 214, 160, 0.12);
  color: #96e8ca;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
}

.timeline-item {
  align-items: center;
}

.timeline-date {
  width: 54px;
  color: var(--muted2);
  font-size: 11px;
  font-family: var(--font-mono);
}

.timeline-title {
  flex: 1;
}

.timeline-note {
  margin: 0;
}

.intro-stack {
  display: grid;
  gap: 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
}

.card {
  border-radius: var(--radius-xl);
}

@keyframes grow {
  from {
    width: 0;
  }
}

@media (max-width: 1280px) {
  .topbar-inner,
  .shell {
    width: min(1180px, calc(100vw - 24px));
  }

  .topics-shell,
  .practice-shell,
  .progress-panels {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .content,
  .lesson-stage {
    order: 1;
  }

  .topic-row,
  .focus-row {
    align-items: flex-start;
  }

  .topic-row-meta {
    min-width: 0;
    justify-items: start;
  }
}

@media (max-width: 960px) {
  .topbar-inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .topbar-actions,
  .breadcrumb {
    margin: 0;
  }

  .hero-card {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid.cols-4,
  .topic-grid,
  .track-row,
  .coverage-row,
  .skill-row {
    grid-template-columns: 1fr;
  }

  .topic-row,
  .focus-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .topic-row-meta,
  .topic-row-progress {
    width: 100%;
  }

  .topic-row-progress {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .track-row .value,
  .coverage-row .meta,
  .skill-row .meta {
    text-align: left;
  }

  .stage-topbar,
  .question-head,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .topbar-inner,
  .shell {
    width: min(100vw - 16px, 100%);
  }

  .sidebar,
  .hero-card,
  .practice-question,
  .rail-card,
  .markscheme-block,
  .coverage-card,
  .skill-card,
  .calendar-card,
  .stat-card,
  .topic-card {
    padding: 14px;
  }

  .lesson-stage {
    min-height: 560px;
    padding: 16px;
  }

  .scene-grid {
    inset: 120px 16px 140px;
  }
}
