.instrument-card {
  width: min(760px, calc(100% - 32px));
  margin: 20px auto;
  padding: 18px 24px 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
  text-align: center;
}
.instrument-card h2 { color: #0b3473; margin: 18px 0 8px; }
.pedagogy { min-height: 24px; color: #43505b; font-weight: 600; }
.sound-summary {
  width: fit-content;
  max-width: 680px;
  margin: 6px auto 10px;
  padding: 7px 12px;
  border-radius: 10px;
  color: #31516e;
  background: #eef6fc;
  font-size: 14px;
  font-weight: 700;
}
.sound-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 34px auto;
  padding: 28px;
  color: #17304e;
  background: #f4f8fc;
  border: 1px solid #d5e3ef;
  border-radius: 16px;
}
.sound-loading[hidden] { display: none !important; }
.open-strings-intro { width: min(650px, 92%); margin: 22px auto 28px; padding: 24px; color: #17304e; background: linear-gradient(180deg, #f7fbff, #eef6fc); border: 2px solid #c9deef; border-radius: 18px; }
.open-strings-intro[hidden] { display: none !important; }
.open-strings-intro h3 { margin: 3px 0 18px; font-size: 22px; }
.intro-kicker { margin: 0; color: #1769c2; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.open-strings-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }
.open-strings-list.combined-staff { display: block; width: min(580px, 100%); margin-inline: auto; padding: 4px 12px 14px; background: #fff; border: 1px solid #d6e5f0; border-radius: 15px; box-shadow: 0 5px 16px rgba(11,52,115,.09); }
.reminder-staff-group + .reminder-staff-group { margin-top: 12px; padding-top: 10px; border-top: 1px solid #dce7f0; }
.open-strings-staff { width: 100%; height: 175px; overflow: visible; }
.open-strings-staff svg { width: 100% !important; height: 100% !important; overflow: visible; }
.open-strings-labels { position: relative; height: 34px; margin: -12px 0 0; }
.open-strings-labels span { position: absolute; top: 0; transform: translateX(-50%); min-width: 48px; padding: 5px 10px; color: #fff; background: #4caf50; border-radius: 8px; font-size: 16px; font-weight: 900; }
.open-string-card { display: grid; justify-items: center; gap: 5px; width: 126px; padding: 8px 5px 9px; background: #fff; border: 1px solid #d6e5f0; border-radius: 13px; box-shadow: 0 4px 12px rgba(11,52,115,.08); }
.open-string-notation { display: grid; place-items: center; width: 112px; height: 98px; overflow: visible; }
.open-string-notation svg { width: 100% !important; height: 100% !important; overflow: visible; }
.open-string-name { min-width: 52px; padding: 6px 12px; color: #fff; background: #4caf50; border-radius: 8px; font-size: 17px; font-weight: 900; }
.open-string-detail { min-height: 16px; color: #526270; font-size: 11px; font-weight: 800; text-transform: lowercase; }
.sound-loading-note {
  color: #ff665e;
  font-size: 38px;
  line-height: 1;
  animation: soundPulse 1s ease-in-out infinite alternate;
}
.sound-loading-track {
  width: min(320px, 100%);
  height: 9px;
  overflow: hidden;
  background: #dce5ed;
  border-radius: 999px;
}
.sound-loading-track span {
  display: block;
  width: 4%;
  height: 100%;
  background: linear-gradient(90deg, #1f6fc9, #ff665e);
  border-radius: inherit;
  transition: width .2s ease;
}
@keyframes soundPulse { to { transform: translateY(-3px) scale(1.08); } }
.sound-mode { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto -4px; font-weight: 700; color: #34424f; }
.sound-mode[hidden] { display: none !important; }
.sound-switch { position: relative; display: inline-block; width: 58px; height: 30px; }
.sound-switch input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.sound-slider { position: absolute; inset: 0; cursor: pointer; border-radius: 999px; background: #aeb6bd; transition: .2s; }
.sound-slider::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: .2s; }
.sound-switch input:checked + .sound-slider { background: #4caf50; }
.sound-switch input:checked + .sound-slider::before { transform: translateX(28px); }
.sound-switch input:focus-visible + .sound-slider { outline: 3px solid rgba(33,100,200,.35); outline-offset: 2px; }
.instrument-note { width: 230px; height: 220px; margin: 0 auto; overflow: hidden; }
.instrument-note svg { width: 100% !important; height: 100% !important; display: block; }
.music-panel {
  position: relative;
  box-sizing: border-box;
  width: min(330px, 86vw);
  height: 270px;
  margin: 10px auto 48px;
  padding: 8px 14px 10px;
  overflow: visible;
  background: linear-gradient(180deg, #fff, #f3f8fd);
  border: 3px solid #c9deef;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(11,52,115,.14), inset 0 0 0 1px #fff;
}
.instrument-hint {
  position: absolute;
  right: auto;
  bottom: 0;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translate(-50%, 58%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 7px 12px;
  color: #17304e;
  background: #f3fbf4;
  border: 2px solid #76bf7b;
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(34,112,50,.14);
  font-size: 15px;
  font-weight: 800;
}
.instrument-hint[hidden] { display: none !important; }
.fingering-visual { display: inline-grid; flex: 0 0 auto; }
.fingering-visual.strings { grid-template-columns: repeat(var(--string-count, 4), 5px); gap: 5px; height: 32px; }
.instrument-hint:has(.fingering-visual.strings) { width: max-content; min-width: 0; min-height: 44px; padding: 6px 10px; gap: 0; }
.instrument-hint:has(.double-bass-fingering) { min-width: 154px; gap: 10px; }
.double-bass-fingering { height: 35px; }
.double-bass-position-label { white-space: nowrap; font-size: 13px; }
.instrument-hint:has(.trombone-help) {
  width: min(430px, calc(100vw - 40px));
  max-width: none;
  padding: 7px 11px;
  gap: 10px;
}
.trombone-help { display:flex; align-items:center; justify-content:center; width:100%; min-width:0; gap:10px; }
.trombone-position {
  --slide-length: 8.5em;
  position: relative;
  display: block;
  flex: 0 1 285px;
  width: 23.5em;
  min-width: 17em;
  height: 4.6em;
  overflow: hidden;
  font-size: 10px;
}
.trombone-position[data-position="1"] { --slide-length: 8.5em; }
.trombone-position[data-position="2"] { --slide-length: 10em; }
.trombone-position[data-position="3"] { --slide-length: 11.5em; }
.trombone-position[data-position="4"] { --slide-length: 13em; }
.trombone-position[data-position="5"] { --slide-length: 14.5em; }
.trombone-position[data-position="6"] { --slide-length: 16em; }
.trombone-position[data-position="7"] { --slide-length: 17.5em; }
.trombone-body { position: absolute; inset: .4em auto auto .6em; width: 5em; height: 3.6em; }
.trombone-mouthpiece { position:absolute; left:0; top:1.25em; width:2.2em; height:.35em; border-radius:.3em; background:#a67620; }
.trombone-mouthpiece::before { content:""; position:absolute; left:-.35em; top:-.22em; width:.45em; height:.8em; border-radius:50%; background:#d6a841; }
.trombone-bell { position:absolute; left:2.5em; top:.2em; width:2.8em; height:2.7em; border-radius:45% 95% 95% 45%; background:linear-gradient(135deg,#f0ca58,#a86b15); clip-path:polygon(0 25%,100% 0,100% 100%,0 75%); }
.trombone-brace { position:absolute; left:2em; top:1.05em; width:2.2em; height:1.5em; border:.28em solid #9b681b; border-radius:.35em; }
.trombone-f-trigger { position:absolute; left:1.65em; top:2.62em; display:grid; place-items:center; width:2.05em; height:1.2em; box-sizing:border-box; border:.16em solid #7b8790; border-radius:.45em; color:#65727c; background:#f3f6f8; font-size:.82em; font-style:normal; font-weight:900; line-height:1; }
.trombone-position[data-f-attachment="active"] .trombone-f-trigger { border-color:#1769c2; color:#fff; background:#1769c2; box-shadow:0 0 0 .18em #d8ebff; }
.trombone-position[data-f-attachment="active"] .trombone-f-trigger::after { content:"✓"; position:absolute; right:-.7em; top:-.65em; display:grid; place-items:center; width:1.25em; height:1.25em; border-radius:50%; color:#fff; background:#2e9b58; font-size:.75em; }
.trombone-slide { position:absolute; left:4.6em; top:1.05em; width:var(--slide-length); height:2.45em; box-sizing:border-box; border:.32em solid #b47a20; border-left:0; border-radius:0 1.35em 1.35em 0; transition:width .2s ease; }
.trombone-slide::before { content:""; position:absolute; left:0; right:.8em; top:.55em; height:.28em; border-radius:.2em; background:#dfb84d; box-shadow:0 .92em 0 #dfb84d; }
.trombone-grip { position:absolute; left:2.1em; top:.15em; width:.32em; height:1.55em; border-radius:.25em; background:#76501b; }
.trombone-help-labels { display:flex; flex:0 0 auto; flex-direction:column; align-items:flex-start; gap:2px; max-width:145px; color:#315774; font-size:11px; line-height:1.15; text-align:left; }
.trombone-help-labels strong { color:#153c63; font-size:14px; white-space:nowrap; }
.trombone-attachment-label { color:#1769c2; font-weight:900; }
.trombone-adjustment-label { font-weight:800; }
.trombone-unavailable { padding:4px 7px; color:#6b4a18; background:#fff4dc; border-radius:8px; }
.fingering-string { position: relative; width: 4px; height: 32px; border-radius: 4px; background: #bdc8d0; }
.fingering-string.active { background: #1769c2; }
.fingering-string.active::after { content: attr(data-finger); position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #fff; background: #ff665e; font-size: 11px; }
.bowed-string-help { display:inline-flex; align-items:center; justify-content:center; gap:10px; }
.bowed-string-fingering .fingering-string.active.placement-high::after { top:28%; }
.bowed-string-fingering .fingering-string.active.placement-low::after { top:72%; }
.bowed-string-placement-label { white-space:nowrap; color:#315774; font-size:12px; font-weight:800; }
.instrument-hint:has(.bowed-string-help) { gap:0; }
.instrument-hint:has(.piano-keyboard-help) {
  width: min(560px, calc(100vw - 40px));
  max-width: none;
  min-height: 66px;
  padding: 8px 12px;
}
.piano-keyboard-help {
  display: block;
  width: 100%;
  min-width: 0;
}
.piano-keyboard {
  position: relative;
  display: block;
  width: 100%;
  height: 48px;
  overflow: hidden;
  border: 2px solid #294257;
  border-radius: 5px;
  background: #fff;
  box-shadow: inset 0 -2px 3px rgba(18,45,66,.12);
}
.piano-white-keys {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(52, minmax(0, 1fr));
}
.piano-white-key {
  position: relative;
  min-width: 0;
  background: #fff;
  border-right: 1px solid #8797a4;
}
.piano-white-key:last-child { border-right: 0; }
.piano-white-key.active {
  z-index: 1;
  background: #62a8f3;
  box-shadow: inset 0 0 0 2px #1769c2;
}
.piano-black-keys { position: absolute; inset: 0; pointer-events: none; }
.piano-black-key {
  position: absolute;
  top: 0;
  left: var(--key-left);
  width: 1.15%;
  height: 61%;
  transform: translateX(-50%);
  border: 1px solid #111820;
  border-radius: 0 0 2px 2px;
  background: #18232c;
  box-shadow: 0 1px 2px rgba(0,0,0,.28);
}
.piano-black-key.active {
  z-index: 2;
  border-color: #0f579f;
  background: #62a8f3;
  box-shadow: 0 0 0 2px #1769c2, 0 2px 4px rgba(0,0,0,.24);
}

.instrument-hint:has(.harpsichord-keyboard-help) {
  width: min(560px, calc(100vw - 40px));
  max-width: none;
  min-height: 70px;
  padding: 8px 12px;
}
.harpsichord-keyboard-help {
  display: block;
  width: 100%;
  min-width: 0;
}
.harpsichord-keyboard {
  position: relative;
  display: block;
  width: 100%;
  height: 50px;
  overflow: hidden;
  border: 5px solid #6f4a2f;
  border-top-width: 4px;
  border-bottom-width: 6px;
  border-radius: 5px;
  background: #eadcbf;
  box-shadow: inset 0 -2px 3px rgba(58,34,18,.18);
}
.harpsichord-white-keys {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(36, minmax(0, 1fr));
}
.harpsichord-white-key {
  position: relative;
  min-width: 0;
  background: #eadfbd;
  border-right: 1px solid #8c785d;
}
.harpsichord-white-key:last-child { border-right: 0; }
.harpsichord-white-key.active {
  z-index: 1;
  background: #62a8f3;
  box-shadow: inset 0 0 0 2px #1769c2;
}
.harpsichord-black-keys { position: absolute; inset: 0; pointer-events: none; }
.harpsichord-black-key {
  position: absolute;
  top: 0;
  left: var(--key-left);
  width: 1.7%;
  height: 62%;
  transform: translateX(-50%);
  border: 1px solid #24180f;
  border-radius: 0 0 2px 2px;
  background: #34261d;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.harpsichord-black-key.active {
  z-index: 2;
  border-color: #0f579f;
  background: #62a8f3;
  box-shadow: 0 0 0 2px #1769c2, 0 2px 4px rgba(0,0,0,.24);
}

.instrument-hint:has(.organ-keyboard-help) {
  width: min(560px, calc(100vw - 40px));
  max-width: none;
  min-height: 126px;
  padding: 8px 12px;
}
.organ-keyboard-help {
  display: grid;
  width: 100%;
  gap: 4px;
}
.organ-keyboard-row {
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  align-items: center;
  gap: 5px;
}
.organ-keyboard-row > b {
  color: #315774;
  font-size: 11px;
  line-height: 1;
  text-align: center;
}
.organ-keybed {
  position: relative;
  display: block;
  width: 100%;
  height: 26px;
  overflow: hidden;
  border: 1px solid #294257;
  border-radius: 3px;
  background: #fff;
}
.organ-white-keys {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--organ-white-count), minmax(0,1fr));
}
.organ-white-key {
  min-width: 0;
  background: #fff;
  border-right: 1px solid #9ba8b2;
}
.organ-white-key:last-child { border-right: 0; }
.organ-black-keys { position:absolute; inset:0; pointer-events:none; }
.organ-black-key {
  position:absolute;
  top:0;
  left:var(--key-left);
  width:1.75%;
  height:62%;
  transform:translateX(-50%);
  border:1px solid #101820;
  border-radius:0 0 2px 2px;
  background:#17232c;
}
.organ-pedal-row .organ-keybed { width: 88%; height: 28px; }
.organ-pedal-row .organ-black-key { width:3.2%; height:58%; }
.organ-white-key.active,
.organ-black-key.active {
  z-index:2;
  background:#62a8f3;
  border-color:#1769c2;
  box-shadow:inset 0 0 0 1px #1769c2;
}
.instrument-hint:has(.mallet-keyboard-help) {
  width: min(560px, calc(100vw - 40px));
  max-width: none;
  min-height: 74px;
  padding: 8px 12px;
}
.mallet-keyboard-help { display:block; width:100%; min-width:0; }
.mallet-keyboard {
  position:relative;
  display:block;
  width:100%;
  height:58px;
  overflow:hidden;
  border-radius:8px;
  background:#d9e1e7;
  border:1px solid #9aa9b5;
  padding:5px 6px;
}
.mallet-natural-row {
  position:absolute;
  left:6px;
  right:6px;
  bottom:5px;
  height:43px;
  display:grid;
  grid-template-columns:repeat(var(--natural-count),minmax(0,1fr));
  gap:1px;
  align-items:end;
}
.mallet-bar.natural {
  display:block;
  height:100%;
  transform:scaleY(var(--bar-scale,1));
  transform-origin:bottom;
  border:1px solid rgba(43,53,61,.42);
  border-radius:3px;
  background:#bc7d43;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28);
}
.mallet-keyboard-help.metal .mallet-bar.natural { background:#c6cdd3; }
.mallet-accidental-row { position:absolute; left:6px; right:6px; top:5px; bottom:5px; pointer-events:none; }
.mallet-bar.accidental {
  position:absolute;
  left:var(--bar-left);
  width:var(--bar-width,2.2%);
  height:47%;
  transform:translateX(-50%);
  border:1px solid rgba(32,42,50,.5);
  border-radius:3px;
  background:#8f5f35;
  box-shadow:0 1px 2px rgba(0,0,0,.18);
}
.mallet-keyboard-help.metal .mallet-bar.accidental { background:#929da6; }
.mallet-bar.active {
  z-index:3;
  background:#62a8f3 !important;
  border-color:#1769c2 !important;
  box-shadow:0 0 0 2px #1769c2, 0 2px 4px rgba(0,0,0,.18) !important;
}
.fingering-visual.trumpet { grid-template-columns: repeat(3, 15px); gap: 4px; }
.fingering-piston { width: 15px; height: 28px; border: 2px solid #1769c2; border-radius: 8px 8px 5px 5px; background: #fff; }
.fingering-piston.active { background: #ff665e; border-color: #d94c45; transform: translateY(4px); }
.fingering-visual.horn { grid-template-columns: repeat(3, 20px); gap: 5px; align-items: center; }
.fingering-visual.woodwind { grid-template-columns: repeat(3, 13px); gap: 5px 7px; align-items: center; }
.woodwind-key { width: 13px; height: 13px; border: 2px solid #1769c2; border-radius: 50%; background: #fff; }
.woodwind-key.active { background: #1769c2; box-shadow: inset 0 0 0 2px #fff; }
.instrument-hint:has(.flute-fingering) {
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 8px 14px;
  gap: 10px;
}
.flute-fingering { position:relative; display:flex; align-items:center; justify-content:center; flex:1 1 auto; min-width:0; gap:7px; }
.flute-fingering-label:empty {
    display: none;
}
.flute-hand, .flute-foot { position:relative; z-index:1; display:flex; align-items:center; gap:5px; padding:3px 5px; background:rgba(255,255,255,.78); border-radius:12px; }
.flute-hand > b { color:#527087; font-size:9px; letter-spacing:.04em; }
.flute-tube { position:absolute; right:3%; left:3%; height:5px; border-radius:4px; background:linear-gradient(180deg,#d5e1e8,#8fa5b4); }
.flute-key { display:grid; place-items:center; width:24px; height:24px; color:#5b7180; background:#f9fcfe; border:2px solid #8daabb; border-radius:50%; box-shadow:0 1px 2px rgba(25,67,91,.15); font-size:9px; font-style:normal; font-weight:900; }
.flute-key.active { color:#fff; background:#1769c2; border-color:#0f579f; box-shadow:inset 0 0 0 2px rgba(255,255,255,.3),0 2px 5px rgba(23,105,194,.25); }
.flute-thumb { border-radius:8px; }
.flute-pinky { width:27px; border-radius:9px; }
.flute-foot { gap:4px; }
.flute-foot-key { width:29px; border-radius:9px; }
.flute-fingering-label { flex:0 1 150px; line-height:1.15; }
.instrument-hint:has(.oboe-fingering) {
  width:min(650px,calc(100vw - 40px));
  max-width:none;
  padding:8px 14px;
  gap:10px;
}
.oboe-fingering { position:relative; display:flex; align-items:center; justify-content:center; flex:1 1 auto; min-width:0; gap:7px; padding:3px 0; }
.oboe-fingering::before { content:""; position:absolute; left:4%; right:4%; height:11px; border:1px solid #8b7140; border-radius:50% 35% 35% 50%; background:linear-gradient(180deg,#f4cf77,#c89132); box-shadow:inset 0 -2px 3px rgba(91,56,10,.22); }
.oboe-hand,.oboe-octave { position:relative; z-index:1; display:flex; align-items:center; gap:5px; padding:3px 5px; border:1px solid #d6e2e9; border-radius:12px; background:rgba(255,255,255,.92); }
.oboe-hand > b { color:#527087; font-size:9px; letter-spacing:.04em; }
.oboe-joint { position:relative; z-index:2; width:8px; height:22px; border:2px solid #72552a; border-radius:4px; background:#d5a448; }
.oboe-hole { display:grid; place-items:center; width:24px; height:24px; color:#516a7b; background:#fff; border:2px solid #1769c2; border-radius:50%; box-shadow:0 1px 2px rgba(25,67,91,.15); font-size:9px; font-style:normal; font-weight:900; }
.oboe-hole.closed { color:#fff; background:#1769c2; box-shadow:inset 0 0 0 2px rgba(255,255,255,.28),0 2px 5px rgba(23,105,194,.22); }
.oboe-hole.half { color:#17304e; background:linear-gradient(90deg,#1769c2 0 50%,#fff 50% 100%); text-shadow:0 1px 0 #fff; }
.oboe-key { display:grid; place-items:center; min-width:28px; height:22px; padding:0 5px; color:#647986; background:#fff; border:2px solid #9fb3bf; border-radius:8px; font-size:8px; font-style:normal; font-weight:900; }
.oboe-key.active { color:#fff; background:#ff665e; border-color:#d94c45; box-shadow:inset 0 0 0 1px rgba(255,255,255,.28); }
.oboe-octave { padding:2px; }
.oboe-octave-key { min-width:25px; border-radius:10px; }
.oboe-pinky,.oboe-f-key { min-width:30px; }
.oboe-fingering-label { flex:0 1 165px; line-height:1.15; }
.oboe-fingering-label:empty {
    display: none;
}
.instrument-hint:has(.clarinet-fingering) {
  width:min(720px,calc(100vw - 40px));
  max-width:none;
  padding:8px 12px;
  gap:10px;
}
.clarinet-fingering { display:flex; align-items:center; justify-content:center; flex:1 1 auto; min-width:0; gap:8px; }
.clarinet-rear,.clarinet-body,.clarinet-hand { position:relative; display:flex; align-items:center; }
.clarinet-rear { gap:4px; padding:4px 6px; border:1px solid #d6e2e9; border-radius:12px; background:#fff; }
.clarinet-rear > b,.clarinet-hand > b { color:#527087; font-size:9px; letter-spacing:.04em; }
.clarinet-body { gap:5px; padding:5px 13px; border-radius:18px; background:linear-gradient(180deg,#36434c,#11191e); box-shadow:inset 0 2px 2px rgba(255,255,255,.25),0 2px 6px rgba(16,34,46,.2); }
.clarinet-hand { z-index:1; gap:4px; padding:2px 4px; border-radius:10px; background:rgba(255,255,255,.93); }
.clarinet-control { display:grid; place-items:center; box-sizing:border-box; font-style:normal; font-weight:900; }
.clarinet-hole { width:24px; height:24px; color:#456377; border:2px solid #2784cf; border-radius:50%; background:#fff; font-size:9px; }
.clarinet-hole.closed { color:#fff; background:#1769c2; box-shadow:inset 0 0 0 2px rgba(255,255,255,.28); }
.clarinet-key { min-width:27px; height:22px; padding:0 4px; color:#647986; border:2px solid #9fb3bf; border-radius:8px; background:#fff; font-size:8px; }
.clarinet-key.active { color:#fff; border-color:#d94c45; background:#ff665e; box-shadow:inset 0 0 0 1px rgba(255,255,255,.28); }
.clarinet-thumb { border-radius:8px; }
.clarinet-register { border-radius:11px; }
.clarinet-pinky { min-width:34px; }
.clarinet-joint { width:7px; height:25px; border:2px solid #9fb3bf; border-radius:3px; background:#d9e2e7; }
.clarinet-mouthpiece { width:14px; height:18px; margin-left:-18px; border-radius:70% 25% 25% 70%; background:#11191e; }
.clarinet-bell { width:18px; height:31px; margin-right:-21px; border-radius:25% 80% 80% 25%; background:#11191e; }
.clarinet-fingering-label { flex:0 1 175px; line-height:1.15; }
.clarinet-fingering-label:empty {
    display: none;
}
.instrument-hint:has(.saxophone-fingering) {
  width:min(720px,calc(100vw - 40px));
  max-width:none;
  padding:8px 12px;
  gap:10px;
}
.saxophone-fingering { display:flex; align-items:center; justify-content:center; flex:1 1 auto; min-width:0; gap:7px; }
.saxophone-octave,.saxophone-body,.saxophone-hand { position:relative; display:flex; align-items:center; }
.saxophone-octave { z-index:2; padding:3px 5px; border:1px solid #e0c887; border-radius:12px; background:#fffaf0; }
.saxophone-body { gap:5px; padding:5px 14px; border-radius:18px; background:linear-gradient(180deg,#eec765,#b98222); box-shadow:inset 0 2px 2px rgba(255,255,255,.38),0 2px 6px rgba(91,56,10,.2); }
.saxophone-hand { z-index:1; gap:4px; padding:2px 4px; border-radius:10px; background:rgba(255,255,255,.93); }
.saxophone-hand > strong { color:#527087; font-size:9px; letter-spacing:.04em; }
.saxophone-control { display:flex; align-items:center; justify-content:center; gap:2px; box-sizing:border-box; min-width:28px; height:24px; padding:0 4px; color:#516a7b; border:2px solid #9fb3bf; border-radius:50%; background:#fff; font-size:8px; font-style:normal; font-weight:900; }
.saxophone-control b { font-size:9px; line-height:1; }
.saxophone-control.pressed { color:#fff; border-color:#0f579f; background:#1769c2; box-shadow:inset 0 0 0 1px rgba(255,255,255,.28); }
.saxophone-control.released b { color:#7b8f9d; }
.saxophone-octave-key { min-width:42px; border-radius:9px; }
.saxophone-pinky { min-width:34px; border-radius:9px; }
.saxophone-joint { width:7px; height:26px; border:2px solid #795719; border-radius:3px; background:#e6b949; }
.saxophone-neck { width:17px; height:18px; margin-left:-20px; border:5px solid #b98222; border-right:0; border-bottom:0; border-radius:90% 0 0 0; }
.saxophone-bell { width:20px; height:32px; margin-right:-23px; border-radius:28% 85% 85% 28%; background:#a96f18; }
.saxophone-fingering-label { flex:0 1 90px; line-height:1.15; }
.instrument-hint:has(.recorder-fingering) {
  width: min(650px, calc(100vw - 40px));
  max-width: none;
  padding: 7px 12px;
  gap: 10px;
}
.recorder-fingering { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-width: 0; gap: 7px; }
.recorder-rear, .recorder-face { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid #d6e2e9; border-radius: 12px; background: rgba(255,255,255,.94); }
.recorder-rear > strong, .recorder-face > strong { color: #527087; font-size: 9px; letter-spacing: .04em; }
.recorder-face { position: relative; padding-inline: 9px; }
.recorder-face::before { content: ""; position: absolute; right: 4px; left: 4px; height: 10px; border: 1px solid #8b7140; border-radius: 10px; background: linear-gradient(180deg,#e8bb68,#bd7f28); }
.recorder-control { position: relative; z-index: 1; display: grid; grid-template-rows: 13px 10px; place-items: center; box-sizing: border-box; width: 25px; height: 29px; color: #456377; border: 2px solid #1769c2; border-radius: 50%; background: #fff; font-style: normal; font-weight: 900; line-height: 1; }
.recorder-control span { font-size: 13px; }
.recorder-control b { font-size: 8px; }
.recorder-control.closed { color: #fff; background: #1769c2; box-shadow: inset 0 0 0 2px rgba(255,255,255,.24); }
.recorder-control.half { color: #17304e; background: linear-gradient(90deg,#1769c2 0 50%,#fff 50% 100%); text-shadow: 0 1px 0 #fff; }
.recorder-thumb { border-radius: 9px; }
.recorder-fingering-label { flex: 0 1 110px; line-height: 1.15; }
.horn-lever { display: grid; place-items: center; width: 20px; height: 29px; color: #1769c2; background: #fff; border: 2px solid #1769c2; border-radius: 8px 8px 12px 12px; font-size: 10px; font-style: normal; }
.horn-lever.active { color: #fff; background: #ff665e; border-color: #d94c45; transform: translateY(4px); }
.instrument-answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px auto 20px; }
.instrument-answers button { min-width: 72px; padding: 12px 18px; border: 0; border-radius: 7px; background: #4caf50; color: #fff; font-size: 18px; cursor: pointer; }
.instrument-answers button:hover { background: #3d9441; }
.instrument-answers button:disabled { opacity: .65; cursor: default; }
.instrument-feedback { min-height: 28px; font-size: 20px; font-weight: 800; }
.instrument-progress { height: 20px; margin: 14px 0; border-radius: 12px; background: #ddd; overflow: hidden; }
#progress-bar { width: 0; height: 100%; background: #4caf50; transition: width .3s ease; }
#score { font-size: 28px; font-weight: 800; margin: 12px 0 0; }
#result .button { display: inline-block; margin: 8px; text-decoration: none; }
.send-score { margin-top: 24px; padding-top: 18px; border-top: 1px solid #d8dde1; }
.send-score h3 { margin: 0 0 12px; }
.send-score-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 620px; margin: 0 auto 8px; }
.send-score input, .send-score select { min-width: 0; padding: 10px; border: 1px solid #cbd2d8; border-radius: 7px; font: inherit; background: #fff; }
.send-confirmation { min-height: 24px; font-weight: 800; }
.send-loading { color: #1769c2; font-weight: 800; }
.send-loading[hidden] { display: none !important; }
@media (max-width: 520px) {
  .instrument-card { padding: 14px; }
  .send-score-fields { grid-template-columns: 1fr; }
  .instrument-hint:has(.recorder-fingering) { width: calc(100vw - 24px); padding: 6px 7px; gap: 5px; }
  .instrument-hint:has(.trombone-help) { width:calc(100vw - 24px); padding:6px 7px; gap:5px; }
  .instrument-hint:has(.piano-keyboard-help) { width:calc(100vw - 24px); min-height:58px; padding:6px 7px; }
  .instrument-hint:has(.harpsichord-keyboard-help) { width:calc(100vw - 24px); min-height:60px; padding:6px 7px; }
  .instrument-hint:has(.organ-keyboard-help) { width:calc(100vw - 24px); min-height:112px; padding:6px 7px; }
  .instrument-hint:has(.mallet-keyboard-help) { width:calc(100vw - 24px); min-height:64px; padding:6px 7px; }
  .piano-keyboard { height:42px; }
  .harpsichord-keyboard { height:44px; }
  .organ-keybed { height:22px; }
  .organ-pedal-row .organ-keybed { height:24px; }
  .mallet-keyboard { height:48px; }
  .trombone-help { gap:5px; }
  .trombone-position { min-width:0; height:4.2em; font-size:clamp(7px,2.25vw,9px); }
  .trombone-help-labels { flex-basis:100px; max-width:100px; font-size:9px; }
  .trombone-help-labels strong { font-size:12px; }
  .recorder-fingering { gap: 4px; }
  .recorder-rear, .recorder-face { gap: 2px; padding: 3px; }
  .recorder-rear > strong, .recorder-face > strong { display: none; }
  .recorder-control { width: 23px; height: 27px; }
  .recorder-fingering-label { flex-basis: 58px; font-size: 12px; }
}

/* Surface : exercice compact et portée agrandie */
.instrument-card {
  position: relative;
  margin-top: 8px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.instrument-card > .home-link {
  position: absolute;
  top: 14px;
  left: 18px;
}
.instrument-card h2 { margin: 4px 100px 4px; }
.pedagogy { min-height: 0; margin: 4px 0; }
.sound-summary { margin: 4px auto 6px; padding: 6px 12px; }
.instrument-note { width: min(250px, 76vw); height: 220px !important; }
#quiz { padding-top: 2px; }
.instrument-answers { margin: -2px auto 8px; }
.instrument-feedback { margin: 4px 0; min-height: 24px; }
.instrument-progress { height: 14px; margin: 8px 0; }
#score { margin-top: 5px; font-size: 22px; }
@media (min-width: 900px) {
  body > h1 { margin-top: 2px !important; margin-bottom: 8px !important; }
  .instrument-card { margin-bottom: 10px; }
}
@media (max-width: 700px) {
  .instrument-card > .home-link { position: static; display: inline-block; }
  .instrument-card h2 { margin: 8px 0 4px; }
  .instrument-note { width: min(220px, 76vw); height: 215px !important; }
}
/* Surface : note mise en avant et interface stable */
#quiz { position: relative; }
.instrument-note {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(250px, 76vw);
  height: 220px !important;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.instrument-note svg {
  width: 100% !important;
  height: 100% !important;
}
.instrument-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  line-height: 1.15;
}
.instrument-progress { margin-top: 4px; }
@media (max-width: 700px) {
  .music-panel { width: min(310px, 90vw); height: 255px; }
  .instrument-note { width: min(235px, 76vw); height: 210px !important; }
}
/* Proportions musicales : agrandissement homogène */
.instrument-note svg {
  transform: scale(1.2);
  transform-origin: center center;
  overflow: visible;
}
.reminder-clef-label { margin: 4px 0 -2px; color: #50657a; font-size: 14px; font-weight: 900; text-align: center; }

/* Exercice fluide sur toutes les tailles d’écran */
.instrument-card { max-width: min(940px, calc(100% - 24px)); }
.instrument-card, .instrument-card > *, #quiz, #result { min-width: 0; }
.open-strings-intro, .open-strings-list.combined-staff { max-width: 100%; }
.open-strings-labels span { min-width: 34px; padding: 4px 7px; font-size: clamp(12px, 2.3vw, 16px); }
.sound-mode { flex-wrap: wrap; }

@media (max-width: 700px) {
  .instrument-card { width: calc(100% - 10px); max-width: none; margin: 6px auto; padding: 12px 10px; border-radius: 14px; }
  .instrument-card > .home-link { margin-bottom: 4px; }
  .instrument-card h2 { font-size: clamp(1.25rem, 6vw, 1.7rem); line-height: 1.15; }
  .pedagogy { font-size: 14px; line-height: 1.35; }
  .sound-summary { max-width: 100%; font-size: 12px; }
  .open-strings-intro { width: 100%; margin: 12px auto; padding: 14px 8px; }
  .open-strings-intro h3 { margin-bottom: 10px; font-size: 19px; }
  .open-strings-list.combined-staff { padding-inline: 3px; }
  .open-strings-staff { height: clamp(130px, 43vw, 175px) !important; }
  .open-strings-labels { margin-top: -8px; }
  .music-panel { width: min(300px, calc(100vw - 34px)); height: 245px; margin-bottom: 42px; padding-inline: 8px; }
  .instrument-note { width: min(220px, 72vw); height: 200px !important; }
  .instrument-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); width: 100%; gap: 7px; }
  .instrument-answers button { min-width: 0; min-height: 48px; margin: 0; padding: 10px 7px; font-size: 17px; }
  .instrument-hint { max-width: calc(100% - 12px); gap: 7px; padding-inline: 8px; font-size: 13px; }
  #quiz .instrument-hint:has(.flute-fingering) { width:min(100%, calc(100vw - 30px)); max-width:none; padding:7px 5px; gap:4px; }
  .flute-fingering { gap:2px; }
  .flute-hand, .flute-foot { gap:2px; padding:2px; }
  .flute-hand > b { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .flute-key { width:20px; height:20px; border-width:1.5px; font-size:8px; }
  .flute-pinky { width:23px; }
  .flute-foot-key { width:25px; }
  .flute-fingering-label { display:none; }
  #quiz .instrument-hint:has(.oboe-fingering) { width:min(100%,calc(100vw - 30px)); max-width:none; padding:7px 4px; gap:3px; }
  .oboe-fingering { gap:2px; }
  .oboe-hand,.oboe-octave { gap:2px; padding:2px; }
  .oboe-hand > b { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .oboe-hole { width:20px; height:20px; border-width:1.5px; font-size:8px; }
  .oboe-key { min-width:23px; height:20px; padding-inline:3px; border-width:1.5px; font-size:7px; }
  .oboe-joint { width:6px; height:18px; }
  .oboe-fingering-label { display:none; }
  #quiz .instrument-hint:has(.clarinet-fingering) { width:min(100%,calc(100vw - 30px)); max-width:none; padding:7px 4px; gap:3px; }
  .clarinet-fingering { gap:3px; }
  .clarinet-body { gap:2px; padding:4px 9px; }
  .clarinet-rear,.clarinet-hand { gap:2px; padding:2px; }
  .clarinet-rear > b,.clarinet-hand > b { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .clarinet-hole { width:20px; height:20px; border-width:1.5px; font-size:8px; }
  .clarinet-key { min-width:22px; height:20px; padding-inline:3px; border-width:1.5px; font-size:7px; }
  .clarinet-pinky { min-width:29px; }
  .clarinet-joint { width:5px; height:19px; }
  .clarinet-fingering-label { display:none; }
  #quiz .instrument-hint:has(.saxophone-fingering) { width:min(100%,calc(100vw - 30px)); max-width:none; padding:7px 4px; gap:3px; }
  .saxophone-fingering { gap:3px; }
  .saxophone-body { gap:2px; padding:4px 9px; }
  .saxophone-octave,.saxophone-hand { gap:2px; padding:2px; }
  .saxophone-hand > strong { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .saxophone-control { min-width:22px; height:20px; padding-inline:3px; border-width:1.5px; font-size:7px; }
  .saxophone-control b { font-size:7px; }
  .saxophone-octave-key { min-width:34px; }
  .saxophone-pinky { min-width:27px; }
  .saxophone-joint { width:5px; height:19px; }
  .saxophone-neck,.saxophone-bell { display:none; }
  .saxophone-fingering-label { display:none; }
  .instrument-progress { height: 12px; }
  #score, #key-score { font-size: 21px; }
  #result .button { display: block; width: 100%; margin: 8px 0; }
}

@media (max-width: 380px) {
  .music-panel { height: 225px; }
  .instrument-note { width: 200px; height: 185px !important; }
  .instrument-answers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.keyboard-hint {
  margin: 7px 0 2px;
  color: #60758a;
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 520px) {
  .keyboard-hint { font-size: 11px; }
}
@media (hover: none) and (pointer: coarse) {
  .keyboard-hint { display: none; }
}

/* Téléphone/tablette : la question complète reste dans la fenêtre. */
@media (max-width: 700px) {
  body:has(> .instrument-card) { padding: 5px !important; }
  body:has(> .instrument-card) .notalix-bar {
    grid-template-columns: 1fr; min-height: 48px; margin-bottom: 5px;
    padding: 5px 7px; border-radius: 12px;
  }
  body:has(> .instrument-card) .notalix-home { display: none; }
  body:has(> .instrument-card) .notalix-brand { grid-column: 1; grid-row: 1; justify-self: center; }
  body:has(> .instrument-card) .notalix-site { display: none; }
  body:has(> .instrument-card) .notalix-module { display: none; }

  /* Le rappel musical est la première chose utile à voir sur téléphone. */
  body.instrument-intro-active .instrument-card { display: flex; flex-direction: column; }
  body.instrument-intro-active .instrument-card > .home-link { order: 1; }
  body.instrument-intro-active .instrument-card > h2 { order: 2; }
  body.instrument-intro-active .instrument-card > .pedagogy { order: 3; }
  body.instrument-intro-active .instrument-card > .open-strings-intro { order: 4; }
  body.instrument-intro-active .instrument-card > .sound-summary { order: 5; }
  body.instrument-intro-active .instrument-card > .exercise-settings { order: 6; }
  body.instrument-intro-active .instrument-card > .exercise-settings-help { order: 7; }
  body.instrument-intro-active .instrument-card > .sound-loading,
  body.instrument-intro-active .instrument-card > #quiz,
  body.instrument-intro-active .instrument-card > #result { order: 9; }
}

@media (max-width: 700px) and (max-height: 900px) {
  .instrument-card { margin-top: 3px; padding-block: 8px; }
  .instrument-card h2 { margin-block: 2px; }
  .instrument-card .pedagogy { margin-block: 2px; font-size: 12px; }
  .sound-summary { display: none; }
  .sound-mode { margin-block: 2px; }
  .music-panel { height: 205px; margin-block: 3px 29px; }
  .instrument-note { width: 205px; height: 170px !important; }
  .instrument-answers { margin-bottom: 3px; }
  .instrument-feedback { height: 28px; min-height: 28px; font-size: 16px; }
  .instrument-progress { margin-block: 3px; }
  #score, #key-score { margin-block: 2px; font-size: 19px; }
}

/* Sur téléphone le doigté occupe sa propre place et ne recouvre jamais les réponses. */
@media (max-width: 700px) {
  #quiz, #result { scroll-margin-top: 8px; }
  #quiz .music-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto !important;
    min-height: 225px;
    margin-bottom: 10px;
    overflow: visible;
  }
  #quiz .instrument-hint {
    position: static;
    width: calc(100% - 8px);
    max-width: none;
    min-height: 48px;
    margin: -16px auto 5px;
    transform: none;
    flex-wrap: wrap;
    line-height: 1.2;
  }
}

/* Couche finale téléphone/tablette : aucun débordement et le doigté garde sa propre ligne. */
html,body { max-width:100%; overflow-x:hidden; }
@media (max-width:700px) {
  .instrument-card { width:100%; max-width:100%; margin:3px auto; padding:9px 7px 13px; }
  .instrument-card > .home-link { margin:0 auto 4px; padding:6px 10px; font-size:12px; }
  .instrument-card h2 { margin:2px 0; font-size:clamp(19px,6vw,25px); }
  .instrument-card .pedagogy { margin:2px auto 5px; font-size:12px; }
  #quiz { scroll-margin-top:6px; }
  #quiz .music-panel { width:min(300px,calc(100vw - 30px)); min-height:205px; margin:4px auto 8px; }
  #quiz .instrument-note { width:200px; height:170px!important; }
  #quiz .instrument-hint { position:static; width:calc(100% - 8px); margin:-12px auto 4px; transform:none; }
  #quiz .instrument-hint:has(.fingering-visual.strings) { width:max-content; max-width:calc(100% - 8px); min-height:44px; padding:6px 10px; }
  .bowed-string-help { gap:8px; }
  .bowed-string-placement-label { font-size:11px; }
  #quiz .instrument-hint:has(.double-bass-fingering) { gap:8px; }
  #quiz .instrument-hint:has(.piano-keyboard-help),
  #quiz .instrument-hint:has(.harpsichord-keyboard-help),
  #quiz .instrument-hint:has(.organ-keyboard-help),
  #quiz .instrument-hint:has(.mallet-keyboard-help) { width:calc(100vw - 24px); max-width:560px; margin:-12px auto 4px; }
  .instrument-answers { display:grid; grid-template-columns:repeat(auto-fit,minmax(52px,1fr)); width:100%; gap:6px; }
  .instrument-answers button { min-width:0; min-height:46px; margin:0; padding:8px 5px; font-size:16px; }
  .keyboard-hint { margin:4px 0; font-size:10px; }
}

@media (max-width:700px) {
  .instrument-card { overflow:hidden; }
  .open-strings-intro, .open-strings-list, .open-string-item, .open-strings-staff { max-width:100%; min-width:0; }
  .open-strings-staff { overflow:hidden; }
  .open-strings-staff svg { display:block; width:100% !important; max-width:100% !important; height:auto !important; margin:auto; }
}


/* Correctif 0.9.8k : sur PC, on libère l’espace sous le doigté et on centre les petits jeux de réponses. */
@media (min-width:1024px) {
  #quiz .music-panel:has(.instrument-hint:not([hidden])) {
    margin-bottom: 38px;
  }
  #quiz .instrument-answers.answers-centered,
  #key-quiz .instrument-answers.answers-centered {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
    gap: 10px;
    margin: 10px auto 8px;
  }
  #quiz .instrument-answers.answers-centered button,
  #key-quiz .instrument-answers.answers-centered button {
    flex: 0 0 clamp(92px, 11vw, 128px);
  }
}

.response-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.response-mode > span { flex-basis: 100%; color: var(--nl-text-muted); font-size: 12px; font-weight: 800; text-align: center; }
.response-mode button {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--nl-line);
  border-radius: var(--nl-radius-control);
  background: var(--nl-surface);
  color: var(--nl-text);
  font-weight: 800;
}
.response-mode button.selected { border-color: var(--nl-family-accent); background: color-mix(in srgb, var(--nl-family-accent) 10%, white); }
.response-mode em { color: var(--nl-family-accent); font-size: 9px; font-style: normal; letter-spacing: .06em; }
.instrument-response-status {
  width: min(520px, 100%);
  min-height: 48px;
  margin: 8px auto;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--nl-family-accent) 28%, var(--nl-line));
  border-radius: var(--nl-radius-control);
  background: color-mix(in srgb, var(--nl-family-accent) 6%, white);
  color: var(--nl-text);
  font-weight: 750;
  text-align: center;
}
@media (max-width:700px) {
  .response-mode { width: 100%; }
  .response-mode > span { flex-basis: 100%; text-align: center; }
  .response-mode button { flex: 1 1 120px; }
}
