/* Reading progress is information, including when reduced motion is enabled.
   Inline spans retain the base text's font, metrics and justification. */
html.atelier-theme body #app .main.page-lesson #lesson-content .st-k-speaking,
html.atelier-theme body #app .main.page-lesson #lesson-content rt.st-k-speaking * {
  color: #d23c3c !important;
}
html.atelier-theme body #app .main.page-lesson .grammar-example > .zh-text { font: inherit; letter-spacing: inherit; color: inherit; }
.grammar-try { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--st-line, #e4e7ed); }
.grammar-try[hidden] { display: none; }
.grammar-try label { display: block; margin-bottom: 12px; }
.grammar-try textarea { display: block; width: 100%; min-height: 100px; resize: vertical; }
.grammar-try .question-actions { display: flex; justify-content: flex-end; }
.grammar-try [aria-live] > .panel { margin: 16px 0 0; }

/* Studio layer. Loaded last. Uses the existing indigo/paper palette only;
   motion is opt-out through the reduce-motion preference and OS setting. */
:root.atelier-theme {
  --st-accent: var(--design-accent, #384c86);
  --st-accent-2: #5b6fae;
  --st-soft: var(--design-soft, #f1f4fa);
  --st-line: var(--design-line, #e4e7ed);
  --st-ink: var(--design-ink, #242935);
  --st-muted: var(--design-muted, #697384);
  --st-warm: var(--design-warm, #b08653);
  --st-ok: var(--design-success, #30735d);
  --st-bad: var(--design-danger, #b74255);
  --st-t1: #b74255; --st-t2: #a8762f; --st-t3: #2f7a5f; --st-t4: #384c86; --st-t0: #8a93a3;
  --st-ease: cubic-bezier(.2,.8,.2,1);
  --st-spring: cubic-bezier(.34,1.56,.64,1);
}

/* ---------- reveal + spotlight ---------- */
html.atelier-theme body .st-reveal { opacity: 0; translate: 0 14px; transition: opacity .55s var(--st-ease) var(--st-delay,0ms), translate .6s var(--st-ease) var(--st-delay,0ms); }
html.atelier-theme body .st-reveal.st-in { opacity: 1; translate: none; }
html.atelier-theme body .shell .main[class] :is(.vocab-card,.course-card,.account-tile,.question,.package) {
  background-image: radial-gradient(260px circle at var(--mx,-400px) var(--my,-400px), rgb(56 76 134 / 5.5%), transparent 62%);
}
html.atelier-theme body .shell .main[class] :is(.vocab-card,.course-card,.account-tile) { transition: transform .25s var(--st-ease), box-shadow .25s var(--st-ease), border-color .2s ease; }
html.atelier-theme body .shell .main[class] :is(.vocab-card,.course-card,.account-tile):hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(31 45 75 / 8%); }

/* ---------- scroll progress ---------- */
html.atelier-theme body .st-scroll { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 2px; pointer-events: none; }
html.atelier-theme body .st-scroll i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--st-accent), #8fa2d6 70%, var(--st-warm)); box-shadow: 0 0 8px rgb(56 76 134 / 35%); }

/* ---------- palette trigger in the top bar ---------- */
html.atelier-theme body .topbar .st-kbd {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; margin-right: 4px;
  border: 1px solid var(--st-line); border-radius: 10px; background: #fff; color: var(--st-muted); cursor: pointer; font: inherit; font-size: 12px;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
html.atelier-theme body .topbar .st-kbd:hover { color: var(--st-accent); border-color: #c7d3e8; background: var(--st-soft); }
html.atelier-theme body .topbar .st-kbd .icon { width: 15px; height: 15px; }
html.atelier-theme body :is(.topbar .st-kbd, .st-palette) kbd { font: 600 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; padding: 4px 6px; border: 1px solid var(--st-line); border-bottom-width: 2px; border-radius: 6px; background: #fafbfd; color: #5d6779; }
@media (max-width: 760px) { html.atelier-theme body .topbar .st-kbd { display: none; } }

/* ---------- command palette ---------- */
html.atelier-theme body .st-palette { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: start center; padding: min(16vh,140px) 16px 16px; }
html.atelier-theme body .st-palette-backdrop { position: absolute; inset: 0; background: rgb(28 34 50 / 22%); backdrop-filter: blur(3px); opacity: 0; transition: opacity .16s ease; }
html.atelier-theme body .st-palette-box { position: relative; width: min(600px,100%); overflow: hidden; border: 1px solid #dfe4ec; border-radius: 18px; background: #fff; box-shadow: 0 28px 70px rgb(24 32 56 / 22%); opacity: 0; transform: translateY(-8px) scale(.985); transition: opacity .18s ease, transform .22s var(--st-ease); }
html.atelier-theme body .st-palette.open :is(.st-palette-backdrop,.st-palette-box) { opacity: 1; transform: none; }
html.atelier-theme body .st-palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--st-line); color: var(--st-muted); }
html.atelier-theme body .st-palette-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent; color: var(--st-ink); font: inherit; font-size: 16px; }
html.atelier-theme body .st-palette ul { max-height: 360px; overflow: auto; margin: 0; padding: 8px; list-style: none; }
html.atelier-theme body .st-palette li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #3c4658; cursor: pointer; font-size: 14px; }
html.atelier-theme body .st-palette li small { margin-left: auto; color: var(--st-muted); font-size: 12px; }
html.atelier-theme body .st-palette li .icon { width: 17px; height: 17px; color: var(--st-muted); }
html.atelier-theme body .st-palette li[aria-selected="true"] { background: var(--st-soft); color: var(--st-accent); box-shadow: inset 3px 0 0 var(--st-accent); }
html.atelier-theme body .st-palette li[aria-selected="true"] .icon { color: var(--st-accent); }
html.atelier-theme body .st-palette li.st-empty { color: var(--st-muted); cursor: default; }
html.atelier-theme body .st-palette footer { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--st-line); background: #fafbfc; color: var(--st-muted); font-size: 11.5px; }
html.atelier-theme body .st-palette footer kbd { margin-right: 2px; }

/* ==========================================================
   LESSON SHELL
   ========================================================== */
/* Sliding chapter indicator replaces the per-tab underline. The tab bar is
   static in workspace.css; `top: auto` cancels the inherited sticky offset. */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .tabs.st-has-ink { position: relative; top: auto; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .tabs.st-has-ink .tab.active::after { opacity: 0; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .tabs.st-has-ink .tab.active { background: transparent; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .tabs.st-has-ink .tab { position: relative; z-index: 1; transition: color .2s ease, background .2s ease; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .tabs .st-ink {
  position: absolute; z-index: 0; left: 0; top: 0; bottom: 6px; border-radius: 10px; pointer-events: none;
  background: var(--st-soft); box-shadow: inset 0 0 0 1px #e1e8f5;
  transition: transform .42s var(--st-spring), width .42s var(--st-ease);
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .tabs .st-ink::after {
  content: ""; position: absolute; left: 18%; right: 18%; bottom: 2px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--st-accent), var(--st-accent-2)); translate: var(--st-peek,0px) 0; transition: translate .3s var(--st-ease);
}

/* Learning path: five chapters and practice joined by one drawn line. */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-overview.st-railed { flex-wrap: wrap; row-gap: 12px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-overview.st-railed .lesson-progress-track { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-overview.st-railed .lesson-current-section { display: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail { position: relative; flex: 1 1 520px; min-width: 0; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail ol { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; padding: 0; list-style: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-track { position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 14px; height: 2px; border-radius: 2px; background: #e6eaf2; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-track i {
  position: absolute; inset: 0; border-radius: inherit; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--st-accent), var(--st-accent-2)); transform: scaleX(calc(var(--st-from) * 1.2)); transition: transform 1.1s var(--st-ease) .15s;
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail.st-go .st-rail-track i { transform: scaleX(min(1, calc(var(--st-to) * 1.2))); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-track b {
  position: absolute; top: -2px; left: 0; width: 46px; height: 6px; border-radius: 6px; opacity: 0;
  background: radial-gradient(closest-side, rgb(255 255 255 / 95%), transparent); animation: st-rail-glint 3.6s var(--st-ease) 1.4s 1 both;
}
@keyframes st-rail-glint { 0% { left: 0; opacity: 0 } 12% { opacity: 1 } 70% { opacity: 1 } 100% { left: calc(min(1, var(--st-to) * 1.2) * 100% - 46px); opacity: 0 } }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node { position: relative; display: flex; justify-content: center; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node button {
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 0; padding: 0 2px; border: 0; background: none; color: var(--st-muted); cursor: pointer; font: inherit; box-shadow: none;
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-dot {
  position: relative; display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid #d7deea; border-radius: 50%; background: #fff;
  color: #8b95a6; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; transition: transform .3s var(--st-spring), border-color .2s, background .2s, color .2s;
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-dot .icon { width: 14px; height: 14px; stroke-width: 2.4; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-label { font-size: 11.5px; line-height: 1.3; white-space: nowrap; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node button:hover .st-dot { transform: translateY(-2px) scale(1.06); border-color: #9fb0d6; color: var(--st-accent); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.done .st-dot { border-color: var(--st-accent); background: var(--st-accent); color: #fff; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.done .st-rail-label { color: #4b5873; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.active .st-dot { border-color: var(--st-accent); color: var(--st-accent); box-shadow: 0 0 0 5px rgb(56 76 134 / 10%); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.active.done .st-dot { color: #fff; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.active .st-dot::after { content: ""; position: absolute; inset: -6px; border: 1.5px solid rgb(56 76 134 / 35%); border-radius: 50%; animation: st-ping 2.4s var(--st-ease) 1 both; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.active .st-rail-label { color: var(--st-accent); font-weight: 650; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node.practice .st-dot { border-style: dashed; }
@keyframes st-ping { 0% { transform: scale(.85); opacity: .9 } 80%, 100% { transform: scale(1.35); opacity: 0 } }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-node .st-dot { animation: st-node-in .5s var(--st-spring) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes st-node-in { from { transform: scale(.6); opacity: 0 } }

/* Shared entrance for auxiliary learning cards. Chapter transitions use the viewport. */
@keyframes st-chapter-in { from { opacity: 0; translate: 0 10px } }

/* A compact toolbar above every chapter; the reading column stays centered. */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-layout { display: block; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content { width: 100%; max-width: 800px; margin: 0 auto; min-width: 0; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-layout > .lesson-tools { position: relative; top: auto; display: flex; align-items: center; gap: 6px; width: 100%; margin: 0 0 16px; padding: 7px 8px; border: 1px solid #e3e8f0; border-radius: 12px; background: #fff; box-shadow: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools-content { display: flex; flex: 1; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; padding: 0; border: 0; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools [hidden] { display: none !important; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .lesson-tool-field { display: flex !important; flex: none; align-items: center; gap: 5px; width: auto; min-height: 30px; margin: 0; color: #66718a; font-size: 11px !important; white-space: nowrap; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .lesson-tools-toggles { display: flex; align-items: center; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson :is(.lesson-tools-toggle, .lesson-tools-more) { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 5px; min-height: 30px; padding: 3px 6px; border: 0; border-radius: 7px; background: #f5f7fb; color: var(--st-accent); cursor: pointer; font: inherit; font-size: 11px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools[data-open="true"] .lesson-tools-toggle [data-i18n] { display: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools-toggle[aria-expanded="true"] > [aria-hidden] { transform: scaleY(-1); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
html.atelier-theme body #app .shell.workspace-shell .main[class].page-lesson .lesson-tools .lesson-tools-actions .btn { display: inline-flex; width: auto; min-height: 30px !important; padding: 4px 7px !important; margin: 0; gap: 4px; font-size: 11px !important; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .lesson-tools-actions .icon { width: 13px; height: 13px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools-progress { margin-left: auto; color: #8993a6; font-size: 10px; white-space: nowrap; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools-extra { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; display: grid; gap: 5px; width: 210px; padding: 8px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fff; box-shadow: 0 8px 25px rgb(31 45 75 / 12%); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .lesson-tools-extra .btn { width: 100%; margin: 0; min-height: 32px; font-size: 12px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content figure { margin-left: auto; margin-right: auto; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .st-seg-field { display: flex !important; align-items: center; gap: 5px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .st-seg-field :is(select, .hb-select) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; opacity: 0 !important; pointer-events: none !important; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-seg { position: relative; display: flex; padding: 1px; border: 1px solid #e3e8f0; border-radius: 8px; background: #f5f7fb; isolation: isolate; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-seg button {
  position: relative; z-index: 1; flex: 1; min-width: 0; min-height: 28px; padding: 3px 4px; border: 0; border-radius: 8px; background: transparent; box-shadow: none;
  color: #66718a; cursor: pointer; font: inherit; font-size: 11px; font-weight: 550; transition: color .2s ease;
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-seg button.on { color: var(--st-accent); font-weight: 650; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-seg button:disabled { cursor: not-allowed; opacity: .5; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-seg-thumb { position: absolute; z-index: 0; top: 1px; bottom: 1px; left: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgb(31 45 75 / 12%), 0 0 0 1px #e1e7f1; transition: transform .35s var(--st-spring), width .3s var(--st-ease); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; }
html.atelier-theme body .st-switch { display: flex !important; align-items: center; gap: 4px; margin: 0; min-height: 30px; white-space: nowrap; cursor: pointer; color: #4d586d; font-size: 11px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .lesson-tools .st-switch { font-size: 11px !important; }
html.atelier-theme body .st-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
html.atelier-theme body .st-switch-ui { position: relative; flex: none; width: 32px; height: 18px; border-radius: 18px; background: #dde3ee; transition: background .2s ease; }
html.atelier-theme body .st-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 18%); transition: transform .28s var(--st-spring); }
html.atelier-theme body .st-switch input:checked + .st-switch-ui { background: var(--st-accent); }
html.atelier-theme body .st-switch input:checked + .st-switch-ui::after { transform: translateX(14px); }
html.atelier-theme body .st-switch input:focus-visible + .st-switch-ui { outline: 2px solid #526caf; outline-offset: 2px; }

/* ---------- tones (1 red · 2 gold · 3 green · 4 blue) ---------- */
html.atelier-theme body :is(.st-t1) { color: var(--st-t1) !important; }
html.atelier-theme body :is(.st-t2) { color: var(--st-t2) !important; }
html.atelier-theme body :is(.st-t3) { color: var(--st-t3) !important; }
html.atelier-theme body :is(.st-t4) { color: var(--st-t4) !important; }
html.atelier-theme body :is(.st-t0) { color: var(--st-t0) !important; }
html.atelier-theme body ruby.st-char:is(.st-t1,.st-t2,.st-t3,.st-t4,.st-t0) { color: inherit !important; }
html.atelier-theme body ruby.st-char.st-t1 rt { color: var(--st-t1); } html.atelier-theme body ruby.st-char.st-t2 rt { color: var(--st-t2); }
html.atelier-theme body ruby.st-char.st-t3 rt { color: var(--st-t3); } html.atelier-theme body ruby.st-char.st-t4 rt { color: var(--st-t4); }
html.atelier-theme body ruby.st-char.st-t0 rt { color: var(--st-t0); }
html.atelier-theme body .st-tones-off :is(.st-t1,.st-t2,.st-t3,.st-t4,.st-t0),
html.atelier-theme body .st-tones-off ruby.st-char rt { color: var(--st-muted) !important; }

/* ==========================================================
   ARTICLE
   ========================================================== */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content { position: relative; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph { position: relative; padding-left: 0; border-radius: 12px; transition: opacity .3s ease, background .3s ease; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph::before {
  content: ""; position: absolute; left: -18px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--st-accent), var(--st-accent-2));
  transform: scaleY(0); transform-origin: 50% 0; transition: transform .35s var(--st-ease);
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph:hover::before { transform: scaleY(1); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph .translation { transition: color .25s ease, border-color .25s ease, background .25s ease; border-left: 2px solid transparent; padding-left: 12px; margin-left: -14px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph:hover .translation { color: #33405a; border-left-color: #b8c5e2; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content.st-focus .article-paragraph { opacity: .38; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content.st-focus .article-paragraph:is(:hover, :focus-within) { opacity: 1; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content.st-focus .lesson-body:not(:hover) .article-paragraph:first-of-type { opacity: 1; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-para-tools { position: absolute; right: -8px; top: -30px; display: flex; align-items: center; gap: 8px; opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .25s var(--st-ease); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph:is(:hover, :focus-within) .st-para-tools { opacity: 1; transform: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-para-index { color: #a6afbf; font: 600 11px/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-icon-btn {
  display: grid; place-items: center; width: 30px; height: 30px; min-height: 0; padding: 0; border: 1px solid #dfe5ef; border-radius: 9px; background: #fff; color: var(--st-accent); cursor: pointer; box-shadow: 0 2px 6px rgb(31 45 75 / 6%);
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-icon-btn:hover { background: var(--st-soft); border-color: #c4d0e7; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-icon-btn .icon { width: 15px; height: 15px; }
@media (hover: none) { html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-para-tools { opacity: 1; transform: none; top: -26px; right: 0; } }

/* Aligned ruby: full-text pinyin sits above each character. */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph.st-ruby > .pinyin-line { display: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .article-paragraph.st-ruby .zh-text { line-height: 2.75; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content ruby.st-char { ruby-align: center; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content ruby.st-char rt { font-size: 11.5px; letter-spacing: -.01em; font-family: Inter, "Segoe UI", Arial, sans-serif; font-weight: 500; opacity: .95; }

/* Glossary words, occurrence links and the hover card. */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .glossary-word { position: relative; transition: background .2s ease, color .2s ease, box-shadow .25s ease; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .glossary-word:is(.st-linked, .st-origin) { background: transparent !important; box-shadow: none !important; border-radius: 0; border-bottom: 2px solid #b8c7e6; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .glossary-word.st-origin { border-bottom-color: var(--st-accent); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content > svg.st-links { position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none; overflow: visible; }
html.atelier-theme body .st-links .st-link { fill: none; stroke: rgb(56 76 134 / 55%); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: round; animation: st-draw .55s var(--st-ease) forwards; animation-delay: calc(var(--i) * 70ms); }
html.atelier-theme body .st-links .st-link-dot { fill: var(--st-accent); filter: drop-shadow(0 0 3px rgb(56 76 134 / 55%)); }
@keyframes st-draw { to { stroke-dashoffset: 0; } }
html.atelier-theme body .st-gloss {
  position: fixed; z-index: 900; box-sizing: border-box; width: 272px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overflow-wrap: anywhere; padding: 11px 12px; border: 1px solid #dfe4ed; border-radius: 14px; background: rgb(255 255 255 / 97%);
  box-shadow: 0 18px 44px rgb(24 32 56 / 16%), 0 2px 6px rgb(24 32 56 / 6%); color: var(--st-ink); backdrop-filter: blur(8px);
  animation: st-pop-in .22s var(--st-ease) both; transform-origin: var(--arrow) 100%;
}
html.atelier-theme body .st-gloss.below { transform-origin: var(--arrow) 0; }
@media (max-width: 600px) { html.atelier-theme body .st-gloss { width: min(320px, calc(100vw - 24px)); } }
html.atelier-theme body .st-gloss::after { content: ""; position: absolute; left: calc(var(--arrow) - 7px); bottom: -7px; width: 12px; height: 12px; border: solid #dfe4ed; border-width: 0 1px 1px 0; background: #fff; transform: rotate(45deg); }
html.atelier-theme body .st-gloss.below::after { bottom: auto; top: -7px; border-width: 1px 0 0 1px; }
@keyframes st-pop-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }
html.atelier-theme body .st-gloss-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
html.atelier-theme body .st-gloss-head strong { font-size: 23px; font-weight: 650; letter-spacing: .02em; }
html.atelier-theme body .st-gloss-hsk { padding: 3px 8px; border-radius: 7px; background: var(--st-soft); color: var(--st-accent); font-size: 11px; font-weight: 650; }
html.atelier-theme body .st-gloss-py { margin: 2px 0 0; font-size: 14px; font-weight: 550; letter-spacing: .02em; }
html.atelier-theme body .st-gloss-en { margin: 4px 0 0; color: #3d5180; font-size: 13px; line-height: 1.45; }
html.atelier-theme body .st-gloss-ex { margin: 6px 0 0; padding: 6px 8px; border-radius: 8px; background: #f7f8fb; color: #4a5468; font-size: 12px; line-height: 1.55; }
html.atelier-theme body .st-gloss-actions { display: flex; gap: 6px; margin-top: 8px; }
html.atelier-theme body .st-gloss-actions button { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 1px solid #dfe5ef; border-radius: 10px; background: #fff; color: var(--st-accent); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; transition: background .16s ease, border-color .16s ease; }
html.atelier-theme body .st-gloss-actions button:hover { background: var(--st-soft); border-color: #c4d0e7; }
html.atelier-theme body .st-gloss-actions button:last-child { color: #fff; border-color: var(--st-accent); background: var(--st-accent); }
html.atelier-theme body .st-gloss-actions button:last-child:hover { background: var(--design-accent-hover, #2e3f70); }
html.atelier-theme body .st-gloss-actions .icon { width: 14px; height: 14px; }

/* Feedback stays with the question or writing card. */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .question-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .question-actions .btn { margin: 0; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .question-actions :is([data-ai-answer], [data-action="grade-writing"]) { order: 2; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .writing-grid { display: block; }
html.atelier-theme body .inline-task-status { margin: 10px 0 0; padding: 10px 12px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fafbfd; color: #66718a; font-size: 12px; }
html.atelier-theme body .inline-task-status p { margin: 0; font-size: 12px; line-height: 1.5; }
html.atelier-theme body .inline-task-status .btn { margin: 6px 0 0; }
html.atelier-theme body .inline-task-skeleton { display: grid; gap: 5px; margin-top: 8px; }
html.atelier-theme body .inline-task-skeleton i { display: block; width: 82%; height: 6px; border-radius: 5px; background: #e9edf5; }
html.atelier-theme body .inline-task-skeleton i:last-child { width: 58%; }
html.atelier-theme body .inline-task-status[data-state="failed"] { border-color: #edcbd2; background: #fff8f9; }
html.atelier-theme body .inline-task-status[data-state="done"] { display: none; }
html.atelier-theme body .st-web-stage .st-node.is-selected { border-color: var(--st-accent); box-shadow: 0 0 0 3px rgb(56 76 134 / 10%); }
html.atelier-theme body .st-web-definition { margin-top: 10px; padding: 10px 14px; border: 1px solid #dbe3f1; border-radius: 12px; background: #f7f9fd; }
html.atelier-theme body .st-web-definition[hidden] { display: none; }
html.atelier-theme body .st-web-definition-head { display: flex; align-items: center; gap: 10px; }
html.atelier-theme body .st-web-definition-head .pinyin-line { margin: 0; font-size: 13px; }
html.atelier-theme body .st-web-definition p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; }

/* ==========================================================
   VOCABULARY
   ========================================================== */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .pinyin-line.st-syllables { color: var(--st-muted); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-wordweb { margin-bottom: 22px; overflow: hidden; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-web-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 4px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-web-head h3 { margin: 6px 0 4px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-web-head p { margin: 0; color: var(--st-muted); font-size: 12.5px; line-height: 1.7; }
html.atelier-theme body .st-web-legend { display: flex; gap: 14px; color: var(--st-muted); font-size: 11.5px; }
html.atelier-theme body .st-web-legend span { display: inline-flex; align-items: center; gap: 6px; }
html.atelier-theme body .st-web-legend i { width: 9px; height: 9px; border-radius: 50%; }
html.atelier-theme body .st-web-legend i.lv-a, html.atelier-theme body .st-node.lv-a::before { background: #7f93c8; }
html.atelier-theme body .st-web-legend i.lv-b, html.atelier-theme body .st-node.lv-b::before { background: var(--st-accent); }
html.atelier-theme body .st-web-legend i.lv-c, html.atelier-theme body .st-node.lv-c::before { background: var(--st-warm); }
html.atelier-theme body .st-web-stage { position: relative; width: 100%; max-width: 1040px; margin: 0 auto; }
html.atelier-theme body .st-web-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
html.atelier-theme body .st-web-orbit { fill: none; stroke: #e7ebf3; stroke-width: 1; stroke-dasharray: 3 7; animation: none; transform-origin: center; transform-box: fill-box; }
@keyframes st-orbit { to { stroke-dashoffset: -600; } }
html.atelier-theme body .st-web-spoke { fill: none; stroke: #cdd6ea; stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke .25s ease, stroke-width .25s ease, opacity .25s ease; }
html.atelier-theme body .st-web-spoke.lv-c { stroke: #e2d3bd; }
html.atelier-theme body .st-web-chord { fill: none; stroke: #b8c4e0; stroke-width: calc(.6px + var(--w) * .35px); stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .7; transition: stroke .25s ease, opacity .25s ease; }
html.atelier-theme body .st-web-stage.st-go .st-web-spoke { animation: st-draw .8s var(--st-ease) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
html.atelier-theme body .st-web-stage.st-go .st-web-chord { animation: st-draw 1.1s var(--st-ease) calc(var(--i) * 90ms + 700ms) 1 both; }
@keyframes st-flow { from { stroke-dasharray: .04 .03; stroke-dashoffset: 0; } to { stroke-dasharray: .04 .03; stroke-dashoffset: -.07; } }
html.atelier-theme body .st-web-pulse { fill: var(--st-accent-2); opacity: .65; }
html.atelier-theme body .st-web-pulse.lv-c { fill: var(--st-warm); }
html.atelier-theme body .st-web-stage.is-focus .st-web-spoke:not(.is-hot), html.atelier-theme body .st-web-stage.is-focus .st-web-chord:not(.is-hot) { opacity: .18; }
html.atelier-theme body .st-web-stage .st-web-spoke.is-hot { stroke: var(--st-accent); stroke-width: 2.2; }
html.atelier-theme body .st-web-stage .st-web-chord.is-hot { stroke: var(--st-accent-2); opacity: 1; stroke-width: 2; animation: st-draw .01s forwards; }
html.atelier-theme body .st-web-core {
  position: absolute; left: 50%; top: 50%; display: grid; justify-items: center; gap: 2px; max-width: 30%; padding: 14px 20px; border: 1px solid #dbe2f0; border-radius: 18px;
  background: #fff; box-shadow: 0 10px 30px rgb(31 45 75 / 9%); transform: translate(-50%,-50%); text-align: center; animation: st-pop-in .5s var(--st-spring) both;
}
html.atelier-theme body .st-web-core strong { color: var(--st-ink); font-size: clamp(15px, 1.8vw, 20px); font-weight: 650; line-height: 1.4; }
html.atelier-theme body .st-web-core small { color: var(--st-muted); font-size: 11.5px; }
html.atelier-theme body .shell .main[class] .st-node {
  position: absolute; display: grid; justify-items: center; gap: 1px; width: max-content; min-width: 64px; min-height: 0; padding: 8px 12px 7px; border: 1px solid #dfe5ef; border-radius: 14px; white-space: nowrap;
  background: #fff; box-shadow: 0 4px 14px rgb(31 45 75 / 7%); color: var(--st-ink); cursor: pointer; font: inherit; text-align: center;
  transform: translate(-50%,-50%); animation: st-node-pop .55s var(--st-spring) both; animation-delay: calc(var(--i) * 70ms + 300ms);
  transition: transform .3s var(--st-spring), box-shadow .25s ease, border-color .2s ease, opacity .25s ease;
}
html.atelier-theme body .shell .main[class] .st-node::before { content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; }
@keyframes st-node-pop { from { opacity: 0; transform: translate(-50%,-50%) scale(.5); } }
html.atelier-theme body .shell .main[class] .st-node strong { font-size: 17px; font-weight: 650; line-height: 1.35; }
html.atelier-theme body .shell .main[class] .st-node .st-node-py { font-size: 11.5px; line-height: 1.3; color: var(--st-muted); }
html.atelier-theme body .shell .main[class] .st-node .st-node-en { max-width: 0; max-height: 0; overflow: hidden; color: #3d5180; font-size: 11.5px; line-height: 1.35; white-space: nowrap; opacity: 0; transition: opacity .2s ease, max-height .25s ease; }
html.atelier-theme body .shell .main[class] .st-node:is(:hover, :focus-visible) { z-index: 3; transform: translate(-50%,-50%) scale(1.08); border-color: #b5c3e1; box-shadow: 0 12px 28px rgb(31 45 75 / 14%); }
html.atelier-theme body .shell .main[class] .st-node:is(:hover, :focus-visible) .st-node-en { max-width: 200px; max-height: 20px; opacity: 1; }
html.atelier-theme body .st-web-stage.is-focus .st-node:not(.is-near) { opacity: .45; }
html.atelier-theme body .st-web-stage.is-focus .st-node.is-near:not(:hover) { border-color: #c9d4ea; box-shadow: 0 0 0 4px rgb(56 76 134 / 7%), 0 4px 14px rgb(31 45 75 / 7%); }
@media (max-width: 640px) {
  html.atelier-theme body .shell .main[class] .st-node { min-width: 0; padding: 5px 8px; border-radius: 11px; }
  html.atelier-theme body .shell .main[class] .st-node strong { font-size: 14px; }
  html.atelier-theme body .shell .main[class] .st-node .st-node-py { display: none; }
  html.atelier-theme body .st-web-core { max-width: 38%; padding: 10px 12px; }
}

/* View switch and flashcards. */
html.atelier-theme body .shell .main[class] .st-view { display: inline-flex; margin-left: auto; padding: 3px; border: 1px solid #e3e8f0; border-radius: 10px; background: #f5f7fb; }
html.atelier-theme body .shell .main[class] .st-view button { min-height: 28px; padding: 3px 12px; border: 0; border-radius: 7px; background: transparent; color: #66718a; cursor: pointer; font: inherit; font-size: 12px; font-weight: 550; box-shadow: none; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
html.atelier-theme body .shell .main[class] .st-view button[aria-pressed="true"] { background: #fff; color: var(--st-accent); box-shadow: 0 1px 3px rgb(31 45 75 / 12%); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash { perspective: 1400px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card {
  position: relative; display: grid; min-height: 230px; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; transform-style: preserve-3d;
  transition: transform .7s var(--st-spring); translate: none; opacity: 1;
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card:hover { transform: translateY(-2px); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card.is-flipped { transform: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card :is(.st-card-front, .st-card-back) {
  grid-area: 1 / 1; padding: 22px; border: 1px solid var(--st-line); border-radius: 16px; background: #fff; box-shadow: 0 3px 16px rgb(36 41 53 / 4%);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .st-card-back { transform: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card:not(.is-flipped) .st-card-back,
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card.is-flipped .st-card-front { display: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid:not(.st-flash) .st-card-front { display: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid:not(.st-flash) .st-card-back { display: contents; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-card-front { display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: radial-gradient(120% 90% at 50% 0%, #f5f7fc, #fff 60%) !important; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-card-front strong { font-size: 44px; font-weight: 650; letter-spacing: .04em; line-height: 1.2; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-card-front small { color: #9aa3b3; font-size: 11.5px; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .vocab-grid.st-flash .vocab-card:focus-visible { outline: 2px solid #526caf; outline-offset: 4px; border-radius: 16px; }

/* Matching: elastic line while choosing. */
html.atelier-theme body .shell .main[class] .matching { position: relative; }
html.atelier-theme body .shell .main[class] .matching > svg.st-band { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
html.atelier-theme body .st-band-line { fill: none; stroke: rgb(56 76 134 / 45%); stroke-width: 2; stroke-dasharray: 5 6; stroke-linecap: round; animation: none; }
html.atelier-theme body .st-band-line.snap { stroke: var(--st-accent); stroke-dasharray: none; stroke-width: 2.4; }
html.atelier-theme body .st-band-head { fill: #fff; stroke: var(--st-accent); stroke-width: 2; }
html.atelier-theme body .st-band-head.snap { fill: var(--st-accent); }
@keyframes st-march { to { stroke-dashoffset: -11; } }
html.atelier-theme body .shell .main[class] .match-item.selected { box-shadow: 0 0 0 4px rgb(56 76 134 / 12%); }
html.atelier-theme body .shell .main[class] .match-item.matched { animation: st-match .5s var(--st-spring); }
@keyframes st-match { 40% { transform: scale(1.05); } }

/* ==========================================================
   GRAMMAR
   ========================================================== */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .grammar-formula.st-quiet { display: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-formula { display: flex; flex-wrap: wrap; align-items: center; row-gap: 10px; margin: 16px 0 18px; padding: 16px 18px; border: 1px solid #e3e8f2; border-radius: 14px; background: linear-gradient(180deg, #fafbfe, #f4f6fb); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-chip {
  padding: 8px 13px; border: 1px solid #dde3ee; border-radius: 10px; background: #fff; color: #4a5468; font-size: 15px; font-weight: 550; line-height: 1.4;
  box-shadow: 0 1px 2px rgb(31 45 75 / 5%); animation: st-chip-in .45s var(--st-spring) both; animation-delay: calc(var(--i) * 110ms);
}
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-chip.key { border-color: var(--st-accent); background: var(--st-accent); color: #fff; font-size: 17px; font-weight: 650; box-shadow: 0 6px 16px rgb(56 76 134 / 25%); }
@keyframes st-chip-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-joint { display: inline-grid; width: 28px; place-items: center; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-joint.comma { width: 22px; color: #9aa6c0; font-size: 18px; font-weight: 700; animation: st-appear .3s ease both; animation-delay: calc(var(--i) * 110ms); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-joint svg { width: 28px; height: 12px; overflow: visible; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-joint path { fill: none; stroke: #9fb0d6; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: st-draw .35s var(--st-ease) forwards; animation-delay: calc(var(--i) * 110ms - 40ms); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content mark.st-mark { padding: 0 2px; border-radius: 4px; color: var(--st-accent); background: linear-gradient(transparent 58%, #dfe7f8 58%); font-weight: 650; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .english-tip { position: relative; border-left: 3px solid var(--st-warm); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .english-tip .st-tip-icon { display: inline-block; margin: 0 10px 6px 0; padding: 2px 7px; border-radius: 6px; background: #f7efe3; color: #8a6538; font: 650 11px/1.6 Inter, Arial, sans-serif; letter-spacing: .04em; }

/* ==========================================================
   READING
   ========================================================== */
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-qa { transition: border-color .2s ease, box-shadow .25s ease; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-qa[open] { border-color: #c6d2e9; box-shadow: 0 6px 18px rgb(31 45 75 / 6%); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-qa[open] > :not(summary) { animation: st-chapter-in .35s var(--st-ease) both; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .axis.st-axis { position: relative; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-axis-line { position: absolute; z-index: 0; left: 50%; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; border-radius: 2px; background: linear-gradient(#e7d6b9, #d3dbeb); pointer-events: none; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-axis-line b { position: absolute; left: -4px; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--st-warm); box-shadow: 0 0 0 5px rgb(176 134 83 / 18%), 0 0 16px rgb(176 134 83 / 50%); animation: st-axis-walk 7s var(--st-ease) 1 both; }
@keyframes st-axis-walk { 0% { bottom: 0; opacity: 0 } 8% { opacity: 1 } 88% { opacity: 1 } 100% { bottom: calc(100% - 10px); opacity: 0 } }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .st-axis .map-building { position: relative; z-index: 1; animation: st-light 7s ease calc(var(--i) * 1.05s + .5s) 1 both; }
@keyframes st-light { 0%, 12%, 100% { box-shadow: 0 0 0 0 rgb(176 134 83 / 0); } 4% { box-shadow: 0 0 0 4px rgb(176 134 83 / 22%), 0 8px 20px rgb(176 134 83 / 18%); } }

/* ==========================================================
   WRITING
   ========================================================== */
html.atelier-theme body .shell .main[class] .writing-meter { display: flex; align-items: center; gap: 10px; }
html.atelier-theme body .shell .main[class] .st-ring { flex: none; width: 26px; height: 26px; }
html.atelier-theme body .shell .main[class] .st-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
html.atelier-theme body .shell .main[class] :is(.st-ring, .st-next-ring) circle { fill: none; stroke-width: 3.4; }
html.atelier-theme body .shell .main[class] :is(.st-ring, .st-next-ring) .bg { stroke: #e7ebf2; }
html.atelier-theme body .shell .main[class] .st-ring .fg { stroke: #9fb0d6; stroke-linecap: round; stroke-dasharray: calc(var(--fill,0) * 1) 100; transition: stroke-dasharray .45s var(--st-ease), stroke .3s ease; }
html.atelier-theme body .shell .main[class] .st-ring.in-range .fg { stroke: var(--st-ok); }
html.atelier-theme body .shell .main[class] .st-ring.over .fg { stroke: var(--st-bad); }
html.atelier-theme body .shell .main[class] .st-targets { margin: 12px 0 14px; padding: 13px 14px; border: 1px solid #e3e8f1; border-radius: 13px; background: #fafbfd; transition: border-color .3s ease, background .3s ease; }
html.atelier-theme body .shell .main[class] .st-targets.is-met { border-color: #cfe3d9; background: #f6fbf8; }
html.atelier-theme body .shell .main[class] .st-targets-head { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--st-muted); font-size: 12px; }
html.atelier-theme body .shell .main[class] .st-targets-head strong { color: var(--st-ink); font-variant-numeric: tabular-nums; }
html.atelier-theme body .shell .main[class] .st-targets.is-met .st-targets-head strong { color: var(--st-ok); }
html.atelier-theme body .shell .main[class] .st-target-list { display: flex; flex-wrap: wrap; gap: 7px; }
html.atelier-theme body .shell .main[class] .st-target { min-height: 0; padding: 5px 11px; border: 1px dashed #cfd7e6; border-radius: 9px; background: #fff; color: #5b667c; cursor: pointer; font: inherit; font-size: 14px; box-shadow: none; transition: background .2s ease, color .2s ease, border-color .2s ease; }
html.atelier-theme body .shell .main[class] .st-target:hover { border-color: #9fb0d6; color: var(--st-accent); }
html.atelier-theme body .shell .main[class] .st-target.is-used { border-style: solid; border-color: var(--st-accent); background: var(--st-accent); color: #fff; }
html.atelier-theme body .shell .main[class] .st-target.st-pop { animation: st-chip-pop .45s var(--st-spring); }
@keyframes st-chip-pop { 40% { transform: scale(1.14); } }
html.atelier-theme body .shell .main[class] .writing-requirements li { transition: color .25s ease; }
html.atelier-theme body .shell .main[class] .writing-requirements li .icon { transition: color .25s ease, transform .35s var(--st-spring), background .25s ease; border-radius: 50%; }
html.atelier-theme body .shell .main[class] .writing-requirements li.st-met { color: var(--st-ok); }
html.atelier-theme body .shell .main[class] .writing-requirements li.st-met .icon { color: #fff; background: var(--st-ok); transform: scale(1.1); }

/* ==========================================================
   PRACTICE
   ========================================================== */
html.atelier-theme body .shell .main[class] .st-qmap {
  position: sticky; z-index: 5; top: 78px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 10px 14px;
  border: 1px solid #e3e8f0; border-radius: 14px; background: rgb(255 255 255 / 92%); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgb(31 45 75 / 5%);
}
html.atelier-theme body .shell .main[class] .st-qmap ol { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
html.atelier-theme body .shell .main[class] .st-qmap button {
  display: grid; place-items: center; width: 30px; height: 30px; min-height: 0; padding: 0; border: 1.5px solid #dbe1eb; border-radius: 50%; background: #fff; color: #7c879a;
  cursor: pointer; font: 650 12px/1 Inter, Arial, sans-serif; box-shadow: none; transition: transform .3s var(--st-spring), background .2s ease, border-color .2s ease, color .2s ease;
}
html.atelier-theme body .shell .main[class] .st-qmap button:hover { transform: scale(1.1); }
html.atelier-theme body .shell .main[class] .st-qmap button.current { border-color: var(--st-warm); color: #8a6538; box-shadow: 0 0 0 4px rgb(176 134 83 / 16%); }
html.atelier-theme body .shell .main[class] .st-qmap button.right { border-color: var(--st-ok); background: var(--st-ok); color: #fff; animation: st-match .45s var(--st-spring); }
html.atelier-theme body .shell .main[class] .st-qmap button.wrong { border-color: var(--st-bad); background: #fff3f5; color: var(--st-bad); }
html.atelier-theme body .shell .main[class] .st-qmap button.done { border-color: var(--st-accent); background: var(--st-soft); color: var(--st-accent); }
html.atelier-theme body .shell .main[class] .st-qmap-hint { color: #9aa3b3; font-size: 11.5px; white-space: nowrap; }
html.atelier-theme body .shell .main[class] .question { transition: border-color .3s ease, box-shadow .3s ease; scroll-margin-top: 150px; }
html.atelier-theme body .shell .main[class] .question.st-current { border-color: #d4dcec; box-shadow: 0 10px 30px rgb(31 45 75 / 6%); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .option { transition: transform .2s var(--st-ease), border-color .2s ease, background .2s ease, box-shadow .2s ease; }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .option:not(:disabled):hover { transform: translateY(-1px); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .option.correct { animation: st-correct .55s var(--st-spring); }
html.atelier-theme body .shell.workspace-shell .main[class].page-lesson #lesson-content .option.wrong { animation: st-shake .45s ease; text-decoration: line-through; text-decoration-thickness: 1.5px; }
@keyframes st-correct { 35% { transform: scale(1.06); box-shadow: 0 0 0 6px rgb(48 115 93 / 14%); } }
@keyframes st-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
html.atelier-theme body .shell .main[class] .feedback { animation: st-chapter-in .35s var(--st-ease) both; }
html.atelier-theme body .shell .main[class] .st-next { display: flex; align-items: center; gap: 18px; margin-top: 14px; padding: 16px 18px; border: 1px solid #dfe5f1; border-radius: 16px; background: #fff; box-shadow: 0 8px 26px rgb(31 45 75 / 6%); animation: st-chapter-in .45s var(--st-ease) .2s both; }
html.atelier-theme body .shell .main[class] .st-next p { margin: 4px 0 10px; color: #4a5468; font-size: 13.5px; line-height: 1.7; }
html.atelier-theme body .shell .main[class] .st-next-ring { position: relative; flex: none; width: 74px; height: 74px; }
html.atelier-theme body .shell .main[class] .st-next-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
html.atelier-theme body .shell .main[class] .st-next-ring .fg { stroke: var(--st-accent); stroke-linecap: round; stroke-dasharray: calc(var(--st-p,0) * 1) 100; }
html.atelier-theme body .shell .main[class] .st-next-ring strong { position: absolute; inset: 0; display: grid; place-items: center; color: var(--st-ink); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ==========================================================
   LEVEL CHOICE ("Why this version?")
   ========================================================== */
html.atelier-theme body .st-why { margin: 16px 0 6px; padding: 16px 18px; border: 1px solid #e1e7f1; border-radius: 15px; background: linear-gradient(180deg, #fbfcfe, #f5f7fb); }
html.atelier-theme body .st-why h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--st-ink); }
html.atelier-theme body .st-why-level { margin: 0 0 12px; color: var(--st-muted); font-size: 12.5px; }
html.atelier-theme body .st-why-level strong { color: var(--st-accent); }
html.atelier-theme body .st-why dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
html.atelier-theme body .st-why dl > div { padding: 9px 11px; border: 1px solid #e6eaf2; border-radius: 11px; background: #fff; animation: st-chip-in .35s var(--st-ease) both; animation-delay: calc(var(--i) * 35ms); }
html.atelier-theme body .st-why dt { color: var(--st-muted); font-size: 11px; }
html.atelier-theme body .st-why dd { margin: 2px 0 0; color: var(--st-ink); font-size: 13px; font-weight: 600; line-height: 1.5; }

/* ==========================================================
   HOME
   ========================================================== */
@keyframes st-float { 50% { translate: 0 -5px; } }
@keyframes st-appear { from { opacity: 0; } }
html.atelier-theme body.home-mode .generation-home .topic-suggestion { animation: st-chip-in .5s var(--st-spring) both; }
html.atelier-theme body.home-mode .generation-home .topic-suggestion:nth-child(2) { animation-delay: 70ms; }
html.atelier-theme body.home-mode .generation-home .topic-suggestion:nth-child(3) { animation-delay: 140ms; }
html.atelier-theme body.home-mode .generation-home .topic-suggestion:nth-child(4) { animation-delay: 210ms; }
html.atelier-theme body.home-mode .generation-home .topic-suggestion:nth-child(5) { animation-delay: 280ms; }

/* ==========================================================
   PROGRESS + WORD REVIEW
   ========================================================== */
html.atelier-theme body .shell .main[class] .st-insight { margin: 18px 0; }
html.atelier-theme body .shell .main[class] .st-insight-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; margin-bottom: 14px; }
html.atelier-theme body .shell .main[class] .st-insight-head h2 { margin: 4px 0 0; }
html.atelier-theme body .shell .main[class] .st-insight-head dl { display: flex; gap: 26px; margin: 0; }
html.atelier-theme body .shell .main[class] .st-insight-head dt { color: var(--st-muted); font-size: 11.5px; }
html.atelier-theme body .shell .main[class] .st-insight-head dd { margin: 2px 0 0; color: var(--st-ink); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
html.atelier-theme body .shell .main[class] .st-insight-body { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: end; }
html.atelier-theme body .shell .main[class] .st-trend { width: 100%; height: auto; max-height: 190px; overflow: visible; }
html.atelier-theme body .shell .main[class] .st-trend-empty { align-self: center; margin: 0; padding: 26px 18px; border: 1px dashed #dde3ec; border-radius: 13px; color: var(--st-muted); font-size: 12.5px; text-align: center; }
html.atelier-theme body .shell .main[class] .st-trend .grid { stroke: #edf0f5; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
html.atelier-theme body .shell .main[class] .st-trend .area { fill: url(#st-trend-fill); animation: st-appear 1.2s ease .5s both; }
html.atelier-theme body .shell .main[class] .st-trend .line { fill: none; stroke: var(--st-accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; animation: st-draw 1.4s var(--st-ease) .2s forwards; }
html.atelier-theme body .shell .main[class] .st-trend .dot { fill: #fff; stroke: var(--st-accent); stroke-width: 2; vector-effect: non-scaling-stroke; animation: st-appear .3s ease both; animation-delay: calc(var(--i) * 50ms + .5s); }
html.atelier-theme body .shell .main[class] .st-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 4px; }
html.atelier-theme body .shell .main[class] .st-heat i { width: 13px; height: 13px; border-radius: 3.5px; background: #eef1f6; animation: st-appear .3s ease both; animation-delay: calc(var(--i) * 8ms); }
html.atelier-theme body .shell .main[class] .st-heat i.lv1 { background: #c9d3ea; } html.atelier-theme body .shell .main[class] .st-heat i.lv2 { background: #93a5d2; }
html.atelier-theme body .shell .main[class] .st-heat i.lv3 { background: #5d73b0; } html.atelier-theme body .shell .main[class] .st-heat i.lv4 { background: var(--st-accent); }
html.atelier-theme body .shell .main[class] .st-heat i.today { box-shadow: 0 0 0 1.5px var(--st-warm); }
html.atelier-theme body .shell .main[class] .st-heat i.future { opacity: .35; }
@media (max-width: 760px) { html.atelier-theme body .shell .main[class] .st-insight-body { grid-template-columns: minmax(0,1fr); } html.atelier-theme body .shell .main[class] .st-insight-head dl { gap: 18px; } }
html.atelier-theme body .st-review .review-hanzi { animation: st-pop-in .45s var(--st-spring) both; }
html.atelier-theme body .st-review .pinyin-line.st-syllables { font-size: 18px; font-weight: 550; letter-spacing: .03em; }
html.atelier-theme body .st-review.is-revealed #review-meaning { animation: st-chapter-in .4s var(--st-ease) both; }
html.atelier-theme body .st-review .st-review-keys { margin: 12px 0 0; color: #9aa3b3; font-size: 11.5px; }
html.atelier-theme body .st-review .st-review-keys kbd { font: 600 10.5px/1 ui-monospace, Consolas, monospace; padding: 3px 5px; border: 1px solid var(--st-line); border-bottom-width: 2px; border-radius: 5px; background: #fafbfd; color: #5d6779; }

/* Magnetic motion never replaces transform (word-web nodes use it to center).
   The press effect scales only the contents, keeping the control's hit area stable. */
html.atelier-theme body .st-magnetic.is-magnetic-enabled {
  translate: var(--st-magnet-x, 0px) var(--st-magnet-y, 0px);
  transition: translate 300ms cubic-bezier(.2,.8,.2,1);
}
html.atelier-theme body .st-magnetic.is-magnetic-enabled .st-magnetic-detail {
  display: inline-flex;
  translate: var(--st-magnet-inner-x, 0px) var(--st-magnet-inner-y, 0px);
  transition: translate 300ms cubic-bezier(.2,.8,.2,1), scale 120ms ease;
}
html.atelier-theme body .st-magnetic.is-magnetic-enabled:active .st-magnetic-detail { scale: .97; }
html.atelier-theme body .st-magnetic.is-magnetic-enabled.is-magnetic-pressed { transition: none !important; }
html.atelier-theme body.reduce-motion .st-magnetic,
html.atelier-theme body.reduce-motion .st-magnetic .st-magnetic-detail { translate: none !important; scale: none; transition: none !important; }
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  html.atelier-theme body .st-magnetic,
  html.atelier-theme body .st-magnetic .st-magnetic-detail { translate: none !important; scale: none; transition: none !important; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html.atelier-theme body .st-reveal { opacity: 1; translate: none; }
  html.atelier-theme body :is(.st-web-pulse, .st-link-dot, .st-axis-line b) { display: none; }
  html.atelier-theme body :is(.st-web-spoke, .st-web-chord, .st-link, .st-joint path) { stroke-dashoffset: 0 !important; }
}
html.atelier-theme body.reduce-motion .st-reveal { opacity: 1; translate: none; }
html.atelier-theme body.reduce-motion :is(.st-web-pulse, .st-link-dot, .st-axis-line b) { display: none; }
html.atelier-theme body.reduce-motion :is(.st-web-spoke, .st-web-chord, .st-link, .st-joint path) { stroke-dashoffset: 0 !important; }
@media (max-width: 760px) {
  html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-label { font-size: 10.5px; }
  html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-dot { width: 26px; height: 26px; }
  html.atelier-theme body .shell.workspace-shell .main[class].page-lesson .st-rail-track { top: 12px; }
  html.atelier-theme body .shell .main[class] .st-qmap { top: 64px; padding: 8px 10px; }
  html.atelier-theme body .shell .main[class] .st-qmap-hint { display: none; }
  html.atelier-theme body .shell .main[class] .st-next { align-items: flex-start; }
  html.atelier-theme body .shell .main[class] .st-next-ring { width: 58px; height: 58px; }
}
