@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Serif+SC:wght@500;600;700;900&display=swap');

:root {
  --paper: #f4f1ea;
  --paper-deep: #ebe5da;
  --ink: #17353a;
  --ink-soft: #496065;
  --ink-faint: #74878a;
  --line: rgba(23, 53, 58, 0.14);
  --card: #fffdf9;
  --teal: #1b3a3f;
  --teal-2: #285158;
  --coral: #ef6b51;
  --coral-deep: #c94e3e;
  --mint: #c4d9c7;
  --mustard: #f4b840;
  --success: #3c8c66;
  --danger: #b6423c;
  --display: 'Noto Serif SC', 'Songti SC', serif;
  --body: 'DM Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 20px 50px rgba(28, 47, 48, 0.08);
  --shadow-card: 0 12px 28px rgba(28, 47, 48, 0.10);
  --focus: #0d6b78;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 0%, rgba(244, 184, 64, 0.16), transparent 25rem),
    radial-gradient(circle at -8% 34%, rgba(196, 217, 199, 0.30), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}

button, a { touch-action: manipulation; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.app-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.home-shell { padding-bottom: 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; padding: 12px 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; }
.brand-mark { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--teal); box-shadow: 5px 5px 0 var(--mustard); transform: rotate(-4deg); }
.brand-mark span:first-child { width: 19px; height: 5px; border-radius: 5px; background: var(--mustard); }
.brand-mark span:last-child { position: absolute; width: 5px; height: 19px; border-radius: 5px; background: var(--mustard); }
.brand-copy { display: grid; gap: 0; line-height: 1.15; }
.brand-copy strong { font-family: var(--display); font-size: 18px; letter-spacing: .05em; }
.brand-copy small { margin-top: 4px; color: var(--ink-faint); font-size: 11px; letter-spacing: .12em; }
.topbar__right { display: flex; align-items: center; gap: 24px; }
.save-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(60, 140, 102, .24); border-radius: 999px; background: rgba(255, 253, 249, .6); color: var(--success); font-size: 12px; font-weight: 700; white-space: nowrap; }
.save-pill .icon { width: 15px; height: 15px; }
.save-pill--dark { border-color: rgba(196, 217, 199, .24); background: rgba(255,255,255,.06); color: var(--mint); }
.text-button, .quiet-button { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 14px; font-weight: 700; }
.text-button:hover, .quiet-button:hover { color: var(--coral-deep); }
.quiet-button { color: var(--ink-faint); font-weight: 500; }

main { display: block; }
.home-section { padding: 24px 0 64px; }
.home-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.home-title { font-family: var(--display); font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.home-count { color: var(--ink-faint); font-size: 14px; font-weight: 600; }

.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.course-card { position: relative; min-width: 0; }
.course-card::before { position: absolute; content: ''; z-index: -1; inset: 12px -8px -8px 8px; border-radius: var(--radius-lg); background: var(--paper-deep); transform: rotate(-1deg); }
.course-card__button { display: block; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-lg); background: var(--card); color: var(--ink); text-align: left; box-shadow: var(--shadow-card); cursor: pointer; transition: transform .22s ease, box-shadow .22s ease; }
.course-card__button:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(28, 47, 48, .14); }
.course-card__button:active { transform: translateY(1px); }

.course-card__visual { position: relative; height: 180px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--teal); color: white; }
.course-card--mint .course-card__visual { background: var(--teal-2); }
.course-card__visual::before { position: absolute; content: ''; width: 220px; height: 220px; top: -60px; right: -40px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 50%; box-shadow: 0 0 0 20px rgba(255, 255, 255, .05); }

.visual-stamp { position: absolute; top: 18px; left: 20px; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--mustard); }
.visual-play-wrapper { position: relative; z-index: 1; }
.visual-play-btn { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(4px); border: 1.5px solid rgba(255, 255, 255, 0.35); color: white; transition: transform .22s ease, background .22s ease, border-color .22s ease; }
.visual-play-btn .icon { width: 26px; height: 26px; margin-left: 3px; }
.course-card__button:hover .visual-play-btn { background: var(--coral); border-color: var(--coral); transform: scale(1.08); }
.visual-tag { position: absolute; bottom: 16px; right: 20px; z-index: 1; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, 0.95); }

.course-card__body { padding: 22px 24px 24px; }
.course-card__title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-card__title-row h3 { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--ink); }
.course-badge { padding: 3px 10px; border-radius: 8px; background: rgba(239, 107, 81, .1); color: var(--coral-deep); font-size: 12px; font-weight: 700; }
.course-card--mint .course-badge { background: rgba(60, 140, 102, .12); color: var(--success); }

