﻿:root {
  --ls-bg: #f7f7f2;
  --ls-bg-2: #eef3ea;
  --ls-paper: rgba(255, 255, 250, 0.92);
  --ls-paper-strong: #fffefa;
  --ls-stage: #eef3ea;
  --ls-stage-grid: rgba(16, 35, 31, 0.08);
  --ls-ink: #10231f;
  --ls-muted: #5f7069;
  --ls-line: rgba(16, 35, 31, 0.12);
  --ls-line-strong: rgba(18, 105, 79, 0.3);
  --ls-primary: #12694f;
  --ls-primary-strong: #0b4335;
  --ls-primary-soft: rgba(18, 105, 79, 0.1);
  --ls-green: #1a8f68;
  --ls-orange: #c98222;
  --ls-shadow-soft: 0 20px 54px rgba(16, 35, 31, 0.1);
  --ls-shadow-card: 0 16px 42px rgba(16, 35, 31, 0.08);
  color: var(--ls-ink);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(143, 199, 173, 0.14), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(246, 240, 222, 0.9), transparent 30%),
    linear-gradient(180deg, var(--ls-bg-2), var(--ls-bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.42;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

code {
  font-family: "JetBrains Mono", "Cascadia Code", monospace;
}

.lesson-page {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.lesson-card {
  background: var(--ls-paper);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: var(--ls-shadow-card);
  backdrop-filter: blur(14px);
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 4px 24px;
}

.platform-brand,
.platform-user,
.platform-nav {
  display: flex;
  align-items: center;
}

.platform-brand {
  gap: 14px;
}

.platform-logo {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #86b99e, #12694f 62%, #c98222);
  box-shadow: 0 20px 36px rgba(20, 108, 82, 0.28);
  overflow: hidden;
}

.platform-logo span {
  position: absolute;
  inset: auto auto 12px 12px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
}

.platform-logo span:nth-child(2) {
  left: 28px;
  bottom: 12px;
  opacity: 0.72;
}

.platform-logo span:nth-child(3) {
  left: 20px;
  bottom: 28px;
  opacity: 0.84;
}

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

.platform-brand-copy strong {
  font-size: 1.8rem;
  font-family: "Sora", "Noto Sans SC", sans-serif;
  letter-spacing: -0.04em;
}

.platform-brand-copy span {
  color: var(--ls-muted);
  font-size: 0.95rem;
}

.platform-nav {
  gap: 30px;
  justify-content: center;
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.platform-nav-link {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 0;
  color: var(--ls-ink);
  text-decoration: none;
  font-weight: 600;
}

.platform-nav-link.is-active {
  color: var(--ls-primary);
}

.platform-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #27936f, #146c52);
}

.platform-user {
  gap: 12px;
}

.platform-icon-button,
.platform-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ls-line);
  background: rgba(255, 255, 255, 0.82);
}

.platform-icon-button {
  cursor: pointer;
  color: var(--ls-muted);
}

.platform-avatar {
  font-weight: 700;
  color: var(--ls-primary);
  box-shadow: 0 14px 26px rgba(20, 108, 82, 0.12);
}

.lesson-hero {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(220px, auto);
  align-items: start;
  gap: 22px;
  padding: 28px 30px;
  margin-bottom: 18px;
}

.lesson-hero-media {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.88), transparent 24%),
    linear-gradient(145deg, rgba(143, 199, 173, 0.18), rgba(20, 108, 82, 0.08));
  display: grid;
  place-items: center;
}

.hero-model-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(145deg, #27936f, #146c52);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 18px 30px rgba(20, 108, 82, 0.22);
}

.lesson-hero-copy {
  display: grid;
  gap: 10px;
  align-self: start;
}

.hero-title-row {
  display: flex;
  align-items: start;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-title-row h1 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
  font-family: "Sora", "Noto Sans SC", sans-serif;
}

.lesson-hero-copy p {
  margin: 0;
  color: var(--ls-muted);
  font-size: 1.02rem;
  max-width: 840px;
}

.review-badge,
.model-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(143, 199, 173, 0.12);
  color: var(--ls-primary);
  border: 1px solid rgba(143, 199, 173, 0.2);
  font-size: 0.92rem;
  font-weight: 600;
}

.lesson-hero-actions,
.model-chip-row,
.import-actions,
.footer-tools,
.qa-score {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lesson-hero-media {
  align-self: start;
}

.lesson-hero-actions {
  align-self: start;
  justify-self: end;
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
}

.lesson-hero-actions .hero-button {
  width: 100%;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid var(--ls-line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ls-ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.hero-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(20, 76, 58, 0.12);
  border-color: var(--ls-line-strong);
}

.hero-button--primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--ls-primary), var(--ls-primary-strong));
  box-shadow: 0 18px 34px rgba(20, 108, 82, 0.28);
}

.hero-button--quiet {
  background: rgba(255, 255, 255, 0.72);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1.55fr) 380px;
  gap: 18px;
  align-items: start;
}

.card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.05em;
  font-family: "Sora", "Noto Sans SC", sans-serif;
}

.card-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 108, 82, 0.08);
  color: var(--ls-primary);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.flow-sidebar,
.content-sidebar {
  padding: 22px;
}

.model-stage-card {
  padding: 22px;
}

