﻿:root {
  color-scheme: light;
  --bg: #eef4fb;
  --surface: #ffffff;
  --surface-soft: #edf5ff;
  --surface-strong: #fbfdff;
  --ink: #142033;
  --muted: #607089;
  --line: #d8e3f2;
  --teal: #1d5fd1;
  --teal-dark: #164aa6;
  --coral: #d45a49;
  --gold: #d99b22;
  --blue: #2a72d8;
  --violet: #5c63c7;
  --shadow: 0 18px 45px rgba(20, 43, 84, 0.14);
  --shadow-soft: 0 10px 28px rgba(20, 43, 84, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 4%, rgba(29, 95, 209, 0.16), transparent 30%),
    radial-gradient(circle at 82% 0%, rgba(92, 99, 199, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, #f4f7fc 100%);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(216, 226, 220, 0.72);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(20, 43, 84, 0.08);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(135deg, #1d5fd1, #4b7df0);
  font-size: 1.45rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(29, 95, 209, 0.22);
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: min(56vw, 680px);
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  width: min(100%, 440px);
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(29, 95, 209, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.search-label {
  padding-right: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(29, 95, 209, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.language-toggle select {
  min-width: 104px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.ghost-button,
.primary-button,
.choice-button,
.small-button,
.mark-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.ghost-button,
.small-button,
.mark-button {
  padding: 0 14px;
}

.ghost-button:hover,
.small-button:hover,
.mark-button:hover,
.choice-button:hover {
  border-color: rgba(29, 95, 209, 0.46);
  background: #f7faff;
  transform: translateY(-1px);
}

.primary-button {
  padding: 0 16px;
  border-color: var(--teal);
  color: #fff;
  background: linear-gradient(135deg, #1d5fd1, #4b7df0);
  box-shadow: 0 12px 24px rgba(29, 95, 209, 0.22);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 24px 28px 38px;
}

.side-panel {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 118px);
  overflow: auto;
}

.side-panel,
.topic-card,
.content-card,
.visual-shell,
.quiz-shell,
.stat-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.side-panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 800;
}

.panel-heading strong {
  color: var(--teal);
}

.stage-nav,
.tree-section-list,
.tree-topic-list {
  display: grid;
}

.stage-nav {
  gap: 9px;
}

.tree-stage,
.tree-section {
  min-width: 0;
}

.tree-stage {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
}

.tree-stage[open],
.tree-stage.active {
  border-color: rgba(29, 95, 209, 0.24);
  background:
    linear-gradient(90deg, rgba(29, 95, 209, 0.08), transparent 72%),
    rgba(237, 245, 255, 0.72);
}

.tree-stage > summary,
.tree-section > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.tree-stage > summary::-webkit-details-marker,
.tree-section > summary::-webkit-details-marker {
  display: none;
}

.tree-stage > summary {
  min-height: 46px;
  padding: 9px 10px;
}

.tree-stage > summary::after,
.tree-section > summary::after {
  content: "›";
  color: #6e7d95;
  font-size: 1.1rem;
  font-weight: 900;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.tree-stage[open] > summary::after,
.tree-section[open] > summary::after {
  transform: rotate(90deg);
}

.tree-stage-title,
.tree-stage-meta {
  min-width: 0;
}

.tree-stage-title {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-stage-meta {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.tree-stage-overview {
  display: block;
  margin: 0 10px 8px;
  padding: 8px 10px;
  border: 1px solid rgba(216, 227, 242, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: #214f95;
  font-size: 0.82rem;
  font-weight: 850;
}

.tree-stage-overview:hover,
.tree-topic:hover,
.tree-topic.active {
  border-color: rgba(29, 95, 209, 0.34);
  background: #f7faff;
}

.tree-section-list {
  gap: 5px;
  padding: 0 8px 10px 14px;
}

.tree-section {
  border-left: 1px solid rgba(29, 95, 209, 0.16);
}

.tree-section > summary {
  min-height: 34px;
  padding: 6px 2px 6px 10px;
  color: #3d4d66;
  font-size: 0.8rem;
  font-weight: 850;
}

.tree-topic-list {
  gap: 4px;
  padding: 2px 0 8px 13px;
}

.tree-topic {
  position: relative;
  display: block;
  min-width: 0;
  padding: 7px 9px 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #4d5f78;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.tree-topic::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9aacbf;
  transform: translateY(-50%);
}

.tree-topic.done::before {
  background: var(--teal);
}

.tree-topic.active {
  color: #123f91;
  font-weight: 900;
}

.tree-topic.active::before {
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: var(--teal);
}

.main-view {
  min-width: 0;
  outline: 0;
}

.dashboard-hero,
.dashboard-head,
.topic-head {
  display: grid;
  gap: 12px;
  margin: 3px 0 18px;
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: stretch;
  gap: 18px;
  margin-top: 0;
}

.dashboard-hero .dashboard-head {
  min-height: 310px;
  margin: 0;
  padding: 30px;
  border: 1px solid rgba(29, 95, 209, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.93), rgba(244, 250, 248, 0.86)),
    linear-gradient(120deg, rgba(29, 95, 209, 0.09), rgba(92, 99, 199, 0.09));
  box-shadow: var(--shadow-soft);
}

.main-view > .dashboard-head,
.topic-head {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(29, 95, 209, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 249, 0.88)),
    linear-gradient(120deg, rgba(47, 111, 167, 0.09), rgba(29, 95, 209, 0.08));
  box-shadow: var(--shadow-soft);
}

.main-view > .dashboard-head::after,
.topic-head::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(29, 95, 209, 0.16);
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(29, 95, 209, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 167, 0.11) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.62;
  pointer-events: none;
}

.eyebrow {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.35rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.18rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.75;
}

.dashboard-lede,
.topic-lede {
  max-width: 880px;
  margin-bottom: 0;
  color: #40504a;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.featured-adventure {
  position: relative;
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 310px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(23, 32, 29, 0.12);
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(12, 24, 42, 0.04), rgba(12, 24, 42, 0.82)),
    url("adventure-pythagorean-shrine/assets/forest-shrine-hero.png") center / cover;
  box-shadow: var(--shadow);
}

.featured-adventure::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  pointer-events: none;
}

.featured-adventure strong {
  position: relative;
  font-size: 1.9rem;
  line-height: 1;
}

.featured-adventure span {
  position: relative;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 750;
}

.featured-adventure .featured-kicker {
  justify-self: start;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.75rem;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-tile {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 248, 0.88)),
    var(--surface);
}

.stat-tile::after {
  content: "";
  position: absolute;
  inset: auto 14px 0 14px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #1d5fd1, #4b7df0, #5c63c7);
}

.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stat-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.stat-tile small {
  display: block;
  margin-top: 4px;
  color: #6a7b74;
  font-weight: 750;
}

.stage-section {
  scroll-margin-top: 100px;
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid rgba(216, 226, 220, 0.68);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.curriculum-section {
  margin-top: 14px;
}

.stage-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(29, 95, 209, 0.16);
  padding-bottom: 10px;
}

.subsection-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(216, 226, 220, 0.72);
}

.subsection-title-row h3 {
  margin-bottom: 4px;
}

.stage-title-row p {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 0.92rem;
}

.subsection-title-row p {
  max-width: 820px;
  margin-bottom: 0;
  font-size: 0.88rem;
}

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

.topic-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 190px;
  padding: 15px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.topic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(29, 95, 209, 0.82), rgba(75, 125, 240, 0.72), rgba(92, 99, 199, 0.68));
  opacity: 0.78;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: rgba(29, 95, 209, 0.38);
  box-shadow: var(--shadow);
}

.topic-meta,
.pill-row,
.neighbor-list,
.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-meta span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf5ff;
  color: #40516c;
  font-size: 0.76rem;
  font-weight: 800;
}

