:root {
  --paper: #f3f0e8;
  --paper-deep: #ebe7dc;
  --card: #fbfaf6;
  --card-strong: #ffffff;
  --ink: #1e2420;
  --ink-soft: #4e574f;
  --muted: #7d847c;
  --line: #dcd8cc;
  --line-strong: #c8c3b5;
  --green: #205f48;
  --green-light: #dfeae2;
  --green-pale: #edf4ee;
  --amber: #c78b37;
  --amber-pale: #f5ead7;
  --blue: #4d6d9a;
  --blue-pale: #e6ecf4;
  --coral: #c96a48;
  --coral-pale: #f4e4dd;
  --violet: #766589;
  --violet-pale: #ece8f1;
  --shadow: 0 18px 50px rgba(44, 48, 40, .07);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --sidebar-width: 248px;
  --sans: "Avenir Next", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(32, 95, 72, .28);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 26px 18px 18px;
  background: #eeeae0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px 25px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(34, 54, 43, .06);
}
.brand-mark svg { width: 34px; height: 34px; }
.brand-name { font-size: 18px; font-weight: 750; letter-spacing: .03em; line-height: 1.1; }
.brand-name span { font-size: 10px; letter-spacing: .16em; color: var(--muted); margin-left: 3px; }
.brand-sub { margin-top: 4px; color: var(--muted); font-size: 10.5px; letter-spacing: .02em; }