.course-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.course-card__progress-label { color: var(--ink-soft); font-size: 13px; }
.course-card__percent { color: var(--coral-deep); font-family: var(--display); font-size: 14px; font-weight: 700; }
.course-card--mint .course-card__percent { color: var(--success); }

.mini-progress { height: 5px; margin-top: 10px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--coral); transition: width .45s ease; }
.course-card--mint .mini-progress span { background: var(--success); }

.course-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.course-card__cta-text { font-size: 14px; font-weight: 700; color: var(--coral-deep); }
.course-card--mint .course-card__cta-text { color: var(--teal-2); }
.course-card__arrow { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; background: var(--paper); color: var(--teal); transition: background .2s ease, transform .2s ease, color .2s ease; }
.course-card__button:hover .course-card__arrow { background: var(--coral); color: white; transform: translateX(3px); }
.course-card--mint .course-card__button:hover .course-card__arrow { background: var(--teal-2); color: white; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 12px 0; color: var(--ink-faint); font-size: 13px; }

.learning-shell { padding-bottom: 32px; }
.learning-topbar { min-height: 58px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 0; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-weight: 700; font-size: 14px; }
.back-button:hover { color: var(--coral-deep); }
.learning-topbar__course { display: flex; align-items: baseline; gap: 8px; color: var(--ink-faint); font-size: 13px; }
.learning-topbar__course strong { color: var(--ink); }
.learning-main { padding: 16px 0 0; }
.learning-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.learning-heading h1 { margin-top: 2px; font-family: var(--display); font-size: clamp(22px, 3vw, 32px); letter-spacing: -.04em; line-height: 1.15; }
.learning-heading .section-label { display: block; font-size: 11px; margin-bottom: 2px; }
.learning-heading__progress { width: 140px; flex: 0 0 auto; }
.learning-heading__progress > span { color: var(--ink-faint); font-size: 11px; }
.learning-heading__progress > strong { float: right; color: var(--coral-deep); font-family: var(--display); font-size: 17px; }
.learning-heading__progress .mini-progress { clear: both; margin-top: 6px; height: 4px; }
.learning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.lesson-main { min-width: 0; }
.video-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--teal); color: #fffaf4; box-shadow: 10px 12px 0 rgba(196, 217, 199, .82), var(--shadow-soft); }
.video-card__topline, .stage-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.video-card__topline { min-height: 48px; padding: 0 18px; color: rgba(255,250,244,.72); font-size: 12px; }
.video-card__topline-left { display: flex; align-items: center; gap: 10px; }
.video-badge { color: var(--mustard); font-weight: 800; letter-spacing: .1em; font-size: 11px; }
.topline-fullscreen-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 250, 244, 0.85); cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.topline-fullscreen-btn:hover { background: rgba(255, 255, 255, 0.2); color: white; }
.topline-fullscreen-btn .icon { width: 16px; height: 16px; }