.topic-meta .done-pill {
  color: #fff;
  background: var(--teal);
}

.status-pill.core {
  color: #174ea6;
  background: #e1edff;
}

.status-pill.extension {
  color: #214f7d;
  background: #e3f0fb;
}

.status-pill.frontier {
  color: #61470d;
  background: #fff1cf;
}

.topic-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.topic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 850;
}

.topic-layout {
  display: grid;
  gap: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.content-card,
.visual-shell,
.quiz-shell {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 253, 252, 0.88)),
    var(--surface);
}

.content-card p:last-child,
.example-list li:last-child {
  margin-bottom: 0;
}

.example-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #43544f;
  line-height: 1.7;
}

.formula-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: #fff8e8;
  color: #3f3724;
  font-weight: 750;
  line-height: 1.55;
}

.visual-shell {
  display: grid;
  gap: 14px;
}

.visual-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

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

.visual-copy p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.visual-canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    linear-gradient(90deg, rgba(29, 95, 209, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 167, 0.11) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  box-shadow: inset 0 1px 18px rgba(18, 32, 29, 0.05);
}

.visual-canvas {
  display: block;
  width: 100%;
  height: 430px;
}

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

.control {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.control output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.quiz-shell {
  display: grid;
  gap: 14px;
}

.quiz-question {
  color: var(--ink);
  font-weight: 850;
}

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

.choice-button {
  min-height: 54px;
  padding: 10px 12px;
  text-align: left;
  line-height: 1.35;
}

.choice-button.correct {
  border-color: rgba(29, 95, 209, 0.65);
  background: #e8f1ff;
}

.choice-button.wrong {
  border-color: rgba(200, 81, 63, 0.55);
  background: #fff0ed;
}

.feedback {
  min-height: 28px;
  color: #41534d;
  font-weight: 750;
}

.py-range {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.py-range output {
  float: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.py-range input {
  width: 100%;
  accent-color: var(--teal);
}

.is-hidden {
  display: none;
}

.empty-state {
  padding: 34px;
  border: 1px dashed rgba(29, 95, 209, 0.45);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .featured-adventure,
  .dashboard-hero .dashboard-head {
    min-height: 260px;
  }

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

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

@media (max-width: 860px) {
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .search-box {
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .dashboard-hero .dashboard-head {
    padding: 22px;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

  .stage-nav {
    grid-template-columns: 1fr;
  }

  .content-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .visual-canvas {
    height: 360px;
  }
}

@media (max-width: 560px) {
  .topbar-actions,
  .stage-title-row,
  .subsection-title-row,
  .visual-top,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 1.55rem;
  }

  .stage-nav,
  .stats-grid,
  .control-grid,
  .choices {
    grid-template-columns: 1fr;
  }

  .visual-canvas {
    height: 320px;
  }

  .dashboard-hero .dashboard-head,
  .featured-adventure {
    min-height: auto;
  }

  .featured-adventure {
    padding: 20px;
    aspect-ratio: 1 / 0.82;
  }

  .hero-actions a {
    width: 100%;
  }
}

/* macOS-inspired visual refresh */
:root {
  --bg: #f2f5fb;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-soft: rgba(246, 249, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --ink: #111827;
  --muted: #6b7280;
  --line: rgba(120, 139, 168, 0.24);
  --teal: #0a84ff;
  --teal-dark: #0066cc;
  --coral: #ff453a;
  --gold: #ff9f0a;
  --blue: #0a84ff;
  --violet: #5856d6;
  --shadow: 0 24px 60px rgba(36, 54, 84, 0.16);
  --shadow-soft: 0 14px 34px rgba(36, 54, 84, 0.09);
}

html {
  background: #eef2f8;
}

body {
  background:
    linear-gradient(120deg, rgba(10, 132, 255, 0.1), transparent 34%),
    linear-gradient(240deg, rgba(88, 86, 214, 0.1), transparent 34%),
    linear-gradient(180deg, #fbfcff 0%, #eef3fb 50%, #f7f8fb 100%);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.topbar {
  width: 100%;
  min-height: 72px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(130, 148, 176, 0.22);
  background: rgba(248, 250, 253, 0.72);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(24px);
}

.brand {
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #0a84ff, #5e5ce6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 24px rgba(10, 132, 255, 0.18);
  font-size: 1.28rem;
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 750;
}

.brand-subtitle {
  color: #7b8494;
  font-size: 0.78rem;
}

.topbar-actions {
  gap: 10px;
}

.search-box {
  min-height: 38px;
  border: 1px solid rgba(120, 139, 168, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 1px 0 rgba(255, 255, 255, 0.52);
}

.search-box:focus-within {
  border-color: rgba(10, 132, 255, 0.54);
  box-shadow:
    0 0 0 3px rgba(10, 132, 255, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.72);
}

.search-label {
  color: #7b8494;
  font-size: 0.78rem;
}

.ghost-button,
.primary-button,
.choice-button,
.small-button,
.mark-button {
  min-height: 36px;
  border-radius: 8px;
  border-color: rgba(120, 139, 168, 0.25);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 248, 253, 0.82));
  color: #1f2937;
  font-size: 0.88rem;
  font-weight: 650;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 1px 2px rgba(31, 41, 55, 0.05);
}

.primary-button {
  border-color: rgba(0, 102, 204, 0.62);
  color: #fff;
  background: linear-gradient(180deg, #37a2ff, #0a84ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(10, 132, 255, 0.22);
}

.ghost-button:hover,
.small-button:hover,
.mark-button:hover,
.choice-button:hover {
  border-color: rgba(10, 132, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 255, 0.9));
  transform: translateY(-1px);
}

.workspace {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 72px);
  padding: 18px 22px 34px;
}

.app-shell {
  width: 100%;
}

.main-view {
  width: 100%;
}

.side-panel,
.topic-card,
.content-card,
.visual-shell,
.quiz-shell,
.stat-tile {
  border: 1px solid rgba(120, 139, 168, 0.23);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 34px rgba(36, 54, 84, 0.08);
  backdrop-filter: saturate(175%) blur(22px);
}

.side-panel {
  top: 90px;
  max-height: calc(100vh - 108px);
  height: calc(100vh - 108px);
  padding: 12px;
  background: rgba(245, 248, 253, 0.66);
}

.panel-heading {
  min-height: 34px;
  margin: 0 4px 8px;
  padding: 0 4px;
  color: #7b8494;
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-heading strong {
  color: #0a84ff;
}

.stage-nav {
  gap: 5px;
}

.tree-stage {
  border-radius: 8px;
}

.tree-stage[open],
.tree-stage.active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(120, 139, 168, 0.15);
}

.tree-stage > summary {
  min-height: 40px;
  padding: 7px 8px;
  border-radius: 8px;
}

.tree-stage > summary:hover,
.tree-section > summary:hover,
.tree-topic:hover,
.tree-stage-overview:hover {
  background: rgba(10, 132, 255, 0.08);
}

.tree-stage-title {
  color: #1f2937;
  font-size: 0.86rem;
  font-weight: 700;
}

.tree-stage-meta {
  color: #8a94a6;
  font-size: 0.7rem;
}

.tree-stage > summary::after,
.tree-section > summary::after {
  color: #9aa4b5;
  font-size: 1rem;
}

.tree-stage-overview {
  margin: 2px 8px 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0a64c7;
  font-size: 0.78rem;
}

.tree-section-list {
  gap: 2px;
  padding: 0 6px 8px 12px;
}

.tree-section {
  border-left: 1px solid rgba(120, 139, 168, 0.18);
}

.tree-section > summary {
  min-height: 31px;
  padding: 5px 4px 5px 10px;
  border-radius: 8px;
  color: #536075;
  font-size: 0.76rem;
  font-weight: 700;
}

.tree-topic-list {
  gap: 1px;
  padding: 1px 0 7px 12px;
}

.tree-topic {
  padding: 7px 9px 7px 16px;
  border: 0;
  border-radius: 8px;
  color: #647084;
  font-size: 0.75rem;
  font-weight: 620;
}

.tree-topic::before {
  left: 7px;
  background: #b4becd;
}

.tree-topic.done::before {
  background: #30d158;
}

.tree-topic.active {
  color: #fff;
  background: linear-gradient(180deg, #37a2ff, #0a84ff);
  box-shadow: 0 8px 18px rgba(10, 132, 255, 0.22);
}

.tree-topic.active::before {
  height: 5px;
  background: rgba(255, 255, 255, 0.95);
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-hero .dashboard-head,
.main-view > .dashboard-head,
.topic-head {
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 253, 0.66)),
    rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 18px 44px rgba(36, 54, 84, 0.1);
  backdrop-filter: saturate(175%) blur(24px);
}

.dashboard-hero .dashboard-head {
  min-height: 286px;
  padding: 28px;
}

.main-view > .dashboard-head,
.topic-head {
  padding: 22px;
}

.main-view > .dashboard-head::after,
.topic-head::after {
  width: 120px;
  height: 120px;
  border-color: rgba(10, 132, 255, 0.12);
  background:
    linear-gradient(90deg, rgba(10, 132, 255, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(88, 86, 214, 0.09) 1px, transparent 1px);
  background-size: 16px 16px;
}

.eyebrow {
  color: #0a84ff;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

h1 {
  color: #101828;
  font-size: 2.22rem;
  font-weight: 760;
}

h2 {
  color: #172033;
  font-size: 1.06rem;
  font-weight: 730;
}

h3 {
  color: #1f2937;
  font-size: 0.96rem;
  font-weight: 720;
}

p,
.dashboard-lede,
.topic-lede {
  color: #667085;
}

.hero-actions {
  gap: 8px;
}

.featured-adventure {
  min-height: 286px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(16, 24, 40, 0.18);
}

.featured-adventure::before {
  inset: 10px;
  border-color: rgba(255, 255, 255, 0.2);
}

.featured-adventure strong {
  font-size: 1.74rem;
  font-weight: 760;
}

.featured-adventure .featured-kicker {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.68rem;
}

.stats-grid {
  gap: 10px;
  margin-bottom: 18px;
}

.stat-tile {
  min-height: 86px;
  padding: 14px 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(247, 249, 253, 0.7)),
    rgba(255, 255, 255, 0.52);
}

.stat-tile::after {
  inset: auto 12px 0 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(10, 132, 255, 0.8), transparent);
}

.stat-tile span {
  color: #7b8494;
  font-size: 0.72rem;
}

.stat-tile strong {
  margin-top: 6px;
  color: #111827;
  font-size: 1.65rem;
  font-weight: 760;
}

.stat-tile small {
  color: #8a94a6;
  font-size: 0.74rem;
}

.stage-section {
  padding: 16px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.stage-title-row,
.subsection-title-row {
  border-bottom-color: rgba(120, 139, 168, 0.18);
}

.topic-grid {
  gap: 10px;
}

.topic-card {
  min-height: 172px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 253, 0.74));
}

.topic-card::before {
  height: 0;
}

.topic-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 132, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 38px rgba(36, 54, 84, 0.13);
}

.topic-meta span,
.pill {
  min-height: 23px;
  border: 1px solid rgba(120, 139, 168, 0.16);
  border-radius: 999px;
  background: rgba(242, 246, 252, 0.9);
  color: #5d697c;
  font-size: 0.7rem;
  font-weight: 680;
}

.status-pill.core {
  color: #075db3;
  background: rgba(10, 132, 255, 0.1);
}

.status-pill.extension {
  color: #5856d6;
  background: rgba(88, 86, 214, 0.1);
}

.status-pill.frontier {
  color: #9a5b00;
  background: rgba(255, 159, 10, 0.14);
}

.topic-meta .done-pill {
  border-color: rgba(48, 209, 88, 0.2);
  background: rgba(48, 209, 88, 0.13);
  color: #118536;
}

.topic-card-footer {
  color: #0a64c7;
  font-size: 0.8rem;
}

.content-card,
.visual-shell,
.quiz-shell {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 253, 0.68));
}