@media (min-width: 981px) {
  .workspace-grid {
    --workspace-reference-card-height: 810px;
  }

  .flow-sidebar,
  .content-sidebar {
    height: var(--workspace-reference-card-height);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

.card-header--stage {
  margin-bottom: 18px;
}

.model-chip--interactive {
  background: rgba(25, 169, 116, 0.12);
  border-color: rgba(25, 169, 116, 0.18);
  color: #0e8d5f;
}

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

.tool-rail {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tool-rail-button {
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid var(--ls-line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ls-muted);
  cursor: pointer;
}

.viewer-panel {
  display: grid;
  gap: 16px;
}

.viewer-shell {
  position: relative;
  min-height: 560px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(rgba(20, 108, 82, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 108, 82, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #f6f7f1, #e7eee6);
  border: 1px solid rgba(201, 222, 207, 0.3);
}

#viewerCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 560px;
  z-index: 2;
}

.viewer-grid-floor {
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  z-index: 1;
  background-image:
    linear-gradient(rgba(20, 108, 82, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 108, 82, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.9) 16%, rgba(0, 0, 0, 0.98));
  transform: perspective(560px) rotateX(72deg);
  transform-origin: center top;
}

.viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.viewer-helper {
  margin: 0;
  color: var(--ls-muted);
  font-size: 0.94rem;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hotspot-button {
  position: absolute;
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ls-ink);
  box-shadow: 0 18px 36px rgba(20, 108, 82, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
}

.hotspot-button.active {
  background: linear-gradient(135deg, var(--ls-primary), var(--ls-primary-strong));
  color: #fff;
}

.content-tabs {
  display: flex;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(97, 126, 112, 0.16);
  margin-bottom: 18px;
  overflow-x: auto;
}

.content-tab {
  padding: 0 0 10px;
  border: 0;
  background: transparent;
  color: var(--ls-muted);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.content-tab.is-active {
  color: var(--ls-primary);
  box-shadow: inset 0 -3px 0 var(--ls-primary);
}

.content-block + .content-block {
  margin-top: 22px;
}

#objectives ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

#objectives li {
  color: var(--ls-ink);
  line-height: 1.65;
}

.teaching-note {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(18, 105, 79, 0.08), rgba(247, 247, 242, 0.9));
  border: 1px solid rgba(20, 108, 82, 0.12);
}

.teaching-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ls-primary);
}

.teaching-note p {
  margin: 0;
  color: var(--ls-muted);
}

.section-nav {
  display: grid;
  gap: 14px;
  counter-reset: lesson-step;
}

.section-button {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 6px;
  width: 100%;
  padding: 18px 18px 18px 68px;
  border: 1px solid rgba(97, 126, 112, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ls-ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  counter-increment: lesson-step;
}

.section-button::before {
  content: counter(lesson-step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 108, 82, 0.1);
  color: var(--ls-primary);
  font-weight: 800;
}

.section-button::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -14px;
  width: 2px;
  height: 14px;
  background: rgba(20, 108, 82, 0.16);
}

.section-button:last-child::after {
  display: none;
}

.section-button:hover,
.section-button.active {
  transform: translateY(-1px);
  border-color: rgba(20, 108, 82, 0.26);
  box-shadow: 0 16px 26px rgba(20, 108, 82, 0.1);
}

.section-button.active {
  background: linear-gradient(135deg, var(--ls-primary), var(--ls-primary-strong));
  color: #fff;
}

.section-button.active::before {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.overview-hero {
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(18, 105, 79, 0.06), transparent 46%),
    linear-gradient(135deg, rgba(255, 254, 250, 0.98), rgba(239, 245, 235, 0.98));
  border: 1px solid rgba(20, 108, 82, 0.1);
  margin-bottom: 14px;
}

.overview-hero h3,
.active-section h3,
.structure-card h3 {
  margin: 8px 0 10px;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
  font-family: "Sora", "Noto Sans SC", sans-serif;
}

.overview-hero p,
.overview-row p,
.overview-row strong,
.active-section p,
.structure-card p,
.question-list li {
  margin: 0;
  line-height: 1.7;
}

.overview-grid {
  display: grid;
  gap: 12px;
}

.overview-row {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(247, 242, 232, 0.94);
  border: 1px solid rgba(20, 108, 82, 0.08);
}

.overview-label,
.section-kicker {
  display: inline-flex;
  color: var(--ls-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.active-section {
  display: grid;
  gap: 16px;
}

.active-section-header {
  display: grid;
  gap: 8px;
}

.active-section-copy {
  padding: 18px 18px 0;
  border-radius: 20px;
  background: rgba(247, 242, 232, 0.92);
  border: 1px solid rgba(20, 108, 82, 0.08);
}

.fact-strip {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(20, 108, 82, 0.08);
  color: var(--ls-primary-strong);
  border: 1px solid rgba(20, 108, 82, 0.08);
}

.key-point-list {
  display: grid;
  gap: 12px;
}

.key-point-row {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(97, 126, 112, 0.12);
}

.key-point-row strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.65;
}

.lesson-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.knowledge-board,
.qa-board {
  padding: 22px;
}

#keyStructures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.structure-card {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(239, 245, 235, 0.96));
  border: 1px solid rgba(97, 126, 112, 0.12);
}

.structure-topline {
  display: flex;
  align-items: start;
  gap: 12px;
}

.structure-index {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(20, 108, 82, 0.12);
  color: var(--ls-primary);
  font-size: 0.88rem;
  font-weight: 800;
}

.structure-role,
.structure-look-for {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.qa-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 16px;
}

.question-bank {
  padding: 18px;
  border-radius: 22px;
  background: rgba(247, 242, 232, 0.96);
  border: 1px solid rgba(97, 126, 112, 0.12);
}

.question-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.question-list li::marker {
  color: var(--ls-primary);
  font-weight: 700;
}

#quizPanel {
  display: grid;
  gap: 14px;
}

.quiz-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(97, 126, 112, 0.12);
}

.quiz-card--single,
.quiz-card--complete {
  min-height: 100%;
}

.quiz-card strong {
  display: block;
  margin-bottom: 14px;
  line-height: 1.6;
}

.quiz-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.quiz-progress-label {
  color: var(--ls-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(97, 126, 112, 0.16);
  overflow: hidden;
}

.quiz-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #27936f, #146c52);
}

.quiz-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 108, 82, 0.08);
  color: var(--ls-primary);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(97, 126, 112, 0.16);
  background: rgba(247, 242, 232, 0.94);
  color: var(--ls-ink);
  text-align: left;
  cursor: pointer;
}

.quiz-option.selected {
  border-color: rgba(20, 108, 82, 0.28);
  background: rgba(20, 108, 82, 0.08);
}

.quiz-option.correct {
  border-color: rgba(25, 169, 116, 0.32);
  background: rgba(25, 169, 116, 0.1);
}

.quiz-option.incorrect {
  border-color: rgba(243, 167, 49, 0.32);
  background: rgba(243, 167, 49, 0.12);
}

.quiz-option:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.quiz-action {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, var(--ls-primary), var(--ls-primary-strong));
  color: #fff;
  cursor: pointer;
}

.quiz-note {
  color: var(--ls-muted);
  font-size: 0.92rem;
}

.quiz-feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
}

