:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #203832;
  background: #f8faf5;
  --ink: #203832;
  --muted: #576d64;
  --rule: #e3ebe2;
  --teal: #116a57;
  --teal-deep: #0e5345;
  --mint: #e2f3e8;
  --yellow: #ffdf76;
  --green: #daefdf;
  --pink: #fae7ed;
  --blue: #e8f1fb;
  --paper: #fff;
  font-synthesis: none;
  accent-color: var(--teal);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #247d67; outline-offset: 3px;
}
button, select { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.top { background: rgba(255,255,255,.95); border-bottom: 1px solid var(--rule); }
.top-inner { max-width: 1392px; min-height: 77px; margin: auto; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; text-decoration: none; align-items: center; gap: 12px; font-size: 1.28rem; font-weight: 800; letter-spacing: .02em; line-height: 1.16; }
.brand small { display:block; font-size: .74rem; font-weight: 600; letter-spacing: .12em; color: var(--muted); margin-top: 5px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--teal); font-size: 1.78rem; box-shadow: 0 3px 0 #0c5443; }
.top-actions, .transport, .keyboard-tools, .edit-tabs, .file-actions, .save-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.soft, .primary, .text-button, .review-chip {
  min-height: 41px; border: 1px solid #dfe9df; background: #fff; border-radius: 11px; padding: 8px 13px; font-size: .89rem; font-weight: 700; display: inline-flex; align-items:center; justify-content:center; gap:8px; white-space:nowrap;
}
.soft:hover { border-color:#a7cbbb; background:#f5faf7; }
.ghost { border-color: transparent; }
.edit-button { background: #e6f3e9; border-color:#d5e9dc; color:#145948; }
.primary { min-height: 48px; padding: 10px 17px; background: var(--teal); border-color: var(--teal); color:#fff; box-shadow:0 3px 0 #0c5041; }
.primary:hover { background:var(--teal-deep); }
.layout { max-width:1392px; margin:auto; padding: 25px 34px 0; display:grid; grid-template-columns: 223px minmax(0,1fr); gap:24px; align-items:start; }
.side-sticky { position:sticky; top:16px; display:grid; gap:15px; }
.aside-card { background:#fff; border:1px solid var(--rule); border-radius:19px; padding:15px 11px 11px; }
.aside-card h2 { font-size:.98rem; margin:0 0 10px 7px; }
.modes { display:grid; gap:5px; }
.mode { display:flex; align-items:center; gap:10px; background:white; border:1px solid transparent; border-radius:13px; width:100%; text-align:left; padding:8px 7px; min-height:63px; }
.mode:hover, .mode[aria-pressed="true"] { border-color:#cce5d8; background:#f1f8f3; }
.mode strong, .mode small { display:block; }
.mode strong { font-size:.94rem; }
.mode small { font-size:.75rem; font-weight:500; margin-top:3px; color:var(--muted); }
.mode-icon { flex:0 0 36px; height:36px; border-radius:11px; display:grid; place-items:center; font-size:1.42rem; line-height:1; font-weight:700; }
.mint { background:#d5eee1; color:#166b55; }
.butter { background:#fff0c9; color:#7e5916; }
.lilac { background:#e8e9fc; color:#514b9d; }
.rose { background:#fae1eb; color:#963c65; }
#chapters { display:grid; gap:3px; }
.chapter { display:grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items:center; gap:7px; width:100%; text-align:left; border:1px solid transparent; border-radius:10px; background:white; min-height:41px; padding:5px 6px; font-size:.83rem; font-weight:700; }
.chapter:hover,.chapter.on { background:#edf7f0; border-color:#d6eadd; }
.chapter .num { background:#ecf1ed; color:var(--teal-deep); font-size:.78rem; border-radius:7px; height:25px; display:grid; place-items:center; }
.chapter em { font-style:normal; color:var(--muted); font-size:.74rem; font-weight:600; }
.workspace { min-width:0; display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.studio, .keyboard-panel, .notation { background:var(--paper); border:1px solid var(--rule); border-radius:21px; box-shadow:0 2px 8px rgba(33,77,60,.025); }
.studio { overflow:hidden; }
.intro { min-height:136px; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 25px; background:linear-gradient(107deg,#e4f3e9 0%,#edf7e9 60%,#fbf3cf 100%); }
.course-label { display:inline-flex; gap:6px; align-items:center; font-size:.79rem; color:#395e50; font-weight:750; letter-spacing:.08em; }
.course-label span { font-size:1rem; color:#146c56; }
h1, h2, h3, p { margin: 0; }
h1 { font-size:clamp(1.95rem,4vw,2.76rem); line-height:1.08; letter-spacing:.02em; margin:4px 0 8px; font-weight:850; }
.intro p { color:#496458; font-size:.9rem; }
.intro-art { position:absolute; right:26px; top:2px; inset-block-end:1px; width:min(33%,275px); pointer-events:none; }
.staff { position:absolute; inset:26% 0 21% 6%; transform:rotate(-9deg) skewX(-18deg); background:repeating-linear-gradient(to bottom,transparent 0 11px,#a7c4a775 11px 12px); mask-image:linear-gradient(90deg,transparent,#000 28% 85%,transparent); }
.music-note { display:grid; place-items:center; position:absolute; line-height:1; }
.note-a { color:#2b866c; background:#d8eedb; font-size:3.4rem; width:66px; height:66px; border-radius:21px; transform:rotate(-13deg); left:17%; bottom:21%; }
.note-b { color:#87601c; background:#fae6a5; font-size:2.55rem; width:49px; height:49px; border-radius:17px; transform:rotate(14deg); right:16%; top:13%; }
.note-c { color:#8d615e; font-size:1.7rem; right:7%; bottom:17%; }
.note-d { color:#2c836e; font-size:2.95rem; left:4%; top:5%; }
.controls { padding:18px 22px 15px; display:grid; gap:13px; }
.playback { display:flex; align-items:center; gap:19px; }
.transport { flex:none; }
.triangle { width:0; height:0; border-top:7px solid transparent; border-bottom:7px solid transparent; border-left:11px solid currentColor; }
.pause-shape { width:11px; height:14px; border-left:4px solid currentColor; border-right:4px solid currentColor; }
.stop-shape { width:9px; height:9px; border-radius:2px; background:#60766b; }
.progress-area { flex:1; min-width:65px; }
.progress-label { display:flex; justify-content:space-between; gap:7px; align-items:center; font-size:.79rem; color:var(--muted); font-weight:650; margin-bottom:3px; }
#status { color:#325e4f; }
#clock, #tempo-value { white-space:nowrap; font-variant-numeric:tabular-nums; }
.progress-control { display:block; }
input[type="range"] { cursor:pointer; margin:0; }
#progress { display:block; width:100%; }
.transport-settings, .switches, .range-panel { display:flex; align-items:center; flex-wrap:wrap; gap:10px 17px; }
.tempo, .volume, .control-field { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:.86rem; font-weight:650; white-space:nowrap; }
#tempo { width: clamp(64px,9vw,122px); }
#volume { width:84px; }
#tempo-value { color:var(--ink); font-weight:800; min-width:58px; }
.rates { display:flex; padding:3px; border:1px solid var(--rule); background:#f7faf6; border-radius:10px; gap:2px; }
.rates button { border:0; background:transparent; color:#506c5f; border-radius:7px; padding:5px 8px; font-weight:770; font-size:.79rem; min-width:34px; }
.rates button[aria-pressed="true"] { background:#dff0e5; color:#155b48; }
select { min-height:34px; appearance:none; border:1px solid #dce8df; border-radius:8px; background-color:#fff; background-image:linear-gradient(45deg,transparent 50%,#527869 50%),linear-gradient(135deg,#527869 50%,transparent 50%); background-position:calc(100% - 12px) 50%,calc(100% - 8px) 50%; background-size:4px 4px; background-repeat:no-repeat; padding:5px 21px 5px 9px; color:var(--ink); font-size:.85rem; font-weight:650; cursor:pointer; max-width:100%; }
.switches { border-top:1px solid #eef1ec; padding-top:11px; gap:9px 17px; }
.switch { display:inline-flex; align-items:center; gap:6px; font-size:.84rem; font-weight:670; color:var(--muted); position:relative; cursor:pointer; white-space:nowrap; min-height:30px; }
.switch input { position:absolute; inset-inline-start:0; opacity:0; width:32px; height:20px; cursor:pointer; }
.track { position:relative; pointer-events:none; width:31px; height:18px; border-radius:14px; background:#dce7df; border:1px solid #cbdacf; }
.track::after { content:""; position:absolute; width:12px; height:12px; border-radius:50%; inset:2px auto auto 2px; background:#fff; box-shadow:0 1px 2px #82948a; transition:transform .14s; }
.switch input:checked + .track { background:#217d64; border-color:#217d64; }
.switch input:checked + .track::after { transform:translateX(13px); }
.switch input:focus-visible + .track { outline:3px solid #247d67; outline-offset:3px; }
.range-panel { background:#f5f9fc; border:1px solid #e4edf3; padding:9px 11px; border-radius:11px; }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.panel-head h2 { font-size:1.18rem; letter-spacing:.02em; }
.panel-head p { color:var(--muted); font-size:.84rem; margin-top:3px; }
.keyboard-panel { min-width:0; padding:14px 18px 14px; }
.keyboard-head { flex-wrap:wrap; margin-bottom:10px; }
.keys-scroll { min-width:0; overflow-x:auto; scrollbar-width:thin; scrollbar-color:#85a799 #254839; border-radius:11px; background:#254839; border:4px solid #254839; }
#keyboard { position:relative; display:flex; align-items:start; width:100%; min-width:880px; height:117px; touch-action:pan-y; user-select:none; }
.key { position:relative; appearance:none; border:1px solid #cbd8cf; border-top:0; padding:0; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; background:#fffefa; color:#25473b; overflow:hidden; gap:1px; }
.key.white { flex:1; min-width:0; height:100%; border-radius:0 0 5px 5px; padding-bottom:3px; box-shadow:inset 0 -4px 0 #e5ebe3; }
.key.black { z-index:1; position:absolute; top:0; transform:translateX(-50%); height:60%; border-radius:0 0 5px 5px; background:linear-gradient(#233d36,#102a23); color:#f3fff9; border:1px solid #19342c; border-top:0; padding-bottom:2px; box-shadow:0 3px 3px #15342f50,inset 0 -3px 0 #203f34; }
.key:hover { filter:brightness(.96); }
.key.sounding { background:#ffe388; color:#473502; border-color:#c99c38; box-shadow:inset 0 -4px 0 #e3b855; }
.key.manual { background:#a5e8cc; color:#154534; border-color:#58ad8a; box-shadow:inset 0 -4px 0 #68b799; }
.key-degree { display:grid; grid-template-rows:8px auto 8px; justify-items:center; align-items:center; font-size:.95rem; line-height:1; font-weight:800; white-space:nowrap; }
.key-degree-value { grid-row:2; }
.key-octave { display:grid; justify-items:center; gap:1px; grid-column:1; }
.key-octave.high { grid-row:1; align-self:end; }
.key-octave.low { grid-row:3; align-self:start; }
.key-octave i { width:2.4px; height:2.4px; border-radius:50%; background:currentColor; }
.key .key-name { font-size:.72rem; color:inherit; opacity:.89; line-height:1.1; white-space:nowrap; }
.key kbd { font-family:inherit; font-size:.66rem; border-radius:3px; background:#e8efe8; min-width:12px; text-align:center; line-height:1.0; height:12px; color:#3d6655; }
.key.black kbd { background:#3d5b53; color:#f6fffa; }
.key-finger { position:absolute; top:5px; display:grid; place-items:center; border-radius:50%; background:#e5f6ed; color:#1c624e; width:17px; height:17px; font-size:.69rem; font-weight:800; }
.finger-status { padding-top:7px; color:var(--muted); font-size:.78rem; }
.notation { padding:16px 19px 18px; min-width:0; }
.score-head { padding-bottom:6px; }
.score-legend { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:6px 0 13px; color:var(--muted); font-size:.75rem; font-weight:640; }
.score-legend i { display:inline-block; width:11px; height:11px; border-radius:3px; margin-right:2px; vertical-align:-1px; }
.legend-now { background:#ffdb6a; }.legend-past { background:#d3ecd9; }
.review-chip { border:1px solid #f3e1ae; background:#fff5dd; color:#77521b; min-height:34px; padding:5px 10px; font-size:.8rem; }
.review-chip:hover { background:#ffecba; }
.score-section { padding:0 0 12px; margin:0 0 13px; border-bottom:1px solid var(--rule); scroll-margin-top:12px; }
.score-section:last-child { border-bottom:0; margin:0; padding:0; }
.section-head { min-height:37px; display:flex; flex-wrap:wrap; align-items:center; gap:6px 9px; background:#e7f4eb; border-radius:9px; padding:5px 9px; }
.score-section:nth-child(2) .section-head { background:#fff2d6; }
.score-section:nth-child(3) .section-head { background:#e9effa; }
.score-section:nth-child(4) .section-head { background:#fae8ee; }
.score-section:nth-child(5) .section-head { background:#e6f4f1; }
.section-head h3 { font-size:.95rem; }
.section-meter { border-radius:6px; padding:2px 5px; background:#ffffffb0; color:#526c60; font-size:.75rem; font-weight:750; }
.section-play { margin-left:auto; padding:3px 7px; border:0; border-radius:6px; background:#ffffffbd; font-size:.76rem; color:#1b6450; font-weight:750; min-height:26px; }
.section-play:hover { background:#fff; }
.measure-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(144px,100%),1fr)); align-items:start; gap:6px; padding:7px 0 0; }
.measure { background:#fff; position:relative; min-width:0; min-height:94px; border-radius:8px; border:1px solid #e3eae2; border-right:2px solid #bdcec3; padding:4px 5px 2px; scroll-margin-top:10px; }
.measure.duet { min-height:160px; }
.measure.on { background:#fcf7e6; border-color:#dfc975; }
.measure.play-range { box-shadow:inset 0 0 0 1px #a1cdbf; }
.measure.double { border-left:3px double #81998d; }
.measure.rep-start { border-left:5px double #426558; }
.measure.rep-end { border-right:5px double #426558; }
.repeat-dots { position:absolute; top:41px; font-weight:900; color:#315447; font-size:1.1rem; pointer-events:none; }
.repeat-dots.start { left:1px; }.repeat-dots.end { right:1px; }
.measure-meta { display:flex; justify-content:space-between; gap:2px; align-items:center; min-height:20px; }
.measure-button { border:0; background:#f0f5f0; color:#355f50; border-radius:5px; padding:2px 5px; font-weight:750; font-size:.71rem; line-height:1.15; min-height:19px; }
.measure-button:hover { background:#dceee2; }
.measure-breath { font-size:.7rem; color:#207765; font-weight:800; }
.measure-review { padding:1px 3px; color:#825920; background:#fff1cd; border-radius:5px; border:0; font-size:.65rem; min-height:19px; }
.voice-row { display:flex; align-items:stretch; position:relative; height:66px; padding:0 1px; }
.voice-row.lower { border-top:1px dashed #e6ebe4; }
.voice-row[aria-disabled="true"] { opacity:.44; }
.note-group { display:flex; position:relative; align-items:stretch; flex:1; min-width:0; }
.note-group.beamed::after,.note-group.triplet::after { position:absolute; left:5%; right:5%; top:53px; height:1.5px; background:#35564b; content:""; pointer-events:none; }
.trip-mark { z-index:1; position:absolute; top:1px; left:6%; right:6%; height:12px; border-top:1.5px solid #507269; border-radius:55% 55% 0 0; text-align:center; pointer-events:none; }
.trip-mark b { position:relative; top:-8px; font-size:.63rem; line-height:1; padding:0 3px; background:#fff; }
.measure.on .trip-mark b { background:#fcf7e6; }
.note { flex:1; width:0; min-width:0; border:0; padding:0; background:transparent; position:relative; display:block; border-radius:6px; color:#172d28; }
.note:hover { background:#e9f5ed; }
.note.active { background:var(--yellow); color:#342707; }
.note.played { background:var(--green); }
.note .digit { font-size:clamp(1.15rem,2.6vw,1.52rem); font-weight:790; display:block; position:absolute; left:0; right:0; top:27px; text-align:center; line-height:24px; font-variant-numeric:tabular-nums; }
.acc { font-size:.66em; position:absolute; top:-3px; margin-left:-.7em; font-weight:720; }
.pitch-wrap { position:relative; }
.dot { position:absolute; width:3.5px; height:3.5px; left:calc(50% - 1.75px); border-radius:100%; background:currentColor; pointer-events:none; }
.single-beam { position:absolute; left:7%; right:7%; top:53px; height:1.5px; background:currentColor; }
.second-beam { position:absolute; left:0; right:0; top:56px; height:1.5px; background:currentColor; }
.second-beam.first { left:6%; }.second-beam.last { right:6%; }
.dynamic { position:absolute; top:1px; left:2px; font-size:.66rem; font-weight:800; font-style:italic; color:#286b5c; line-height:1; pointer-events:none; z-index:2; }
.slur-in,.slur-out { position:absolute; height:9px; top:7px; border-top:1.4px solid #527267; pointer-events:none; }
.slur-out { left:50%; right:-4px; border-radius:75% 0 0 0; }
.slur-in { right:50%; left:-4px; border-radius:0 75% 0 0; }
.note-group:has(.note .slur-out) { flex-grow:1.05; }
.note-finger { font-size:.68rem; color:#135548; position:absolute; right:2px; top:16px; font-weight:800; }
footer { text-align:center; color:var(--muted); font-size:.76rem; margin:0 0 20px; }
footer span { margin:0 4px; }
dialog { width:min(1080px,calc(100% - 22px)); max-height:calc(100% - 24px); margin:auto; padding:0; background:#fff; color:var(--ink); border:1px solid #dfe9df; border-radius:19px; box-shadow:0 12px 60px #1f492d33; overflow:auto; }
dialog::backdrop { background:#18352880; }
.dialog-head,.dialog-footer { padding:13px 17px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; background:#f5faf6; position:sticky; z-index:5; }
.dialog-head { top:0; border-bottom:1px solid var(--rule); }
.dialog-head h2 { font-size:1.25rem; }
.dialog-head p { font-size:.83rem; color:var(--muted); margin-top:3px; }
.dialog-footer { bottom:0; border-top:1px solid var(--rule); }
.original-body,.editor-body { padding:13px 16px; }
.original-body img,.source-image { width:100%; height:auto; display:block; border:1px solid var(--rule); border-radius:9px; }
.edit-tabs { border-bottom:1px solid var(--rule); margin-bottom:12px; gap:4px; }
.edit-tabs button { background:#fff; min-height:39px; padding:6px 9px; border:0; border-bottom:3px solid transparent; font-size:.88rem; font-weight:750; }
.edit-tabs button[aria-current="page"] { border-color:var(--teal); color:var(--teal); }
.edit-fields { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; margin-bottom:10px; }
.edit-fields label,.review-field { display:flex; gap:7px; align-items:center; color:var(--muted); font-weight:650; font-size:.84rem; }
.edit-fields input:not([type="checkbox"]), .note-table input:not([type="checkbox"]), .review-field textarea { border:1px solid #dce8df; border-radius:7px; background:#fff; padding:6px; color:var(--ink); }
.review-field { align-items:flex-start; margin:9px 0; }
.review-field textarea { flex:1; min-height:55px; resize:vertical; }
.edit-help { color:var(--muted); font-size:.86rem; margin:7px 0 12px; line-height:1.55; }
.voice-edit { border:1px solid var(--rule); border-radius:11px; padding:9px; margin:10px 0; }
.voice-edit legend { font-weight:800; padding:0 6px; }
.table-scroll { overflow:auto; margin-bottom:8px; }
.note-table { width:100%; min-width:800px; border-collapse:collapse; font-size:.76rem; }
.note-table th { text-align:left; color:#426254; font-weight:780; white-space:nowrap; }
.note-table th,.note-table td { padding:4px; border-bottom:1px solid #edf2ed; }
.note-table select,.note-table input[type="number"] { min-height:30px; }
.note-table input[type="number"] { width:53px; }
.note-table input[type="checkbox"] { width:17px; height:17px; }
.note-table button { border:1px solid #e3eae2; background:#fff; border-radius:5px; padding:2px 4px; margin-right:2px; min-height:26px; }
.note-table button:hover { background:#e6f4ec; }
.text-button { border-color:transparent; background:transparent; color:#315d50; }
.order-list,.review-list { list-style:none; padding:0; margin:10px 0; display:grid; gap:6px; }
.order-list li,.review-list li { border:1px solid var(--rule); border-radius:8px; padding:7px 8px; align-items:center; display:flex; gap:7px; flex-wrap:wrap; font-size:.88rem; }
.order-list li strong { flex:1; }
.review-list li { background:#fffaf0; }
#editor-status { font-size:.83rem; color:#795218; }
#toast { position:fixed; z-index:40; left:50%; bottom:18px; transform:translateX(-50%); max-width:calc(100% - 20px); width:max-content; background:#164b3d; color:white; border-radius:11px; padding:10px 15px; font-weight:700; box-shadow:0 4px 17px #163b33a0; }
@media (max-width:1020px) {
  .layout { grid-template-columns:190px minmax(0,1fr); padding-inline:17px; gap:13px; }
  .top-inner { padding-inline:17px; }
  .controls { padding-inline:15px; }
}
@media (max-width:780px), (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  .layout { display:block; padding:12px 11px 0; }
  .top-inner { min-height:60px; padding-inline:11px; gap:6px; }
  .top-actions { gap:3px; }
  .top-actions .soft { font-size:.74rem; min-height:34px; padding:4px 6px; }
  .top-actions .soft span { display:none; }
  .brand { gap:7px; font-size:1.02rem; }
  .brand small { font-size:.62rem; margin-top:3px; }
  .brand-mark { width:34px;height:34px;font-size:1.38rem;border-radius:10px; }
  .side-sticky { display:block; }
  .aside-card { padding:6px; margin-bottom:11px; border-radius:13px; }
  .aside-card h2,.mode small,.chapter-card { display:none; }
  .modes { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
  .mode { padding:5px 2px; justify-content:center; gap:4px; min-height:36px; border-radius:8px; }
  .mode strong { font-size:.76rem; white-space:nowrap; }
  .mode-icon { flex-basis:21px; height:21px; font-size:1rem; border-radius:6px; }
  .intro { min-height:107px; padding:14px; }
  .intro-art { right:9px; width:29%; }
  .note-a { width:40px; height:40px; font-size:2.1rem; border-radius:12px; }
  .note-b { width:32px; height:32px; font-size:1.7rem; border-radius:9px; right:7%; }
  .note-c { font-size:1.2rem; }
  .controls { padding:12px 10px; gap:10px; }
  .playback { gap:10px; }
  .primary { min-height:41px; padding:7px 10px; }
  .stop-button { min-height:38px; padding:6px 8px; }
  .keyboard-panel,.notation { padding:11px 9px; border-radius:15px; }
  #keyboard { height:108px; }
}
@media (max-width:390px) {
  .top-actions .soft { font-size:.68rem; padding-inline:4px; }
  .mode-icon { display:none; }
  .playback:has(#step-next:not([hidden])) { flex-wrap:wrap; }
  .playback:has(#step-next:not([hidden])) .progress-area { flex-basis:100%; }
  .measure-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .panel-head p { font-size:.75rem; }
}
@media print {
  @page { size:A4 landscape; margin:9mm; }
  * { box-shadow:none!important; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  body { color:#000; background:#fff; }
  .top,.sidebar,.controls,.keyboard-panel,footer,dialog,#toast,.section-play,.review-chip,.score-legend,.score-head p,.intro-art,.course-label { display:none!important; }
  .layout,.workspace { display:block; margin:0; padding:0; max-width:none; }
  .intro { padding:0; min-height:0; background:none; }
  .intro h1 { font-size:22px; }
  .intro p { margin-bottom:5px; }
  .studio,.notation { border:0; border-radius:0; padding:0; }
  .score-section { margin:0 0 5px; padding:0 0 4px; }
  .section-head { break-after:avoid; min-height:23px; padding:2px 6px; }
  .measure-grid { grid-template-columns:repeat(8,minmax(0,1fr)); gap:4px; padding-top:4px; align-items:start; }
  .measure { break-inside:avoid; min-height:82px; border-radius:0; }
  .measure.duet { min-height:142px; }
  .voice-row { height:62px; }
  .voice-row[aria-disabled="true"] { opacity:1; }
  .note.active,.note.played,.measure.on { background:#fff; }
  .score-head h2 { display:none; }
}
.keyboard-panel { position:sticky; top:8px; z-index:4; }
.measure,.score-section { scroll-margin-top:calc(var(--keyboard-height,175px) + 16px); }
.mini-transport { display:flex; gap:4px; margin-left:auto; }
.mini-transport .soft { min-height:30px; padding:3px 8px; font-size:.76rem; color:var(--teal-deep); background:#edf8f0; }
.measure-button { font-size:.72rem; }

@media(max-width:500px){
  .keyboard-head:has(.mini-transport:not([hidden])) p { display:none; }
  .keyboard-head .octave select { font-size:.75rem; max-width:66px; padding-left:5px; }
}
@media (pointer:coarse), (max-width:780px), (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  .key kbd,.keyboard-shortcuts { display:none; }
}
@media(max-height:500px) and (orientation:landscape) {
  #keyboard {height:86px}
  .keyboard-panel {padding:7px 10px}
  .keyboard-head {margin-bottom:5px}
  .keyboard-head p {display:none}
  .keyboard-head h2 {font-size:1rem}
}
.tie-out { left:calc(50% / var(--tie-symbols,3)); }
.key-scroll-tools { display:flex; justify-content:space-between; align-items:center; margin-top:6px; gap:8px; }
.key-scroll-tools .soft { min-height:38px; padding:4px 11px; font-size:.8rem; }
#keys-in-view { font-size:.78rem; font-weight:700; color:var(--muted); white-space:nowrap; }
@media (max-height:500px) and (orientation:landscape) {
  .key-scroll-tools .soft { min-height:34px; }
}
@media print {
  .keyboard-panel { position:static; }
  .measure-review { background:none; color:#72521e; }
}
#print-info { display:none; }
@media print {
  #print-info { display:block; }
}