.video-stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: clamp(280px, 48vh, 500px); background: #09191c; cursor: pointer; overflow: hidden; transition: height 0.25s ease; }
.video-stage.is-portrait { height: clamp(320px, 52vh, 540px); }
.video-stage.is-landscape { height: clamp(220px, 38vh, 420px); }
.video-stage video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #09191c; pointer-events: auto; }
.play-overlay { position: absolute; top: 50%; left: 50%; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(23,53,58,.86); color: white; box-shadow: 0 12px 34px rgba(0,0,0,.28); cursor: pointer; font-weight: 800; font-size: 14px; transform: translate(-50%, -50%); transition: transform .2s ease, background .2s ease; }
.play-overlay:hover { background: var(--coral); transform: translate(-50%, -50%) scale(1.04); }
.play-overlay .icon { width: 20px; height: 20px; }
.video-error { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; gap: 9px; width: min(90%, 440px); padding: 14px; border-radius: 14px; background: rgba(15, 34, 37, .94); color: #fff; font-size: 13px; transform: translate(-50%, -50%); }
.video-error .icon { color: var(--mustard); }
.video-error span { flex: 1; }
.secondary-button--small { min-height: 38px; padding: 6px 10px; border-color: rgba(255,255,255,.3); color: white; font-size: 12px; }
.stage-panel { padding: 14px 18px 16px; border-top: 1px solid rgba(255,255,255,.12); background: rgba(0, 0, 0, 0.12); }
.stage-panel .section-label { color: var(--mint); font-size: 11px; }
.stage-panel__meta { display: flex; align-items: center; gap: 12px; }
.stage-panel__meta > span:first-child { color: var(--mustard); font-size: 12px; font-weight: 800; }
#video-time { color: rgba(255, 250, 244, 0.65); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.stage-tracker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stage-step { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: rgba(255,250,244,.5); font: inherit; text-align: left; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease; }
.stage-step:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.15); transform: translateY(-1px); }
.stage-step__number { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800; }
.stage-step strong, .stage-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-step strong { font-size: 12px; }
.stage-step small { margin-top: 1px; font-size: 10px; opacity: .7; }
.stage-step.is-active { border-color: rgba(244,184,64,.34); background: rgba(244,184,64,.13); color: var(--mustard); }
.stage-step.is-done { color: var(--mint); }
.timeline { position: relative; height: 7px; margin-top: 12px; border-radius: 999px; background: rgba(255,255,255,.16); cursor: pointer; }
.timeline > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--mustard); transition: width .12s linear; }
.timeline i { position: absolute; top: 50%; width: 7px; height: 7px; border: 2px solid var(--teal); border-radius: 50%; background: var(--mint); transform: translate(-50%, -50%); pointer-events: none; }
.completion-note { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-top: 1px solid rgba(255,255,255,.1); color: var(--mint); font-size: 13px; }
.completion-note > .icon { color: var(--mustard); }
.completion-note span { flex: 1; }
.completion-note .text-button { color: var(--mustard); font-size: 12px; white-space: nowrap; }
.lesson-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.lesson-actions .primary-button { min-width: 220px; min-height: 48px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,249,.62); color: var(--ink-soft); cursor: pointer; font-weight: 700; transition: border-color .2s ease, color .2s ease, background .2s ease; }
.secondary-button:hover { border-color: var(--coral); background: var(--card); color: var(--coral-deep); }
.lesson-tip { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: var(--ink-faint); font-size: 12px; }
.lesson-tip .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--coral); }

.lesson-sidebar { position: sticky; top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,249,.72); box-shadow: 0 10px 24px rgba(28,47,48,.05); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; }
.sidebar-head h2 { margin-top: 2px; font-family: var(--display); font-size: 22px; }
.directory-toggle { display: none; align-items: center; gap: 6px; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; }
.sidebar-progress { margin: 0 18px 14px; padding: 12px; border-radius: 12px; background: var(--paper); }
.sidebar-progress__copy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink-faint); font-size: 12px; }
.sidebar-progress__copy strong { color: var(--coral-deep); font-family: var(--display); font-size: 20px; }
.sidebar-progress .progress-track { width: 100%; height: 5px; margin-top: 8px; background: rgba(23,53,58,.12); }
.sidebar-progress .progress-track span { background: var(--coral); }
.sidebar-progress small { display: block; margin-top: 6px; color: var(--ink-faint); font-size: 11px; }
.action-list { max-height: min(56svh, 540px); overflow: auto; margin: 0; padding: 0 10px 12px; list-style: none; scrollbar-color: var(--paper-deep) transparent; }
.action-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.action-item:hover { background: var(--paper); transform: translateX(2px); }
.action-item.is-active { border-color: rgba(239,107,81,.25); background: rgba(239,107,81,.08); }
.action-item__number { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; background: var(--paper); color: var(--ink-faint); font-family: var(--display); font-size: 13px; font-weight: 700; }
.action-item.is-active .action-item__number { background: var(--coral); color: white; }
.action-item.is-done .action-item__number { background: var(--mint); color: var(--success); }
.action-item__copy { min-width: 0; flex: 1; }
.action-item__copy strong, .action-item__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-item__copy strong { font-size: 13px; }
.action-item__copy small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.action-item__state { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; color: var(--success); }
.action-item.is-active .action-item__state { color: var(--coral); }
.action-item__state .icon { width: 15px; height: 15px; }