.quiz-feedback p {
  margin: 0;
  color: inherit;
}

.quiz-feedback.muted {
  background: rgba(247, 242, 232, 0.98);
  color: var(--ls-muted);
  border: 1px solid rgba(97, 126, 112, 0.12);
}

.quiz-feedback.success {
  background: rgba(25, 169, 116, 0.12);
  color: #0d8357;
}

.quiz-feedback.warning {
  background: rgba(243, 167, 49, 0.14);
  color: #8c6308;
}

.quiz-feedback.info {
  background: rgba(20, 108, 82, 0.1);
  color: var(--ls-primary-strong);
}

.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px;
  margin-top: 18px;
}

.footer-tools {
  color: var(--ls-muted);
  font-size: 0.92rem;
}

.footer-tools span:first-child {
  color: var(--ls-ink);
  font-weight: 700;
}

#attribution {
  margin: 0;
  color: var(--ls-muted);
  font-size: 0.88rem;
}

.model-import-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 254, 250, 0.98), rgba(239, 245, 235, 0.98));
  border: 1px solid rgba(20, 108, 82, 0.12);
}

.model-import-copy p,
.import-status {
  margin: 0;
  color: var(--ls-muted);
}

.dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border-radius: 22px;
  border: 1px dashed rgba(20, 108, 82, 0.32);
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
  cursor: pointer;
}

.dropzone.dragging {
  background: rgba(20, 108, 82, 0.08);
  border-style: solid;
}

.dropzone strong {
  font-size: 1.04rem;
}

.import-status {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(97, 126, 112, 0.12);
}

.import-status.success {
  color: #0d8357;
  background: rgba(25, 169, 116, 0.12);
}

.import-status.error {
  color: #b04d2f;
  background: rgba(255, 126, 92, 0.12);
}

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

  .content-sidebar {
    grid-column: 1 / -1;
  }

  .lesson-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .lesson-page {
    width: min(100%, calc(100% - 20px));
  }

  .platform-header,
  .lesson-hero {
    grid-template-columns: 1fr;
  }

  .platform-header {
    display: grid;
    justify-items: start;
  }

  .platform-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .lesson-hero {
    display: grid;
    justify-items: start;
  }

  .lesson-hero-actions {
    justify-self: start;
    min-width: 0;
    width: 100%;
    flex-direction: row;
    align-items: center;
  }

  .lesson-hero-actions .hero-button {
    width: auto;
  }

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

  .stage-layout,
  .qa-grid,
  #keyStructures {
    grid-template-columns: 1fr;
  }

  .tool-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(84px, 1fr);
    overflow-x: auto;
  }

  .viewer-shell,
  #viewerCanvas {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .lesson-page {
    width: min(100%, calc(100% - 16px));
    padding-top: 14px;
  }

  .platform-brand-copy strong {
    font-size: 1.35rem;
  }

  .lesson-hero,
  .flow-sidebar,
  .model-stage-card,
  .content-sidebar,
  .knowledge-board,
  .qa-board,
  .lesson-footer {
    padding: 18px;
  }

  .hero-title-row h1 {
    font-size: 2rem;
  }

  .viewer-shell,
  #viewerCanvas {
    min-height: 340px;
  }

  .platform-nav {
    gap: 18px;
  }
}

/* 2026 lesson workspace redesign */
body {
  color: var(--ls-ink);
  background:
    linear-gradient(rgba(16, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfbf7 0%, #edf4ed 100%);
  background-size: 44px 44px, 44px 44px, auto;
}

body::before {
  opacity: 0;
}

.lesson-page {
  width: min(1500px, calc(100% - 32px));
}

.platform-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 250, 0.78);
  border-radius: 20px;
  background: rgba(255, 255, 250, 0.88);
  box-shadow: 0 14px 38px rgba(16, 35, 31, 0.08);
  backdrop-filter: blur(18px);
}

.platform-logo {
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), transparent 45%),
    linear-gradient(135deg, #86b99e, #12694f 62%, #c98222);
  box-shadow: 0 14px 28px rgba(18, 105, 79, 0.2);
}

.platform-brand-copy strong,
.hero-title-row h1,
.card-header h2 {
  color: var(--ls-ink);
  letter-spacing: -0.035em;
}

.platform-nav {
  gap: 22px;
}

.platform-nav-link {
  color: #304741;
}

.platform-nav-link.is-active {
  color: var(--ls-primary);
}

.platform-nav-link.is-active::after {
  bottom: 0;
  height: 3px;
  background: #12694f;
}

.lesson-card {
  border: 1px solid rgba(16, 35, 31, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 250, 0.9);
  box-shadow: 0 16px 42px rgba(16, 35, 31, 0.08);
  backdrop-filter: blur(14px);
}

.lesson-hero {
  border-left: 6px solid var(--ls-primary);
  background:
    linear-gradient(135deg, rgba(18, 105, 79, 0.06), transparent 46%),
    rgba(255, 255, 250, 0.92);
}

.lesson-hero-media,
.hero-model-badge {
  border-radius: 18px;
}