.nav-label {
  margin: 0 12px 8px;
  color: #8c9189;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-label-spaced { margin-top: 24px; }
.primary-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #626a62;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.48); color: var(--ink); }
.nav-item.is-active {
  color: var(--green);
  background: var(--card);
  border-color: #d7d3c7;
  box-shadow: 0 3px 10px rgba(45, 54, 45, .05);
  font-weight: 650;
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 11px;
  width: 3px;
  height: 22px;
  background: var(--green);
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 17px; height: 17px; position: relative; opacity: .8; }
.icon-grid::before, .icon-grid::after {
  content: ""; position: absolute; border: 1.5px solid currentColor; border-radius: 2px;
}
.icon-grid::before { inset: 0 8px 8px 0; }
.icon-grid::after { inset: 8px 0 0 8px; }
.nav-count {
  margin-left: auto;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #778079;
  background: #e3dfd5;
  font-size: 10px;
}
.topic-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-blue { background: var(--blue); }
.dot-coral { background: var(--coral); }
.dot-violet { background: var(--violet); }
.dot-teal { background: #4c8978; }
.dot-rose { background: #a95d72; }
.dot-ink { background: var(--ink); }
.nav-check {
  width: 16px; height: 16px; margin-left: auto; border: 1px solid #c9c6bc; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.35);
}
.nav-check.is-done { background: var(--green); border-color: var(--green); }
.nav-check.is-done::after {
  content: ""; width: 6px; height: 3px; border-left: 1.4px solid white; border-bottom: 1.4px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}
.sidebar-bottom { margin-top: auto; padding-top: 28px; }
.week-goal {
  padding: 15px 14px;
  border: 1px solid #d7d3c7;
  border-radius: 15px;
  background: rgba(250,249,244,.55);
}
.week-goal-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.week-goal-top strong { color: var(--ink); font-size: 11px; }
.progress-track { height: 5px; margin: 10px 0 8px; background: #ddd9cf; overflow: hidden; border-radius: 99px; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s ease; }
.week-goal p { margin: 0; color: var(--muted); font-size: 10px; }
.student-row {
  display: flex; align-items: center; gap: 10px; padding: 16px 4px 0;
}
.student-avatar {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--green); color: #fff; font-family: var(--serif); font-size: 15px; flex: 0 0 auto;
}
.student-row div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.student-row strong { font-size: 11.5px; font-weight: 650; }
.student-row span { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.icon-button { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; letter-spacing: .08em; }

.workspace { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  height: 74px; padding: 0 38px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: rgba(243, 240, 232, .9);
  border-bottom: 1px solid rgba(220, 216, 204, .8);
  backdrop-filter: blur(14px);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--muted); }
.breadcrumb i { font-style: normal; color: #aaa89f; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.reader-tools { display: flex; align-items: center; gap: 5px; }
.reader-button { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.42); color: var(--ink-soft); font-size: 10px; font-weight: 650; cursor: pointer; }
.reader-button:hover, .reader-button.is-active { color: var(--green); border-color: var(--green); background: var(--green-pale); }
.tool-symbol { width: 17px; text-align: center; color: var(--green); font-family: var(--serif); font-size: 14px; line-height: 1; }
.nav-count.has-items { color: #fff; background: var(--coral); }

.search-trigger {
  width: 270px; height: 36px; padding: 0 10px 0 12px;
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); background: rgba(255,255,255,.55); border: 1px solid var(--line);
  border-radius: 10px; font-size: 10.5px; cursor: pointer;
}
.search-trigger:hover { background: var(--card); border-color: var(--line-strong); }
.search-trigger kbd { margin-left: auto; }
kbd {
  border: 1px solid #d5d1c6; border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px;
  background: #f8f6f0; color: #858a82; font-family: var(--sans); font-size: 9px; line-height: 1;
}
.search-glyph { width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-glyph::after { content: ""; position: absolute; width: 5px; height: 1.5px; background: currentColor; right: -4px; bottom: -2px; transform: rotate(45deg); border-radius: 2px; }
.date-pill {
  height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border-radius: 99px; background: var(--green-pale); color: var(--green); font-size: 10px; white-space: nowrap;
}
.date-pill strong { font-size: 11px; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #55a479; box-shadow: 0 0 0 4px rgba(85,164,121,.12); }
.mobile-menu { display: none; border: 0; background: transparent; padding: 8px; }
.mobile-menu span { display: block; width: 19px; height: 1.5px; margin: 4px; background: var(--ink); }

main { padding: 36px 38px 56px; max-width: 1540px; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; animation: view-in .4s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 28px;
  align-items: stretch;
  min-height: 266px;
  padding: 38px 40px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #f8f5ed;
  background:
    radial-gradient(circle at 82% -20%, rgba(160, 190, 167, .2), transparent 38%),
    linear-gradient(120deg, #1d3c32, #20362e 55%, #294235);
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute; right: 35%; bottom: -120px; width: 340px; height: 340px;
  border: 1px solid rgba(244,240,229,.08); border-radius: 50%;
}
.hero::after {
  content: "P"; position: absolute; right: 31%; top: 20px; color: rgba(255,255,255,.03);
  font-family: var(--serif); font-size: 300px; line-height: 1;
}
.hero-copy { position: relative; z-index: 1; align-self: center; }
.eyebrow, .section-kicker {
  margin: 0 0 12px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
}
.hero .eyebrow { display: flex; align-items: center; gap: 8px; color: #aabdb1; }
.hero .eyebrow span { width: 20px; height: 1px; background: #91aa98; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(34px, 4vw, 54px); font-weight: 500; letter-spacing: -.035em; line-height: 1.09; }
.hero-description { max-width: 530px; margin: 17px 0 24px; color: #c5d1c8; font-size: 13px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  min-height: 43px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; border-radius: 11px; font-size: 11.5px; font-weight: 650; cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #17372c; background: #f5f0e6; }
.button-primary:hover { background: #fffdf8; }
.button-ghost { color: #e4ebe5; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.2); }
.button-ghost:hover { background: rgba(255,255,255,.09); }
.button-dark { color: #f4f1e9; background: var(--ink); }
.button-dark:hover { background: #303a33; }
.full-button { width: 100%; justify-content: space-between; padding: 0 15px; }
.quiz-glyph { width: 13px; height: 13px; border: 1.3px solid currentColor; border-radius: 50%; position: relative; }
.quiz-glyph::after { content: "?"; position: absolute; inset: -2px 0 0; font-size: 9px; text-align: center; }

.mastery-card {
  position: relative; z-index: 1; align-self: stretch; padding: 20px;
  background: rgba(244,241,232,.09); border: 1px solid rgba(244,241,232,.15); border-radius: 19px;
  backdrop-filter: blur(13px);
}
.mastery-top { display: flex; justify-content: space-between; color: #afc0b4; font-size: 10px; }
.trend { color: #b8d6c1; }
.mastery-main { display: flex; align-items: center; gap: 16px; margin: 18px 0; }
.mastery-ring {
  --progress: 68;
  width: 98px; height: 98px; flex: 0 0 auto; border-radius: 50%;
  background: conic-gradient(#c8dfcf calc(var(--progress) * 1%), rgba(255,255,255,.11) 0);
  display: grid; place-items: center; position: relative;
}
.mastery-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #2a4137; }
.mastery-ring span { position: relative; z-index: 1; font-family: var(--serif); font-size: 27px; }
.mastery-ring small { font-family: var(--sans); font-size: 10px; color: #b8c9bd; margin-left: 2px; }
.mastery-copy strong { display: block; font-size: 12px; font-weight: 650; margin-bottom: 7px; }
.mastery-copy p { margin: 0; color: #acbeb1; font-size: 10px; line-height: 1.65; }
.mastery-footer { display: flex; flex-wrap: wrap; gap: 13px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); color: #b9c9bd; font-size: 9px; }
.legend-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; }
.legend-dot.green { background: #8db69b; }
.legend-dot.amber { background: #d5a85f; }
.legend-dot.muted { background: #77887c; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(280px, .68fr); gap: 19px; margin-top: 19px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 8px 28px rgba(43,47,39,.035); }
.market-lab { padding: 23px 24px 19px; overflow: hidden; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading h2, .focus-card h2, .quiz-card h2, .tutor-card h2, .section-heading-row h2 {
  margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 560; letter-spacing: -.02em;
}
.card-heading .section-kicker { margin-bottom: 5px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  color: var(--green); background: var(--green-pale); border-radius: 99px; font-size: 9px; white-space: nowrap;
}
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: #4e9a70; }
.lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 22px; margin-top: 17px; align-items: stretch; }
.chart-wrap { position: relative; min-width: 0; }
#market-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #e4e0d5; stroke-width: 1; stroke-dasharray: 2 5; }
.chart-axis-line { stroke: #bdb8ac; stroke-width: 1.2; fill: none; }
.chart-tick-text { fill: #92968f; font-family: var(--sans); font-size: 9px; }
.chart-axis-label { fill: #666d66; font-family: var(--sans); font-size: 10px; font-weight: 600; }
.chart-line { stroke-width: 2.6; stroke-linecap: round; fill: none; transition: all .25s ease; }
.demand-line { stroke: var(--green); }
.supply-line { stroke: var(--coral); }
.guide-line { stroke: #868c85; stroke-width: 1; stroke-dasharray: 4 5; }
.equilibrium-dot { fill: var(--ink); stroke: #fbfaf6; stroke-width: 2.5; transition: all .25s ease; }
.equilibrium-halo { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .18; transition: all .25s ease; }
.curve-label { font-family: var(--sans); font-size: 10px; font-weight: 700; }
.curve-label.demand { fill: var(--green); }
.curve-label.supply { fill: var(--coral); }
.eq-label { fill: var(--ink); font-family: var(--sans); font-size: 9px; font-weight: 650; }
.chart-caption { display: flex; gap: 17px; padding: 7px 0 0 21px; color: var(--muted); font-size: 9px; }
.chart-caption span { display: flex; align-items: center; gap: 5px; }
.line-sample { width: 15px; height: 2px; border-radius: 2px; display: inline-block; }
.line-sample.demand { background: var(--green); }
.line-sample.supply { background: var(--coral); }
.area-sample { width: 12px; height: 8px; display: inline-block; border-radius: 2px; background: linear-gradient(90deg, rgba(32,95,72,.3), rgba(201,106,72,.3)); }
.chart-tooltip {
  position: absolute; z-index: 3; padding: 5px 8px; border-radius: 7px; color: #fff; background: rgba(30,36,32,.9);
  font-size: 9px; pointer-events: none; opacity: 0; transform: translate(-50%, -125%); transition: opacity .12s ease;
}
.chart-tooltip.is-visible { opacity: 1; }

.lab-controls { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 21px; }
.equilibrium-readout { padding: 7px 0 14px; border-bottom: 1px solid var(--line); }
.equilibrium-readout > span { color: var(--muted); font-size: 9px; }
.readout-main { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.readout-main strong { color: var(--green); font-family: var(--serif); font-size: 28px; font-weight: 560; }
.readout-main span, .readout-sub span { color: var(--muted); font-size: 9px; }
.readout-sub { display: flex; justify-content: space-between; margin-top: 5px; }
.readout-sub strong { font-size: 11px; }
.slider-group { padding: 14px 0 2px; }
.slider-label { display: flex; justify-content: space-between; align-items: center; font-size: 10px; margin-bottom: 9px; }
.slider-label output { color: var(--green); font-weight: 650; }
input[type="range"] {
  width: 100%; height: 3px; margin: 0; appearance: none; background: linear-gradient(to right, #c8d4ca, var(--green));
  border-radius: 99px; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid var(--green); background: var(--card); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #a4a69f; font-size: 8px; }
.insight-box { display: flex; gap: 8px; margin-top: 15px; padding: 10px; border-radius: 10px; background: #f1efe7; }
.insight-mark {
  width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: var(--green); color: #fff; font-family: var(--serif); font-size: 10px;
}
.insight-box p { margin: 0; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.text-button { border: 0; padding: 0; color: var(--ink-soft); background: transparent; font-size: 9.5px; cursor: pointer; }
.text-button:hover { color: var(--green); }
.lab-controls > .text-button { align-self: flex-start; margin-top: auto; padding-top: 12px; }
.lab-controls > .text-button span { margin-left: 3px; }

.focus-card { padding: 23px 21px 18px; display: flex; flex-direction: column; }
.focus-header { display: flex; justify-content: space-between; gap: 12px; }
.time-badge { align-self: flex-start; padding: 5px 8px; border-radius: 7px; background: #eeece4; color: var(--muted); font-size: 9px; }
.focus-intro { margin: 13px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.focus-question { padding: 13px 14px; border-left: 2px solid var(--green); border-radius: 0 9px 9px 0; background: var(--green-pale); }
.focus-question span { color: var(--green); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.focus-question h3 { margin: 5px 0 0; font-family: var(--serif); font-size: 15px; font-weight: 560; line-height: 1.45; }
.learning-steps { margin: 10px 0 16px; }
.learning-step { position: relative; display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #ebe7dc; }
.learning-step:last-child { border-bottom: 0; }
.step-dot { width: 8px; height: 8px; border: 1.3px solid #b4b7b0; border-radius: 50%; }
.learning-step.is-done .step-dot { background: var(--green); border-color: var(--green); }
.learning-step.is-done .step-dot::after { content: ""; display: block; width: 4px; height: 2px; margin: 2px 0 0 1.5px; border-left: 1px solid white; border-bottom: 1px solid white; transform: rotate(-45deg); }
.learning-step.is-current .step-dot { background: var(--card); border: 2px solid var(--green); box-shadow: 0 0 0 4px rgba(32,95,72,.1); }
.learning-step div { display: flex; flex-direction: column; }
.learning-step strong { font-size: 10px; font-weight: 650; }
.learning-step small { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.learning-step > span:last-child { color: #93978f; font-size: 8px; }
.focus-note { margin: 9px 0 0; color: #9a9d96; text-align: center; font-size: 8px; }

.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 34px 0 15px; }
.section-heading-row .section-kicker { margin-bottom: 5px; }
.section-heading-row h2 { font-size: 26px; }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.topic-card {
  position: relative; min-height: 248px; padding: 19px; overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(40,45,37,.07); border-color: #cbc7ba; }
.topic-card::after {
  content: ""; position: absolute; width: 170px; height: 170px; right: -74px; bottom: -90px;
  border-radius: 50%; background: var(--topic-pale); opacity: .6;
}
.topic-green { --topic-color: var(--green); --topic-pale: var(--green-pale); }
.topic-coral { --topic-color: var(--coral); --topic-pale: var(--coral-pale); }
.topic-violet { --topic-color: var(--violet); --topic-pale: var(--violet-pale); }
.topic-amber { --topic-color: var(--amber); --topic-pale: var(--amber-pale); }
.topic-blue { --topic-color: var(--blue); --topic-pale: var(--blue-pale); }
.topic-card-top { display: flex; justify-content: space-between; align-items: center; }
.topic-index { color: var(--topic-color); font-family: var(--serif); font-size: 12px; }
.topic-state { color: var(--muted); font-size: 8px; padding: 4px 7px; border-radius: 99px; background: #f1efe8; }
.topic-state.ready { color: var(--green); background: var(--green-pale); }
.topic-illustration { height: 66px; margin: 10px 3px 2px; position: relative; z-index: 1; }
.topic-illustration svg { width: 100%; height: 100%; overflow: visible; }
.ill-line { fill: none; stroke-width: 1.7; stroke-linecap: round; }
.ill-demand { stroke: var(--topic-color); opacity: .8; }
.ill-supply { stroke: var(--topic-color); opacity: .32; }
.topic-illustration circle { fill: var(--topic-color); }
.elastic-bars { height: 100%; display: flex; align-items: flex-end; gap: 8px; padding: 7px 35px 2px 48px; }
.elastic-bars i { flex: 1; border-radius: 3px 3px 1px 1px; background: var(--topic-color); opacity: .22; }
.elastic-bars i:nth-child(4) { opacity: .7; }
.topic-card h3 { position: relative; z-index: 1; margin: 3px 0 7px; font-family: var(--serif); font-size: 18px; font-weight: 570; line-height: 1.28; }
.topic-card p { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.topic-meta { position: absolute; left: 19px; bottom: 18px; z-index: 1; color: #979b94; font-size: 8.5px; }

.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(280px, .68fr); gap: 19px; margin-top: 19px; }
.quiz-card { padding: 23px 24px 20px; }
.question-counter { color: var(--muted); font-family: var(--serif); font-size: 13px; }
.quiz-tag { margin: 14px 0 8px; color: var(--green); font-size: 8.5px; font-weight: 700; letter-spacing: .08em; }
.quiz-question h3 { margin: 0 0 15px; font-family: var(--serif); font-size: 17px; font-weight: 550; line-height: 1.5; }
.answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.answer-list button {
  min-height: 41px; padding: 7px 11px; display: flex; align-items: center; gap: 9px; text-align: left;
  border: 1px solid #e2ded3; border-radius: 9px; background: #fdfcf8; color: var(--ink-soft); font-size: 9.5px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.answer-list button:hover { border-color: #b9c7bc; background: #fafcf9; }
.answer-list button span {
  width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 5px; background: #efede6; font-size: 8px;
}
.answer-list button.is-correct { border-color: #83aa91; background: var(--green-pale); color: var(--green); }
.answer-list button.is-correct span { color: #fff; background: var(--green); }
.answer-list button.is-wrong { border-color: #d99882; background: #f8eae4; color: #9e4c31; }
.answer-list button.is-wrong span { color: #fff; background: var(--coral); }
.answer-list button:disabled { cursor: default; transform: none; }
.quiz-feedback { display: none; margin-top: 11px; padding: 10px 12px; border-radius: 8px; color: var(--ink-soft); background: #f1efe7; font-size: 9px; line-height: 1.6; }
.quiz-feedback.is-visible { display: block; animation: view-in .25s ease both; }
.quiz-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.quiz-hint { color: #a2a59e; font-size: 8px; }

.tutor-card {
  position: relative; overflow: hidden; padding: 23px 23px 18px; color: #eef1ec;
  background: linear-gradient(145deg, #263c32, #1d2d26); border-color: #263c32;
}
.tutor-card::after {
  content: ""; position: absolute; width: 160px; height: 160px; right: -80px; top: -70px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 50%;
}
.tutor-card .section-kicker { color: #9db0a3; margin-top: 18px; margin-bottom: 6px; }
.tutor-card h2 { font-size: 21px; color: #f2f1ea; }
.tutor-card blockquote { margin: 14px 0 21px; color: #c3cec6; font-family: var(--serif); font-size: 14px; line-height: 1.7; }
.tutor-orbit { width: 44px; height: 44px; position: relative; display: grid; place-items: center; }
.tutor-orbit div { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #d5e2d8; font-size: 11px; }
.tutor-orbit span { position: absolute; width: 5px; height: 5px; background: #9cc3a8; border-radius: 50%; }
.tutor-orbit span:nth-child(1) { top: 0; right: 3px; }
.tutor-orbit span:nth-child(2) { left: 0; bottom: 7px; opacity: .5; }
.tutor-orbit span:nth-child(3) { right: 9px; bottom: 1px; width: 3px; height: 3px; opacity: .7; }
.tutor-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.tutor-footer span { color: #92a399; font-size: 8px; }
.round-arrow { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #e4ece5; background: transparent; cursor: pointer; }
.round-arrow:hover { background: rgba(255,255,255,.09); }

/* Topic detail */
.topic-view { max-width: 1200px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.back-button:hover { color: var(--green); }
.topic-hero { position: relative; overflow: hidden; padding: 32px 34px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); }
.topic-hero::after { content: attr(data-index); position: absolute; right: 28px; bottom: -46px; color: #f0ede4; font-family: var(--serif); font-size: 160px; line-height: 1; }
.topic-hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.topic-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--topic-color); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.topic-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--topic-color); }
.topic-progress-label { color: var(--muted); font-size: 9px; }
.topic-hero h1 { position: relative; z-index: 1; max-width: 720px; margin: 14px 0 11px; font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); font-weight: 520; letter-spacing: -.035em; }
.topic-hero > p { position: relative; z-index: 1; max-width: 690px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.topic-hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.meta-pill { padding: 6px 9px; border-radius: 7px; color: var(--muted); background: #f1efe8; font-size: 8.5px; }
.topic-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 19px; margin-top: 19px; }
.lesson-card { padding: 29px 30px; }
.lesson-card h2 { margin: 0 0 17px; font-family: var(--serif); font-size: 24px; font-weight: 560; }
.lesson-card h3 { margin: 24px 0 11px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.lesson-card p { color: var(--ink-soft); font-size: 11px; line-height: 1.9; }
.principle-callout { margin: 18px 0; padding: 17px 18px; border-left: 3px solid var(--topic-color); border-radius: 0 12px 12px 0; background: var(--topic-pale); }
.principle-callout span { color: var(--topic-color); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.principle-callout p { margin: 6px 0 0; color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.6; }
.concept-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.concept-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 11px 12px; border: 1px solid #e7e3d9; border-radius: 10px; background: #fdfcf8; color: var(--ink-soft); font-size: 10px; line-height: 1.65; }
.concept-list b { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; background: var(--topic-pale); color: var(--topic-color); font-size: 8px; }
.concept-list strong { color: var(--ink); font-weight: 650; }
.example-box { margin-top: 24px; padding: 17px 18px; border-radius: 13px; background: #f1efe8; }
.example-box span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.example-box h3 { margin: 7px 0 6px; font-family: var(--serif); font-size: 16px; font-weight: 560; }
.example-box p { margin: 0; font-size: 10px; line-height: 1.75; }
.objective-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 20px; padding: 0; list-style: none; }
.objective-list li { display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border: 1px solid #e7e3d9; border-radius: 10px; background: #fdfcf8; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.objective-list li > span { color: var(--topic-color); font-family: var(--serif); font-size: 10px; flex: 0 0 auto; }
.lesson-intro { margin: 0 0 18px !important; }
.chapter-outline { display: grid; gap: 0; border-top: 1px solid #e6e1d6; }
.outline-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid #e6e1d6; }
.outline-number { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 10px; }
.outline-item strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 10.5px; font-weight: 700; }
.outline-item p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.72; }
.life-lab-card { margin-top: 19px; padding: 27px 29px; background: linear-gradient(135deg, var(--card), var(--topic-pale)); }
.life-lab-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.life-lab-heading .section-kicker { margin-bottom: 5px; color: var(--topic-color); }
.life-lab-heading h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 560; }
.life-lab-heading > span { padding: 5px 8px; color: var(--topic-color); background: rgba(255,255,255,.45); border-radius: 99px; font-size: 8px; white-space: nowrap; }
.life-lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.life-lab-item { position: relative; padding: 17px 17px 15px; border: 1px solid color-mix(in srgb, var(--topic-color) 18%, var(--line)); border-radius: 14px; background: rgba(255,255,255,.48); overflow: hidden; }
.life-lab-top { display: flex; align-items: baseline; gap: 9px; }
.life-lab-top > span { color: var(--topic-color); font-family: var(--serif); font-size: 11px; }
.life-lab-top strong { font-size: 11px; }
.life-scene { margin: 10px 0 13px; color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.life-model { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--topic-pale); }
.life-model span { color: var(--topic-color); font-size: 7.5px; font-weight: 700; letter-spacing: .08em; }
.life-model strong { color: var(--ink); font-size: 9px; }
.life-takeaway { margin: 11px 0 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.65; }
.life-takeaway i { display: block; margin-bottom: 2px; color: var(--topic-color); font-style: normal; font-size: 7.5px; font-weight: 700; letter-spacing: .08em; }
.detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 19px; margin-top: 19px; }
.detail-card { padding: 25px 26px; }
.detail-card h2 { margin: 0 0 16px; font-family: var(--serif); font-size: 22px; font-weight: 560; }
.term-list { margin: 0; }
.term-list > div { padding: 11px 0; border-bottom: 1px solid #e8e4da; }
.term-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.term-list dt { color: var(--topic-color); font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.term-list dd { margin: 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.65; }
.exam-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.exam-list li { display: flex; gap: 9px; align-items: flex-start; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.exam-list li span { flex: 0 0 auto; color: var(--topic-color); font-family: var(--serif); font-size: 10px; }
.exam-tip { margin-top: 16px; padding: 13px 14px; border-radius: 10px; background: var(--topic-pale); }
.exam-tip strong { display: block; color: var(--topic-color); font-size: 9px; margin-bottom: 4px; }
.exam-tip p { margin: 0; font-size: 9px; line-height: 1.65; color: var(--ink-soft); }
.worked-card { grid-column: 1 / -1; }
.worked-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.worked-head .section-kicker { margin-bottom: 5px; }
.worked-head > span { padding: 5px 8px; border-radius: 99px; color: var(--topic-color); background: var(--topic-pale); font-size: 8px; white-space: nowrap; }
.worked-question { margin: 0; padding: 14px 15px; border-left: 3px solid var(--topic-color); border-radius: 0 9px 9px 0; background: #f2f0e8; color: var(--ink); font-size: 10.5px; line-height: 1.7; }
.worked-steps { display: grid; gap: 9px; margin: 14px 0; padding: 0; list-style: none; }
.worked-steps li { display: grid; grid-template-columns: 23px 1fr; gap: 10px; align-items: start; }
.worked-steps li > span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--topic-color); font-size: 8px; }
.worked-steps p { margin: 1px 0 0; font-size: 10px; line-height: 1.7; }
.worked-answer { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--topic-color) 24%, var(--line)); border-radius: 10px; background: var(--topic-pale); }
.worked-answer span { flex: 0 0 auto; color: var(--topic-color); font-size: 8px; font-weight: 700; letter-spacing: .08em; padding-top: 2px; }
.worked-answer p { margin: 0; color: var(--ink); font-size: 10px; line-height: 1.7; }

.topic-side { display: flex; flex-direction: column; gap: 15px; }
.formula-card { padding: 22px; }
.formula-card h3 { margin: 0 0 14px; font-family: var(--serif); font-size: 18px; font-weight: 560; }
.formula-display { padding: 14px 12px; border-radius: 10px; color: var(--topic-color); background: var(--topic-pale); text-align: center; font-family: var(--serif); font-size: 20px; }
.formula-note { margin: 11px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.pitfall-card { padding: 21px 22px; color: #f4f0e7; background: #242d27; border-color: #242d27; }
.pitfall-card .section-kicker { color: #9eada1; }
.pitfall-card h3 { margin: 0 0 9px; font-family: var(--serif); font-size: 18px; font-weight: 560; }
.pitfall-card p { margin: 0; color: #bfc9c0; font-size: 10px; line-height: 1.75; }
.evaluation-card { padding: 21px 22px; background: var(--topic-pale); border-color: color-mix(in srgb, var(--topic-color) 24%, var(--line)); }
.evaluation-card .section-kicker { color: var(--topic-color); }
.evaluation-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 18px; font-weight: 560; }
.evaluation-card p:last-child { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.topic-actions { padding: 21px 22px; }
.topic-actions h3 { margin: 0 0 7px; font-family: var(--serif); font-size: 18px; font-weight: 560; }
.topic-actions p { margin: 0 0 14px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.complete-button.is-done { background: var(--green); color: white; }
.related-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.related-chip { padding: 5px 8px; border: 1px solid #e0ddd3; border-radius: 99px; background: transparent; color: var(--muted); font-size: 8px; cursor: pointer; }
.related-chip:hover { color: var(--topic-color); border-color: var(--topic-color); }

/* Study tools */
.tool-view { max-width: 1220px; }
.tool-hero { position: relative; overflow: hidden; padding: 37px 39px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--card); }
.tool-hero::after { content: "∑"; position: absolute; right: 36px; bottom: -55px; color: rgba(32,95,72,.06); font-family: var(--serif); font-size: 190px; line-height: 1; }
.tool-hero-amber::after { content: "◈"; color: rgba(199,139,55,.09); }
.tool-hero-coral::after { content: "!"; color: rgba(201,106,72,.08); }
.tool-hero .eyebrow { color: var(--green); }
.tool-hero-amber .eyebrow { color: var(--amber); }
.tool-hero-coral .eyebrow { color: var(--coral); }
.tool-hero h1 { position: relative; z-index: 1; margin: 12px 0 13px; font-family: var(--serif); font-size: clamp(34px, 5vw, 49px); font-weight: 520; letter-spacing: -.035em; line-height: 1.12; }
.tool-hero > p:last-child { position: relative; z-index: 1; max-width: 680px; margin: 0; color: var(--ink-soft); font-size: 11.5px; line-height: 1.8; }
.tool-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 24px 0 17px; }
.tool-search { width: min(360px, 100%); height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); }
.tool-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10.5px; }
.filter-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.filter-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font-size: 8.5px; cursor: pointer; }
.filter-chip:hover, .filter-chip.is-active { color: var(--green); border-color: #96b3a0; background: var(--green-pale); }
.formula-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.formula-library-card { padding: 21px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.formula-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 8px; }
.formula-card-top span:last-child { color: var(--topic-color); font-weight: 700; }
.formula-large { margin: 14px 0 11px; padding: 14px 12px; border-radius: 10px; color: var(--topic-color); background: var(--topic-pale); text-align: center; font-family: var(--serif); font-size: 20px; line-height: 1.35; }
.formula-plain { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.formula-life, .formula-pitfall { margin-top: 12px; padding: 11px 12px; border-radius: 9px; background: #f1efe8; }
.formula-life span, .formula-pitfall span { display: block; margin-bottom: 3px; color: var(--topic-color); font-size: 7.5px; font-weight: 700; letter-spacing: .08em; }
.formula-life p, .formula-pitfall p { margin: 0; color: var(--ink-soft); font-size: 9px; line-height: 1.65; }
.formula-pitfall { background: #f8ece7; }
.formula-pitfall span { color: var(--coral); }
.formula-open { margin-top: 13px; color: var(--topic-color); }
.tool-empty { grid-column: 1 / -1; padding: 54px 24px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--card); text-align: center; color: var(--muted); }
.tool-empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 560; margin-bottom: 6px; }
.tool-empty p { margin: 0; font-size: 10px; line-height: 1.7; }

.flashcard-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin: 22px 0 15px; }
.flashcard-toolbar > label { color: var(--muted); font-size: 9px; }
.flashcard-toolbar select { height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 9px; }
.flashcard-stat { color: var(--muted); font-size: 9px; margin-left: auto; }
.flashcard-progress { max-width: 720px; margin: 0 auto 12px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 8px; }
.flashcard-progress .progress-track { flex: 1; margin: 0; }
.flashcard { width: min(720px, 100%); height: 365px; margin: 0 auto; padding: 0; display: block; border: 0; border-radius: 22px; background: transparent; perspective: 1200px; cursor: pointer; text-align: left; }
.flashcard-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; border: 1px solid var(--line); border-radius: 22px; backface-visibility: hidden; transition: transform .45s ease; }
.flashcard { position: relative; transform-style: preserve-3d; transition: transform .45s ease; }
.flashcard.is-flipped { transform: rotateY(180deg); }
.flashcard-front { background: radial-gradient(circle at 80% 10%, rgba(32,95,72,.09), transparent 34%), var(--card); }
.flashcard-back { background: linear-gradient(145deg, #244237, #1d3028); color: #edf2ec; transform: rotateY(180deg); border-color: #244237; }
.flashcard-kind { color: var(--green); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.flashcard-back .flashcard-kind { color: #a7c5b2; }
.flashcard-face h2 { max-width: 590px; margin: 15px 0 10px; font-family: var(--serif); font-size: clamp(29px, 4vw, 42px); font-weight: 540; line-height: 1.2; text-align: center; }
.flashcard-face p { max-width: 570px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; text-align: center; }
.flashcard-back p { color: #d5dfd7; font-size: 14px; }
.flashcard-face small { margin-top: 22px; color: var(--muted); font-size: 8px; }
.flashcard-back small { color: #9fb2a5; }
.flashcard-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.button-soft { color: var(--ink-soft); background: #ece9df; border-color: #dcd7ca; }
.button-ghost-light { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.button:disabled { opacity: .38; cursor: not-allowed; transform: none; }

.mistake-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 22px 0 16px; }
.mistake-stat { padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.mistake-stat span { display: block; color: var(--muted); font-size: 8px; margin-bottom: 6px; }
.mistake-stat strong { font-family: var(--serif); font-size: 28px; font-weight: 560; color: var(--coral); }
.mistake-stat small { color: var(--muted); font-size: 8px; margin-left: 3px; }
.mistake-card { margin-bottom: 12px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.mistake-card-head { display: flex; justify-content: space-between; gap: 12px; color: var(--coral); font-size: 8px; font-weight: 700; }
.mistake-card-head small { color: var(--muted); font-weight: 400; }
.mistake-card h3 { margin: 10px 0 11px; font-family: var(--serif); font-size: 17px; font-weight: 560; line-height: 1.55; }
.mistake-answer-row { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 10px 12px; border-radius: 9px; background: #f1efe8; color: var(--muted); font-size: 9px; }
.mistake-answer-row strong { font-weight: 650; }
.wrong-answer { color: var(--coral); }
.correct-answer { color: var(--green); }
.mistake-explanation { margin: 11px 0 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.75; }
.mistake-actions { display: flex; align-items: center; gap: 15px; margin-top: 13px; }
.mistake-retry { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.mistake-answer-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mistake-empty .button { margin-top: 17px; }
.empty-mark { width: 34px; height: 34px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: var(--green-pale); color: var(--green); font-size: 16px; }
.data-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 17px; padding: 18px 20px; }
.data-tools strong { font-size: 10px; }
.data-tools p { margin: 4px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.data-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.quick-lab { margin-top: 19px; padding: 25px 27px; }
.quick-lab-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.quick-lab-head .section-kicker { margin-bottom: 5px; color: var(--topic-color); }
.quick-lab-head h2 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 560; }
.quick-lab-head > span { padding: 5px 8px; border-radius: 99px; color: var(--topic-color); background: var(--topic-pale); font-size: 8px; white-space: nowrap; }
.quick-lab-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 24px; align-items: center; }
#monopoly-chart { width: 100%; height: auto; }
.lab-axis { stroke: var(--line-strong); stroke-width: 1.1; }
.lab-line { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.lab-line.demand { stroke: var(--topic-color); }
.lab-line.mr { stroke: var(--coral); stroke-dasharray: 5 4; }
.lab-line.mc { stroke: var(--blue); }
.lab-guide { stroke: var(--muted); stroke-width: .9; stroke-dasharray: 3 4; }
.lab-dot { fill: var(--topic-color); stroke: var(--card); stroke-width: 2; }
.lab-axis-label { fill: var(--muted); font-family: var(--sans); font-size: 9px; }
.quick-lab-controls { display: flex; flex-direction: column; gap: 14px; }
.lab-range label { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 9px; }
.lab-range output { color: var(--topic-color); font-weight: 700; }
.lab-range input[type="range"] { margin-top: 9px; }
.lab-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.lab-results > div { padding: 10px; border-radius: 9px; background: var(--topic-pale); }
.lab-results span { display: block; color: var(--muted); font-size: 7.5px; margin-bottom: 4px; }
.lab-results strong { color: var(--topic-color); font-family: var(--serif); font-size: 16px; font-weight: 560; }
.lab-insight { margin: 0; padding: 11px 12px; border-radius: 9px; background: #f1efe8; color: var(--ink-soft); font-size: 9px; line-height: 1.65; }
.externality-visual { padding: 14px 5px; }
.externality-bar { margin-bottom: 16px; }
.externality-bar-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--ink-soft); font-size: 9px; }
.externality-bar-label strong { color: var(--topic-color); font-family: var(--serif); font-size: 16px; }
.bar-track { height: 13px; overflow: hidden; border-radius: 99px; background: #e9e5db; }
.bar-track i { display: block; height: 100%; border-radius: inherit; transition: width .25s ease; }
.private-bar { background: var(--coral); }
.social-bar { background: var(--topic-color); }
.externality-gap { display: flex; align-items: baseline; gap: 7px; padding: 11px 13px; border-radius: 10px; background: var(--topic-pale); }
.externality-gap span { color: var(--muted); font-size: 8px; }
.externality-gap strong { color: var(--topic-color); font-family: var(--serif); font-size: 20px; }
.externality-gap small { color: var(--muted); font-size: 8px; }
.externality-lab .lab-results { grid-template-columns: 1fr 1fr; }

/* Dark theme and reading preferences */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111612;
  --paper-deep: #151b17;
  --card: #1a211c;
  --card-strong: #202821;
  --ink: #edf1eb;
  --ink-soft: #c0c9c1;
  --muted: #89958c;
  --line: #303a32;
  --line-strong: #465148;
  --green: #8bc6a7;
  --green-light: #253b2e;
  --green-pale: #203328;
  --amber: #dfb467;
  --amber-pale: #3b3020;
  --blue: #91acd4;
  --blue-pale: #263241;
  --coral: #e09473;
  --coral-pale: #3e2a23;
  --violet: #b2a1c7;
  --violet-pale: #312b3a;
  --shadow: 0 18px 50px rgba(0, 0, 0, .26);
}
html[data-theme="dark"] .sidebar { background: #161c18; }
html[data-theme="dark"] .topbar { background: rgba(17,22,18,.91); }
html[data-theme="dark"] .search-trigger,
html[data-theme="dark"] .reader-button,
html[data-theme="dark"] .week-goal,
html[data-theme="dark"] .flashcard-toolbar select,
html[data-theme="dark"] .tool-search { background: #1b221d; }
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .search-result.is-selected,
html[data-theme="dark"] .answer-list button,
html[data-theme="dark"] .objective-list li,
html[data-theme="dark"] .concept-list li,
html[data-theme="dark"] .insight-box,
html[data-theme="dark"] .example-box,
html[data-theme="dark"] .exam-tip,
html[data-theme="dark"] .worked-question,
html[data-theme="dark"] .formula-life,
html[data-theme="dark"] .mistake-answer-row,
html[data-theme="dark"] .search-result:hover { background: #202720; }
html[data-theme="dark"] .formula-pitfall { background: #32251f; }
html[data-theme="dark"] .lab-insight,
html[data-theme="dark"] .bar-track { background: #222a24; }
html[data-theme="dark"] .lesson-card p,
html[data-theme="dark"] .lesson-card .outline-item p,
html[data-theme="dark"] .lesson-card .concept-list li,
html[data-theme="dark"] .lesson-card .life-scene,
html[data-theme="dark"] .lesson-card .life-takeaway { color: var(--ink-soft); }
html[data-theme="dark"] .formula-large,
html[data-theme="dark"] .life-model,
html[data-theme="dark"] .exam-tip,
html[data-theme="dark"] .principle-callout,
html[data-theme="dark"] .focus-question,
html[data-theme="dark"] .externality-gap,
html[data-theme="dark"] .lab-results > div,
html[data-theme="dark"] .evaluation-card { background: color-mix(in srgb, var(--topic-color) 18%, var(--card)); }
html[data-theme="dark"] .formula-large,
html[data-theme="dark"] .formula-card-top span:last-child,
html[data-theme="dark"] .formula-life span,
html[data-theme="dark"] .life-model span,
html[data-theme="dark"] .lab-range output,
html[data-theme="dark"] .lab-results strong,
html[data-theme="dark"] .quick-lab-head > span,
html[data-theme="dark"] .life-lab-heading > span { color: #a8d3b8; }
html[data-theme="dark"] .chart-grid-line { stroke: #303a32; }
html[data-theme="dark"] .chart-axis-line { stroke: #677269; }
html[data-theme="dark"] .chart-tick-text { fill: #8d978f; }
html[data-theme="dark"] .chart-axis-label { fill: #bcc5bd; }
html[data-theme="dark"] .guide-line { stroke: #8c968e; }
html[data-theme="dark"] .equilibrium-dot { fill: #eef2ec; stroke: #1a211c; }
html[data-theme="dark"] .equilibrium-halo { stroke: #eef2ec; }
html[data-theme="dark"] .flashcard-front { background: radial-gradient(circle at 80% 10%, rgba(139,198,167,.1), transparent 34%), var(--card); }
html[data-theme="dark"] .button-soft { background: #252c26; border-color: #354037; }
html[data-theme="dark"] .mistake-answer-row,
html[data-theme="dark"] .data-tools,
html[data-theme="dark"] .search-modal-head,
html[data-theme="dark"] .search-modal-foot { border-color: var(--line); }
html[data-theme="dark"] .toast { background: rgba(235,240,234,.95); color: #172019; }

html[data-reading-size="large"] .lesson-card p,
html[data-reading-size="large"] .lesson-card .outline-item p,
html[data-reading-size="large"] .lesson-card .concept-list li,
html[data-reading-size="large"] .lesson-card .objective-list li,
html[data-reading-size="large"] .lesson-card .life-scene,
html[data-reading-size="large"] .lesson-card .life-takeaway,
html[data-reading-size="large"] .detail-card .term-list dd,
html[data-reading-size="large"] .detail-card .exam-list li,
html[data-reading-size="large"] .worked-steps p,
html[data-reading-size="large"] .worked-answer p { font-size: 12px !important; line-height: 1.9 !important; }
html[data-reading-size="large"] .lesson-card h2,
html[data-reading-size="large"] .detail-card h2 { font-size: 27px; }
html[data-reading-size="large"] .topic-hero > p { font-size: 13.5px; }
html[data-reading-size="large"] .quiz-question h3,
html[data-reading-size="large"] .flashcard-face p { font-size: 14px; }

/* Modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 13vh 20px 30px;
  background: rgba(27,31,27,.42); backdrop-filter: blur(5px);
}
.modal-backdrop[hidden] { display: none; }
.modal { width: min(620px, 100%); border: 1px solid #d5d1c5; border-radius: 19px; background: var(--card); box-shadow: 0 30px 90px rgba(20,25,21,.24); animation: modal-in .22s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-7px) scale(.99); } to { opacity: 1; transform: none; } }
.search-modal-card { overflow: hidden; }
.search-modal-head { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.search-modal-head .search-glyph { width: 17px; height: 17px; color: var(--muted); }
#command-search { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
#command-search::placeholder { color: #a3a69e; }
.close-modal { border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 8px; padding: 4px 6px; cursor: pointer; }
.search-results { max-height: 360px; overflow: auto; padding: 8px; }
.search-result {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 11px;
  border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer;
}
.search-result:hover, .search-result.is-selected { background: #efede5; }
.result-num { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--topic-pale); color: var(--topic-color); font-family: var(--serif); font-size: 10px; }
.search-result strong { display: block; font-size: 11px; font-weight: 650; }
.search-result small { display: block; margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.search-result > span:last-child { color: #a0a39c; font-size: 9px; }
.empty-results { padding: 42px 20px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.7; }
.search-modal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.search-modal-foot span { display: flex; align-items: center; gap: 4px; }
.search-modal-foot kbd { padding: 2px 4px; }

.quiz-modal-card { padding: 24px; }
.quiz-modal-top { display: flex; justify-content: space-between; align-items: flex-start; }
.quiz-modal-top h2 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 560; }
.close-round { width: 28px; height: 28px; border-radius: 50%; font-size: 16px; line-height: 1; }
#modal-quiz-content .quiz-tag { margin-top: 22px; }
#modal-quiz-content h3 { margin: 0 0 17px; font-family: var(--serif); font-size: 19px; font-weight: 550; line-height: 1.55; }
#modal-quiz-content .answer-list { grid-template-columns: 1fr; }
#modal-quiz-content .answer-list button { min-height: 45px; font-size: 10.5px; }
.modal-quiz-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.modal-quiz-score { color: var(--muted); font-size: 9px; }
.modal-quiz-score strong { color: var(--green); font-family: var(--serif); font-size: 17px; }

.toast {
  position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  max-width: min(420px, calc(100vw - 40px)); padding: 10px 15px; border-radius: 9px;
  color: #f6f3eb; background: rgba(30,36,32,.94); box-shadow: 0 10px 28px rgba(0,0,0,.2);
  font-size: 10px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .sidebar { width: 218px; }
  :root { --sidebar-width: 218px; }
  .topbar { padding: 0 26px; }
  main { padding: 28px 26px 48px; }
  .search-trigger { width: 220px; }
  .hero { padding: 32px; }
  .lab-layout { grid-template-columns: minmax(0, 1fr) 190px; gap: 15px; }
  .lab-controls { padding-left: 16px; }
  .dashboard-grid, .bottom-grid { grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr); }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-card { min-height: 238px; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.12); }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { height: 64px; padding: 0 20px; }
  .breadcrumb { margin-right: auto; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
  .search-trigger span:not(.search-glyph), .search-trigger kbd { display: none; }
  .date-pill { display: none; }
  main { padding: 24px 20px 44px; }
  .hero { grid-template-columns: 1fr; }
  .mastery-card { max-width: 100%; }
  .dashboard-grid, .bottom-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: 0; }
  .learning-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .learning-step { grid-template-columns: 14px 1fr; border-bottom: 0; border-right: 1px solid #ebe7dc; }
  .learning-step:last-child { border-right: 0; }
  .learning-step > span:last-child { display: none; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-layout { grid-template-columns: 1fr; }
  .topic-side { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
  .topic-actions { grid-column: span 2; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .life-lab-grid { grid-template-columns: 1fr; }
  .formula-library { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { padding: 0 14px; }
  .breadcrumb span, .breadcrumb i { display: none; }
  main { padding: 18px 14px 36px; }
  .hero { padding: 27px 23px; border-radius: 21px; }
  .hero h1 { font-size: 37px; }
  .hero-description { font-size: 12px; }
  .mastery-card { padding: 17px; }
  .mastery-main { gap: 12px; }
  .mastery-ring { width: 82px; height: 82px; }
  .mastery-ring span { font-size: 23px; }
  .market-lab, .quiz-card { padding: 19px 16px; }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-controls { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .lab-controls > .text-button { margin-top: 10px; }
  .chart-caption { padding-left: 7px; }
  .learning-steps { grid-template-columns: 1fr; gap: 0; }
  .learning-step { border-right: 0; border-bottom: 1px solid #ebe7dc; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 215px; }
  .section-heading-row h2 { font-size: 23px; }
  .answer-list { grid-template-columns: 1fr; }
  .topic-hero { padding: 26px 22px; }
  .topic-hero h1 { font-size: 38px; }
  .topic-layout { grid-template-columns: 1fr; }
  .topic-side { grid-template-columns: 1fr; }
  .topic-actions { grid-column: auto; }
  .objective-list { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .worked-card { grid-column: auto; }
  .lesson-card { padding: 22px 20px; }
  .life-lab-card { padding: 22px 18px; }
  .life-lab-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .tool-hero { padding: 28px 22px; }
  .tool-hero h1 { font-size: 36px; }
  .tool-toolbar { align-items: stretch; flex-direction: column; }
  .tool-search { width: 100%; }
  .filter-chips { justify-content: flex-start; }
  .formula-library { grid-template-columns: 1fr; }
  .flashcard { height: 330px; }
  .flashcard-face { padding: 24px 20px; }
  .flashcard-actions { flex-wrap: wrap; }
  .flashcard-actions .button { flex: 1; min-width: 110px; }
  .flashcard-stat { margin-left: 0; }
  .mistake-summary { grid-template-columns: 1fr; }
  .mistake-answer-list { grid-template-columns: 1fr; }
  .data-tools { align-items: flex-start; flex-direction: column; }
  .quick-lab { padding: 20px 17px; }
  .quick-lab-head { align-items: flex-start; flex-direction: column; }
  .quick-lab-grid { grid-template-columns: 1fr; }
  .reader-button { width: 28px; height: 28px; }
  .modal-backdrop { padding-top: 7vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