.loading-screen { display: grid; place-items: center; align-content: center; min-height: 100svh; gap: 12px; color: var(--ink-soft); text-align: center; }
.loading-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 19px; background: var(--teal); color: var(--mustard); font-family: var(--display); font-size: 20px; font-weight: 700; box-shadow: 7px 7px 0 var(--coral); }
.loading-screen--error h1 { font-family: var(--display); font-size: 32px; }
.loading-screen--error p { margin-bottom: 10px; }
.toast { position: fixed; z-index: 20; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 9px; max-width: min(360px, calc(100vw - 40px)); min-height: 48px; padding: 10px 15px; border-radius: 13px; background: var(--teal); color: white; box-shadow: 0 13px 32px rgba(20,35,36,.2); font-size: 13px; animation: toast-in .25s ease-out both; }
.toast .icon { color: var(--mustard); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
[data-reveal] { animation: reveal-up .48s cubic-bezier(.2,.75,.25,1) var(--reveal-delay, 0ms) both; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1050px) {
  .learning-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
  .course-card__visual { height: 170px; }
}

@media (max-width: 820px) {
  .app-shell { width: min(100% - 32px, 680px); }
  .topbar { min-height: 64px; }
  .course-grid { grid-template-columns: 1fr; max-width: 540px; margin: 0 auto; }
  .learning-topbar__course { display: none; }
  .learning-main { padding-top: 14px; }
  .learning-layout { display: flex; flex-direction: column; }
  .lesson-main, .lesson-sidebar { width: 100%; }
  .lesson-sidebar { position: static; }
  .directory-toggle { display: inline-flex; }
  .action-list { max-height: none; }
  .action-list.is-collapsed { display: none; }
}

@media (max-width: 560px) {
  .app-shell { width: calc(100% - 24px); }
  .topbar { padding-top: max(8px, env(safe-area-inset-top)); min-height: 56px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-copy strong { font-size: 17px; }
  .home-section { padding: 18px 0 48px; }
  .home-header { margin-bottom: 20px; }
  .course-card__visual { height: 150px; }
  .course-card__body { padding: 18px 20px 20px; }
  .course-card__title-row h3 { font-size: 21px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 6px; padding: 16px 0 10px; }
  .learning-shell { width: 100%; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .learning-shell .topbar { width: calc(100% - 20px); margin: 0 auto; min-height: 48px; }
  .learning-main { padding-top: 8px; }
  .learning-heading { width: calc(100% - 20px); margin: 0 auto 10px; align-items: center; }
  .learning-heading h1 { font-size: 20px; }
  .learning-heading__progress { width: 105px; }
  .learning-heading__progress > strong { font-size: 15px; }
  .video-card { border-radius: 0; box-shadow: none; }
  .video-card__topline { min-height: 40px; padding: 0 12px; font-size: 11px; }
  .video-stage { height: clamp(240px, 46vh, 440px); }
  .video-stage.is-portrait { height: clamp(280px, 48vh, 460px); }
  .video-stage.is-landscape { height: auto; aspect-ratio: 16 / 9; max-height: 38vh; }
  .stage-panel { padding: 10px 12px 12px; }
  .stage-tracker { gap: 5px; margin-top: 8px; }
  .stage-step { gap: 5px; padding: 7px 5px; }
  .stage-step__number { width: 18px; height: 18px; font-size: 10px; }
  .stage-step strong { font-size: 11px; }
  .stage-step small { font-size: 9px; }
  .timeline { margin-top: 10px; height: 6px; }
  .completion-note { padding: 0 12px; min-height: 40px; font-size: 12px; }
  .lesson-actions { width: calc(100% - 20px); margin: 12px auto 0; flex-direction: row; gap: 8px; }
  .lesson-actions .primary-button { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .lesson-actions .secondary-button { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .lesson-tip { display: none; }
  .lesson-sidebar { width: calc(100% - 20px); margin: 20px auto 0; }
  .sidebar-head { padding: 14px 12px 10px; }
  .sidebar-progress { margin-right: 12px; margin-left: 12px; padding: 10px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .video-stage { height: clamp(180px, 58vh, 260px); }
  .video-stage.is-portrait { height: clamp(180px, 62vh, 280px); }
  .video-stage.is-landscape { height: clamp(160px, 55vh, 240px); }
}

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

@media (prefers-color-scheme: dark) {
  :root { --paper: #182b2e; --paper-deep: #20373a; --ink: #f7f2e9; --ink-soft: #c5d1cc; --ink-faint: #a6b7b4; --line: rgba(236, 244, 239, .18); --card: #213b3f; --teal: #102326; --teal-2: #1b3438; --focus: #f4c85d; --shadow-card: 0 12px 28px rgba(0,0,0,.2); }
  body { background: radial-gradient(circle at 92% 0%, rgba(244,184,64,.09), transparent 25rem), var(--paper); }
  .brand-copy small, .course-card__progress-label, .section-count, .lesson-tip, .action-item__copy small { color: var(--ink-faint); }
  .course-card__button, .secondary-button, .lesson-sidebar { background: var(--card); }
  .course-card::before { background: var(--paper-deep); }
  .course-card__arrow, .action-item__number { background: var(--paper-deep); }
  .course-card--mint .course-card__cta-text { color: var(--mint); }
  .mini-progress { background: rgba(255,255,255,.13); }
}