.hero-model-badge,
.hero-button--primary {
  background: linear-gradient(135deg, #12694f, #0b4335);
  box-shadow: 0 14px 30px rgba(18, 105, 79, 0.22);
}

.hero-button,
.platform-icon-button,
.platform-avatar,
.model-chip,
.review-badge {
  border-radius: 14px;
}

.hero-button {
  font-weight: 750;
}

.hero-button--quiet,
.platform-icon-button,
.platform-avatar {
  background: rgba(255, 255, 250, 0.82);
}

.workspace-grid {
  gap: 16px;
}

.flow-sidebar,
.content-sidebar,
.model-stage-card,
.knowledge-board,
.qa-board,
.lesson-footer {
  border-color: rgba(16, 35, 31, 0.1);
}

.model-stage-card {
  background:
    linear-gradient(135deg, rgba(18, 105, 79, 0.04), transparent 38%),
    rgba(255, 255, 250, 0.9);
}

.viewer-shell {
  border-color: rgba(16, 35, 31, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(var(--ls-stage-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ls-stage-grid) 1px, transparent 1px),
    linear-gradient(180deg, #f6f7f1, #e7eee6);
  background-size: 30px 30px, 30px 30px, auto;
}

.tool-rail-button,
.content-tab,
.structure-card,
.quiz-item,
.question-list li {
  border-radius: 14px;
}

.tool-rail-button {
  background: rgba(255, 255, 250, 0.78);
}

.section-nav-button.is-active,
.content-tab.is-active {
  color: var(--ls-primary);
}

.section-nav-button.is-active {
  border-color: rgba(18, 105, 79, 0.28);
  background: rgba(18, 105, 79, 0.08);
}

.structure-card,
.quiz-item,
.question-list li,
.course-overview-card,
.key-point-card {
  border-color: rgba(16, 35, 31, 0.1);
  background: rgba(255, 255, 250, 0.74);
}

.lesson-bottom-grid {
  gap: 16px;
}

.workspace-grid > *,
.stage-layout > *,
.lesson-bottom-grid > * {
  min-width: 0;
}

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

  .flow-sidebar,
  .model-stage-card,
  .content-sidebar {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .platform-header {
    position: static;
    border-radius: 16px;
  }
}

/* 2026 DESIGN.md reset: lesson cockpit */
:root {
  --ls-bg: #090f0c;
  --ls-bg-2: #111a15;
  --ls-paper: rgba(17, 26, 21, 0.9);
  --ls-paper-strong: #17241d;
  --ls-stage: #0c1510;
  --ls-stage-grid: rgba(0, 217, 146, 0.08);
  --ls-ink: #f4f1e8;
  --ls-muted: #c8d0c7;
  --ls-line: rgba(244, 241, 232, 0.14);
  --ls-line-strong: rgba(0, 217, 146, 0.42);
  --ls-primary: #00d992;
  --ls-primary-strong: #0c6f4f;
  --ls-primary-soft: rgba(0, 217, 146, 0.12);
  --ls-green: #00d992;
  --ls-orange: #d9a441;
  --ls-shadow-soft: none;
  --ls-shadow-card: none;
}

body {
  color: var(--ls-ink);
  background:
    linear-gradient(rgba(244, 241, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 232, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 52% 0%, rgba(0, 217, 146, 0.12), transparent 34rem),
    #090f0c;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

body *,
body *::before,
body *::after {
  letter-spacing: 0 !important;
}

.lesson-page {
  width: min(1500px, calc(100% - 32px));
}

.platform-header,
.lesson-card,
.lesson-hero,
.flow-sidebar,
.content-sidebar,
.model-stage-card,
.knowledge-board,
.qa-board,
.lesson-footer,
.overview-hero,
.structure-card,
.quiz-item,
.question-list li,
.course-overview-card,
.key-point-card,
.model-import-panel {
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  color: var(--ls-ink);
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.035), rgba(244, 241, 232, 0.01)),
    rgba(17, 26, 21, 0.88);
  box-shadow: none;
}

.platform-header {
  top: 12px;
  padding: 12px 16px;
  backdrop-filter: blur(18px);
}

.platform-logo {
  border-radius: 8px;
  background: #00d992;
  box-shadow: none;
}

.platform-logo span {
  border-radius: 2px;
  background: #07110d;
}

.platform-brand-copy strong,
.hero-title-row h1,
.card-header h2,
.overview-hero h3,
.active-section h3,
.structure-card h3 {
  color: var(--ls-ink);
  font-family: Inter, "Plus Jakarta Sans", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  font-weight: 650;
  letter-spacing: 0 !important;
}

.platform-brand-copy span,
.lesson-hero-copy p,
.overview-hero p,
.overview-row p,
.structure-card p,
.quiz-item p,
.question-list li,
.import-status,
.model-import-copy p {
  color: var(--ls-muted);
  line-height: 1.65;
}

.platform-nav {
  gap: 10px;
}

.platform-nav-link,
.platform-icon-button,
.platform-avatar,
.hero-button,
.model-chip,
.content-tab,
.section-nav-button,
.tool-rail-button {
  min-height: 44px;
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  color: var(--ls-ink);
  background: rgba(12, 21, 16, 0.72);
  box-shadow: none;
}

.platform-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  text-decoration: none;
}

.platform-nav-link.is-active,
.content-tab.is-active,
.section-nav-button.is-active,
.tool-rail-button:hover {
  border-color: var(--ls-line-strong);
  color: var(--ls-primary);
  background: rgba(0, 217, 146, 0.1);
}

.platform-nav-link.is-active::after {
  display: none;
}

.lesson-hero {
  border-left: 4px solid var(--ls-primary);
}

.hero-model-badge,
.hero-button--primary {
  border-color: var(--ls-primary);
  color: #07110d;
  background: var(--ls-primary);
  box-shadow: none;
}

.hero-button--quiet,
.platform-icon-button,
.platform-avatar {
  background: rgba(12, 21, 16, 0.72);
}

.card-eyebrow,
.section-kicker,
.mini-label,
.active-section-header span,
.model-chip,
.review-badge {
  color: var(--ls-primary);
  font-family: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.viewer-shell {
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  background:
    linear-gradient(var(--ls-stage-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ls-stage-grid) 1px, transparent 1px),
    radial-gradient(circle at 50% 12%, rgba(0, 217, 146, 0.12), transparent 24rem),
    #0c1510;
  background-size: 30px 30px, 30px 30px, auto, auto;
}

.viewer-grid-floor {
  opacity: 0.58;
}

.hotspot-button {
  border: 1px solid rgba(0, 217, 146, 0.58);
  border-radius: 8px;
  color: #07110d;
  background: var(--ls-primary);
  box-shadow: none;
}

.tool-rail {
  gap: 8px;
}

.structure-index,
.question-list li::marker,
.quiz-index,
.key-point-card strong {
  color: var(--ls-orange);
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  color: var(--ls-ink);
  background: #0c1510;
  box-shadow: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 217, 146, 0.48);
  outline-offset: 3px;
}

.workspace-grid > *,
.stage-layout > *,
.lesson-bottom-grid > * {
  min-width: 0;
}

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

  .platform-header {
    position: static;
  }

  .platform-nav {
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .lesson-page {
    width: min(100%, calc(100% - 16px));
  }

  .hero-title-row h1 {
    font-size: 2rem;
    line-height: 1.12;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Keep the shared site navigation above the lesson stage and side panels. */
.platform-header {
  z-index: 1000;
  isolation: isolate;
  overflow: visible;
}

.platform-nav {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}

.platform-nav-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .platform-header {
    position: sticky;
    top: 8px;
  }

  .platform-nav {
    flex-wrap: wrap;
    overflow: visible;
    padding: 2px 0;
  }
}

/* Generated courseware contrast and viewer controls */
.platform-nav,
.platform-user,
.content-tabs {
  display: none !important;
}

.platform-header {
  justify-content: flex-start;
}

.lesson-page {
  color: #0b1f1a;
}

.lesson-card,
.flow-sidebar,
.content-sidebar,
.model-stage-card {
  color: #0b1f1a;
  background: #fffdf4;
  border-color: rgba(8, 31, 24, 0.18);
}

.platform-brand-copy strong,
.hero-title-row h1,
.card-header h2,
.overview-hero h3,
.overview-row strong,
.structure-card h3,
.active-section h3,
.key-point-row strong,
.quiz-card strong,
.question-list li,
.lesson-card p {
  color: #07120f;
}

.platform-brand-copy span,
.lesson-hero-copy p,
.card-eyebrow,
.overview-label,
.viewer-helper,
.structure-role p,
.structure-look-for p,
.active-section-copy p,
.quiz-note,
.quiz-feedback,
.import-status,
.model-import-copy p,
.dropzone span {
  color: #2f4a43;
}

.model-chip,
.review-badge,
.section-kicker {
  color: #10231f;
  background: #e7f3ec;
  border-color: rgba(8, 31, 24, 0.18);
}

.viewer-shell {
  background:
    linear-gradient(rgba(132, 160, 148, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 160, 148, 0.2) 1px, transparent 1px),
    radial-gradient(circle at 46% 12%, rgba(0, 217, 146, 0.14), transparent 24rem),
    #101a15;
  background-size: 30px 30px, 30px 30px, auto, auto;
}

.tool-rail-button {
  width: 100%;
  min-height: 42px;
  color: #10231f;
  background: #f0f7f1;
  border: 1px solid rgba(8, 31, 24, 0.2);
}

.tool-rail-button:hover,
.tool-rail-button:focus-visible {
  color: #07120f;
  background: #dff2e7;
  border-color: rgba(0, 136, 93, 0.5);
}

.tool-rail-button.is-active {
  color: #04100b;
  background: #00d992;
  border-color: #008f62;
}

.brightness-control {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid rgba(8, 31, 24, 0.2);
  border-radius: 8px;
  color: #10231f;
  background: #fffdf4;
}

.brightness-control span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brightness-control input[type="range"] {
  min-height: auto;
  width: 100%;
  accent-color: #008f62;
  background: transparent;
  box-shadow: none;
}

.viewer-notes-panel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  width: min(360px, calc(100% - 32px));
  max-height: 44%;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(8, 31, 24, 0.2);
  border-radius: 8px;
  color: #10231f;
  background: rgba(255, 253, 244, 0.96);
  box-shadow: 0 18px 44px rgba(8, 31, 24, 0.22);
}

.viewer-notes-panel[hidden] {
  display: none;
}

.viewer-notes-panel strong {
  display: block;
  margin-bottom: 8px;
  color: #07120f;
}

.viewer-notes-panel p,
.viewer-notes-panel li {
  color: #2f4a43;
}

.viewer-notes-panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.hotspot-layer[hidden] {
  display: none;
}

/* Courseware theme repair: align exported lessons with the main Lessons3D dark/cream style. */
body {
  color: #f4f1e8;
  background:
    linear-gradient(rgba(244, 241, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 232, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 52% 0%, rgba(143, 199, 173, 0.18), transparent 34rem),
    linear-gradient(180deg, #071611 0%, #0b2119 48%, #071611 100%);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.lesson-page {
  color: #f4f1e8;
}

.platform-header {
  color: #f4f1e8;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.08), rgba(244, 241, 232, 0.025)),
    rgba(8, 22, 17, 0.92);
  border-color: rgba(244, 241, 232, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.platform-brand-copy strong {
  color: #fbf8ef;
}

.platform-brand-copy span {
  color: #a9d8bf;
}

.lesson-card,
.flow-sidebar,
.content-sidebar,
.model-stage-card,
.knowledge-board,
.qa-board,
.lesson-footer {
  color: #071611;
  background: #fbf8ef;
  border: 1px solid rgba(244, 241, 232, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.hero-title-row h1,
.card-header h2,
.lesson-card h2,
.lesson-card h3,
.lesson-card strong,
.lesson-card p,
.active-section-copy p,
.viewer-helper {
  color: #071611;
}

.lesson-hero-copy p,
.card-eyebrow,
.overview-label,
.quiz-note,
.import-status,
.model-import-copy p,
.dropzone span,
.lesson-footer,
.lesson-footer p,
.footer-tools span {
  color: #385247;
}

.footer-tools span:first-child {
  color: #70847a;
}

#attribution {
  color: #385247;
}

.card-eyebrow,
.model-chip,
.review-badge,
.section-kicker,
.quiz-state,
.qa-score {
  color: #0d3a2a;
  background: rgba(143, 199, 173, 0.16);
  border-color: rgba(18, 105, 79, 0.2);
}

.overview-hero,
.overview-row,
.active-section,
.key-point-row,
.teaching-note,
.model-import-panel,
.structure-card,
.question-list,
.quiz-card {
  color: #071611;
  background: #f3eee3;
  border: 1px solid rgba(7, 22, 17, 0.12);
  box-shadow: none;
}

.overview-hero h3,
.overview-row strong,
.active-section h3,
.key-point-row strong,
.teaching-note strong,
.model-import-panel h2,
.structure-card h3,
.quiz-card strong,
.question-list li {
  color: #071611;
}

.overview-hero p,
.structure-role p,
.structure-look-for p,
.structure-card p,
.active-section p,
.teaching-note p,
.quiz-feedback,
.question-list li {
  color: #304a40;
}

.structure-index,
.question-list li::marker,
.quiz-index {
  color: #c98222;
}

.question-list li {
  background: #fbf8ef;
  border-color: rgba(7, 22, 17, 0.1);
}

.lesson-flow-button {
  color: #304a40;
  background: #fbf8ef;
  border-color: rgba(7, 22, 17, 0.12);
}

.lesson-flow-button.active {
  color: #fbf8ef;
  background: linear-gradient(135deg, #12694f, #0b4335);
  border-color: transparent;
}

.lesson-flow-button.active span,
.lesson-flow-button.active strong {
  color: #fbf8ef;
}

.section-button {
  color: #304a40;
  background: #fbf8ef;
  border-color: rgba(7, 22, 17, 0.12);
}

.section-button::before {
  color: #12694f;
  background: #e7f3ec;
}

.section-button.active {
  color: #fbf8ef;
  background: #0b6d50;
  border-color: transparent;
}

.section-button.active::before {
  color: #fbf8ef;
  background: rgba(255, 255, 255, 0.2);
}

.viewer-shell {
  border-color: rgba(143, 199, 173, 0.28);
  background:
    linear-gradient(rgba(143, 199, 173, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 199, 173, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 48% 14%, rgba(143, 199, 173, 0.16), transparent 24rem),
    #0b1f18;
}

.tool-rail-button {
  color: #123328;
  background: #eef4ec;
  border-color: rgba(7, 22, 17, 0.14);
}

.tool-rail-button:hover,
.tool-rail-button:focus-visible {
  color: #071611;
  background: #dcefe4;
  border-color: rgba(18, 105, 79, 0.42);
}

.tool-rail-button.is-active,
.hero-button--primary {
  color: #fbf8ef;
  background: linear-gradient(135deg, #12694f, #0b4335);
  border-color: transparent;
}

.hero-button--quiet,
.import-actions .hero-button {
  color: #fbf8ef;
  background: #111a15;
  border-color: rgba(17, 26, 21, 0.2);
}

.hero-button--quiet:hover,
.import-actions .hero-button:hover {
  background: #0b4335;
}

.brightness-control,
.dropzone,
.import-status,
.quiz-option {
  color: #071611;
  background: #fbf8ef;
  border-color: rgba(7, 22, 17, 0.14);
}

.brightness-control span,
.dropzone strong {
  color: #123328;
}

.quiz-option {
  color: #304a40;
}

.quiz-option:hover,
.quiz-option.selected {
  color: #071611;
  background: #e7f3ec;
  border-color: rgba(18, 105, 79, 0.28);
}

.quiz-option.correct {
  color: #052017;
  background: #c9f3dc;
  border-color: rgba(18, 105, 79, 0.44);
}

.quiz-option.incorrect {
  color: #481a13;
  background: #ffe1da;
  border-color: rgba(184, 69, 39, 0.34);
}

.viewer-notes-panel {
  color: #071611;
  background: rgba(251, 248, 239, 0.96);
  border-color: rgba(7, 22, 17, 0.14);
}

.viewer-notes-panel strong {
  color: #071611;
}

.viewer-notes-panel p,
.viewer-notes-panel li {
  color: #304a40;
}

.hotspot-button {
  color: #071611;
  background: #00d992;
  border-color: rgba(0, 217, 146, 0.58);
}

html,
body,
.immersive-player {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(143, 199, 173, 0.18), transparent 24rem),
    radial-gradient(circle at 78% 12%, rgba(248, 244, 232, 0.08), transparent 30rem),
    #071611;
}

.immersive-player {
  position: relative;
  isolation: isolate;
  --player-top-safe: 1rem;
  --player-side-gap: 1rem;
  --player-bottom-safe: 1rem;
  --player-drawer-rail-width: 12rem;
  --player-drawer-gap: 1rem;
}

.immersive-stage,
#viewerCanvas {
  position: absolute;
  inset: 0;
}

#viewerCanvas {
  width: 100vw;
  height: 100vh;
}

#viewerCanvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.viewer-grid-floor {
  pointer-events: none;
}

.floating-tool-rail,
.floating-drawer-rail {
  position: fixed;
  z-index: 48;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.floating-tool-rail {
  left: 1rem;
  top: calc(var(--player-top-safe) + 0.75rem);
  bottom: var(--player-bottom-safe);
  width: min(12rem, calc(100vw - 2rem));
  justify-content: flex-start;
  max-height: calc(100vh - var(--player-top-safe) - var(--player-bottom-safe) - 0.75rem);
  overflow: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
}

.floating-drawer-rail {
  right: 1rem;
  top: calc(var(--player-top-safe) + 0.25rem);
  width: min(var(--player-drawer-rail-width), calc(100vw - 2rem));
  max-height: calc(100vh - var(--player-top-safe) - var(--player-bottom-safe));
  overflow: auto;
  padding-left: 0.2rem;
  scrollbar-width: thin;
}

.floating-tool-rail .tool-rail-button,
.floating-drawer-rail .tool-rail-button,
.tool-rail-link,
.drawer-close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  width: 100%;
  padding: 0.75rem 0.95rem;
  text-align: center;
  white-space: nowrap;
  color: #fbf8ef;
  background: rgba(7, 22, 17, 0.46);
  border: 1px solid rgba(248, 244, 232, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.floating-tool-rail .tool-rail-button:hover,
.floating-tool-rail .tool-rail-button:focus-visible,
.floating-drawer-rail .tool-rail-button:hover,
.floating-drawer-rail .tool-rail-button:focus-visible,
.tool-rail-link:hover,
.tool-rail-link:focus-visible,
.drawer-close-button:hover,
.drawer-close-button:focus-visible {
  color: #fbf8ef;
  background: rgba(11, 67, 53, 0.84);
  border-color: rgba(248, 244, 232, 0.92);
}

.floating-tool-rail .tool-rail-button.is-active,
.floating-tool-rail .tool-rail-button[aria-pressed="true"],
.floating-drawer-rail .tool-rail-button[aria-expanded="true"] {
  color: #071611;
  background: rgba(248, 244, 232, 0.94);
  border-color: rgba(248, 244, 232, 0.96);
}

.tool-rail-link {
  text-decoration: none;
}

.brightness-control {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 0.95rem;
  color: #fbf8ef;
  background: rgba(7, 22, 17, 0.46);
  border: 1px solid rgba(248, 244, 232, 0.72);
  border-radius: 1rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.brightness-control span {
  color: #fbf8ef;
}

.brightness-control input {
  width: 100%;
}

.lesson-drawer {
  position: fixed;
  top: calc(var(--player-top-safe) + 0.25rem);
  right: calc(var(--player-side-gap) + var(--player-drawer-rail-width) + var(--player-drawer-gap));
  z-index: 42;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(28rem, calc(100vw - 19rem));
  max-width: calc(100vw - var(--player-drawer-rail-width) - 4rem);
  height: calc(100vh - var(--player-top-safe) - var(--player-bottom-safe) - 0.25rem);
  color: #fbf8ef;
  background: rgba(4, 16, 12, 0.92);
  border: 1px solid rgba(248, 244, 232, 0.18);
  border-radius: 1.4rem;
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 2rem));
  transition:
    transform 220ms ease,
    opacity 180ms ease,
    visibility 0s linear 220ms;
}

.lesson-drawer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition:
    transform 260ms ease,
    opacity 180ms ease,
    visibility 0s linear 0s;
}

.lesson-drawer[hidden] {
  display: none !important;
}

.lesson-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(248, 244, 232, 0.12);
}

.lesson-drawer-header strong {
  color: #fbf8ef;
  font-size: 1rem;
}

.drawer-close-button {
  width: auto;
  min-width: 5.5rem;
}

.lesson-drawer-body {
  overflow: auto;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 164, 65, 0.78) rgba(248, 244, 232, 0.08);
}

.lesson-drawer-body::-webkit-scrollbar,
.floating-tool-rail::-webkit-scrollbar,
.floating-drawer-rail::-webkit-scrollbar {
  width: 12px;
}

.lesson-drawer-body::-webkit-scrollbar-track,
.floating-tool-rail::-webkit-scrollbar-track,
.floating-drawer-rail::-webkit-scrollbar-track {
  background: rgba(248, 244, 232, 0.08);
  border-radius: 999px;
}

.lesson-drawer-body::-webkit-scrollbar-thumb,
.floating-tool-rail::-webkit-scrollbar-thumb,
.floating-drawer-rail::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(217, 164, 65, 0.92), rgba(143, 106, 37, 0.92));
  border: 2px solid rgba(4, 16, 12, 0.88);
  border-radius: 999px;
}

.lesson-drawer-body::-webkit-scrollbar-thumb:hover,
.floating-tool-rail::-webkit-scrollbar-thumb:hover,
.floating-drawer-rail::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(233, 183, 94, 0.98), rgba(172, 128, 42, 0.98));
}

