:root {
  --ink: #193c39;
  --muted: #596b66;
  --ground: #fcfbf7;
  --paper: #fcfbf7;
  --tint: #f0f3ed;
  --line: #dce1d8;
  --sans: Arial, Helvetica, sans-serif;
  --header: 86px;
  --nav: 280px;
}
html { scroll-padding-top: calc(var(--header) + 24px); }
body { background: var(--ground); color: #293f3d; }
.topbar { height: var(--header); padding: 0 34px; gap: 28px; background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.topbar .brand { gap: 13px; color: var(--ink); line-height: 1.3; }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font: 17px Georgia, serif; border: 0; }
.brand strong { font: 500 23px Georgia, serif; }
.brand small { font-size: 9px; letter-spacing: 1.6px; color: var(--ink); }
.edition { color: var(--ink); margin: 0 auto; flex: 1; text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .quiet-button, #language-switch { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 13px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.topbar .quiet-button:hover, #language-switch:hover { background: var(--tint); }
.topbar .contents-toggle { display: none; }
body .workspace, body.tuner-tool-active .workspace, body.fingering-tool-active .workspace { max-width: 1680px; padding: 0; gap: 0; grid-template-columns: var(--nav) minmax(0, 1fr); }
body .sidebar { position: sticky; top: var(--header); padding: 0; border-right: 1px solid #d6d8d2; height: calc(100dvh - var(--header)); max-height: calc(100dvh - var(--header)); min-height: 0; align-self: start; overflow: hidden; }
.sidebar .chapter-links { display: grid; gap: 3px; overflow: visible; max-height: none; }
.sidebar .chapter-links a { min-height: 40px; padding: 8px 10px; border-radius: 5px; font-size: 15px; font-weight: 550; line-height: 1.35; color: var(--ink); }
.sidebar .chapter-links a > span { min-width: 24px; color: #59655e; font-size: 11px; }
.sidebar .chapter-links a:hover { background: #e5e4dc; }
.sidebar .chapter-links a[aria-current] { color: #1d5d8b; background: #fff; box-shadow: inset 3px 0 #1d5d8b; font-weight: 650; border: 0; }
.sidebar .nav-kicker { margin: 0 0 12px; padding: 0 12px; color: #59655e; font-size: 11px; letter-spacing: 1.6px; }
body .sidebar .finger-tool-shortcut { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 7px; align-items: center; margin: 0 0 12px; min-height: 42px; padding: 9px; border: 1px solid #b8d4c0; border-left: 4px solid #168244; border-radius: 5px; background: #f0f8f1; color: #168244; font-size: 14px; font-weight: 700; }
.sidebar .finger-shortcut-icon { width: auto; height: auto; background: transparent; color: inherit; }
.sidebar-note { font-size: 12px; margin-top: 20px; padding: 16px 10px 10px; }
.sidebar .quickstart-download, #contents-dialog .quickstart-download { border-radius: 5px; background: var(--ink); color: white; }
.sidebar .quickstart-download strong { font-size: 14px; }
.sidebar .quickstart-download small, .offline-status { font-size: 11px; }
body #main { min-width: 0; padding: 44px clamp(24px, 4vw, 64px) 24px; }
body .chapter { background: transparent; border: 0; box-shadow: none; padding: 0; outline: none; border-radius: 0; }
#start .hero-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; background: transparent; }
#start .hero-copy { padding: 0; }
#start .hero-copy h1 { line-height: 1.08; font-weight: 400; }
#start > :not(.hero-layout) { margin-left: 0; margin-right: 0; }
.button.primary { background: var(--ink); }
.button.primary:hover { background: #28574d; }
h1, h2, h3, h4 { color: var(--ink); }
.goal-box { background: var(--tint); color: var(--ink); border-left: 3px solid #71836e; border-radius: 0; }
.goal-box p, .goal-box .goal-label { color: var(--ink); }
h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: -1.5px; }
.chapter-head h1 { font-size: clamp(38px, 4.3vw, 64px); line-height: 1.12; }
.eyebrow, .mini-label { color: #46625b; }
.manual-footer { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 0; font-size: 10px; letter-spacing: .4px; color: var(--muted); }
.chapter-pager { background: var(--paper); border-top: 1px solid var(--line); box-shadow: none; }
dialog { background: var(--paper); color: #293f3d; border-color: var(--line); border-radius: 8px; }
html[lang="zh-CN"] { --sans: 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; --serif: 'Noto Serif CJK SC', 'Songti SC', serif; }
html[lang="zh-CN"] h1, html[lang="zh-CN"] h2, html[lang="zh-CN"] #start .hero-copy h1 { font-family: var(--serif); letter-spacing: 0; line-height: 1.4; }
html[lang="zh-CN"] .eyebrow, html[lang="zh-CN"] .mini-label { letter-spacing: .6px; }
html[lang="zh-CN"] .tuner-coach p { line-height: 1.7; }
#pitch-workbench[data-mode="demo"][data-audio="reference"] .tuner-controls { display: flex; grid-row: 3; grid-column: 1 / -1; }
#pitch-workbench[data-mode="demo"] #tuner-start, #pitch-workbench[data-mode="demo"] #tuner-mic-hint { display: none; }
@media screen and (min-width: 761px) { body.tuner-tool-active #main, body.fingering-tool-active #main { padding: 20px 28px; } }
@media screen and (max-width: 1100px) { :root { --nav: 258px; } .topbar { gap: 16px; padding-inline: 24px; } .edition { display: block; font-size: 15px; } }
@media screen and (max-width: 760px) {
  :root { --header: 73px; }
  .topbar { padding: 10px 17px; gap: 7px; height: auto; min-height: var(--header); }
  .brand { gap: 9px; flex: 1 1 0; min-width: 0; }
  .brand-mark { width: 36px; height: 36px; font-size: 13px; flex-shrink: 0; }
  .brand strong { font-size: 20px; }
  .brand small { font-size: 7px; letter-spacing: 1px; }
  .topbar .quiet-button, #language-switch { padding: 7px 10px; font-size: 11px; }
  .topbar .contents-toggle { display: inline-flex; }
  .edition { display: none; }
  body .workspace, body.tuner-tool-active .workspace, body.fingering-tool-active .workspace { display: block; }
  body #main, body.tuner-tool-active #main, body.fingering-tool-active #main { padding: 24px 18px; }
  body .sidebar { display: none; }
  .chapter-head h1 { font-size: 38px; }
  #start .hero-layout { grid-template-columns: 1fr; }
}
@media screen and (max-width: 380px) { .brand-mark { display: none; } .topbar { padding-inline: 12px; } .topbar .quiet-button, #language-switch { padding-inline: 8px; } }
@media print { #language-switch { display: none !important; } body #main { padding: 0; } body .chapter { padding: 0; } .manual-footer { display: none; } }

.topbar #language-switch, .topbar [data-search-open] { width: 88px; height: 44px; padding-inline: 8px; gap: 5px; }
.sidebar-scroll { height: 100%; min-height: 0; overflow-y: auto; padding: 28px 20px 52px 28px; scrollbar-width: none; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.sidebar-scroll::-webkit-scrollbar, #contents-dialog::-webkit-scrollbar { display: none; }
.nav-scroll-arrow { position: absolute; z-index: 3; bottom: 4px; left: 16px; width: calc(100% - 32px); height: 36px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); box-shadow: 0 -8px 14px var(--paper); cursor: pointer; }
.nav-scroll-arrow[hidden] { display: none; }
.sidebar-scroll:focus-visible { outline: 2px solid #1d5d8b; outline-offset: -3px; }
#contents-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: none; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
#contents-dialog > .dialog-head { position: sticky; top: -24px; z-index: 4; background: var(--paper); }
#contents-dialog > .nav-scroll-arrow { position: sticky; display: block; bottom: -12px; left: 0; width: 100%; flex-shrink: 0; }
#contents-dialog > .nav-scroll-arrow[hidden] { display: none; }
#start .safety-callout { color: var(--ink); border-color: var(--line); background: var(--tint); }
#start .safety-callout > strong { color: var(--ink); }
#start .safety-list > li { background: var(--paper); border-color: var(--line); }
#start .safety-list > li .safety-heading > span { color: var(--ink); background: #e3e9e0; }
#start .safety-list > li:last-child { border-color: #b94a42; background: #fff4f2; }
#start .safety-list > li:last-child .safety-heading > span { color: #fff; background: #a52d27; }
#start .safety-list > li:last-child strong { color: #922b25; }
#start .safety-secondary, #start .key-type-note { color: var(--ink); background: var(--tint); border-color: var(--line); }
.merged-course-map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.merged-course-map-grid > li { min-width: 0; display: flex; flex-direction: column; }
.merged-course-map-grid > li > strong { font-size: 14px; line-height: 1.5; }
.merged-course-map-grid .route-button-r3 { display: flex; flex: 1; flex-direction: column; gap: 12px; }
.merged-course-map-grid .route-button-r3 > span { line-height: 1.6; font-size: 12px; }
.merged-course-map-grid .route-button-r3 > b { margin-top: auto; white-space: nowrap; font-size: 12px; }
html[lang="zh-CN"] #start .hero-copy h1 { font-size: clamp(30px, 3.5vw, 56px); text-wrap: balance; }
#interactive-fingering .interactive-note-buttons { grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); }
#interactive-fingering .interactive-note-button { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#interactive-fingering .interactive-fingering-registers { min-width: 0; }
#tuning .tuner-guide-launch { position: sticky; top: calc(var(--header) + 8px); z-index: 10; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 4px 12px #193c3914; }
#flute-nerd-merged-scales .merged-source-figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.practice-entry { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); }
.practice-entry p { margin: 0 0 10px; font-size: 13px; }
.first-note-practice-links { position: sticky; top: calc(var(--header) + 8px); z-index: 12; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; margin-block: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 4px 12px #193c3914; }
.first-note-practice-links .button { min-width: 0; min-height: 44px; padding: 10px 8px; white-space: normal; text-align: center; justify-content: center; font-size: 14px; }
#starter-notes [id] { scroll-margin-top: 96px; }
.sound-practice-entry .button { gap: 8px; }
.lesson-practice-entry, .guided-note-lesson { padding: 18px; margin-block: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); }
.lesson-practice-entry h3, .lesson-practice-entry p { flex-basis: 100%; margin: 0 0 10px; }
.lesson-practice-entry p, .guided-note-lesson p { font-size: 14px; line-height: 1.65; }
.lesson-reading-link { display: block; margin-top: 12px; }
.guided-note-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.guided-note-actions { display: flex; justify-content: flex-end; }
.guided-note-heading h3 { margin: 0; font-size: 18px; }
#guided-note-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-block: 14px; }
#guided-note-steps button { min-width: 0; white-space: normal; }
#guided-note-steps [aria-pressed="true"] { background: var(--ink); color: #fff; }
#guided-note-step-title { margin: 0 0 6px; font-size: 16px; }
.guided-note-copy { padding: 0; margin: 8px 0; border: 0; background: transparent; }
.guided-note-copy summary { min-height: 44px; padding: 10px 0; font-size: 13px; }
#guided-note-recover { display: block; margin-top: 12px; }
.guided-note-copy p { margin: 6px 0; }
#guided-note-check { padding-left: 10px; border-left: 3px solid var(--ink); }
.guided-note-actions { margin-top: 10px; font-size: 13px; }
#interactive-fingering:has(#guided-note-lesson:not([hidden])) .interactive-fingering-registers,
#interactive-fingering:has(#guided-note-lesson:not([hidden])) .interactive-register-switch,
#interactive-fingering:has(#guided-note-lesson:not([hidden])) .interactive-note-select { display: none; }
#fingering-practice-host:has(#fingering-practice-panel:not([hidden])) > .practice-entry { padding: 0; border: 0; background: transparent; display: flex; justify-content: flex-end; }
#fingering-practice-host:has(#fingering-practice-panel:not([hidden])) > .practice-entry p { display: none; }
@media screen and (max-width: 600px) { .lesson-practice-entry, .guided-note-lesson { padding: 12px; } #guided-note-steps { gap: 5px; } #guided-note-steps button { font-size: 12px; padding: 10px 6px; } .guided-note-actions { align-items: stretch; flex-direction: column; } }
@media screen and (max-width: 600px) { .first-note-practice-links { gap: 5px; padding: 6px; } .first-note-practice-links .button { font-size: 12px; padding: 9px 5px; } }
@media print { .lesson-practice-entry, .guided-note-lesson, .first-note-practice-links { display: none !important; } }
#pitch-workbench[data-task="practice"] { padding: 16px; margin-top: 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
#pitch-workbench[data-task="practice"] .tuner-app-bar, #pitch-workbench[data-task="practice"] .tuner-header, #pitch-workbench[data-task="practice"] .tuner-mode-switch, #pitch-workbench[data-task="practice"] .tuner-journey, #pitch-workbench[data-task="practice"] .tuner-safety, #pitch-workbench[data-task="practice"] #tuner-next-practice, #pitch-workbench[data-task="practice"] #tuner-target-hint, #pitch-workbench[data-task="practice"] #tuner-note-picker { display: none; }
#pitch-workbench[data-task="practice"] .tuner-target-row { display: flex; justify-content: space-between; }
#pitch-workbench[data-task="practice"] .tuner-target-row::before { content: attr(data-practice-label); font-size: 20px; font-weight: 700; }
#pitch-workbench[data-task="practice"] .tuner-note { font-size: 42px; }
#pitch-workbench[data-task="practice"] .tuner-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#pitch-workbench[data-task="practice"] .tuner-coach { padding: 14px; }
#tuner-practice-mode { display: none; }
@media screen and (max-width: 1200px) { .merged-course-map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media screen and (max-width: 760px) { .topbar #language-switch, .topbar [data-search-open] { width: 60px; } .practice-entry { padding: 10px; } }
@media screen and (max-width: 600px) { .merged-course-map-grid, #flute-nerd-merged-scales .merged-source-figure-grid { grid-template-columns: minmax(0, 1fr); } #pitch-workbench[data-task="practice"] .tuner-workspace { grid-template-columns: minmax(0, 1fr); } }
@media print { .sidebar, .nav-scroll-arrow, .practice-entry, #pitch-workbench { display: none !important; } }