.formula-box {
  border-left-color: #0a84ff;
  background: rgba(10, 132, 255, 0.08);
  color: #1f355d;
}

.visual-canvas-wrap {
  border-color: rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)),
    linear-gradient(90deg, rgba(10, 132, 255, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(88, 86, 214, 0.08) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

.control {
  border-color: rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.control input[type="range"],
.py-range input {
  accent-color: #0a84ff;
}

.choice-button {
  background: rgba(255, 255, 255, 0.64);
}

.choice-button.correct {
  border-color: rgba(10, 132, 255, 0.44);
  background: rgba(10, 132, 255, 0.1);
}

.choice-button.wrong {
  border-color: rgba(255, 69, 58, 0.4);
  background: rgba(255, 69, 58, 0.1);
}

.empty-state {
  border-color: rgba(10, 132, 255, 0.24);
  background: rgba(255, 255, 255, 0.58);
}

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
    width: 100%;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .featured-adventure,
  .dashboard-hero .dashboard-head {
    min-height: 248px;
  }
}

@media (max-width: 860px) {
  .topbar {
    padding: 14px;
  }

  .workspace {
    padding: 14px;
  }

  .side-panel {
    max-height: 420px;
  }

  .dashboard-hero .dashboard-head {
    padding: 22px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 1.62rem;
  }

  .featured-adventure {
    aspect-ratio: 1 / 0.86;
  }
}


