:root {
  --paper: #fffbf2;
  --ink: #20241f;
  --brand: #0d7c66;
  --jade: var(--brand);
  --accent: #c8432b;
  --gold: #d9a441;
  --muted: #555d56;
  --line: #d9ded5;
  --rounded: ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --scene-bg: #e9f5ef;
  --scene-fg: #095744;
}
[data-scene="food"] { --scene-bg: #ffead7; --scene-fg: #803a16; }
[data-scene="travel"] { --scene-bg: #e7efff; --scene-fg: #244b82; }
[data-scene="directions"] { --scene-bg: #ddf3ef; --scene-fg: #155b54; }
[data-scene="health"] { --scene-bg: #fce6ed; --scene-fg: #842e4c; }
[data-scene="emergency"] { --scene-bg: #ffe7e1; --scene-fg: #912a22; }
[data-scene="greetings"] { --scene-bg: #fff0c8; --scene-fg: #715000; }
[data-scene="shopping"] { --scene-bg: #f0e8ff; --scene-fg: #543185; }
[data-scene="home"] { --scene-bg: #f1e9dc; --scene-fg: #67462c; }
[data-scene="social"] { --scene-bg: #f9e7f5; --scene-fg: #782d65; }
[data-scene="work"] { --scene-bg: #e8eff2; --scene-fg: #344e60; }

h1, h2, h3 { font-family: var(--rounded); letter-spacing: 0; overflow-wrap: anywhere; }
main h1 { font-size: 32px; line-height: 1.16; }
main h2 { font-size: 23px; line-height: 1.3; }
main [hidden] { display: none !important; }
:where(a, button, summary, [tabindex]):focus-visible { outline: 3px solid #245ec2; outline-offset: 3px; }
.learn-icon { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
.topbar { background: var(--paper); backdrop-filter: none; }
.brand-mark { width: 35px; height: 35px; color: white; background: var(--accent); border: 0; border-radius: 8px; font-size: 21px; }
.topbar nav a { display: inline-flex; align-items: center; gap: 5px; }
.topbar nav, footer nav { min-width: 0; flex-wrap: wrap; }
.topbar nav .learn-icon { width: 16px; height: 16px; }
.mobile-site-menu { display: none; }
.mobile-app-nav .learn-icon { width: 19px; height: 19px; }
footer { position: relative; background: #f2ecdf; }
.footer-wave { position: absolute; left: 0; bottom: 100%; width: 100%; height: 18px; color: #f2ecdf; pointer-events: none; }

.traveler-art { display: block; width: min(100%, 212px); height: auto; }
.home-hero.hero { min-height: auto; background: #f4f9f3; align-items: center; }
.home-hero .hero-copy { min-width: 0; }
.hero-traveler .traveler-art { width: 176px; margin: 0 0 10px; }
.home-hero .trainer-preview, .learn-shell .learn-trainer {
  color: var(--ink); background: #eaf5ee; border: 1px solid #b6cec1; box-shadow: none;
}
.trainer-preview .trainer-status, .trainer-preview .trainer-status span, .trainer-preview .trainer-status strong { color: var(--jade-dark); }
.trainer-preview .voice-switch { color: var(--ink); }
.trainer-preview .voice-switch button:not(.active), .trainer-preview .trainer-scenes button:not(.active),
.trainer-preview .trainer-mini-flow > :not(:first-child) { color: var(--ink); background: white; border-color: #c8d8ce; }
.home-hero .daily-card, #activeCard { border: 1px solid #bfd2c6; box-shadow: 0 3px #bfd2c6; }
.home-hero .hanzi, #activeCard .hanzi { font-size: 48px; line-height: 1.16; overflow-wrap: anywhere; }
.home-hero .pinyin, #activeCard .pinyin { font-size: 17px; line-height: 1.5; }
.home-hero .meaning, #activeCard .meaning { font-size: 16px; }
.home-hero .primary-play, #activeCard .primary-play { background: var(--brand); color: white; }
.scene-art { display: inline-grid; place-items: center; width: 60px; aspect-ratio: 1; border-radius: 16px; background: var(--scene-bg); color: var(--scene-fg); }
.scene-art .learn-icon { width: 36px; height: 36px; }
.scene-entry-grid > a { display: grid; align-content: start; gap: 6px; padding: 16px; min-width: 0; background: var(--scene-bg); color: var(--scene-fg); border: 1px solid color-mix(in srgb, var(--scene-fg) 32%, white); border-radius: 16px; box-shadow: 0 3px color-mix(in srgb, var(--scene-fg) 32%, white); }
.scene-entry-grid > a:hover { background: color-mix(in srgb, var(--scene-bg) 86%, white); }
.scene-entry-grid .scene-art { background: #ffffffa0; }
.scene-entry-grid > a > span:not(.scene-art) { color: inherit; font-size: 17px; font-weight: 800; }
.scene-entry-grid > a > strong { color: inherit; font-size: 14px; font-weight: 500; }
.scene-entry-grid small { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.scene-entry-grid small svg { width: 16px; height: 16px; }
#scenes, .scene-entry-grid#topics { scroll-margin-top: 84px; }
.home-plan-path { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); list-style: none; padding: 0; margin: 18px 0 0; width: min(100%, 390px); position: relative; }
.home-plan-path::before { content: ""; border-top: 2px dashed #8caba0; position: absolute; inset: 18px 6% auto; }
.home-plan-path li { z-index: 1; display: grid; place-items: center; }
.home-plan-path a { width: 36px; height: 36px; display: grid; place-items: center; position: relative; border-radius: 50%; color: #555d56; border: 1px solid #c6d1c8; background: #f6f8f4; font-weight: 750; }
.home-plan-path a[aria-current="step"] { border: 2px solid var(--brand); color: var(--jade-dark); }
.home-plan-path a.done { background: var(--brand); color: white; }
.home-plan-path a.done span { display: none; }
.home-tool-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #d8efe6; color: var(--jade-dark); }
[data-home-due]:empty { display: none; }
[data-home-due] { display: block; margin-top: 8px; font-weight: 750; color: var(--jade-dark); }

.detail-page[data-scene] .topic-scene-hero { display: grid; grid-template-columns: 1fr; gap: 12px; max-width: none; background: var(--scene-bg); color: var(--ink); padding: 24px; border-radius: 16px; }
.topic-scene-hero > .scene-art { width: 88px; background: #ffffffab; }
.topic-scene-hero > .scene-art svg { width: 52px; height: 52px; }
.scene-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-block: 14px; font-size: 14px; font-weight: 750; color: var(--scene-fg); }
.guide-scene-tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; background: var(--scene-bg); color: var(--scene-fg); border-radius: 6px; }
.guide-scene-tag svg { width: 17px; height: 17px; }
.guide-scene-tag .eyebrow { margin: 0; padding: 0; color: inherit; background: none; border: 0; }
.page-section h2::before { content: ""; display: inline-block; width: 5px; height: .88em; margin-right: 9px; border-radius: 2px; background: var(--scene-fg); vertical-align: -.02em; }
.guide-page .lesson-copy p, .guide-page .lesson-copy li, .guide-page .guide-block li { font-size: 17px; line-height: 1.75; }
.guide-page .lesson-copy p + p { margin-top: 1em; }
.guide-page .content-byline { font-size: 14px; color: var(--muted); }
.guide-page .phrase-card h3 { font-size: 30px; }
.guide-page .phrase-card:first-child { border-left: 4px solid var(--gold); background: #fffcf5; }
.guide-page .phrase-card:first-child:has(.mini-save.saved) { border-left-color: var(--brand); }
.guide-index-card, .scene-guide-link { background: var(--scene-bg); color: var(--scene-fg); }
.scene-guide-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.scene-guide-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.scene-practice-entry ul { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0; margin: 0; list-style: none; }
.scene-practice-entry a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.scene-practice-entry .learn-icon { width: 17px; height: 17px; }
.guide-callout { padding: 16px; border-left: 4px solid var(--gold); background: #fff2cf; }
.guide-callout p { margin: 0; }
.field-quick {
  color: var(--ink);
  background: var(--scene-bg);
  border: 1px solid color-mix(in srgb, var(--scene-fg) 28%, white);
}
.field-quick h2 { margin: 0 0 12px; font-size: 21px; }
.field-quick .field-quick-entry + .field-quick-entry { border-top: 1px solid #0002; margin-top: 12px; padding-top: 12px; }
.field-quick p { margin: 4px 0; color: var(--ink); }
.field-quick .primary-link { margin-top: 16px; display: inline-flex; gap: 8px; align-items: center; }
.field-lesson { max-width: 960px; scroll-margin-top: 85px; }
.field-aid { background: var(--scene-bg); padding: 16px; border-left: 4px solid var(--scene-fg); }
.field-aid h3, .field-aid p { margin: 0; }
.field-aid ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 10px 0; list-style: none; }
.field-aid li { background: white; color: var(--scene-fg); border: 1px solid #0002; padding: 8px; border-radius: 6px; font-weight: 750; }
.field-steps { display: grid; gap: 18px; margin-top: 18px; }
.field-step { min-width: 0; border: 1px solid #c7d2c7; border-radius: 8px; padding: clamp(14px, 3vw, 22px); background: white; scroll-margin-top: 85px; }
.field-step h3 { margin-top: 0; font-size: 19px; line-height: 1.4; }
.field-step-index { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--scene-fg); font-size: 14px; margin-right: 4px; }
.field-turn { margin-block: 12px; }
.field-turn p, .field-model p { margin: 4px 0; line-height: 1.5; }
.field-chinese { font-size: 22px; font-weight: 750; overflow-wrap: anywhere; }
.field-pinyin { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.field-audio { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; color: var(--jade-dark); background: #f2f9f4; border: 1px solid #a9c3b5; border-radius: 7px; cursor: pointer; font-weight: 750; }
.field-audio:hover { background: #d9eee3; }
.field-audio:focus-visible { outline: 2px solid var(--jade-dark); outline-offset: 2px; }
.field-audio svg { width: 17px; height: 17px; }
.field-reply-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.field-heard .field-chat-message { padding: 10px 12px; border-inline-start: 3px solid var(--scene-fg); background: var(--scene-bg); }
.field-step summary { cursor: pointer; color: var(--jade-dark); padding-block: 10px; font-weight: 750; }
.field-step fieldset { min-width: 0; padding: 0; margin: 0 0 10px; border: 0; }
.field-step legend { font-weight: 800; margin-bottom: 6px; }
.field-choice { display: flex; align-items: center; min-height: 44px; gap: 8px; padding: 6px 9px; margin-bottom: 6px; border: 1px solid #c7d2c7; border-radius: 6px; cursor: pointer; }
.field-choice:has(input:checked) { border-color: var(--brand); background: #ecf7f1; }
.field-choice input { accent-color: var(--brand); flex: none; }
.field-step .field-feedback { margin: 8px 0 0; font-weight: 700; }
.field-feedback[data-result="correct"] { color: var(--jade-dark); }
.field-feedback[data-result="retry"] { color: #8b3d17; }
.field-model { border-top: 1px solid var(--line); margin-top: 12px; }
.field-step:has(.field-feedback[data-result="correct"]) .field-model-explanation { display: none; }
.field-trainer-link { display: inline-block; margin: 8px; }
.field-library-count { display: flex; align-items: baseline; gap: 6px; color: var(--muted); }
.field-library-count p { margin: 0; }
.guide-pathways { max-width: 960px; }
.guide-pathways ul { margin: 0; padding-inline-start: 20px; }
.guide-pathways li + li { margin-top: 10px; }
.guide-pathways li span { display: block; color: var(--muted); }
.learn-quickbar { position: static; }
#speak-practice { scroll-margin-top: 84px; }
.lesson-return:not([hidden]) { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 6px; }
#speak-practice .speak-phrase { color: var(--ink); font-size: 25px; font-weight: 750; overflow-wrap: anywhere; }
#speak-practice .speak-phrase, #speak-practice .speak-pinyin { margin-block: 4px; }
#speak-practice .speak-pinyin { font-weight: 650; overflow-wrap: anywhere; }
#speak-practice .speak-phrase:empty, #speak-practice .speak-pinyin:empty { display: none; }
.scene-walkthrough { counter-reset: scene-step; }
.scene-walkthrough span { display: block; position: relative; padding: 10px 0 10px 42px; }
.scene-walkthrough span::before { counter-increment: scene-step; content: counter(scene-step); display: grid; place-items: center; position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--scene-fg); color: white; font-weight: 750; font-size: 13px; }
.scene-walkthrough span:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 40px; bottom: -8px; border-left: 2px dotted var(--scene-fg); }
.scene-walkthrough .timeline-icon { float: right; margin: 2px 0 4px 8px; color: var(--scene-fg); width: 18px; height: 18px; }
.scene-feature { color: var(--scene-fg); background: var(--scene-bg); padding: 20px; border-radius: 12px; }
.scene-feature h2 { color: inherit; margin-top: 0; }
.scene-feature .learn-icon { margin-right: 6px; }
.feature-scale, .feature-numbers, .feature-choices { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 0; padding: 0; list-style: none; }
.feature-scale li, .feature-numbers > div, .feature-choices > div { flex: 1 1 105px; padding: 9px 12px; background: #fff; border-bottom: 3px solid var(--scene-fg); border-radius: 6px; }
.feature-scale li:nth-child(2) { border-color: #b47a20; }
.feature-scale li:nth-child(3) { border-color: #ba5329; }
.feature-scale li:nth-child(4) { border-color: #8f271f; }
.scene-feature [lang="zh-CN"] { display: block; font-size: 21px; font-weight: 800; }
.scene-feature dd { margin: 0; }
.feature-numbers dt { font-size: 27px; font-weight: 850; }
.feature-compass { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; max-width: 340px; padding: 10px; background: #fff; border-radius: 8px; }
.feature-compass > :first-child { grid-column: 1 / -1; }
.feature-board { padding: 12px; color: #fff; background: var(--scene-fg); border-radius: 8px; }
.feature-board span { display: block; margin: 4px 0; }
.feature-slip { background: #fff; border-bottom: 2px dashed currentColor; padding: 12px; max-width: 300px; }
.feature-formula { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 750; }
.feature-formula span { background: #fff; padding: 8px 12px; border-radius: 6px; }
.feature-exchange { border-left: 3px solid currentColor; padding-left: 14px; margin: 0; }
.feature-exchange p { margin: 6px 0; }
.feature-check { padding-left: 23px; }
.feature-check li { margin: 6px 0; }
.feature-body { display: flex; align-items: center; gap: 20px; }
.feature-body svg { width: 84px; height: 112px; flex: none; }
.feature-body dl { margin: 0; }
.feature-body dd + dt { margin-top: 9px; }

.detail-page .results, .trainer-page .results, .saved-page .results { grid-template-columns: minmax(0, 1fr); gap: 15px; }
.result-card { position: relative; border: 1.5px solid #d1dbd2; border-radius: 16px; padding: 15px; background: white; box-shadow: 0 3px #d1dbd2; min-width: 0; }
.result-card:has(.mini-save.saved) { border-left: 4px solid var(--brand); }
.result-card .result-top { display: block; }
.result-card .result-top > :first-child { padding-right: 46px; min-width: 0; }
.result-card:has(.mini-save:is([data-save-id], [data-save])) .result-top > :first-child { padding-right: 0; }
.result-card h3 { font-size: 32px; font-weight: 700; line-height: 1.2; }
.result-card p { font-size: 15px; overflow-wrap: anywhere; }
.result-card .result-top p strong { font-size: 16px; }
.result-card .result-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.topic-page .result-actions-row { width: 100%; justify-content: space-between; }
.topic-page .phrase-action-group { display: flex; align-items: center; gap: inherit; }
.topic-page .phrase-action-group:last-child { margin-inline-start: auto; }
.result-card .mini-save { position: absolute; top: 9px; right: 9px; background: transparent; color: var(--jade-dark); border: 0; min-width: 44px; min-height: 44px; padding: 0; }
.result-card .mini-save.saved svg { fill: var(--brand); }
.result-card .mini-save:hover { background: #e7f3ed; }
.result-card .mini-play { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--brand); color: white; border: 0; }
.result-card .mini-save:is([data-save-id], [data-save]), .phrase-slow {
  position: static; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid #a9c3b5;
  border-radius: 22px; background: #f4faf6; color: var(--jade-dark); font-size: 13px;
}
.result-card .mini-save:is([data-save-id], [data-save]):is(.saved, :hover), .phrase-slow:hover { background: #e0f0e8; }
.phrase-action-label { white-space: nowrap; }
.result-actions-row .learn-icon { width: 17px; height: 17px; }
.result-card .mini-practice { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 7px; gap: 5px; font-size: 14px; font-weight: 750; color: var(--jade-dark); }
.result-card .mini-play:active, .phrase-slow:active { transform: translateY(1px); }
.tone1 { color: #b32d36 !important; }
.tone2 { color: #26723a !important; }
.tone3 { color: #2b5cb5 !important; }
.tone4 { color: #73459b !important; }
.tone0 { color: #626562 !important; }
:is([lang="zh-Latn"], .pinyin, .flashcard-pinyin) :is(.tone0, .tone1, .tone2, .tone3, .tone4) { text-transform: none; }
.scene-course-card .field-pinyin span { font: inherit; letter-spacing: inherit; text-transform: none; }
.scene-dialogue-list, .dialogue-list { border: 0; max-width: 820px; }
.scene-dialogue-line, .dialogue-line { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border: 0; }
.dialogue-line .chat-bubble strong { display: block; font-size: 22px; }
.scene-dialogue-line[data-side="right"], .dialogue-line[data-side="right"], [data-side="right"] .chat-turn { flex-direction: row-reverse; }
.chat-avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: var(--scene-fg); background: var(--scene-bg); font-size: 14px; font-weight: 850; }
[data-side="right"] .chat-body { text-align: right; }
.chat-body { min-width: 0; max-width: 612px; }
.chat-turn { display: flex; align-items: center; gap: 8px; }
.chat-turn .mini-play { flex: none; }
.chat-bubble { padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--scene-bg); overflow-wrap: anywhere; }
[data-side="right"] .chat-bubble { background: #edf2f6; border-radius: 14px 4px 14px 14px; }
.chat-bubble p[lang="zh-Latn"] { font-size: 14px; }
.chat-bubble p[lang="zh-Latn"] span { font: inherit; }
.chat-body .chat-speaker { display: block; color: var(--muted); margin-bottom: 3px; font-size: 12px; }
.faq-list summary { min-height: 44px; }

.practice-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.practice-tabs button { min-width: 0; min-height: 52px; display: flex; gap: 6px; align-items: center; justify-content: center; padding-inline: 5px; }
.practice-step-number { display: grid; place-items: center; background: #e6ebe5; color: var(--jade-dark); border-radius: 50%; width: 20px; height: 20px; font-size: 12px; flex: none; }
.practice-tabs button.active .practice-step-number, .practice-tabs .step-done .practice-step-number { color: white; background: var(--brand); }
.practice-step-number svg { width: 15px; height: 15px; }
.learn-journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; gap: 6px; padding: 0; margin: 0 0 12px; }
.learn-journey li { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 48px; font-size: 12px; font-weight: 750; color: var(--muted); }
.learn-journey li > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #dfe8e0; }
.learn-journey li[aria-current="step"], .learn-journey .step-done { color: var(--jade-dark); }
.learn-journey li[aria-current="step"] > span, .learn-journey .step-done > span { background: var(--brand); color: white; }
.learn-journey .learn-icon { width: 15px; height: 15px; }
.saved-confirmation { color: var(--jade-dark); font-size: 14px; font-weight: 750; }
#speakBtn, #stopRecordBtn { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: white; }
#stopRecordBtn { background: var(--accent); animation: record-pulse 1.6s ease-in-out infinite; }
.record-wave { display: flex; align-items: center; gap: 4px; height: 22px; margin-block: 8px; color: #7f9a8e; }
.record-wave i { display: block; height: var(--h, 6px); width: 3px; border-radius: 2px; background: currentColor; }
[data-practice-panel="speak"]:has(#stopRecordBtn:not([hidden])) .record-wave { color: var(--accent); }
@keyframes record-pulse { 50% { box-shadow: 0 0 0 5px #c8432b33; } }
.cards-page .flashcard { border: 2px solid #bed3c8; border-radius: 20px; box-shadow: 0 5px #bed3c8; background: white; color: var(--ink); }
.cards-page .flashcard-face { background: white; color: var(--ink); border-radius: inherit; overflow-wrap: anywhere; }
.cards-page .flashcard-english { font-size: 34px; }
.cards-page .flashcard-hanzi { font-size: 54px; line-height: 1.2; }
.cards-page .flashcard-pinyin { font-size: 22px; }
.cards-page .flashcard-back:not([hidden]) { animation: card-reveal .22s ease-out; }
@keyframes card-reveal { from { opacity: .5; transform: rotateY(-8deg); } to { opacity: 1; transform: none; } }
.card-rating button:is([data-card-rating="good"], [data-card-rating="easy"]) { color: white; background: var(--brand); border-color: var(--brand); }
.card-rating button:is([data-card-rating="good"], [data-card-rating="easy"]) span { color: white; }
#cardsEmpty .traveler-art, .empty-results .traveler-art, #savedEmpty .traveler-art { margin-inline: auto; width: 140px; }
@media (min-width: 700px) {
  .detail-page:not(.topic-page) .results, .trainer-page .results, .saved-page .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-page[data-scene] .topic-scene-hero { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 24px; }
  .topic-scene-hero > .scene-art { width: 132px; }
  .topic-scene-hero > .scene-art svg { width: 76px; height: 76px; }
}
@media (min-width: 900px) {
  .topic-page .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  .topic-page .results { grid-template-columns: repeat(3, minmax(0, 1fr)); max-inline-size: 1500px; }
}
@media (max-width: 899px) {
  .topic-page .results { max-inline-size: 600px; }
}
@media (max-width: 699px) {
  main h1, .learn-sidebar h1 { width: auto; font-size: 28px; line-height: 1.16; }
  .home-hero.hero { grid-template-columns: minmax(0, 1fr) 86px; padding-top: 18px; gap: 12px; }
  .home-hero .hero-copy { display: contents; }
  .home-hero .hero-copy > *, .home-hero .trainer-preview { grid-column: 1 / -1; }
  .home-hero .hero-copy h1 { grid-row: 1; grid-column: 1; text-wrap: wrap; }
  .home-hero .hero-traveler { grid-row: 1; grid-column: 2; align-self: center; }
  .hero-traveler .traveler-art { width: 100%; margin: 0; }
  .home-hero .subhead { grid-row: 2; width: auto; margin: 0; }
  .home-hero .trainer-preview { grid-row: 4; display: grid; gap: 9px; }
  .home-hero .trainer-preview .voice-switch { grid-row: 5; margin: 0; }
  .home-hero .trainer-scenes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-hero .trainer-scenes button { padding-inline: 2px; }
  .home-hero .hero-actions { grid-row: 3; display: flex; flex-wrap: wrap; margin-top: 5px; }
  .home-hero .hero-path-compact { display: flex; flex-wrap: wrap; gap: 5px 9px; }
  .home-hero .home-daily-note { margin-top: 9px; }
  .home-hero .daily-card, #activeCard { position: relative; text-align: left; padding: 15px; }
  .home-hero .daily-card .hanzi, #activeCard .hanzi { padding-right: 62px; font-size: 44px; }
  .home-hero .daily-card .primary-play, #activeCard .primary-play { position: absolute; top: 32px; right: 14px; width: 52px; height: 52px; min-width: 52px; min-height: 52px; }
  .detail-hero { margin-right: 0; }
  .detail-page { padding-top: 20px; }
  .detail-page[data-scene] .topic-scene-hero { display: block; padding: 16px; }
  .topic-scene-hero > .scene-art { float: right; width: 54px; margin: 0 0 5px 8px; }
  .topic-scene-hero > .scene-art svg { width: 32px; height: 32px; }
  .topic-scene-hero .eyebrow { margin-bottom: 9px; font-size: 12px; padding: 4px 8px; }
  .topic-scene-hero .subhead { width: auto; }
  .scene-meta { margin-block: 8px; }
  .scene-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-entry-grid > a { padding: 10px; }
  .result-card .result-actions-row { gap: 6px; }
  .result-card .mini-save:is([data-save-id], [data-save]), .result-card .phrase-slow { padding-inline: 7px; }
  .result-card .mini-practice { padding-inline: 6px; font-size: 13px; }
  .result-card .result-actions-row .learn-icon { width: 16px; height: 16px; }
  .practice-tabs button { flex-direction: column; font-size: 13px; }
  .cards-page .flashcard-english { font-size: 28px; }
  .cards-page .flashcard-hanzi { font-size: 46px; }
}
@media (max-width: 900px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .topbar .topline { display: none; }
  .mobile-site-menu { display: block; position: relative; }
  .mobile-site-menu summary { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; list-style: none; color: var(--jade-dark); border: 1px solid #bdd2c5; border-radius: 8px; }
  .mobile-site-menu summary::-webkit-details-marker { display: none; }
  .mobile-site-menu > div { position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; width: 178px; padding: 6px; border: 1px solid #bdd2c5; border-radius: 8px; background: white; box-shadow: 0 3px #bdd2c5; }
  .mobile-site-menu a { display: flex; align-items: center; min-height: 44px; gap: 8px; padding: 0 7px; }
  .mobile-site-menu a .learn-icon { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #stopRecordBtn, .cards-page .flashcard-back { animation: none; }
}
