@charset "UTF-8";
:root {
  --bg: #f5f6f8; --paper: #ffffff; --ink: #302c2a; --muted: #777d83;
  --accent: #fee500; --accent-light: #fff9cc; --line: #e6e8eb;
  --sage: #58798b; --purple: #fee500; --sun: #fee500; --pencil: #476c85;
  --chat: #b9cbd8; --chat-ink: #466171;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, select { touch-action: manipulation; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
button span[data-icon] { display: inline-flex; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible, .sentence-card:focus-visible { outline: 2px solid #476c85; outline-offset: 3px; }
input:focus, textarea:focus { outline: 2px solid #476c85; outline-offset: 1px; }
button:hover:not(:disabled) { background-color: #302c2a08; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }

/* A small messenger shell: navigation rail, real learning conversations and room. */
.app-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100dvh - 80px); min-height: 550px; }
.sidebar { display: flex; min-width: 0; min-height: 0; height: 100%; background: var(--paper); border-right: 1px solid var(--line); }
.sidebar-rail { width: 62px; flex-shrink: 0; display: flex; align-items: center; flex-direction: column; gap: 26px; padding: 24px 0 20px; background: #f0f1f3; border-right: 1px solid #e8eaec; }
.brand { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent); }
.brand-book { display: block; width: 42px; height: 42px; }
.brand-bubble { position: relative; display: grid; place-items: center; width: 28px; height: 23px; border-radius: 50%; background: #342a27; color: var(--accent); font-size: 21px; font-weight: 700; line-height: 1; }
.brand-bubble:after { content: ""; position: absolute; left: 4px; bottom: -3px; border-top: 7px solid #342a27; border-right: 7px solid transparent; transform: rotate(7deg); }
.rail-current { color: #342a27; margin: 12px 0 0; }
.rail-current svg { width: 24px; height: 24px; }
.rail-guide { color: #92969c; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 11px; background: #d7e3ed; color: #506a7c; font-size: 15px; }
.sidebar-body { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; flex: 1; padding: 27px 14px 18px; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.sidebar-heading h2 { font-size: 23px; letter-spacing: -.7px; margin: 0; }
.sidebar-heading > span { font-size: 12px; font-weight: 600; color: #989ba0; }
.sidebar-subtitle { margin: 11px 6px 28px; color: #8a8f94; font-size: 11px; }
.side-label { display: block; margin: 0 6px 11px; font-size: 10px; color: #92969c; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 74px; padding: 11px 8px; text-align: left; border-radius: 12px; margin-bottom: 4px; }
.nav-item.active { background: #f1f3f5; }
.conversation-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 14px; color: #4b555c; font-size: 24px; font-weight: 600; }
.conversation-avatar.yellow { background: var(--accent); color: #3c3330; }
.conversation-avatar.learning-avatar { background: transparent; }
.conversation-avatar img, .room-avatar img, .mini-cover img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.conversation-avatar.blue { background: #e0eaf1; color: #6c8aa1; }
.conversation-avatar.pink { background: #f8e7e7; color: #b38787; }
.conversation-avatar svg { width: 21px; height: 21px; }
.nav-copy { display: block; min-width: 0; flex: 1; }
.nav-copy strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.nav-copy small { display: block; font-size: 11px; line-height: 1.5; color: #969ba0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-dot { width: 6px; height: 6px; border-radius: 50%; background: #d2b926; }
.count { font-size: 10px; color: #73585b; background: #f7e7e8; padding: 3px 5px; border-radius: 7px; }
.side-learning { border-top: 1px solid #eff0f2; padding: 17px 6px 0; margin-top: 14px; }
.side-learning .side-label { margin-left: 0; }
.side-learning p { margin: 15px 0 5px; font-size: 13px; font-weight: 600; letter-spacing: -.3px; }
.side-learning > small { display: block; color: #969ba0; font-size: 10px; }
.side-learning ol { list-style: none; padding: 0; margin: 14px 0 9px; color: #7d8389; font-size: 10px; }
.side-learning li { display: flex; align-items: center; gap: 9px; margin: 9px 0; }
.side-learning li > span { display: grid; place-items: center; width: 17px; height: 17px; font-size: 9px; background: #f0f2f4; border-radius: 50%; color: #737b83; }
.guide-link { display: inline-flex; align-items: center; gap: 3px; padding: 4px 0; font-size: 10px; color: #788792; white-space: nowrap; }
.guide-link svg { width: 12px; height: 12px; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.sidebar-bottom small { display: block; text-align: center; margin-top: 10px; font-size: 9px; color: #a2a5aa; }
.quiet-button { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 42px; gap: 7px; border-radius: 9px; background: var(--accent); font-size: 11px; font-weight: 600; }
.quiet-button:hover:not(:disabled) { background: #f3db00; }
.quiet-button svg { width: 16px; height: 16px; }

main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 0 26px 20px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 74px; flex-shrink: 0; border-bottom: 1px solid #e5e8ec; }
.room-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.room-avatar { display: grid; place-items: center; width: 39px; height: 39px; flex-shrink: 0; background: transparent; border-radius: 14px; }
.room-heading strong { display: block; font-size: 14px; font-weight: 650; }
.room-heading small { display: block; margin-top: 5px; font-size: 10px; color: #94999e; }
.top-actions { display: flex; align-items: center; gap: 13px; }
.top-add { display: flex; align-items: center; gap: 5px; color: #737b83; font-size: 11px; min-height: 36px; padding: 0 5px; }
.top-add svg { width: 17px; height: 17px; }
.mobile-library { display: none; }
.welcome-note { display: flex; align-items: center; gap: 9px; min-height: 48px; flex-shrink: 0; }
.welcome-sun { font-size: 21px; color: #d0b748; }
.welcome-note p { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 10px; }
.welcome-note p strong { font-weight: 500; color: #737c84; }
.welcome-note p > span { color: #a0a5ab; }
.welcome-note .guide-link { margin-left: auto; }
.lesson-heading { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 8px 0 19px; flex-shrink: 0; }
.lesson-copy { min-width: 0; }
.lesson-label { display: flex; align-items: center; gap: 9px; color: #8a9198; font-size: 10px; }
.pill { padding: 3px 7px; color: #78828a; background: #e9edf1; border-radius: 5px; font-size: 9px; }
.lesson-heading h1 { font-size: 20px; line-height: 1.4; letter-spacing: -.6px; font-weight: 650; margin: 8px 0 5px; }
.lesson-heading p { margin: 0; font-size: 10px; line-height: 1.7; color: #989da2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lesson-progress { flex-shrink: 0; width: 100px; }
.lesson-progress > div:first-child { display: flex; justify-content: space-between; gap: 6px; font-size: 10px; color: #8b939a; margin-bottom: 9px; }
.lesson-progress strong { font-size: 10px; font-weight: 500; color: #727b82; }
.progress-track { height: 4px; border-radius: 3px; background: #e2e7eb; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; background: #d4bb1e; transition: width .2s; }
.learning-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); flex: 1; min-height: 0; gap: 22px; }
.video-column { min-width: 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d1d8de transparent; padding: 0 3px 12px 0; }
.column-heading { display: flex; align-items: center; gap: 7px; min-height: 34px; color: #838c94; font-size: 10px; }
.column-heading > span[data-icon] svg { width: 13px; height: 13px; }
.column-heading strong { font-weight: 500; }
.column-caption { margin-left: auto; color: #a3aab1; font-size: 9px; }
.video-wrap { position: relative; width: 100%; min-width: 0; aspect-ratio: 16 / 9; min-height: 200px; overflow: hidden; background: #25313a; border-radius: 10px; }
#youtube-player, #local-player, .video-wrap iframe { width: 100%; height: 100%; position: absolute; inset: 0; border: 0; }
.video-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; color: #d6e1e9; background: #324652; }
.cover-mark { font-size: 29px; font-weight: 600; }
.cover-play { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--ink); }
.cover-play svg { width: 20px; height: 20px; }
.video-cover p { margin: 0; font-size: 10px; color: #9eb2c0; }
.video-status { display: flex; align-items: center; gap: 6px; padding: 11px 1px 15px; color: #949da5; font-size: 9px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #b9c1c8; flex-shrink: 0; }
.status-dot.ready { background: #6da590; }
.video-status > span:nth-child(2) { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.video-status a { margin-left: auto; white-space: nowrap; }
.video-status a svg { width: 10px; height: 10px; }
.practice-panel { padding: 19px 18px 16px; border: 1px solid #e4e8ec; border-radius: 12px; background: var(--paper); }
.video-column > .practice-panel { display: none; }
.practice-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; font-size: 9px; color: #a1a7ad; }
.eyebrow { font-size: 10px; color: #8a9299; }
.practice-heading .eyebrow { color: #7a858e; display: inline-flex; align-items: center; gap: 5px; }
.practice-heading svg { width: 12px; height: 12px; }
.practice-korean { width: fit-content; max-width: 94%; margin-left: auto; position: relative; background: var(--accent); border-radius: 10px 2px 10px 10px; padding: 11px 14px; font-size: 19px; font-weight: 550; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
.practice-korean:after { content: ""; position: absolute; right: -7px; top: 0; border-top: 9px solid var(--accent); border-right: 9px solid transparent; }
#practice-chinese { font-size: 11px; line-height: 1.9; color: #8d969e; text-align: right; margin: 9px 0 18px; }
.practice-steps { display: flex; gap: 11px; font-size: 9px; color: #a9aeb4; margin: 17px 0; }
.step.active { color: #706127; }
.step.active:before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: #d2b827; vertical-align: 1px; }
.record-actions { display: flex; align-items: center; gap: 9px; }
.record-button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; min-height: 40px; border-radius: 8px; background: var(--accent); color: var(--ink); font-size: 11px; }
.record-button:hover:not(:disabled) { background: #f3db00; }
.record-button svg { width: 15px; height: 15px; }
.record-button.recording { background: #fae4e4; color: #bb4848; animation: pulse 1.2s infinite; }
.record-button.recording:hover:not(:disabled) { background: #f3d8d8; }
.record-actions .icon-button { background: #f4f6f8; width: 35px; height: 35px; }
.record-actions .icon-button svg { width: 16px; height: 16px; }
.record-hint { color: #a3a9af; font-size: 9px; line-height: 1.8; margin: 12px 0; }
#recording-audio { width: 100%; height: 35px; margin-top: 6px; }
.practice-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #eef0f2; padding-top: 10px; margin-top: 11px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; font-size: 10px; color: #8d979f; }
.text-button svg { width: 13px; height: 13px; }
.text-button.done { color: #537c68; }
.source-note { font-size: 10px; line-height: 1.9; color: #99a1a8; margin: 15px 0 0; }
.source-note summary { display: flex; gap: 5px; align-items: center; cursor: pointer; font-size: 9px; }
.source-note svg { width: 11px; height: 11px; }
.source-note p { margin: 9px 0 0; }

/* Messages are subtitles from the same original video, never invented conversations. */
.sentences-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--chat); border-radius: 13px; overflow: hidden; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 57px; padding: 12px 17px 9px; border-bottom: 1px solid #8ca4b52e; }
.chat-header strong { display: block; font-size: 12px; font-weight: 600; color: #42596a; }
.chat-header small { display: block; margin-top: 4px; color: #78909f; font-size: 9px; }
.chat-header .icon-button { color: #668193; width: 30px; height: 30px; }
.chat-header svg { width: 16px; height: 16px; }
.chat-header-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.follow-button { min-height: 30px; padding: 6px 8px; border-radius: 7px; font-size: 9px; color: #647e8e; background: #d0dfe9; white-space: nowrap; }
.follow-button[aria-pressed="true"] { background: #fff1a0; color: #786329; }
.tabs { display: flex; align-items: center; gap: 3px; padding: 8px 12px; min-height: 42px; flex-shrink: 0; }
.tab { min-height: 30px; padding: 7px 10px; font-size: 10px; white-space: nowrap; border-radius: 7px; color: #678192; }
.tab.active { background: #e9f0f5; color: #435e72; }
.tab > span { margin-left: 4px; font-size: 8px; color: #8a9eac; }
.filter-favorites { margin-left: auto; width: 28px; height: 28px; padding: 0; color: #7893a4; }
.filter-favorites.active { color: #4e6574; background: var(--accent); border-radius: 7px; }
.filter-favorites svg { width: 15px; height: 15px; }
.sentence-list { flex: 1; min-height: 0; overflow-y: auto; padding: 13px 15px 15px; scrollbar-width: thin; scrollbar-color: #8ba5b766 transparent; scroll-padding: 10px; }
.sentence-card { position: relative; padding: 0 0 21px 38px; cursor: pointer; outline-offset: -2px; }
.chat-author { display: flex; align-items: center; gap: 9px; min-height: 21px; margin-bottom: 7px; }
.chat-avatar { position: absolute; left: 0; top: 0; display: block; width: 32px; height: 32px; border-radius: 11px; object-fit: contain; pointer-events: none; }
.chat-speaker { font-size: 9px; color: #658191; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 21px; margin: 0 0 5px; }
.timestamp { color: #6b8597; font-size: 8px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.active .timestamp { background: #fee500; color: #72621e; border-radius: 5px; padding: 3px 6px; }
.active .timestamp:after { content: " · 当前句"; }
.card-actions { display: flex; align-items: center; gap: 4px; color: #6a899c; }
.card-actions button { display: grid; place-items: center; width: 27px; height: 25px; padding: 0; border-radius: 6px; }
.card-actions svg { width: 13px; height: 13px; }
.card-actions .saved { color: #8a7422; }
.card-actions .saved svg { fill: var(--accent); }
.chat-messages { position: relative; width: fit-content; max-width: 100%; background: #fff; border-radius: 2px 11px 11px 11px; padding: 12px 14px 13px; box-shadow: 0 1px 1px #4a637012; }
.chat-messages:before { content: ""; position: absolute; top: 0; left: -7px; border-top: 9px solid #fff; border-left: 9px solid transparent; }
.sentence-card.active .chat-messages { box-shadow: 0 0 0 2px #fee500, 0 2px 3px #54708415; }
.sentence-card:hover .chat-messages { background: #fffef2; }
.card-ko { font-size: 20px; font-weight: 500; line-height: 1.75; letter-spacing: -.4px; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.card-ko mark { background: #fff3aa; color: inherit; padding: 0 2px; border-radius: 3px; font: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.translation-label { display: block; font-size: 8px; color: #b0b7bd; margin: 12px 0 4px; }
.card-zh { font-size: 12px; line-height: 1.8; color: #8e979f; margin: 0; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 8px; color: #547d77; }
.card-meta svg { width: 10px; height: 10px; }
.empty-state { padding: 25px 16px; font-size: 12px; line-height: 1.9; text-align: center; color: #617d91; }
.learning-composer { flex-shrink: 0; padding: 11px 14px 13px; background: #fff; border-top: 1px solid #adbfcd; }
.mission-status { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #9aa2aa; font-size: 8px; margin-bottom: 9px; }
.mission-status strong, .mission-status b { font-weight: 500; color: #818b94; }
.mission-status small { font-size: 8px; white-space: nowrap; }
.mission-dot { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: #d8bc20; vertical-align: 1px; }
.mission-actions { display: flex; gap: 7px; }
.mission-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 1; padding: 9px 6px; min-height: 36px; background: #f3f5f7; border-radius: 7px; font-size: 10px; color: #7b858e; white-space: nowrap; }
.mission-actions svg { width: 14px; height: 14px; }
.mission-actions .slow-label { font-size: 9px; font-weight: 650; }
.mission-actions #mission-record { background: var(--accent); color: #5b5030; font-weight: 500; }
.mission-actions #mission-record:hover:not(:disabled) { background: #f3db00; }
#speaking-panel, .dictation-panel { min-height: 0; overflow-y: auto; flex: 1; padding: 10px 15px 17px; }
#speaking-panel .practice-panel { display: block; margin: 0; border: 0; }
.dictation-panel h2 { font-size: 22px; letter-spacing: -.6px; margin: 13px 0; color: #476577; }
.dictation-panel > p { font-size: 11px; line-height: 1.9; color: #6d8a9d; }
.dictation-panel > .eyebrow { color: #678698; }
.dictation-panel label { display: block; font-size: 10px; margin: 20px 0 8px; color: #6b8598; }
.dictation-panel textarea { background: #f9fcfe !important; border: 0 !important; min-height: 105px; }
.dictation-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.dictation-result { margin-top: 17px; padding: 13px; background: #eaf2f7; color: #577184; border-radius: 9px; font-size: 11px; line-height: 1.9; }
.dictation-result strong { display: block; font-size: 19px; margin-top: 7px; overflow-wrap: anywhere; }

/* Listening stays available in every view. */
.player-bar { position: fixed; inset: auto 0 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; height: 80px; padding: 13px 27px; background: #fff; border-top: 1px solid #e1e5e9; }
.player-context { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mini-cover { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fee500; color: #534930; font-size: 22px; flex-shrink: 0; }
.player-context strong { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; margin-bottom: 5px; }
.player-context small { color: #a3aab1; font-size: 9px; }
.player-main { display: flex; align-items: center; gap: 17px; }
.player-main .icon-button { width: 40px; height: 44px; color: #9aabb6; }
.main-play { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--accent); color: #493e2a; }
.main-play:hover:not(:disabled) { background: #f3db00; }
.main-play svg { width: 20px; height: 20px; }
.player-options { display: flex; align-items: center; justify-content: flex-end; gap: 11px; }
.select-control { display: flex; align-items: center; gap: 5px; padding: 8px 10px; min-height: 36px; border-radius: 8px; background: #f4f6f8; }
.select-control svg { width: 14px; height: 14px; color: #9cabb5; }
select { max-width: 95px; border: 0; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }
.player-options select { font-size: 11px; color: #929da5; }
.player-options select option { background: var(--paper); color: var(--ink); }
.loop-button { display: flex; align-items: center; gap: 5px; min-height: 36px; font-size: 11px; padding: 8px 11px; border-radius: 8px; background: #f4f6f8; color: #929da5; }
.loop-button svg { width: 15px; height: 15px; }
.loop-button.active { background: #fff2ab; color: #8f7833; }

/* Course files, import and learning notes use the same messenger surfaces. */
dialog { padding: 26px; border: 1px solid var(--ink); border-left: 7px solid var(--ink); border-radius: 9px; background: var(--paper); width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; color: var(--ink); box-shadow: 7px 7px 0 #302c2a1c; }
dialog::backdrop { background: #27364370; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 3px double var(--ink); }
.dialog-header h2 { font-family: "Songti SC", "STSong", serif; font-size: 25px; font-weight: 600; letter-spacing: -.4px; margin: 7px 0 0; }
.dialog-header .icon-button { flex-shrink: 0; border: 1px solid var(--line); }
form > label { display: block; font-size: 12px; margin: 17px 0 8px; }
input:not([type=radio]):not([type=checkbox]), textarea { width: 100%; border: 1px solid #dce2e7; border-radius: 9px; padding: 12px 13px; background: #f9fafb; color: var(--ink); font-size: 14px; }
textarea { resize: vertical; line-height: 1.8; }
.field-hint { font-size: 11px; line-height: 1.9; color: var(--muted); margin-top: 8px; }
.import-source-tabs { display: flex; gap: 20px; margin: 20px 0; font-size: 12px; }
.import-source-tabs label { display: flex; align-items: center; gap: 5px; }
.import-source-tabs input { accent-color: var(--ink); }
details { color: var(--muted); font-size: 11px; margin: 14px 0; }
summary { cursor: pointer; }
pre { overflow: auto; background: #f3f6f8; border-left: 2px solid var(--sage); padding: 12px; line-height: 1.7; font-size: 12px; }
.primary-button { padding: 11px 19px; background: var(--ink); color: var(--paper); border-radius: 9px; font-size: 12px; }
.outlined-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--sage); border-radius: 9px; padding: 10px 15px; font-size: 12px; color: var(--ink); }
.wide { width: 100%; margin-top: 16px; }
.form-error { padding: 11px; border-left: 2px solid var(--pencil); font-size: 12px; line-height: 1.8; background: #fff0e9; color: #8d432d; }
.library-summary { font-size: 11px; line-height: 1.9; color: var(--muted); margin: 8px 0 0; }
.library-row { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.library-card { width: 100%; display: flex; align-items: center; gap: 13px; flex: 1; min-width: 0; text-align: left; padding: 15px 12px; border: 1px solid var(--line); border-radius: 9px; margin: 0; }
.library-card > div { min-width: 0; overflow-wrap: anywhere; }
.library-card h3 { font-size: 14px; font-weight: 600; line-height: 1.6; margin: 0 0 6px; }
.library-card p { font-size: 10px; color: var(--muted); line-height: 1.8; margin: 0; }
.library-card.selected { background: #f3f6f8; border-left: 3px solid var(--pencil); padding-left: 10px; }
.library-card:disabled { opacity: .75; }
.library-cover { width: 37px; height: 45px; display: grid; place-items: center; flex-shrink: 0; object-fit: cover; border: 1px solid #d8e1e8; background: #e3edf4; color: var(--ink); font-size: 23px; }
.library-archive { flex-shrink: 0; color: var(--muted); font-size: 10px; padding: 11px 4px; }
#library-dialog { width: min(680px, calc(100% - 30px)); }
.library-tabs { display: flex; gap: 0; margin: 0 0 20px; border-bottom: 1px solid var(--ink); }
.library-tabs button { padding: 10px 14px; border-radius: 9px; font-size: 12px; color: var(--muted); }
.library-tabs button.active { background: var(--ink); color: var(--paper); }
#library-show-archived { margin: -8px 0 12px; }
.catalog-view #library-show-archived { display: none !important; }
.catalog-search-label { display: block; font-size: 12px; margin: 17px 0 8px; }
.catalog-filters { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 10px; margin: 15px 0; }
.catalog-filters label { display: flex; flex-direction: column; gap: 7px; font-size: 10px; color: var(--muted); min-width: 0; }
.catalog-filters select { width: 100%; max-width: none; border: 1px solid var(--line); padding: 10px 7px; font-size: 12px; background: #f9fafb; }
.catalog-ready-label { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.catalog-ready-label input { accent-color: var(--ink); }
#catalog-summary { margin: 16px 0; }
.catalog-card { padding: 17px 0; margin: 0; border-bottom: 1px solid var(--line); }
.catalog-card h3 { font-size: 15px; line-height: 1.7; margin: 0 0 7px; }
.catalog-card p { font-size: 11px; line-height: 1.9; color: var(--muted); margin: 6px 0; overflow-wrap: anywhere; }
.catalog-original { font-size: 10px !important; }
.catalog-scenes { color: var(--sage) !important; }
.catalog-state { display: block; font-size: 11px; color: #866532; margin-top: 9px; }
.catalog-state.ready { color: var(--sage); }
.catalog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.catalog-actions a { display: inline-flex; align-items: center; min-height: 42px; font-size: 11px; color: var(--muted); }
.catalog-actions button { min-height: 42px; font-size: 12px; padding: 8px 12px; }
.catalog-pagination { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 4px; font-size: 12px; color: var(--muted); }
.sentence-quality { display: inline-block; font-size: 11px; color: #83552f; border-left: 2px solid #c69e4c; background: #fff7d4; padding: 5px 8px; margin-top: 10px; }
.import-progress { padding: 12px; border-left: 2px solid var(--sage); background: #eff4f8; color: var(--sage); font-size: 12px; line-height: 1.9; }
.import-progress:before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 8px; border: 2px solid #cbd8e2; border-top-color: var(--sage); border-radius: 50%; vertical-align: -1px; animation: import-spin 1s linear infinite; }
#import-form[aria-busy="true"] input { opacity: .65; }
.toast { position: fixed; z-index: 30; bottom: 98px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 30px); padding: 12px 18px; background: var(--ink); border: 1px solid #e4e8eb; color: var(--paper); font-size: 12px; line-height: 1.7; text-align: center; }
/* Sentence explanations stay readable while the dialog title remains in place. */
.card-actions .notes-button { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 48px; height: auto; min-height: 28px; gap: 3px; padding: 4px 6px; font-size: 9px; white-space: nowrap; }
#notes-dialog { width: min(720px, calc(100% - 24px)); top: 16px; bottom: auto; margin: 0 auto; max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
#notes-dialog[open] { display: flex; flex-direction: column; }
#notes-dialog .notes-header { flex-shrink: 0; gap: 12px; margin: 0; padding: 20px 24px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.notes-title-group { display: flex; align-items: center; gap: 11px; min-width: 0; }
.notes-title-group > div { min-width: 0; }
.notes-buddy { display: block; width: 42px; height: 42px; flex-shrink: 0; }
#notes-dialog .notes-header h2 { font-family: inherit; font-size: 20px; line-height: 1.4; margin: 0; }
#notes-subtitle { margin: 5px 0 0; color: #818b94; font-size: 12px; line-height: 1.5; }
#notes-dialog .notes-header .icon-button { width: 38px; height: 38px; border-radius: 12px; }
#notes-content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c4cfd7 transparent; padding: 24px; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
#notes-content .note-sentence { margin: 0; color: #2f4452; font-size: 24px; line-height: 1.65; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }
#notes-content p { margin: 0 0 12px; font-size: 15px; color: #596976; }
#notes-content .note-translation { margin: 8px 0 22px; font-size: 15px; color: #7b858e; }
.note-tabs { position: sticky; z-index: 1; top: -24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 0 -4px 23px; padding: 9px 4px; background: var(--paper); border-bottom: 1px solid #e9edf0; }
.note-tabs button { min-width: 0; min-height: 42px; padding: 9px 8px; border-radius: 9px; color: #7e8d98; font-size: 14px; line-height: 1.5; white-space: nowrap; }
.note-tabs button[aria-selected="true"], .note-tabs button.active { color: #65582a; background: #fff2aa; font-weight: 600; }
.note-tabs button:hover:not(:disabled) { background: #f0f4f7; }
.note-tabs button[aria-selected="true"]:hover { background: #ffeda0; }
.note-section { min-width: 0; }
#notes-content .note-section h3 { font-size: 17px; color: #435d70; line-height: 1.6; margin: 0 0 12px; }
#notes-content .note-section h4 { margin: 0 0 8px; color: #3a5263; font-size: 17px; font-weight: 600; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
.note-overview { margin: 0 0 20px; }
#notes-content .note-overview > p:last-child { margin-bottom: 0; }
.note-overview ul, .grammar-item ul { margin: 8px 0 0; padding-left: 21px; color: #596976; }
.note-overview li, .grammar-item li { margin-bottom: 7px; }
.word-list, .grammar-list { display: grid; gap: 12px; }
.word-item, .grammar-item { min-width: 0; padding: 18px; border: 1px solid #e4eaf0; border-radius: 12px; background: #f8fafc; }
.word-item h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
#notes-content .word-lemma { display: inline-block; margin-right: 8px; margin-bottom: 5px; color: #7d8d98; font-size: 12px; line-height: 1.6; font-weight: 400; }
#notes-content .word-meaning { margin-bottom: 6px; color: #4d6576; }
#notes-content .word-usage { margin-bottom: 0; color: #7f8c96; font-size: 14px; }
#notes-content .word-item > p:last-child, #notes-content .grammar-item > p:last-child { margin-bottom: 0; }
#notes-content .note-callout, #notes-content .note-explanation { margin: 18px 0 0; padding: 15px 17px; border-radius: 10px; background: #fff8d9; color: #756333; font-size: 14px; line-height: 1.9; }
#notes-content .note-callout p { color: inherit; font-size: inherit; }
#notes-content .note-overview p, #notes-content .note-callout p, #notes-content .grammar-item p { white-space: pre-line; }
#notes-content .note-callout > p:last-child { margin-bottom: 0; }
.note-source-links { display: flex; flex-wrap: wrap; gap: 9px 15px; padding-top: 19px; margin-top: 21px; border-top: 1px solid #e9edf0; font-size: 12px; line-height: 1.8; color: #8a969e; }
.note-source-links a { color: #587d94; text-decoration: underline; text-underline-offset: 3px; }
#notes-content .note-empty { padding: 17px; border-radius: 11px; background: #f4f7f9; color: #7e8d97; font-size: 14px; line-height: 1.9; }
@media (max-width: 620px) {
  .card-actions .notes-button { min-height: 40px; min-width: 51px; font-size: 10px; }
  #notes-dialog { top: 12px; max-height: calc(100dvh - 24px); width: calc(100% - 20px); }
  #notes-dialog .notes-header { padding: 15px 15px 13px; gap: 8px; }
  #notes-dialog .notes-header h2 { font-size: 18px; }
  .notes-title-group { gap: 8px; }
  .notes-buddy { width: 36px; height: 36px; }
  #notes-subtitle { font-size: 11px; }
  #notes-content { padding: 19px 16px; }
  #notes-content .note-sentence { font-size: 22px; }
  .note-tabs { top: -19px; margin-bottom: 19px; gap: 3px; }
  .note-tabs button { min-height: 44px; padding: 10px 5px; font-size: 13px; }
  .word-item, .grammar-item { padding: 15px 13px; }
  #notes-content .note-callout, #notes-content .note-explanation { padding: 13px; }
}
.guide-intro { margin: -4px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.guide-steps { padding: 0; margin: 0; counter-reset: guide; list-style: none; }
.guide-steps li { position: relative; padding: 0 0 22px 36px; counter-increment: guide; }
.guide-steps li:before { content: counter(guide, decimal-leading-zero); position: absolute; top: 0; left: 0; color: var(--pencil); font: italic 19px Georgia, serif; }
.guide-steps h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.guide-steps p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.guide-reminder { margin: 0; border-left: 2px solid #d7bf43; padding: 10px 13px; color: #7b6b37; background: #fff8d4; font-size: 12px; line-height: 1.9; }

/* Dialog adaptation and content states. */
dialog { border: 1px solid #dbe1e6; border-radius: 15px; box-shadow: 0 15px 60px #20334135; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-family: inherit; font-size: 22px; }
.dialog-header .icon-button { border: 0; background: #f4f6f8; }
dialog:not(#notes-dialog) .dialog-header { position: sticky; top: -26px; z-index: 3; background: var(--paper); padding-top: 14px; }
.primary-button { background: var(--accent); color: #54482a; font-weight: 500; }
.primary-button:hover:not(:disabled) { background: #f3db00; }
.outlined-button { border-color: #d7e0e7; color: #688293; }
.library-tabs { border-bottom: 1px solid var(--line); }
.library-tabs button.active { background: #fff4ad; color: #6d5c2c; }
.library-card.selected { border-left-color: #d8bf23; }
.library-cover { border: 0; border-radius: 12px; width: 40px; height: 40px; }
.catalog-card { border-left: 1px solid var(--line); }
.toast { border: 0; border-radius: 10px; background: #3c4b55; pointer-events: none; }
.netflix-entry { width: 100%; justify-content: center; margin-top: 15px; padding: 9px; font-size: 11px; }
.platform-note p { font-size: 12px; line-height: 1.9; }
.netflix-intro { color: #8a929a; font-size: 12px; line-height: 1.9; margin: 0 0 18px; }
.netflix-samples article { border: 1px solid var(--line); padding: 17px; border-radius: 11px; margin-bottom: 12px; }
.netflix-source-label { display: flex; justify-content: space-between; color: #9a7880; font-size: 9px; letter-spacing: .4px; }
.netflix-source-label > span { color: #89959e; }
.netflix-samples h3 { font-size: 14px; font-weight: 600; margin: 12px 0 7px; line-height: 1.6; }
.netflix-samples p { color: #8d969e; font-size: 11px; line-height: 1.8; margin: 0 0 5px; }
.source-caption-status { display: block; font-size: 10px; color: #a08a53; margin: 7px 0 13px; }
.netflix-samples .outlined-button { font-size: 11px; padding: 9px 12px; }
.netflix-samples .outlined-button svg { width: 12px; height: 12px; }
.netflix-footnote { font-size: 10px; line-height: 1.9; color: #a0a7ad; }
.netflix-footnote a { color: #67849a; }
body.subtitles-hidden .card-ko, body.subtitles-hidden .card-zh, body.subtitles-hidden .translation-label { visibility: hidden; }
body.subtitles-ko .card-zh, body.subtitles-ko .translation-label { display: none; }
body.subtitles-hidden .practice-korean, body.subtitles-hidden #practice-chinese, body.dictation-mode .practice-korean, body.dictation-mode #practice-chinese { visibility: hidden; }
body.subtitles-ko #practice-chinese { display: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px #bb48481a; } }
@keyframes import-spin { to { transform: rotate(360deg); } }
@media (min-width: 1500px) {
  .app-shell { grid-template-columns: 325px minmax(0, 1fr); }
  main { padding-left: 40px; padding-right: 40px; }
  .learning-grid { gap: 30px; }
  .card-ko { font-size: 22px; }
  .card-zh { font-size: 12px; }
}
@media (max-width: 1160px) {
  .app-shell { grid-template-columns: 265px minmax(0, 1fr); }
  .sidebar-rail { width: 54px; }
  .sidebar-body { padding-left: 10px; padding-right: 10px; }
  .side-learning { padding-top: 20px; margin-top: 14px; }
  main { padding-left: 19px; padding-right: 19px; }
  .learning-grid { gap: 15px; }
  .lesson-progress { width: 78px; }
  .practice-panel { padding: 17px 14px; }
  .chat-header { padding-left: 14px; padding-right: 12px; }
  .sentence-list { padding-left: 12px; padding-right: 12px; }
  .tab { padding: 7px 8px; }
  .card-ko { font-size: 18px; }
  .mission-actions { gap: 5px; }
  .mission-actions button { padding-left: 4px; padding-right: 4px; font-size: 9px; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  main { padding-left: 25px; padding-right: 25px; }
  .mobile-library { display: inline-flex; }
  .player-context { display: none; }
  .player-bar { grid-template-columns: auto 1fr; gap: 25px; }
}
@media (max-height: 780px) and (min-width: 961px) {
  .sidebar-subtitle { margin-bottom: 20px; }
  .side-learning ol { margin-top: 11px; margin-bottom: 5px; }
  .side-learning li { margin-top: 7px; margin-bottom: 7px; }
  .sidebar-bottom > small { display: none; }
}
@media (max-width: 620px) {
  .app-shell { display: block; height: auto; min-height: 100dvh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  main { padding: 0 15px 20px; display: block; overflow: visible; }
  .topbar { min-height: 61px; gap: 7px; }
  .room-heading { gap: 8px; }
  .room-avatar { width: 33px; height: 33px; border-radius: 12px; font-size: 20px; }
  .room-heading strong { font-size: 12px; }
  .room-heading small { font-size: 9px; margin-top: 4px; }
  .top-actions { gap: 2px; }
  .top-add { padding: 4px; width: 32px; justify-content: center; }
  .top-add > span:last-child { display: none; }
  .mobile-library { width: 32px; }
  .welcome-note { min-height: 41px; gap: 5px; }
  .welcome-note p { font-size: 9px; gap: 6px; }
  .welcome-note p strong { display: none; }
  .welcome-sun { font-size: 18px; }
  .welcome-note .guide-link { font-size: 9px; }
  .lesson-heading { padding: 5px 0 13px; align-items: center; gap: 13px; }
  .lesson-label { font-size: 9px; gap: 6px; }
  .pill { padding: 3px 5px; font-size: 8px; }
  .lesson-label > span:last-child { display: none; }
  .lesson-heading h1 { font-size: 18px; line-height: 1.5; margin: 6px 0 4px; }
  .lesson-heading p { font-size: 9px; -webkit-line-clamp: 1; }
  .lesson-progress { width: 64px; }
  .lesson-progress > div:first-child { flex-direction: column; gap: 4px; font-size: 9px; margin-bottom: 6px; }
  .lesson-progress strong { font-size: 9px; }
  .learning-grid { display: block; }
  .video-column { position: sticky; top: 0; z-index: 5; overflow: visible; padding: 7px 0 0; background: var(--bg); }
  .column-heading { display: none; }
  .video-wrap { border-radius: 10px; min-height: 200px; }
  .video-status { padding: 9px 1px 5px; font-size: 9px; }
  .video-column > .practice-panel { display: none; }
  .source-note { margin: 7px 0 0; }
  .source-note summary { font-size: 9px; min-height: 23px; }
  .source-note p { font-size: 10px; }
  .sentences-column { min-height: 395px; height: min(620px, 77dvh); margin-top: 14px; border-radius: 12px; }
  .chat-header { min-height: 52px; padding: 10px 14px 8px; }
  .chat-header strong { font-size: 12px; }
  .chat-header small { font-size: 9px; }
  .tabs { padding: 7px 11px; min-height: 41px; }
  .tab { font-size: 11px; padding: 7px 10px; }
  .tab > span { font-size: 8px; }
  .sentence-list { padding: 10px 13px 15px; }
  .sentence-card { padding-left: 37px; padding-bottom: 22px; }
  .chat-avatar { width: 30px; height: 30px; }
  .chat-speaker { font-size: 9px; }
  .timestamp { font-size: 9px; }
  .card-actions button { width: 30px; height: 28px; }
  .card-actions svg { width: 14px; height: 14px; }
  .chat-messages { padding: 11px 13px 12px; }
  .card-ko { font-size: 20px; line-height: 1.75; }
  .card-zh { font-size: 12px; }
  .translation-label { font-size: 9px; }
  .mission-status { font-size: 8px; }
  .mission-actions button { min-height: 40px; font-size: 10px; }
  #speaking-panel .practice-panel { padding: 17px 14px; }
  .dictation-panel { padding: 10px 17px 17px; }
  .player-bar { display: flex; justify-content: space-between; height: auto; min-height: 76px; padding: 11px 13px calc(11px + env(safe-area-inset-bottom)); gap: 5px; }
  .player-options { display: contents; }
  .player-main { order: 2; gap: 2px; flex-shrink: 0; }
  .player-main .icon-button { width: 44px; height: 44px; }
  .player-main .icon-button svg { width: 16px; height: 16px; }
  .main-play { width: 44px; height: 44px; border-radius: 14px; }
  .select-control { order: 1; padding: 8px 5px; gap: 2px; min-width: 0; }
  .select-control svg { display: none; }
  .select-control select { font-size: 11px; max-width: 62px; min-width: 0; }
  .loop-button { order: 3; gap: 4px; padding: 9px 7px; flex-shrink: 0; font-size: 11px; }
  .loop-button svg { width: 15px; height: 15px; }
  .toast { bottom: calc(94px + env(safe-area-inset-bottom)); }
  dialog { padding: 21px; }
  dialog:not(#notes-dialog) .dialog-header { top: -21px; }
  .dialog-header h2 { font-size: 21px; }
  input:not([type=radio]):not([type=checkbox]), textarea { font-size: 16px; }
  #library-dialog { padding: 19px; }
  #library-dialog .dialog-header { top: -19px; }
  .catalog-filters { grid-template-columns: 1fr 1fr; }
  .catalog-filters label:first-child { grid-column: 1 / -1; }
  .catalog-filters select { min-height: 42px; font-size: 13px; }
  .library-card { padding: 12px; gap: 10px; }
  .library-card.selected { padding-left: 10px; }
  .library-cover { width: 34px; height: 34px; font-size: 21px; }
  .library-card h3 { font-size: 13px; }
  .library-tabs button { font-size: 12px; padding: 9px; }
}
@media (max-width: 360px) {
  main { padding-left: 12px; padding-right: 12px; }
  .room-heading strong { font-size: 11px; }
  .room-heading small { font-size: 8px; }
  .lesson-heading h1 { font-size: 17px; }
  .tab { padding: 7px 8px; font-size: 10px; }
  .tab > span { margin-left: 2px; }
  .card-ko { font-size: 19px; }
  .chat-messages { padding-left: 11px; padding-right: 11px; }
  .sentence-list { padding-left: 11px; padding-right: 11px; }
  .mission-status { font-size: 7px; }
  .mission-actions button { font-size: 9px; }
  .player-bar { padding-left: 9px; padding-right: 9px; gap: 4px; }
  .select-control { padding: 8px 3px; flex-shrink: 1; }
  .select-control select { max-width: 55px; }
  .loop-button { padding: 9px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Calm, readable course discovery; controls remain reachable on narrow phones. */
.course-discovery { margin: 0 0 17px; }
.catalog-view .course-search-label, .catalog-view #course-search, .catalog-view .course-quick-start { display: none; }
.course-category-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.course-category-tabs button { min-height: 42px; padding: 9px 12px; border: 1px solid #dce4e8; border-radius: 14px; font-size: 12px; color: #50636f; background: #f7fafb; }
.course-category-tabs button.active { background: #fff3a4; color: #4a4322; border-color: #e6d470; font-weight: 600; }
.course-quick-start { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #f1f7f4; }
.course-quick-start button { flex-shrink: 0; min-height: 44px; background: white; }
.course-quick-start p { margin: 0; color: #506b5e; font-size: 12px; line-height: 1.8; }
.course-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 15px 0 10px; }
.course-filters label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); min-width: 0; }
.course-filters select { min-height: 44px; width: 100%; max-width: none; background: #f9fafb; border: 1px solid var(--line); border-radius: 9px; padding: 9px 7px; font-size: 12px; }
.difficulty-guide { border: 1px solid #dce4e8; border-radius: 9px; padding: 12px; margin: 13px 0 0; }
.difficulty-guide summary { font-size: 12px; color: #53656d; min-height: 24px; }
.difficulty-guide p { line-height: 1.9; overflow-wrap: anywhere; }
#course-clear { margin-top: 6px; min-height: 40px; }
.course-entry { margin-bottom: 15px; padding-bottom: 12px; border-bottom: 1px solid #e8eef1; }
.course-entry .library-row { margin-bottom: 0; }
.course-tags { display: flex; flex-wrap: wrap; gap: 6px 9px; margin: 0 0 7px !important; align-items: center; }
.course-tags > span { font-size: 11px; color: #536773; }
.difficulty-badge { border-radius: 6px; padding: 1px 6px; background: #eaf3e8; color: #38633f !important; }
.difficulty-badge.medium { background: #fff3ce; color: #785d29 !important; }
.difficulty-badge.hard { background: #f5e7ed; color: #884b64 !important; }
.difficulty-badge.unassessed { background: #ecedf0; color: #616873 !important; }
.course-difficulty-reason { margin: 8px 0 0 50px; font-size: 11px; line-height: 1.8; }
.course-difficulty-reason summary { padding: 7px 0; min-height: 36px; color: #53656d; }
.course-difficulty-reason ul { margin: 6px 0; padding-left: 20px; }
.course-difficulty-reason p { margin: 5px 0; }
.course-discovery button:focus-visible, .course-discovery select:focus-visible, .course-discovery input:focus-visible, .course-difficulty-reason summary:focus-visible { outline: 3px solid #86acbb; outline-offset: 3px; }
@media(max-width:600px){
  .course-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .course-filters label:last-child { grid-column: 1 / -1; }
  .course-quick-start { flex-direction: column; align-items: stretch; gap: 8px; }
  .course-category-tabs { gap: 6px; }
  .course-category-tabs button { flex: 1 1 calc(50% - 6px); font-size: 12px; padding: 9px 7px; }
  .course-difficulty-reason { margin-left: 5px; }
  .library-row { flex-wrap: wrap; }
  .library-row .library-card { flex-basis: 100%; }
  .library-row .library-archive { display: inline-flex; align-items: center; padding: 8px 10px; min-height: 44px; }
}

.library-import-status { margin: 4px 0 16px; padding: 11px 13px; border-radius: 9px; background: #fff8d9; color: #756333; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.library-card .course-learning-notes { margin-top: 7px; color: #4c6572; font-size: 11px; }
.lesson-learning-notes { flex-shrink: 0; padding: 10px 13px; margin-bottom: 15px; border-radius: 10px; background: #fffbee; color: #556674; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.lesson-learning-notes p { margin: 2px 0; }
.lesson-learning-notes strong { color: #475b67; font-weight: 600; }
.course-quick-start button.active { background: #fff8d9; border-color: #d8bf23; }
@media(max-width:600px){.lesson-learning-notes { padding: 9px 11px; font-size: 12px; margin-bottom: 12px; }}
@media(max-width:600px){.course-category-tabs button { flex: 1 1 calc(33.33% - 6px); padding-inline: 3px; font-size: 11px; white-space: nowrap; }}

.course-detail-filter { margin: 12px 0 0; border: 1px solid #dce4e8; border-radius: 9px; padding: 0 12px; }
.course-detail-filter > summary { min-height: 42px; padding: 11px 0; font-size: 12px; line-height: 1.7; color: #53656d; overflow-wrap: anywhere; }
.course-detail-filter[open] { padding-bottom: 12px; }
.course-detail-filter .course-filters { margin-top: 8px; }
.course-detail-filter .difficulty-guide { margin-top: 10px; }
.course-detail-filter > summary:focus-visible { outline: 3px solid #86acbb; outline-offset: 3px; }
@media(max-width:600px){
  .course-quick-start { padding: 9px; gap: 6px; }
  .course-quick-start p { font-size: 12px; line-height: 1.6; }
  .course-discovery { margin-bottom: 10px; }
  .course-category-tabs { margin: 10px 0; }
}

/* Prioritize the text learners read and the controls they use repeatedly. */
.card-zh { color: #526471; font-size: 14px; }
#practice-chinese { color: #526471; font-size: 14px; }
.record-hint { color: #526471; font-size: 13px; }
.dictation-panel > p, .dictation-panel label { font-size: 13px; color: #435d70; }
.dictation-panel .dictation-context { font-size: 12px; font-weight: 600; margin-bottom: 13px; }
.dictation-panel .dictation-draft-status { font-size: 12px; margin: 9px 0 0; }
.dictation-actions { flex-wrap: wrap; gap: 8px 14px; }
.dictation-actions button { min-height: 44px; font-size: 13px; }
.dictation-result { font-size: 14px; color: #405d70; }
.dictation-result p { margin: 10px 0; line-height: 1.8; }
.dictation-differences { padding-left: 20px; margin: 12px 0; overflow-wrap: anywhere; }
.dictation-differences li { margin: 5px 0; }
.card-actions button { min-width: 40px; min-height: 40px; }
.card-actions .notes-button { font-size: 12px; padding: 6px; min-height: 40px; }
.chat-speaker, .timestamp { font-size: 11px; color: #435d70; }
.empty-state .outlined-button { display: block; margin: 15px auto 0; min-height: 44px; }
.video-status { color: #526471; font-size: 12px; }
@media(max-width:620px){
  .card-zh { font-size: 14px; }
  .card-actions button, .card-actions .notes-button { min-width: 44px; min-height: 44px; }
  .record-actions .icon-button { width: 44px; height: 44px; }
  .record-button { min-height: 44px; font-size: 13px; }
  .lesson-heading p { font-size: 12px; -webkit-line-clamp: 2; }
  .video-status { font-size: 12px; }
  .mission-actions button { min-height: 44px; font-size: 12px; }
  .tab { min-height: 40px; }
}

/* A learner begins with one next step, not a catalogue of unfinished assets. */
.home-mode .app-shell { height: 100dvh; min-height: 0; }
.home-mode main { display: block; overflow-y: auto; padding-bottom: 36px; }
.home-mode main > .welcome-note, .home-mode main > .lesson-heading,
.home-mode main > .lesson-learning-notes, .home-mode main > .learning-grid,
.home-mode .player-bar { display: none !important; }
.home-mode .topbar { position: sticky; top: 0; z-index: 6; background: var(--bg); }
.learning-home { max-width: 990px; margin: 0 auto; padding: 28px 0; }
.path-intro h1 { font-size: 30px; letter-spacing: -.7px; margin: 9px 0 14px; }
.learning-home p { font-size: 14px; line-height: 1.9; color: #52616b; }
.learning-home h2 { font-size: 22px; line-height: 1.6; margin: 9px 0 12px; }
.learning-home h3 { font-size: 17px; line-height: 1.7; }
.learning-home .eyebrow { font-size: 12px; color: #5b6771; }
.stage-picker { margin: 24px 0; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.stage-picker > summary { cursor: pointer; font-size: 15px; min-height: 44px; line-height: 1.8; }
.stage-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; margin: 14px 0; }
.stage-card { min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border: 1px solid #dce2e5; background: white; text-align: left; border-radius: 12px; padding: 18px; }
.stage-card:first-child { grid-column: 1 / -1; }
.stage-card[aria-pressed=true], .stage-card:hover { border-color: #a79113; background: #fffbea; }
.stage-card strong { font-size: 17px; }
.stage-card > span:last-child { font-size: 13px; line-height: 1.8; color: #52616b; }
.stage-number { color: #6b5b16; background: #fff5ac; border-radius: 5px; padding: 4px 8px; font-size: 12px; }
.path-first-step, .path-today { background: #fff; border: 1px solid #e2e6e9; border-radius: 14px; padding: 24px; margin: 20px 0; }
.path-today { border-top: 4px solid #e4ce33; }
.path-today .primary-button { min-height: 48px; font-size: 15px; margin-top: 8px; }
.path-prerequisite { background: #f3f6f8; padding: 11px 14px; border-radius: 8px; }
.path-task-steps { padding-left: 20px; font-size: 14px; line-height: 1.8; }
.path-task-steps li { padding: 8px 0 8px 5px; }
.path-task-steps strong { margin-right: 10px; color: #635825; }
.path-resources, .path-review { margin: 28px 0; }
.path-course { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; background: white; border: 1px solid #e1e6e9; border-radius: 10px; margin: 10px 0; padding: 15px 18px; min-height: 64px; }
.path-course strong { font-size: 15px; line-height: 1.7; }
.path-course span { font-size: 13px; color: #52616b; line-height: 1.7; }
.path-outline { border-top: 1px solid var(--line); padding: 14px 0; }
.path-outline > summary { min-height: 44px; line-height: 1.8; cursor: pointer; font-size: 15px; }
.path-outline section { margin: 18px 0; }
.path-outline li { font-size: 14px; line-height: 1.9; }
.path-bottom-actions { margin: 24px 0; }
.path-bottom-actions button, .path-resources > button, .path-first-step button { min-height: 44px; font-size: 14px; }
.sentence-review-card { background: white; border: 1px solid #e1e6e9; border-radius: 10px; padding: 16px; margin: 10px 0; }
.sentence-review-card button { min-height: 44px; margin-right: 6px; }
.course-stage-row { display: flex; align-items: center; gap: 12px; margin: 15px 0 8px; }
.course-stage-row label { font-size: 14px; flex-shrink: 0; }
.course-stage-row select { min-height: 44px; min-width: 0; width: 100%; border: 1px solid #d5dde2; border-radius: 8px; padding: 7px 10px; background: white; font-size: 14px; }
.library-extra { border-top: 1px solid #e2e6e9; padding: 16px 0 0; margin-top: 18px; }
.library-extra > summary { min-height: 44px; cursor: pointer; font-size: 14px; }
.library-extra button { min-height: 44px; }
.library-card .course-goal { font-size: 14px; line-height: 1.8; color: #3e5360; }
.library-card .course-learning-notes { font-size: 12px; color: #5b6c76; line-height: 1.8; }
.stage-badge { background: #fff7c6; color: #635511; padding: 4px 7px; border-radius: 5px; }
#micro-dialog { width: min(780px,calc(100vw - 32px)); }
#micro-dialog .dialog-header { position: sticky; top: -26px; z-index: 3; background: var(--paper); padding-top: 14px; }
#micro-content { font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
#micro-content h3 { font-size: 18px; line-height: 1.8; margin: 18px 0 10px; }
.micro-objectives { background: #fff9d2; padding: 14px; border-radius: 8px; }
.micro-example { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; border-left: 3px solid #d8bd32; padding: 10px 14px; margin: 12px 0; background: #f5f7f8; }
.micro-example strong { font-size: 23px; }
.micro-example small { width: 100%; font-size: 13px; color: #52616b; }
.micro-exercise { border-top: 1px solid #e1e5e8; padding: 12px 0 24px; margin-top: 24px; }
.micro-answer fieldset { border: 0; padding: 0; margin: 0; }
.micro-answer legend { font-size: 13px; color: #5b6c76; }
.micro-answer fieldset label { display: flex; align-items: center; gap: 10px; border: 1px solid #dce3e7; background: #fff; border-radius: 8px; padding: 11px 13px; margin: 9px 0; min-height: 48px; cursor: pointer; }
.micro-answer input[type=radio] { width: 18px; height: 18px; accent-color: #7c701e; }
.micro-answer textarea { display: block; width: 100%; min-height: 80px; margin: 8px 0 14px; font-size: 18px; line-height: 1.8; }
.micro-exercise-actions, .micro-next-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.micro-exercise-actions button, .micro-next-actions button { min-height: 44px; font-size: 14px; }
.micro-feedback { margin-top: 13px; padding: 13px 16px; background: #edf3f6; border-radius: 8px; color: #405564; }
.micro-feedback p { margin: 8px 0 0; }
.micro-references { margin-top: 24px; font-size: 13px; }
.micro-references a { display: block; margin: 10px 0; text-decoration: underline; color: #476c85; }
.micro-source-media { margin: 18px 0; }
.micro-source-media iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; }
.micro-reading-material { white-space: pre-wrap; padding: 17px; background: #fff; border: 1px solid #dce3e7; border-left: 3px solid #d8bd32; border-radius: 8px; font-size: 20px; line-height: 1.9; }
.course-task-button { margin: 4px 0 12px; min-height: 44px; }
@media(max-width:700px) {
  .home-mode .app-shell { padding-bottom: env(safe-area-inset-bottom); }
  .home-mode main { padding-bottom: 25px; }
  .learning-home { padding-top: 22px; }
  .path-intro h1 { font-size: 25px; }
  .stage-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stage-card { padding: 14px; }
  .stage-card strong { font-size: 15px; }
  .stage-card > span:last-child { font-size: 12px; }
  .path-first-step, .path-today { padding: 19px 17px; }
  .course-stage-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  #micro-dialog { padding: 20px 17px; }
  #micro-dialog .dialog-header { top: -20px; }
  #micro-content h3 { font-size: 17px; }
  .micro-example { gap: 6px 10px; }
}

.course-extra-filters>summary,.micro-demonstration>summary,.record-comparison>summary{padding:12px 0;min-height:44px;cursor:pointer;font-weight:600}.course-extra-filters .course-filters{margin-top:10px}.record-comparison{font-size:13px;line-height:1.75;color:var(--muted)}.micro-demonstration{margin:16px 0}.path-outline li p{margin:4px 0}

.micro-source-media iframe{min-height:200px;}

.micro-compose{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}.micro-compose summary{min-height:44px;cursor:pointer}.micro-compose label{display:inline-grid;gap:6px;margin:0 8px 12px 0}.micro-compose select{min-height:44px;min-width:88px;font-size:20px}.micro-compose button{max-width:100%;white-space:normal;}
/* Prescribed learning stays readable on narrow phones and desktop. */
.fixed-learning{max-width:850px;margin:auto;padding:24px 0}.fixed-learning h1{font-size:clamp(24px,3vw,34px);line-height:1.35;margin:10px 0 12px}.fixed-learning h2{font-size:22px;margin-top:24px}.fixed-learning p{line-height:1.8}.route-picker{margin:22px 0}.route-choice{display:flex;flex-direction:column;text-align:left;gap:8px;width:100%;padding:18px;margin-top:12px;border:1px solid var(--border,#ddd);background:white;border-radius:14px;color:inherit}.route-choice[aria-pressed=true]{border-color:#4f4735;background:#fff8d8}.route-choice small{line-height:1.7;color:#625d51}.route-progress-row{display:grid;grid-template-columns:210px 1fr;gap:16px;align-items:center;font-size:14px;margin:12px 0}.route-progress-row progress{width:100%;height:12px;accent-color:#a48623}.fixed-task-list{padding-left:24px;margin-top:20px}.fixed-task-list li{padding:14px 0;border-bottom:1px solid #e6e2d9;line-height:1.7}.fixed-task-list li p{margin:6px 0}.fixed-task-list small{display:block;color:#686153}.fixed-task-list button{margin-top:6px}.route-outline,.free-stage-learning,.learning-report,.learning-materials,.pronunciation-lab{max-width:850px;margin:16px auto;padding:18px;border:1px solid #e3dfd4;border-radius:14px;background:#fffef9}.learning-materials a{display:inline-block;margin:12px 10px 0 0;text-decoration:none}.learning-report select{margin:16px;min-height:44px}.mistake-book section,.pronunciation-lab section{padding:16px 0;border-bottom:1px solid #ddd}.pronunciation-lab img{display:block;width:100%;max-width:510px;margin:14px 0}.mistake-book button,.pronunciation-lab button{margin:8px 10px 8px 0}.pronunciation-lab p{line-height:1.8}.route-outline section{padding:10px 0}.route-outline h3{margin-bottom:6px}.route-outline p{margin:6px 0}.shadow-mode-label{display:flex;flex-direction:column;gap:8px;margin:14px 0;font-size:14px}.shadow-mode-label select{min-height:44px;border:1px solid #d5cfbd;border-radius:10px;padding:8px;background:#fffef9}.audio-evidence{margin-top:16px;font-size:13px;line-height:1.7}.audio-evidence canvas,.audio-evidence svg{width:100%;max-width:100%;display:block}.audio-evidence label{display:block}.audio-evidence input{width:100%;max-width:100%;margin:10px 0}.audio-evidence button{min-height:44px}summary{min-height:30px;line-height:1.6;cursor:pointer}.home-mode .learning-home{padding-bottom:100px}
@media(max-width:620px){.route-progress-row{grid-template-columns:1fr;gap:6px}.fixed-learning{padding-top:10px}.fixed-learning h2{font-size:19px}.fixed-task-list{padding-left:20px}.route-outline,.learning-report,.pronunciation-lab,.learning-materials,.free-stage-learning{padding:14px}.learning-materials a{display:block;margin-right:0}.fixed-learning>.primary-button{width:100%;white-space:normal}.route-choice{padding:15px}.audio-evidence input{font-size:12px}.learning-report select{margin-left:8px;max-width:180px}}
.learning-home button,.learning-home summary,.learning-home a.outlined-button{min-height:44px}.fixed-learning>.primary-button{min-height:48px}.fixed-task-list .text-button{padding:8px 12px}.learning-report button{white-space:normal;line-height:1.6}.micro-next-actions .text-button{white-space:normal;min-height:44px}


/* Keep one sentence and its recording actions together. */
.video-options { color: #607584; font-size: 12px; line-height: 1.7; }
.video-options > summary { min-height: 44px; padding: 10px 0; }
.video-options > .outlined-button { min-height: 44px; }
.video-options .source-note { font-size: 12px; }
.lesson-advice-details > summary { min-height: 44px; cursor: pointer; }
body.speaking-mode .learning-composer { display: none; }
body.speaking-mode .chat-header { display: none; }
#speaking-panel .practice-panel { padding: 16px; }
.practice-heading { font-size: 12px; margin-bottom: 12px; color: #627786; }
.practice-heading .eyebrow { font-size: 12px; }
.practice-korean { width: auto; max-width: 100%; margin: 0; padding: 0; background: none; border-radius: 0; font-size: 24px; line-height: 1.6; color: #263d4b; }
.practice-korean::after { display: none; }
#practice-chinese { text-align: left; font-size: 14px; line-height: 1.7; margin: 7px 0 14px; color: #62717b; }
.shadow-mode-label { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; }
.shadow-mode-label > span { flex-shrink: 0; }
.shadow-mode-label select { flex: 1; width: 100%; min-width: 0; max-width: none; min-height: 44px; font-size: 14px; padding: 8px; border-color: #d8e1e7; background: #f7fafb; }
.record-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; }
.record-actions > button { min-width: 0; min-height: 48px; justify-content: center; padding: 10px 8px; font-size: 15px; line-height: 1.5; border-radius: 10px; }
.record-hint { min-height: 22px; color: #5a7180; font-size: 13px; line-height: 1.65; margin: 10px 0 12px; }
.mobile-guide { display: none; }
.record-feedback { display: flex; align-items: center; gap: 8px; }
.record-feedback .record-hint { flex: 1; min-width: 0; }
.record-elapsed { color: #5a7180; font-size: 13px; font-variant-numeric: tabular-nums; }
.recording-results { border-top: 1px solid #e6edf1; padding-top: 12px; }
.recording-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.recording-toolbar .outlined-button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; font-size: 14px; }
.recording-toolbar .text-button { min-height: 44px; padding: 8px; margin-left: auto; font-size: 12px; }
#recording-audio { min-height: 44px; margin: 10px 0 0; }
.practice-details { min-width: 0; font-size: 13px; color: #607686; line-height: 1.75; }
.practice-details > summary { min-height: 44px; display: flex; align-items: center; padding: 8px 0; cursor: pointer; }
.practice-details > summary::before { content: "▸"; margin-right: 6px; }
.practice-details[open] > summary::before { content: "▾"; }
.practice-details p { margin: 8px 0; }
.practice-footer { flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; margin-top: 8px; padding-top: 4px; }
.practice-footer > .text-button { min-height: 44px; padding: 8px 0; font-size: 13px; }
.practice-footer > .record-comparison { margin-left: auto; max-width: 100%; }
.practice-footer > .record-comparison[open] { flex-basis: 100%; margin-left: 0; }
@media (max-width: 620px) {
  :root { --mobile-video-height: min(calc((100vw - 24px) * 9 / 16), 26dvh, 200px); }
  main { padding: 0 12px 16px; }
  .topbar { min-height: 52px; }
  .room-heading small, .welcome-note { display: none; }
  .top-actions .mobile-guide { display: inline-flex; }
  .top-actions .mobile-guide, .top-actions .mobile-library, .top-add { width: 44px; height: 44px; flex-shrink: 0; }
  .lesson-heading { padding: 7px 0 10px; }
  .lesson-label .pill, .lesson-heading p { font-size: 11px; }
  .lesson-heading h1 { margin-top: 4px; font-size: 18px; }
  .lesson-progress strong, .lesson-progress > div:first-child { font-size: 11px; }
  .lesson-learning-notes { margin: 0 0 8px; padding: 0 10px; font-size: 13px; }
  .lesson-learning-notes summary { min-height: 44px; padding: 10px 0; }
  .learning-grid { display: block; }
  .video-column { display: contents; position: static; overflow: visible; }
  .video-wrap { position: sticky; top: 0; z-index: 5; min-height: 0; height: var(--mobile-video-height); aspect-ratio: auto; border: 1px solid var(--bg); }
  .video-status { font-size: 11px; padding: 6px 0 0; min-height: 28px; }
  .video-options > summary { min-height: 40px; padding: 8px 0; font-size: 12px; }
  .sentences-column { margin-top: 4px; min-height: 360px; }
  .tabs { min-height: 48px; padding: 4px 7px; gap: 2px; }
  .tab { min-height: 44px; padding: 8px 10px; font-size: 13px; }
  .tab > span { display: none; }
  .filter-favorites { min-width: 44px; min-height: 44px; }
  .chat-header { padding: 6px 10px; min-height: 46px; }
  .chat-header > div:first-child { display: none; }
  .chat-header-actions { width: 100%; justify-content: space-between; }
  .follow-button, .chat-header .icon-button { min-height: 44px; font-size: 12px; }
  .chat-header .icon-button { min-width: 44px; }
  body.speaking-mode .sentences-column { height: auto; min-height: 0; overflow: visible; padding-bottom: 0; }
  body.speaking-mode .tabs { position: sticky; top: var(--mobile-video-height); z-index: 4; background: var(--chat); border-radius: 12px 12px 0 0; }
  #speaking-panel { overflow: visible; padding: 0 8px 8px; scroll-margin-top: calc(var(--mobile-video-height) + 52px + 8px); scroll-margin-bottom: calc(80px + env(safe-area-inset-bottom)); }
  #speaking-panel .practice-panel { padding: 14px 12px 8px; }
  .practice-heading { margin-bottom: 8px; }
  .practice-korean { font-size: 24px; line-height: 1.55; }
  #practice-chinese { margin-bottom: 12px; }
  .player-bar { min-height: 68px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 4px; }
  .player-main { gap: 0; }
  .player-options .select-control { min-height: 44px; padding: 6px; }
  .select-control select { font-size: 12px; min-height: 32px; }
  .loop-button { min-height: 44px; min-width: 44px; padding: 6px; font-size: 12px; }
  .toast { top: calc(8px + env(safe-area-inset-top)); bottom: auto; font-size: 13px; }
}
@media (max-width: 360px) {
  .player-bar { gap: 2px; padding-left: 4px; padding-right: 4px; }
  .player-main .icon-button { width: 44px; }
  .loop-button > span:last-child { display: none; }
  .player-options .select-control { padding: 4px; }
  .record-actions { gap: 7px; }
  .record-actions > button { font-size: 14px; }
}

/* Direct explanations stay reachable during speaking and in narrow dialogs. */
.practice-heading { min-height: 44px; gap: 6px; margin-bottom: 6px; }
.practice-heading .practice-explanation { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 60px; min-height: 44px; padding: 6px; font-size: 13px; white-space: nowrap; color: #49677b; }
.practice-heading .practice-explanation svg { width: 16px; height: 16px; }
#sentence-position { margin-left: auto; white-space: nowrap; }
.dialog-header .icon-button, #notes-dialog .notes-header .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.course-stage-row select { max-width: none; }
#notes-content .note-translation + .note-empty { display: inline-block; padding: 4px 9px; margin: 0 0 10px; font-size: 12px; line-height: 1.6; border-radius: 6px; }
@media (max-width: 620px) {
  #notes-dialog { width: calc(100% - 16px); max-width: calc(100% - 16px); top: 8px; max-height: calc(100dvh - 16px); }
  #notes-dialog .notes-header { padding: 10px 12px; }
  .notes-buddy { width: 32px; height: 32px; }
  #notes-content { padding: 16px 12px; }
  #notes-content .note-sentence { font-size: 20px; line-height: 1.5; }
  #notes-content .note-translation { margin: 7px 0 10px; font-size: 14px; line-height: 1.7; }
  .note-tabs { top: -16px; padding: 5px 4px; margin-bottom: 12px; }
  .note-tabs button { padding: 8px 5px; }
  .word-item, .grammar-item { padding: 12px; }
  .practice-heading { margin-bottom: 6px; }
  .course-stage-row select { font-size: 16px; }
}

.library-navigation { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.library-navigation > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; font-size: 14px; }
.library-navigation > button[aria-pressed="true"] { background: #fff3b0; border-color: #ddc855; color: #64592c; }
