@font-face { font-family: Lesson; src: url('assets/FrexSansGB-Regular.woff2'); font-display: swap; }
@font-face { font-family: Lesson; src: url('assets/FrexSansGB-Bold.woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Hand; src: url('assets/SmileySans-Oblique.ttf.woff2'); font-display: swap; }
/* Citrus, sea breeze, Amalfi blue and cream from the user's reference. */
:root {
  --page: #fff9e8;
  --surface: #fffdf5;
  --score-paper: #ffffff;
  --ink: #203a61;
  --muted: #53657d;
  --line: #d4dce2;
  --accent: #2e5aa7;
  --accent-soft: #e2f1ff;
  --mode-active: #86c5ff;
  --accent-border: #91afd5;
  --control-line: #b6c9df;
  --play-bg: #ffa62b;
  --play-ink: #203a61;
  --play-border: #d48a22;
  --play-hover: #ffb64f;
  --role-two-ink: #203a61;
  --role-three-ink: #fffdf5;
  --role-one: #f8e6a0;
  --role-two: #86c5ff;
  --role-three: #2e5aa7;
  --role-two-line: #6c9fd2;
  --role-three-line: #2e5aa7;
  --selection: #cce6ff;
  --focus: #2e5aa7;
  --error: #963a1e;
  --error-bg: #fff0d5;
  color: var(--ink);
  background: var(--page);
  color-scheme: only light;
  font-family: Lesson, 'PingFang SC', 'Microsoft Yahei', sans-serif;
  font-size: 16px;
}
:root[data-eye="on"] {
  --score-paper: #f8e6a0;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
a { color: var(--accent); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--selection); }
svg { display: block; }
.site-header { max-width: 1320px; padding: 10px 32px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.classroom-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; color: var(--accent); }
.classroom-brand svg { width: 28px; height: 28px; }
.site-header p { margin: 0; font-size: 14px; color: var(--muted); }
main { max-width: 1320px; margin: auto; padding: 24px 32px; }
.lesson-intro { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
h1 { margin: 0; font-family: Hand, Lesson, sans-serif; font-size: 44px; line-height: 1.2; font-weight: 400; color: var(--accent); }
.lesson-intro p { margin: 5px 0 0; color: var(--muted); font-size: 17px; }
.roles { display: flex; gap: 10px; }
.roles button { min-width: 140px; min-height: 66px; padding: 9px 20px; border: 2px solid var(--accent-border); border-radius: 12px; background: var(--surface); text-align: center; }
.roles strong { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 19px; }
.roles .role-check { display: grid; place-items: center; flex: 0 0 17px; width: 17px; height: 17px; margin: 0; border: 1px solid var(--accent-border); border-radius: 50%; color: transparent; font-size: 13px; line-height: 1; }
.roles [aria-pressed=true] .role-check { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.roles span { display: block; font-size: 12px; margin-top: 4px; color: inherit; }
.roles [data-role=SI] { color: var(--accent); background: var(--role-one); }
.roles [data-role=SII] { color: var(--role-two-ink); background: var(--role-two); border-color: var(--role-two-line); }
.roles [data-role=A] { color: var(--role-three-ink); background: var(--role-three); border-color: var(--role-three-line); }
.roles button[aria-pressed=true] { border-color: currentColor; }
.roles [data-role=A] .role-check { border-color: #c8dcf6; }
.roles [data-role=A][aria-pressed=true] { border-color: var(--ink); }
.roles [data-role=A][aria-pressed=true] .role-check { background: var(--surface); color: var(--accent); border-color: var(--surface); }
.roles button:hover { filter: brightness(.97); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.lesson-main { min-width: 0; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--control-line); }
.mode-tabs button { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 62px; padding: 12px 8px; border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); font-size: 19px; font-weight: 700; }
.mode-tabs svg { width: 26px; height: 26px; flex: 0 0 auto; }
.mode-tabs button[aria-pressed=true] { background: var(--mode-active); border-color: var(--accent); color: var(--ink); }
.mode-tabs button:hover { background: var(--accent-soft); }
.track-options { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0 4px 8px; color: var(--muted); font-size: 14px; }
.track-options label { display: inline-flex; align-items: center; min-height: 44px; }
input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; vertical-align: middle; }
.view-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.view-tabs button { padding: 12px 4px; min-height: 48px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 16px; color: var(--muted); }
.view-tabs button[aria-pressed=true] { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.score-toolbar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 0; background: var(--page); }
.score-navigation, .page-controls, #page-form, .score-zoom { display: flex; align-items: center; gap: 6px; }
.score-navigation { gap: 14px; }
#page-form { margin: 0; white-space: nowrap; font-size: 13px; }
.page-controls button, .score-zoom button { min-height: 44px; padding: 6px 10px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); font-size: 13px; white-space: nowrap; }
.page-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.page-controls svg { width: 18px; height: 18px; }
.page-controls button:disabled, .score-zoom button:disabled { opacity: .4; cursor: default; }
#page { width: 44px; min-height: 44px; text-align: center; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); color: var(--ink); appearance: textfield; }
#page::-webkit-inner-spin-button, #page::-webkit-outer-spin-button { appearance: none; }
#page-form .jump, #bars { display: none; }
.follow { white-space: nowrap; }
.score-zoom { gap: 4px; }
.score-zoom button { min-width: 44px; padding: 5px 7px; }
.score-zoom svg { width: 18px; height: 18px; }
.score-zoom output { min-width: 40px; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.paper { height: calc(100dvh - 340px); min-height: 380px; overflow: auto; overscroll-behavior: contain; isolation: isolate; background: var(--score-paper); border: 1px solid var(--line); border-radius: 10px; scrollbar-color: var(--accent-border) var(--page); scrollbar-width: thin; }
.paper img { display: block; width: 100%; max-width: none; height: auto; margin-inline: auto; }
.practice { position: sticky; top: 20px; min-width: 0; }
.player-shell { padding: 4px 0 22px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.track-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.track-heading p { margin: 0; font-size: 13px; color: var(--muted); }
.track-heading h2 { margin: 3px 0 0; font-size: 22px; }
.track-heading a { font-size: 12px; }
.current-caption { margin: 26px 0 10px; font-size: 15px; font-weight: 700; color: var(--accent); }
.current-line { font-size: 25px; font-weight: 700; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.current-meaning { font-size: 16px; line-height: 1.7; color: var(--muted); margin: 10px 0 22px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 15px; }
.secondary-control { width: 44px; height: 44px; display: grid; place-items: center; padding: 4px; border: 0; background: transparent; }
.secondary-control svg { width: 22px; height: 22px; }
.play { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 142px; height: 54px; padding: 10px 22px; background: var(--play-bg); color: var(--play-ink); border: 1px solid var(--play-border); border-radius: 28px; font-size: 19px; font-weight: 700; }
.play:hover { background: var(--play-hover); }
.play svg { width: 24px; height: 24px; }
.progress { margin-top: 17px; }
.progress input { width: 100%; margin: 0; height: 20px; accent-color: var(--accent); cursor: pointer; }
.progress>div { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.practice-extra { padding: 18px 0; }
.practice-extra>summary { display: none; }
.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; font-size: 13px; color: var(--muted); }
.settings label { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.settings select { padding: 6px; min-height: 44px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.volume input { width: 96px; accent-color: var(--accent); }
.lyrics-heading { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.lyrics-heading h3 { margin: 0; font-size: 15px; }
.lyrics-heading span { font-size: 12px; color: var(--muted); }
.phrases { max-height: 260px; overflow: auto; margin-top: 12px; scrollbar-width: thin; }
.phrase { display: flex; gap: 10px; width: 100%; padding: 13px 8px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; font-size: 16px; line-height: 1.6; }
.phrase .bar { min-width: 28px; color: var(--muted); font-size: 12px; padding-top: 3px; }
.phrase.active { background: var(--accent-soft); border-radius: 8px; color: var(--accent); }
.phrase:hover { background: var(--accent-soft); }
.empty, .lyrics-help { color: var(--muted); font-size: 15px; line-height: 1.7; }
.lyrics-help { margin: 10px 0 14px; }
#lyrics-view { min-height: 450px; }
.lyric-card { display: block; width: 100%; padding: 20px 22px; margin: 0 0 12px; border: 2px solid var(--control-line); border-radius: 12px; background: var(--surface); text-align: left; }
.lyric-card .english { display: block; font-size: 26px; line-height: 1.65; font-weight: 700; }
.lyric-card .meaning { display: block; margin-top: 8px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.lyric-card.active { border-color: var(--accent); background: var(--accent-soft); }
.teacher-tools { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.teacher-tools summary { min-height: 44px; line-height: 44px; cursor: pointer; }
.teacher-tools button, .teacher-tools a { display: block; min-height: 44px; padding: 8px 4px; border: 0; background: transparent; font-size: 13px; }
#feedback { color: var(--error); font-size: 14px; line-height: 1.6; }
#feedback:empty { display: none; }
footer { max-width: 1320px; margin: 10px auto 0; padding: 22px 32px 30px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
@media(max-width:1050px) {
  .workspace { grid-template-columns: minmax(0,1fr) 270px; gap: 20px; }
  .roles button { min-width: 110px; padding-inline: 13px; }
  .roles strong { font-size: 17px; }
  .roles span { font-size: 11px; }
  .score-navigation { gap: 7px; }
  .follow { font-size: 11px; }
  .player-shell { padding: 4px 0 18px; }
}
@media(max-width:720px), (min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .site-header { padding: 4px 14px; min-height: 52px; }
  .classroom-brand { font-size: 16px; gap: 7px; }
  .classroom-brand svg { width: 23px; height: 23px; }
  .site-header p { font-size: 11px; max-width: 170px; text-align: right; }
  main { padding: 10px 12px 154px; }
  .lesson-intro { display: block; margin-bottom: 10px; }
  .lesson-intro>div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
  h1 { font-size: 32px; }
  .lesson-intro p { font-size: 14px; margin: 0; white-space: nowrap; }
  .roles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .roles button { min-width: 0; min-height: 57px; padding: 7px 3px; border-radius: 10px; }
  .roles strong { font-size: 17px; }
  .roles span { font-size: 11px; margin-top: 3px; }
  .workspace { display: block; }
  .mode-tabs { gap: 7px; margin-bottom: 10px; }
  .mode-tabs button { min-height: 52px; padding: 8px 3px; gap: 6px; border-radius: 7px 7px 0 0; font-size: 16px; }
  .mode-tabs svg { width: 22px; height: 22px; }
  .track-options { font-size: 13px; gap: 20px; padding-bottom: 10px; }
  .view-tabs { gap: 26px; }
  .view-tabs button { font-size: 16px; min-height: 44px; padding: 8px 3px; }
  .score-toolbar { gap: 5px; padding: 8px 0; }
  .score-navigation { gap: 4px; }
  .page-controls, #page-form { gap: 3px; }
  #page-form>label { display: none; }
  #page-form { font-size: 11px; }
  .page-controls button { min-width: 44px; min-height: 44px; padding: 5px; font-size: 12px; }
  .page-controls button span { display: none; }
  #page { width: 44px; min-height: 44px; font-size: 14px; }
  .page-unit { display: none; }
  .score-zoom { gap: 2px; }
  .score-zoom button { min-width: 44px; min-height: 44px; padding: 5px 3px; font-size: 12px; }
  .score-zoom output { min-width: 32px; font-size: 11px; }
  .score-zoom svg { width: 15px; height: 15px; }
  .paper { height: calc(100dvh - 436px); min-height: 250px; border-radius: 8px; }
  #lyrics-view { min-height: 350px; }
  .lyric-card { padding: 15px 16px; }
  .lyric-card .english { font-size: 23px; line-height: 1.65; }
  .lyric-card .meaning { font-size: 16px; }
  .practice { position: static; }
  .player-shell { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 9px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border: 0; border-top: 2px solid var(--line); border-radius: 0; }
  .track-heading, .current-caption, .current-meaning { display: none; }
  .player-shell .current-line { font-size: 16px; line-height: 24px; height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 5px; }
  .transport { justify-content: flex-start; gap: 8px; width: calc(100% - 88px); }
  .play { min-width: 110px; height: 44px; font-size: 18px; padding: 7px 18px; }
  .play svg { width: 22px; height: 22px; }
  .secondary-control { width: 44px; height: 44px; padding: 4px; }
  .secondary-control svg { width: 20px; height: 20px; }
  .progress { margin-top: 4px; }
  .progress input { height: 28px; }
  .progress>div { font-size: 11px; line-height: 14px; }
  .practice-extra { padding: 0; }
  .practice-extra>summary { display: flex; position: fixed; z-index: 30; right: 14px; bottom: calc(53px + env(safe-area-inset-bottom)); width: 82px; height: 44px; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 8px; color: var(--accent); font-size: 14px; font-weight: 700; list-style: none; cursor: pointer; }
  .practice-extra>summary::-webkit-details-marker { display: none; }
  .practice-extra[open]>summary { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  .panel-body { position: fixed; z-index: 25; bottom: calc(153px + env(safe-area-inset-bottom)); left: 12px; right: 12px; max-height: 55dvh; overflow-y: auto; padding: 18px 16px; background: var(--surface); border: 1px solid var(--accent-border); border-radius: 12px; box-shadow: 0 -6px 26px #203a611a; }
  .settings { font-size: 13px; gap: 12px; }
  .volume input { width: 82px; }
  .phrases { max-height: 26dvh; }
  .teacher-tools { margin-top: 12px; padding-top: 12px; }
  #feedback { position: fixed; z-index: 31; left: 12px; right: 12px; bottom: 153px; margin: 0; padding: 10px; background: var(--error-bg); border-radius: 8px; }
  footer { padding: 12px 14px 154px; margin: 0; display: block; font-size: 11px; }
  footer a { display: block; margin-top: 8px; }
}
@media(prefers-reduced-motion:no-preference) {
  button { transition: background-color .15s, border-color .15s; }
}
@media(min-width:721px) and (max-width:1050px) {
  .mode-tabs button { flex-direction: column; gap: 4px; min-height: 82px; font-size: 17px; }
}
@media(max-width:720px), (min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .paper { height: calc(100dvh - 504px - env(safe-area-inset-bottom)); }
  .lesson-main:has(#sing-options:not([hidden])) .paper { height: calc(100dvh - 556px - env(safe-area-inset-bottom)); }
}

/* Portrait tablets use the full score width and a reachable playback dock. */
@media(min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .site-header { min-height: 60px; padding: 8px 24px; }
  .classroom-brand { font-size: 18px; }
  .site-header p { max-width: none; font-size: 14px; }
  main { padding: 14px 24px 190px; }
  .lesson-intro { display: flex; gap: 18px; margin-bottom: 16px; }
  .lesson-intro>div { display: block; min-width: 250px; margin: 0; }
  h1 { font-size: 44px; }
  .lesson-intro p { font-size: 17px; margin-top: 4px; }
  .roles { flex: 1; gap: 10px; }
  .roles button { min-height: 68px; padding: 9px 6px; }
  .roles strong { font-size: 20px; }
  .roles span { font-size: 12px; }
  .mode-tabs { gap: 12px; margin-bottom: 14px; }
  .mode-tabs button { flex-direction: row; min-height: 66px; gap: 10px; font-size: 21px; }
  .mode-tabs svg { width: 28px; height: 28px; }
  .view-tabs { gap: 30px; }
  .view-tabs button { min-height: 48px; font-size: 20px; }
  .score-toolbar { padding: 8px 0; gap: 12px; }
  .page-controls { gap: 7px; }
  .page-controls button, #page { min-height: 44px; font-size: 14px; }
  .page-controls button span { display: inline; }
  #page { width: 44px; }
  .page-unit { display: inline; }
  #page-form { gap: 5px; font-size: 13px; }
  .score-zoom { gap: 5px; }
  .score-zoom button { min-width: 44px; min-height: 44px; font-size: 14px; }
  .score-zoom svg { width: 19px; height: 19px; }
  .score-zoom output { min-width: 45px; font-size: 13px; }
  .paper { height: calc(100dvh - 558px - env(safe-area-inset-bottom)); min-height: 320px; }
  .lesson-main:has(#sing-options:not([hidden])) .paper { height: calc(100dvh - 610px - env(safe-area-inset-bottom)); }
  .track-options { font-size: 15px; padding-bottom: 12px; }
  .player-shell { padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); }
  .player-shell .current-line { font-size: 22px; line-height: 30px; height: 30px; margin-bottom: 5px; }
  .player-shell .current-meaning { display: block; height: 24px; margin: 0 0 6px; font-size: 16px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .transport { width: calc(100% - 130px); justify-content: center; gap: 24px; }
  .play { min-width: 160px; height: 48px; font-size: 21px; }
  .secondary-control { width: 40px; height: 48px; }
  .secondary-control svg { width: 24px; height: 24px; }
  .progress input { height: 20px; }
  .progress>div { font-size: 13px; line-height: 14px; }
  .practice-extra>summary { right: 24px; bottom: calc(49px + env(safe-area-inset-bottom)); width: 110px; height: 48px; font-size: 17px; }
  .panel-body { left: 24px; right: 24px; bottom: calc(184px + env(safe-area-inset-bottom)); max-height: 55dvh; padding: 22px; }
  .settings { font-size: 16px; gap: 20px; }
  .phrases { max-height: 30dvh; }
  .phrase { font-size: 20px; padding: 16px 10px; }
  .lyric-card { padding: 22px 26px; }
  .lyric-card .english { font-size: 30px; }
  .lyric-card .meaning { font-size: 20px; }
  footer { padding-inline: 24px; padding-bottom: 200px; display: flex; }
  #feedback { bottom: 184px; }
}
/* Keep playback within reach when a long verse is selected in landscape. */
@media(min-width:721px) and (max-width:1366px) and (max-height:950px) and (orientation:landscape) {
  .practice { max-height: calc(100dvh - 40px); overflow-y: auto; scrollbar-width: thin; }
  .player-shell { padding: 4px 0 18px; }
  .current-caption { margin-top: 18px; margin-bottom: 8px; }
  .current-line { max-height: 160px; overflow-y: auto; font-size: 22px; line-height: 1.5; }
  .current-meaning { max-height: 64px; overflow-y: auto; margin: 8px 0 16px; font-size: 14px; line-height: 1.5; }
}

.paper img { mix-blend-mode: multiply; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.eye-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--accent-border); border-radius: 9px; background: var(--surface); color: var(--accent); font-size: 13px; white-space: nowrap; }
.eye-toggle svg { width: 19px; height: 19px; }
@media(max-width:720px) {
  .header-actions { gap: 0; }
  .header-actions p { display: none; }
  .eye-toggle { min-height: 44px; padding: 4px 8px; font-size: 12px; gap: 5px; }
  .eye-toggle svg { width: 18px; height: 18px; }
}
@media(min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .header-actions { gap: 14px; }
  .header-actions p { font-size: 13px; }
  .eye-toggle { min-height: 44px; font-size: 14px; }
}

@media(max-width:370px) {
  .roles span:not(.role-check) { font-size: 10px; white-space: nowrap; }
  .mode-tabs button { flex-direction: column; gap: 3px; font-size: 14px; min-height: 65px; }
  .paper { height: calc(100dvh - 553px - env(safe-area-inset-bottom)); }
  .lesson-main:has(#sing-options:not([hidden])) .paper { height: calc(100dvh - 605px - env(safe-area-inset-bottom)); }
  .transport { gap: 4px; }
  .play { min-width: 90px; padding-inline: 12px; }
}

/* Word and sentence practice share one audio mode and source clock. */
.header-actions { gap: 10px; }
.header-actions>button { min-height: 44px; padding: 6px 12px; border: 1px solid var(--accent-border); border-radius: 9px; background: var(--surface); color: var(--accent); font-size: 13px; }
.all-lessons { font-size: 13px; margin-right: 8px; }
.reading-switch { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 4px 0 8px; }
.reading-switch button { min-height: 44px; padding: 8px 4px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); font-size: 15px; color: var(--accent); }
.reading-switch button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); font-weight: 700; }
.mode-options { min-height: 56px; }
.track-options select { min-height: 44px; margin-left: 10px; padding: 6px 10px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.paper { overflow: hidden; position: relative; }
.score-sheet { position: relative; width: 100%; transform-origin: 50% 50%; user-select: none; background: var(--score-paper); }
.score-sheet>img { pointer-events: none; -webkit-user-drag: none; }
.score-overlay { position: absolute; inset: 0; pointer-events: none; }
.score-hit { position: absolute; pointer-events: auto; min-width: 0; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 2px; background: transparent; }
.score-hit.selected { background: #86c5ff33; }
.score-hit.active { background: #ffa62b66; }
.score-hit:focus-visible { outline-width: 2px; outline-offset: 1px; }
.lyric-card { text-align: left; }
.lyric-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.phrase-play { min-height: 44px; padding: 7px 14px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); border-radius: 8px; font-size: 14px; }
.word-list { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 12px; }
.word { min-height: 44px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; font-size: 25px; line-height: 1.5; }
.word:hover, .word.selected { background: var(--accent-soft); }
.word.active, .current-line [data-word].active { background: linear-gradient(90deg,var(--mode-active) var(--word-progress,0%),var(--accent-soft) var(--word-progress,0%)); box-shadow: inset 0 -2px var(--accent); }
.lyric-card .meaning { margin: 12px 8px 0; font-size: 17px; color: var(--muted); line-height: 1.75; }
.cross-page-note { margin: 12px 8px 0; font-size: 13px; color: var(--accent); line-height: 1.7; }
#progress-label { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
#story-view { max-width: 760px; min-height: 400px; padding: 25px 8px; font-size: 19px; line-height: 1.9; }
#story-view h2 { font-size: 27px; line-height: 1.5; margin: 0 0 22px; }
#story-view h3 { font-size: 20px; color: var(--accent); margin-top: 28px; }
#transpose-note { display: block; width: 100%; font-size: 12px; }
#bars { display: inline; font-size: 12px; color: var(--muted); }
.present .workspace { grid-template-columns: 1fr; }
.present .practice-extra, .present .track-heading, .present .current-caption, .present .current-meaning { display: none; }
.present .practice { position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 40; max-height: none; overflow: visible; }
.present .player-shell { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(200px,1fr); align-items: center; gap: 24px; padding: 12px 32px; background: var(--surface); border-top: 1px solid var(--line); }
.present .current-line { font-size: 20px; max-height: 64px; overflow: auto; }
.present .progress { margin: 0; }
.present .paper { height: calc(100dvh - 390px); }
@media(max-width:720px), (min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  #bars { display: none; }
  .reading-switch { gap: 5px; }
  .reading-switch button { font-size: 13px; }
  .mode-options { min-height: 56px; padding-bottom: 10px; }
  .paper, .lesson-main:has(.mode-options:not([hidden])) .paper { height: calc(100dvh - 630px - env(safe-area-inset-bottom)); min-height: 200px; }
  main { padding-bottom: 177px; }
  #progress-label { font-size: 11px; line-height: 16px; }
  .practice-extra>summary { bottom: calc(53px + env(safe-area-inset-bottom)); }
  .panel-body { bottom: calc(174px + env(safe-area-inset-bottom)); }
  .word { font-size: 23px; padding: 7px 6px; }
  .lyric-card-heading { font-size: 12px; gap: 10px; }
  .phrase-play { font-size: 13px; padding-inline: 10px; }
  #story-view { padding-inline: 4px; font-size: 18px; }
  #story-view h2 { font-size: 25px; }
}
@media(max-width:720px) {
  .all-lessons { display: none; }
  .header-actions { gap: 6px; }
  .header-actions>button { padding: 4px 7px; font-size: 12px; }
  .score-toolbar { row-gap: 6px; }
  .score-zoom { margin-left: auto; }
  .view-tabs { gap: 20px; }
  .present .player-shell { display: block; padding: 9px 14px 8px; }
  .present .current-line { max-height: 24px; }
  .present .progress { margin-top: 4px; }
}
@media(min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .paper, .lesson-main:has(.mode-options:not([hidden])) .paper { height: calc(100dvh - 630px - env(safe-area-inset-bottom)); min-height: 300px; }
  .reading-switch button { font-size: 18px; }
  .reading-switch { padding-bottom: 12px; }
  .word { font-size: 30px; }
  .panel-body { bottom: calc(204px + env(safe-area-inset-bottom)); }
  main { padding-bottom: 214px; }
}
.present .practice-extra { display: block; }
.present .player-shell { padding-right: 130px; }
.present .practice-extra>summary { display: flex; align-items: center; justify-content: center; position: fixed; right: 20px; bottom: 18px; z-index: 50; width: 90px; min-height: 44px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 8px; font-size: 14px; color: var(--accent); cursor: pointer; list-style: none; }
.present .practice-extra>summary::-webkit-details-marker { display: none; }
.present .panel-body { position: fixed; z-index: 49; bottom: 100px; right: 20px; left: auto; width: min(360px,calc(100vw - 40px)); max-height: 65dvh; overflow-y: auto; background: var(--surface); padding: 20px; border: 1px solid var(--accent-border); border-radius: 12px; }
@media(max-width:720px) {
  .present .player-shell { padding-right: 14px; }
  .present .practice-extra>summary { right: 14px; bottom: 53px; width: 82px; }
  .present .panel-body { bottom: 174px; }
}

@media(max-width:720px), (min-width:721px) and (max-width:1100px) and (orientation:portrait) { #feedback { bottom: 174px; } }

.present .practice-extra { padding: 0; }

.voice-mix { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; min-inline-size: 0; margin: 0 0 12px; padding: 4px 10px 8px; border: 1px solid var(--control-line); border-radius: 9px; }
.voice-mix legend { padding: 0 6px; color: var(--accent); font-size: 13px; }
.voice-mix label { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; color: var(--ink); font-size: 16px; cursor: pointer; }
.current-caption { margin: 12px 0 8px; }
@media(max-width:720px), (min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .mix-active .player-shell .current-caption { display: block; margin: 0 0 3px; font-size: 12px; line-height: 18px; }
  .mix-active .panel-body { bottom: calc(197px + env(safe-area-inset-bottom)); }
  .mix-active #feedback { bottom: calc(197px + env(safe-area-inset-bottom)); }
  .voice-mix label { font-size: 15px; }
}
@media(max-width:420px) {
  .voice-mix { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(min-width:721px) and (max-width:1100px) and (orientation:portrait) {
  .mix-active .panel-body, .mix-active #feedback { bottom: calc(236px + env(safe-area-inset-bottom)); }
}

.present .player-shell .current-caption { display: none; }

.voice-mix small { display: block; font-size: 10px; line-height: 1.2; color: var(--muted); text-align: center; }

.media-preload { margin: -10px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
