:root {
  --bg: #17130d;
  --bg-deep: #100d09;
  --panel: #211b12cc;
  --panel-solid: #241d14;
  --ink: #eee5d4;
  --ink-soft: #d4c9b0;
  --muted: #b8a682;
  --gold: #dfb64f;
  --gold-soft: #e6c374;
  --gold-pale: #f0d896;
  --line: #b39b6740;
  --line-strong: #b39b6766;
  --sage: #8fa38a;
  --rust: #c47a5a;
  --rust-pale: #3a241c;
  --ok: #7dba8f;
  --ok-bg: #1a2b22;
  --bad: #d08972;
  --bad-bg: #2f1d18;
  --shadow: 0 24px 60px #00000055;
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  color-scheme: dark;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { color: #17130d; background: var(--gold-soft); }
:focus-visible { outline: 3px solid #dfb64f88; outline-offset: 3px; }

.skip-link {
  position: fixed; z-index: 100; top: 10px; left: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--gold); color: #17130d;
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

.page-atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%, #6a502d66, transparent 58%),
    radial-gradient(ellipse at 12% 100%, #60451c33, transparent 50%),
    var(--bg);
}
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 420px; height: 420px; right: -170px; top: 100px; background: #dfb64f18; animation: drift 42s linear infinite; }
.orb-two { width: 360px; height: 360px; left: -180px; top: 48%; background: #8fa38a12; animation: drift 56s linear infinite reverse; }
.grid-lines {
  position: absolute; inset: 0; opacity: .22;
  background-image:
    radial-gradient(circle at 18% 24%, #c7ba88 0 1px, transparent 1.6px),
    radial-gradient(circle at 80% 32%, #9eac9d 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 78%, #c7ba88 0 1px, transparent 1.6px);
  background-size: 470px 410px, 570px 610px, 730px 590px;
  animation: drift 48s linear infinite;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, 18px, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px clamp(18px, 4vw, 40px);
  backdrop-filter: blur(14px);
  background: #17130de6;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 15px/1 var(--serif); letter-spacing: .04em; color: var(--ink);
}
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--gold); border-radius: 50%;
  color: var(--gold); font: italic 18px/1 var(--serif);
}
.header-course {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
}
.header-divider { width: 1px; height: 18px; background: var(--line-strong); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.language-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #00000033;
}
.language-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 14px; font-size: 12px; letter-spacing: .04em;
}
.language-switch button[aria-pressed="true"] { background: #dfb64f22; color: var(--gold-soft); }
.home-link {
  font-size: 12px; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid transparent;
}
.home-link:hover { color: var(--gold-soft); border-bottom-color: var(--gold); }

.app-shell { max-width: 1480px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 40px) 80px; }
.course-with-chat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.course-with-chat.chat-open { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
.main-column { min-width: 0; }
.state-panel {
  min-height: 48vh; display: grid; place-content: center; gap: 14px; text-align: center;
  animation: rise .5s ease both;
}
.loading-symbol { display: flex; justify-content: center; gap: 8px; }
.loading-symbol span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--gold);
  animation: pulse 1.1s ease-in-out infinite;
}
.loading-symbol span:nth-child(2) { animation-delay: .15s; }
.loading-symbol span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}
.state-error .state-icon {
  width: 48px; height: 48px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--rust); color: var(--rust);
}
.state-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); transition: background .2s, border-color .2s, transform .2s;
}
.button:hover { border-color: var(--gold); transform: translateY(-1px); }
.button-primary { background: var(--gold); color: #17130d; border-color: var(--gold); font-weight: 650; }
.button-primary:hover { background: var(--gold-soft); }
.button-quiet { color: var(--muted); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }

.course-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 28px 0 18px; animation: rise .7s ease both;
}
.eyebrow {
  margin: 0 0 12px; font-size: 11px; letter-spacing: .22em; color: var(--muted); font-family: var(--sans);
}
#course-title {
  margin: 0; font: normal clamp(40px, 7vw, 64px)/1.05 var(--serif);
  letter-spacing: -1.5px; color: #e9e5d8;
}
.hero-subtitle { margin: 14px 0 0; max-width: 38rem; color: var(--ink-soft); font: italic 17px/1.7 var(--serif); }
.hero-disclaimer { margin: 14px 0 0; max-width: 40rem; color: var(--muted); font-size: 13px; line-height: 1.7; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #00000033;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px #7dba8f88; }

.progress-medallion {
  position: relative; width: 148px; height: 148px;
  display: grid; place-items: center; animation: rise .9s ease both;
}
.progress-medallion svg { width: 148px; height: 148px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #b39b6728; stroke-width: 8; }
.ring-value {
  fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 320; stroke-dashoffset: 320; transition: stroke-dashoffset .6s ease;
}
.medallion-copy {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px;
}
.medallion-copy strong { font: 700 28px/1 var(--serif); color: var(--gold-soft); }
.medallion-copy span { font-size: 11px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }

.dashboard, .track-hub { margin-top: 28px; }
.section-heading {
  display: flex; justify-content: space-between; gap: 18px; align-items: end; flex-wrap: wrap; margin-bottom: 18px;
}
.section-heading h2 { margin: 0; font: 28px/1.2 var(--serif); }
.heading-note { margin: 0; color: var(--muted); max-width: 28rem; font-size: 14px; }
.metric-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.metric-card {
  padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #2a2218cc, #1b160fcc); box-shadow: var(--shadow);
}
.metric-primary { border-color: #dfb64f55; }
.metric-review { border-color: #c47a5a55; }
.metric-label { display: block; color: var(--muted); font-size: 12px; letter-spacing: .08em; margin-bottom: 10px; }
.metric-card strong { display: block; font: 700 28px/1 var(--serif); color: var(--gold-soft); }
.metric-note { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; }

.track-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.track-card {
  text-align: left; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #1d1710cc; transition: border-color .2s, transform .2s, background .2s;
}
.track-card:hover, .track-card.is-active {
  border-color: var(--gold); transform: translateY(-2px); background: #271f14ee;
}
.track-card .track-index {
  display: inline-block; margin-bottom: 10px; color: var(--gold); font-size: 12px; letter-spacing: .16em;
}
.track-card h3 { margin: 0 0 8px; font: 22px/1.25 var(--serif); }
.track-card p { margin: 0; color: var(--muted); font-size: 14px; }
.track-progress {
  margin-top: 16px; height: 4px; border-radius: 999px; background: #b39b6728; overflow: hidden;
}
.track-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); width: 0; transition: width .4s ease; }
.track-meta { margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }

.learning-layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; margin-top: 34px; align-items: start;
}
.course-sidebar, .lesson-panel {
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background: #1c1610d9; box-shadow: var(--shadow);
}
.course-sidebar { padding: 22px 18px; position: sticky; top: 86px; }
.sidebar-heading h2 { margin: 0; font: 22px/1.2 var(--serif); }
.track-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.track-filter button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 10px; font-size: 12px;
}
.track-filter button[aria-pressed="true"] { color: var(--gold-soft); border-color: var(--gold); background: #dfb64f18; }
.section-nav { display: grid; gap: 8px; max-height: min(58vh, 560px); overflow: auto; padding-right: 4px; }
.nav-item {
  display: grid; gap: 4px; text-align: left; width: 100%;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; background: transparent; color: var(--ink-soft);
}
.nav-item:hover { background: #dfb64f10; }
.nav-item.is-active { border-color: #dfb64f55; background: #dfb64f14; color: var(--ink); }
.nav-item small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.nav-item .nav-status { color: var(--gold); font-size: 11px; }
.sidebar-key { display: flex; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.key-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.key-mastered { background: var(--ok); }
.key-started { background: var(--gold); }

.lesson-panel { padding: 28px clamp(18px, 3vw, 32px); min-height: 640px; animation: rise .45s ease both; }
.section-kicker { color: var(--gold); font-size: 12px; letter-spacing: .16em; margin: 0 0 10px; }
.section-title { margin: 0 0 10px; font: 34px/1.2 var(--serif); }
.section-summary { margin: 0 0 22px; color: var(--ink-soft); font: italic 16px/1.7 var(--serif); }
.objective-list { margin: 0 0 24px; padding-left: 18px; color: var(--ink-soft); }
.objective-list li + li { margin-top: 6px; }

.lesson-block {
  border-top: 1px solid var(--line); padding: 4px 0;
}
.lesson-block > summary {
  cursor: pointer; list-style: none; padding: 16px 0; font: 600 18px/1.4 var(--serif); color: var(--gold-soft);
}
.lesson-block > summary::-webkit-details-marker { display: none; }
.lesson-block > summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.lesson-block[open] > summary::after { content: "–"; }
.lesson-body { padding: 0 0 18px; color: var(--ink-soft); }
.lesson-body p { margin: 0 0 12px; }
.lesson-body p:last-child { margin-bottom: 0; }

.glossary-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.glossary-chip {
  border: 1px solid var(--line); background: #00000033; color: var(--gold-soft);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; letter-spacing: .04em;
}
.glossary-chip:hover, .glossary-chip:focus-visible { border-color: var(--gold); background: #dfb64f18; }
.glossary-tip {
  position: fixed; z-index: 40; max-width: 280px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: #2a2218f2; color: var(--ink); font-size: 13px; line-height: 1.55;
  box-shadow: var(--shadow); pointer-events: none;
}

.interactive-panel {
  margin: 22px 0; padding: 18px; border: 1px solid #dfb64f44; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #2b2318, #1a1510);
}
.interactive-panel h3 { margin: 0 0 12px; font: 20px/1.3 var(--serif); color: var(--gold-soft); }
.check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check-list label {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #00000022; cursor: pointer;
}
.check-list input { margin-top: 3px; accent-color: var(--gold); }
.check-progress { margin-top: 12px; color: var(--muted); font-size: 13px; }

.chooser-grid, .scenario-grid { display: grid; gap: 12px; }
.chooser-prompt { margin: 0 0 8px; color: var(--ink-soft); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row button, .scenario-tab {
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 8px 12px;
}
.choice-row button.is-correct, .scenario-tab.is-active { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.choice-row button.is-wrong { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.feedback-line { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.slider-stack { display: grid; gap: 14px; }
.slider-row label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--ink-soft); font-size: 14px; }
.slider-row input[type="range"] { width: 100%; accent-color: var(--gold); }
.allocation-bars { display: grid; gap: 8px; margin-top: 14px; }
.alloc-bar {
  display: grid; grid-template-columns: 120px 1fr 48px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted);
}
.alloc-bar .track { height: 10px; border-radius: 999px; background: #b39b6724; overflow: hidden; }
.alloc-bar .track i { display: block; height: 100%; border-radius: inherit; }

.calc-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px;
}
.calc-grid label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.calc-grid input {
  min-height: 42px; border: 1px solid var(--line); border-radius: 8px;
  background: #0f0c09; padding: 8px 10px; color: var(--ink);
}
.calc-result {
  padding: 12px 14px; border-radius: 10px; background: #dfb64f14; border: 1px solid #dfb64f33; color: var(--ink-soft);
}
.calc-result strong { color: var(--gold-soft); }

.sensitivity-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sensitivity-table th, .sensitivity-table td { border-top: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.sensitivity-table th { color: var(--muted); font-weight: 600; }
.pill {
  display: inline-block; min-width: 52px; text-align: center; padding: 3px 8px; border-radius: 999px; font-size: 12px;
}
.pill-high { background: #c47a5a33; color: #e0a08a; }
.pill-med { background: #dfb64f28; color: var(--gold-soft); }
.pill-low { background: #8fa38a28; color: #b5c7b1; }

.notes-link-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.notes-link {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--gold-soft); font-size: 13px;
}
.notes-link:hover { border-color: var(--gold); background: #dfb64f14; }

.quiz-panel { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--line); }
.quiz-panel h3 { margin: 18px 0 8px; font: 24px/1.25 var(--serif); }
.quiz-intro { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.question {
  padding: 16px 0; border-top: 1px solid var(--line);
}
.question-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.question-prompt { margin: 0 0 12px; font-size: 16px; color: var(--ink); }
.options { display: grid; gap: 8px; }
.option {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #00000022; cursor: pointer;
}
.option:hover { border-color: #dfb64f66; }
.option:has(input:checked) { border-color: var(--gold); background: #dfb64f14; }
.option.correct { border-color: var(--ok); background: var(--ok-bg); }
.option.incorrect { border-color: var(--bad); background: var(--bad-bg); }
.option input { margin-top: 3px; accent-color: var(--gold); }
.fill-input {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px;
  background: #0f0c09; padding: 12px 14px;
}
.boolean-row { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.quiz-result {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #00000033;
}
.quiz-result.ok { border-color: #7dba8f55; background: var(--ok-bg); }
.quiz-result.bad { border-color: #c47a5a55; background: var(--bad-bg); }
.explain { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.section-nav-footer {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line);
}
.read-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0; }
.read-note { color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 50; padding: 12px 18px; border-radius: 999px;
  background: #2a2218f0; border: 1px solid var(--gold); color: var(--gold-soft);
  box-shadow: var(--shadow);
}

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

.exercise-stack { display: grid; gap: 18px; margin: 22px 0; }
.exercise-card {
  border: 1px solid #dfb64f44; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #2b2318, #1a1510); padding: 18px;
}
.exercise-card h3 { margin: 0 0 8px; font: 20px/1.3 var(--serif); color: var(--gold-soft); }
.exercise-prompt { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }
.editor-shell {
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #0c0a08; min-height: 220px;
}
.editor-gutter {
  margin: 0; padding: 14px 8px; list-style: none;
  background: #14100c; color: #6f634c; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right; user-select: none; overflow: hidden;
}
.editor-input {
  width: 100%; min-height: 220px; border: 0; resize: vertical;
  padding: 14px 14px 14px 10px; background: transparent; color: #e8dfc8;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2; outline: none;
}
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px;
}
.editor-toolbar .hotkey-hint { color: var(--muted); font-size: 12px; margin-left: auto; }
.exercise-feedback {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #00000033; font-size: 14px;
}
.exercise-feedback.ok { border-color: #7dba8f55; background: var(--ok-bg); }
.exercise-feedback.bad { border-color: #c47a5a55; background: var(--bad-bg); }
.exercise-feedback ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.assist-box {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px dashed #dfb64f55; background: #dfb64f10; color: var(--ink-soft);
  white-space: pre-wrap; font-size: 14px; line-height: 1.6;
}
.badge-passed {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); font-size: 11px; letter-spacing: .06em;
}

.chat-panel {
  position: sticky; top: 86px; align-self: start;
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100vh - 110px);
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-xl);
  background: #1c1610f2; box-shadow: var(--shadow);
  animation: rise .35s ease both;
}
.chat-header { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.chat-header h2 { margin: 0; font: 22px/1.2 var(--serif); }
.icon-button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 20px; line-height: 1;
}
.chat-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.field-label { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.model-select {
  min-height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: #0f0c09; padding: 8px 10px; color: var(--ink);
}
.chat-thread {
  flex: 1; min-height: 180px; overflow: auto; display: grid; gap: 10px;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #0f0c09aa;
}
.chat-msg {
  padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.55; white-space: pre-wrap;
}
.chat-msg.user { background: #dfb64f18; border: 1px solid #dfb64f33; }
.chat-msg.assistant { background: #00000044; border: 1px solid var(--line); color: var(--ink-soft); }
.chat-msg .meta { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.chat-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-shots img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: #000;
}
.chat-compose textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: #0f0c09; padding: 10px 12px; resize: vertical; min-height: 84px;
}
.chat-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; }
.file-button { cursor: pointer; }

@media (max-width: 1100px) {
  .course-with-chat.chat-open { grid-template-columns: 1fr; }
  .chat-panel { position: static; max-height: none; }
  .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .course-hero { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-layout { grid-template-columns: 1fr; }
  .course-sidebar { position: static; }
}
@media (max-width: 720px) {
  .track-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .header-course { display: none; }
  .alloc-bar { grid-template-columns: 1fr; }
  .editor-toolbar .hotkey-hint { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