.lesson-drawer-body .structure-card,
.lesson-drawer-body .quiz-card,
.lesson-drawer-body .question-list li {
  color: #fbf8ef;
  background: rgba(248, 244, 232, 0.14);
  border-color: rgba(248, 244, 232, 0.24);
}

.lesson-drawer-body .structure-card h3,
.lesson-drawer-body .structure-card p,
.lesson-drawer-body .quiz-card strong,
.lesson-drawer-body .quiz-card p,
.lesson-drawer-body .question-list li,
.lesson-drawer-body .overview-label,
.lesson-drawer-body .structure-index {
  color: #fbf8ef;
}

.lesson-drawer-body .quiz-feedback.warning,
.lesson-drawer-body .quiz-feedback.success,
.lesson-drawer-body .quiz-feedback.muted {
  color: #1b241f;
  background: rgba(255, 250, 242, 0.88);
  border-color: rgba(205, 187, 150, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.lesson-drawer-body .quiz-option {
  color: #1b241f;
  background: rgba(248, 244, 232, 0.92);
  border-color: rgba(219, 202, 167, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.lesson-drawer-body .quiz-option:hover,
.lesson-drawer-body .quiz-option:focus-visible {
  color: #1b241f;
  background: rgba(243, 236, 219, 0.98);
  border-color: rgba(184, 118, 23, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 8px 18px rgba(82, 60, 18, 0.12);
  transform: translateY(-1px);
}

.lesson-drawer-body .quiz-option.correct,
.lesson-drawer-body .quiz-option.selected {
  color: #071611;
  background: linear-gradient(180deg, rgba(233, 245, 236, 0.98), rgba(215, 238, 222, 0.98));
  border-color: rgba(18, 105, 79, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 22px rgba(18, 105, 79, 0.12);
}

.lesson-drawer-body .quiz-option.incorrect {
  color: #4a2119;
  background: linear-gradient(180deg, rgba(255, 238, 231, 0.98), rgba(252, 226, 214, 0.98));
  border-color: rgba(184, 69, 39, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 22px rgba(184, 69, 39, 0.1);
}

.lesson-drawer-body .quiz-option:disabled {
  opacity: 1;
  cursor: default;
}

.lesson-drawer-body .quiz-feedback strong,
.lesson-drawer-body .quiz-feedback p {
  color: inherit;
}

#lessonQuestions .question-list {
  gap: 0.9rem;
}

#lessonQuestions .question-list li {
  color: #1b241f;
  background: rgba(248, 244, 232, 0.96);
  border: 1px solid rgba(219, 202, 167, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.12);
  line-height: 1.65;
  font-weight: 550;
}

#lessonQuestions .question-list li::marker {
  color: #b87617;
}

#keyStructures .structure-card,
.lesson-drawer-body .script-card {
  color: #1b241f;
  background: rgba(248, 244, 232, 0.96);
  border: 1px solid rgba(219, 202, 167, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.12);
}

.lesson-drawer-body #keyStructures {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

#keyStructures .structure-card h3,
#keyStructures .structure-card p,
#keyStructures .structure-card .overview-label,
#keyStructures .structure-card .structure-index,
.lesson-drawer-body .script-card h3,
.lesson-drawer-body .script-card p,
.lesson-drawer-body .script-card strong,
.lesson-drawer-body .script-step-meta {
  color: #1b241f;
}

#keyStructures .structure-card .structure-index,
.lesson-drawer-body .script-step-meta {
  color: #b87617;
}

#keyStructures .structure-card .overview-label {
  color: #6e5a37;
}

#keyStructures .structure-card .structure-topline {
  align-items: flex-start;
}

#keyStructures .structure-card,
#keyStructures .structure-card .structure-copy,
#keyStructures .structure-card .card-knowledge-block {
  width: 100%;
  box-sizing: border-box;
}

#keyStructures .structure-card h3,
.lesson-drawer-body .script-card h3 {
  line-height: 1.35;
}

.lesson-drawer-body .script-card p {
  line-height: 1.65;
}

.drawer-theme-kicker {
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8f6a25;
}

.card-knowledge-block {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid rgba(205, 187, 150, 0.58);
  border-radius: 0.9rem;
}

.card-knowledge-block strong {
  color: #1b241f;
}

.lesson-drawer-body .card-knowledge-block p,
.lesson-drawer-body .card-knowledge-block li,
.lesson-drawer-body .card-knowledge-block strong,
.lesson-drawer-body .card-knowledge-block .overview-label {
  color: #1b241f;
}

.card-bullets {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.card-bullets--numbered {
  padding-left: 1.45rem;
  gap: 0.75rem;
}

.card-bullets li {
  color: #1b241f;
  line-height: 1.65;
}

.lesson-drawer-body .script-actions {
  padding-top: 0;
  border-top: 0;
  margin-top: -0.1rem;
}

.lesson-drawer-body .script-action {
  color: #fbf8ef;
  background: rgba(7, 22, 17, 0.88);
  border: 1px solid rgba(7, 22, 17, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.lesson-drawer-body .script-action:hover,
.lesson-drawer-body .script-action:focus-visible {
  background: rgba(11, 67, 53, 0.94);
  border-color: rgba(11, 67, 53, 0.98);
}

.script-card,
.task-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  color: #fbf8ef;
  background: rgba(248, 244, 232, 0.08);
  border: 1px solid rgba(248, 244, 232, 0.16);
  border-radius: 1rem;
}

.structure-card--themed,
.quiz-card--integrated,
.script-card {
  gap: 1rem;
}

#keyStructures .structure-card--themed {
  width: 100%;
}

.structure-card--themed .structure-copy,
.quiz-card--integrated {
  display: grid;
  gap: 1rem;
}

.structure-card--themed .structure-topline {
  gap: 0.9rem;
}

.quiz-card--integrated .quiz-progress {
  margin-bottom: 0.1rem;
}

.quiz-card--integrated .quiz-progress-label {
  color: #6e5a37;
}

.quiz-card--integrated .quiz-progress-bar {
  background: rgba(205, 187, 150, 0.35);
}

.quiz-card--integrated .quiz-progress-bar span {
  background: linear-gradient(90deg, rgba(184, 118, 23, 0.92), rgba(143, 106, 37, 0.92));
}

.quiz-card--integrated .quiz-note {
  margin-top: -0.15rem;
}

.integrated-quiz-stack {
  display: grid;
  gap: 1rem;
  margin-top: 0.25rem;
}

.integrated-quiz-item {
  display: grid;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(189, 170, 133, 0.42);
}

.integrated-quiz-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.integrated-quiz-question {
  margin: 0;
  color: #1b241f;
  font-weight: 700;
  line-height: 1.68;
}

.script-step-meta,
.task-meta,
.task-feedback {
  font-size: 0.9rem;
  color: rgba(251, 248, 239, 0.92);
}

.script-card h3,
.task-card h3,
.script-card p,
.task-card p,
.script-card li,
.task-card li {
  color: #fbf8ef;
}

.script-actions,
.task-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.script-action,
.task-action {
  min-height: 2.6rem;
  padding: 0.65rem 0.95rem;
  color: #fbf8ef;
  background: rgba(7, 22, 17, 0.64);
  border: 1px solid rgba(248, 244, 232, 0.68);
  border-radius: 0.9rem;
}

.script-action:hover,
.script-action:focus-visible,
.task-action:hover,
.task-action:focus-visible {
  background: rgba(11, 67, 53, 0.84);
  border-color: rgba(248, 244, 232, 0.92);
}

.script-action:disabled,
.task-action:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.hotspot-button.is-target {
  box-shadow: 0 0 0 4px rgba(251, 248, 239, 0.36);
}

.hotspot-button.is-correct {
  background: #fbf8ef;
  border-color: rgba(248, 244, 232, 0.96);
}

.hotspot-button.is-incorrect {
  background: #ffd7ce;
  border-color: rgba(255, 215, 206, 0.9);
}

.model-import-panel {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 50;
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  color: #fbf8ef;
  background: rgba(7, 22, 17, 0.88);
  border: 1px solid rgba(248, 244, 232, 0.18);
  border-radius: 1.4rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.model-import-panel .card-header h2,
.model-import-panel .card-eyebrow,
.model-import-panel p,
.model-import-panel .model-chip,
.model-import-panel .import-status,
.model-import-panel code,
.model-import-panel strong,
.model-import-panel span {
  color: #fbf8ef;
}

.model-import-panel .dropzone,
.model-import-panel .import-status {
  background: rgba(248, 244, 232, 0.08);
  border-color: rgba(248, 244, 232, 0.16);
}

.viewer-notes-panel {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  max-width: min(28rem, calc(100vw - 12rem));
  color: #fbf8ef;
  background: rgba(7, 22, 17, 0.72);
  border: 1px solid rgba(248, 244, 232, 0.18);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.28);
}

.viewer-notes-panel strong,
.viewer-notes-panel p,
.viewer-notes-panel li {
  color: #fbf8ef;
}

@media (max-width: 900px) {
  .floating-tool-rail,
  .floating-drawer-rail {
    top: auto;
  }

  .floating-tool-rail {
    left: 0.75rem;
    bottom: 0.75rem;
    top: auto;
    width: min(11rem, calc(100vw - 10rem));
    max-height: calc(100vh - 12rem);
  }

  .floating-drawer-rail {
    right: 0.75rem;
    bottom: 0.75rem;
    top: auto;
    width: min(11rem, calc(100vw - 10rem));
    max-height: calc(100vh - 12rem);
  }

  .lesson-drawer {
    top: calc(var(--player-top-safe) + 0.15rem);
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
    height: calc(100vh - var(--player-top-safe) - 0.9rem);
    transform: translateX(calc(100% + 1rem));
  }

  .viewer-notes-panel {
    left: 0.75rem;
    right: 0.75rem;
    transform: none;
    max-width: none;
  }

  .model-import-panel {
    top: calc(var(--player-top-safe) + 0.15rem);
    left: 0.75rem;
    right: 0.75rem;
    bottom: auto;
    width: auto;
    max-height: calc(100vh - var(--player-top-safe) - 10.5rem);
  }
}
