:root {
  --pond: #071c22;
  --pond-2: #0d333c;
  --ink: #1c2822;
  --ink-soft: #4d5c56;
  --paper: #f4efe4;
  --paper-2: #ebe4d4;
  --line: rgba(28, 40, 34, 0.12);
  --gold: #a67c45;
  --gold-2: #e7d3ae;
  --cream: #f7f3ea;
  --do: #c45448;
  --re: #b47d18;
  --mi: #0f736c;
  --fa: #2f6f56;
  --sol: #534b92;
  --la: #2f5f8a;
  --sib: #8a4b6a;
  --si: #8a4b6a;
  --do-glow: #e3897c;
  --re-glow: #e2b15a;
  --mi-glow: #3eaea4;
  --fa-glow: #7dba9a;
  --sol-glow: #8e86c9;
  --la-glow: #7eafd4;
  --sib-glow: #d7a0bc;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  --serif: "Fraunces", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Nunito", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--sans);
  background: var(--pond);
  overflow-x: hidden;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
::selection { background: #e4cfab; color: var(--ink); }

.pond {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(150, 196, 186, 0.18), transparent 55%),
    radial-gradient(700px 480px at 110% 90%, rgba(176, 122, 64, 0.16), transparent 50%),
    linear-gradient(180deg, #114049 0%, #08262c 42%, #071c22 100%);
  overflow: hidden;
}
.pond::before,
.pond::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.14), transparent 70%) 20% 30% / 28% 18% no-repeat,
    radial-gradient(closest-side, rgba(255, 236, 200, 0.1), transparent 70%) 70% 60% / 34% 22% no-repeat;
  animation: caustic 22s ease-in-out infinite alternate;
  pointer-events: none;
}
.pond::after { animation-duration: 31s; opacity: 0.7; mix-blend-mode: screen; }
@keyframes caustic {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px 0 16px;
  gap: 14px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 10px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 64, 73, 0.88), rgba(7, 28, 34, 0.86));
  border: 1px solid rgba(231, 211, 174, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  flex-direction: column;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 0;
}
.brand em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 560;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand span {
  margin-top: 3px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.piece-jump {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 230px;
  max-width: 330px;
}
.piece-jump-lab {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.piece-jump-btn {
  appearance: none;
  width: 100%;
  max-width: 100%;
  text-align: left;
  background: rgba(247, 243, 234, 0.12);
  color: var(--cream);
  border: 1.5px solid rgba(231, 211, 174, 0.35);
  border-radius: 10px;
  padding: 6px 28px 6px 10px;
  font: 800 0.82rem var(--sans);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23e7d3ae' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}
.piece-jump-btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.piece-jump.open .piece-jump-btn {
  background-color: rgba(247, 243, 234, 0.2);
  border-color: var(--gold-2);
}
.piece-jump-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 6px);
  width: max(100%, min(320px, calc(100vw - 24px)));
  max-height: min(60dvh, 420px);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  -webkit-overflow-scrolling: touch;
}
.piece-jump-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font: 800 0.9rem var(--sans);
  min-height: 44px;
  line-height: 1.25;
}
.piece-jump-item:hover, .piece-jump-item:focus-visible { background: rgba(28, 40, 34, 0.08); }
.piece-jump-item.on { background: var(--ink); color: var(--cream); }
.path-open-note {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: rgba(247, 243, 234, 0.82);
}
.stamps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: min(520px, 42vw); justify-content: center; }
.stamps.many { gap: 4px; max-width: min(560px, 48vw); }
.stamps.many .stamp.star { width: 14px; height: 14px; }
.stamp {
  width: 36px;
  height: 22px;
  display: inline-block;
  opacity: 0.45;
}
.stamp.star { width: 22px; height: 22px; }
.stamp svg { width: 100%; height: 100%; display: block; }
.stamp:not(.on) { filter: grayscale(1) brightness(1.4); }
.guide-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 0.82rem;
}
.top-back {
  padding: 7px 14px;
  font-size: 0.86rem;
  color: var(--cream);
  box-shadow: inset 0 0 0 1.5px rgba(247, 243, 234, 0.35);
}
.mic-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(231, 211, 174, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: var(--cream);
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 800;
  font-size: 0.8rem;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.mic-top-btn:hover { background: rgba(255, 255, 255, 0.13); }
.mic-top-btn.on {
  background: rgba(231, 211, 174, 0.18);
  border-color: var(--gold-2);
  color: var(--gold-2);
}
.mic-top-btn .mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.45);
  transition: background 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}
.mic-top-btn.on .mic-dot { background: var(--gold); }
.mic-top-btn.hot .mic-dot {
  background: #4cd97b;
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(76, 217, 123, 0.85);
}
.stamp.on { opacity: 1; filter: none; }
.stamp.gold { filter: drop-shadow(0 0 4px rgba(231, 211, 174, 0.8)); }
.vol {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.vol input { width: 88px; accent-color: var(--gold); }
.speed input { width: 108px; }
.speed #speedword { text-transform: none; letter-spacing: 0.01em; min-width: 5.4rem; font-size: 0.82rem; }

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 5px;
  scrollbar-width: none;
  align-self: flex-start;
  max-width: 100%;
  background: rgba(247, 243, 234, 0.07);
  border: 1px solid rgba(231, 211, 174, 0.15);
  border-radius: 999px;
}
.nav::-webkit-scrollbar { display: none; }
.nav button {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}
.nav button.on {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}
.nav button.next:not(.on) {
  box-shadow: inset 0 0 0 1.5px var(--gold-2);
  color: var(--gold-2);
  background: rgba(231, 211, 174, 0.12);
}

.workspace {
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 14px;
  align-items: start;
}
.workspace:not(:has(.parent)) { grid-template-columns: minmax(0, 1fr); }
.paper {
  background: linear-gradient(180deg, var(--paper), #f8f4eb 70%);
  color: var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.stage {
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.kicker {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
}
.stage h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.lede {
  margin: 10px 0 0;
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 38rem;
  line-height: 1.45;
}

.lyrics {
  margin: 22px 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.65rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.lyrics.compact { font-size: clamp(1.25rem, 2.4vw, 1.85rem); }
.line { margin: 0 0 4px; }
.line.soft { font-size: 0.92em; color: var(--ink-soft); font-style: italic; }
.word { display: inline-block; white-space: nowrap; margin-right: 0.28em; }
.syl { border-radius: 10px; padding: 0 0.08em; transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.syl.on {
  background: color-mix(in srgb, var(--c, var(--gold)) 18%, white);
  color: var(--ink);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c, var(--gold)) 40%, transparent);
  font-weight: 700;
}
.drop-row { display: flex; align-items: center; gap: 10px; min-height: 0; margin-top: 8px; }
.drop-row:not(:has(.drop.go)):not(:has(.breath:not(:empty))) { display: none; }
.drop {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--mi);
  transform: scale(0.7);
  opacity: 0;
}
.drop.go { animation: drop 0.45s ease; }
@keyframes drop {
  0% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.45; }
}
.breath {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.cue {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
}
.cue[hidden] { display: none; }
.cue-num {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--serif);
  font-size: 1.8rem;
  flex: none;
}
.cue-num.do { background: var(--do); }
.cue-num.re { background: var(--re); }
.cue-num.mi { background: var(--mi); }
.cue-num.sol { background: var(--sol); }
.cue-num.fa { background: var(--fa); }
.cue strong { display: block; font-size: 1.35rem; }
.cue span { color: var(--ink-soft); }
.note-msg {
  margin: 8px 0 0;
  min-height: 1.4em;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 0.98rem;
  background: var(--ink);
  color: var(--cream);
}
.btn.gold { background: var(--gold); color: #1b140c; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(28, 40, 34, 0.22);
}
.btn:focus-visible, .nav button:focus-visible, .brand:focus-visible,
.guide-btn:focus-visible, .mic-top-btn:focus-visible, .chip:focus-visible,
.scale-pick:focus-visible, .phrase-tabs button:focus-visible, .path-item:focus-visible,
.score-page:focus-visible, .score-nav:focus-visible, .write-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
/* Les touches sont des boutons : le focus doit se voir sans masquer la couleur de la note. */
.white:focus-visible, .black:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
  z-index: 5;
}
.scale-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 14px 0 4px;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.scale-pick {
  flex: 0 0 auto;
  border: 0;
  background: rgba(28, 40, 34, 0.06);
  color: var(--ink);
  border-radius: 14px;
  padding: 8px 12px 7px;
  min-width: 92px;
  text-align: left;
}
.scale-pick b {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 560;
}
.scale-pick small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.scale-pick.on {
  background: var(--ink);
  color: var(--cream);
}
.scale-pick.on small { color: var(--gold-2); }
.scale-pick.song:not(.on) { box-shadow: inset 0 0 0 1.5px var(--gold); }
.phrase-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 4px; max-height: 9.5rem; overflow-y: auto; padding-right: 2px; scroll-behavior: smooth; }
.phrase-tabs button {
  border: 0;
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}
.phrase-tabs button.on { background: var(--ink); color: var(--cream); }
.phrase-tabs .tab-part {
  flex-basis: 100%;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.phrase-tabs .tab-part:first-child { margin-top: 0; }
.phrase-tabs button.done { box-shadow: inset 0 -2px 0 var(--gold); }

.dots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(28, 40, 34, 0.15);
  display: block;
}
.dots .long { display: block; flex: 1; height: 8px; border-radius: 4px; background: rgba(28, 40, 34, 0.12); overflow: hidden; }
.dots .long b { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width 0.25s linear; }
.dots i.on { background: var(--gold); }
.dots i.now { background: var(--ink); transform: scale(1.25); }

.setup {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.card {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.card p { margin: 0; color: var(--ink-soft); line-height: 1.4; font-size: 0.95rem; }

.landmark-fig { margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; max-width: 540px; }
.landmark { width: 100%; height: auto; display: block; }
.landmark-fig figcaption { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.4; }
.landmark-fig figcaption strong { color: var(--ink); }
.write-toggle {
  align-self: flex-start;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px rgba(28, 40, 34, 0.22);
}
.write-toggle.on { background: var(--ink); color: var(--cream); box-shadow: none; }
.score-wrap {
  margin: 12px 0 2px;
  padding: 10px 6px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: visible;
}
.score { width: 100%; height: auto; display: block; }
.score-pages { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 2px 0 4px; }
.score-page {
  width: 10px; height: 10px; border: 0; padding: 0; border-radius: 50%;
  background: rgba(28, 40, 34, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
}
.score-page.on { background: var(--ink); transform: scale(1.2); }
.score-nav {
  border: 0;
  background: rgba(28, 40, 34, 0.08);
  color: var(--ink);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.score-nav:disabled { opacity: 0.28; cursor: default; }
.score-page-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin: 0 2px;
}
.score-note[data-mark], .staff-note[data-midi] { cursor: pointer; }
.score-clef, .sig, .acc, .time, .time-c { font-family: Georgia, "Times New Roman", serif; fill: #1c2822; }
.sig, .acc { font-size: 22px; }
.time { font-weight: 700; }
.time-c { font-weight: 700; font-style: normal; }
.legato-mark { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.fing, .lyr, .volta, .fin, .ottava { font-family: Nunito, "Segoe UI", sans-serif; fill: #1c2822; }
.ottava { font-size: 12px; font-weight: 800; font-style: italic; }
.fing { font-size: 16px; font-weight: 800; }
.lyr { font-size: 16px; }
.volta, .fin { font-size: 12px; font-weight: 800; font-style: italic; }
.score-note .halo { fill: transparent; }
.score-note.on .halo { fill: rgba(166, 124, 69, 0.2); }
.score-note.on .head {
  fill: var(--gold);
  stroke: #6e4f24;
  stroke-width: 1.8;
}
.score-note.open.on .head { fill: #f7f0e2; stroke: var(--gold); stroke-width: 2; }
.score-note.on .stem { stroke: var(--gold); stroke-width: 1.8; }
.score-note.on .fing { fill: #6e4f24; }
.score-note.on .lyr { fill: #6e4f24; font-weight: 700; }
.score-note.on .acc { fill: var(--gold); }
.staff-note .staff-halo,
.staff-note .staff-halo-ring { fill: transparent; }
.staff-wrap:has(.staff-note) .staff-note .staff-halo {
  fill: rgba(166, 124, 69, 0.22);
}
.staff-wrap:has(.staff-note) .staff-note .staff-halo-ring { fill: transparent; }
.staff-wrap:has(.staff-note) .staff-finger circle {
  fill: var(--gold);
  stroke: #6e4f24;
  stroke-width: 1.5;
}
.staff-wrap:has(.staff-note) .staff-finger text { fill: #fff; }
.staff-wrap { margin: 4px 0 0; }
.staff { width: 100%; height: auto; display: block; }
.clef { font-family: Georgia, "Times New Roman", serif; font-size: 132px; }
.hand-steps { display: flex; gap: 6px; margin: 14px 0; }
.hand-steps i {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(28, 40, 34, 0.15); display: block;
}
.hand-steps i.on { background: var(--mi); }

.parent {
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.parent h2 {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.say {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.parent ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.parent li { margin: 4px 0; line-height: 1.4; }
.stuck {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.4;
}
details { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.45; }
details summary { cursor: pointer; color: var(--ink); font-weight: 800; }
.tiny {
  margin-top: 16px;
  background: none;
  border: 0;
  color: var(--ink-soft);
  padding: 0;
  text-align: left;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.toggles { display: flex; flex-direction: column; gap: 6px; }
.toggles button { text-align: left; }

.piano { width: min(720px, 100%); margin: 0 auto; }
.piano.dense { width: min(1040px, 100%); }
.piano.dense .white { margin: 0 1px; }
.piano.dense .white .nm { font-size: 0.82rem; }
.piano.dense .white .fn { font-size: 0.78rem; }
.piano.dense .white .kb { display: none; }
.rail {
  background: linear-gradient(180deg, #4a3428, #2a1b14);
  border-radius: 18px;
  padding: 14px 12px 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #f0e2cf;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0 6px 8px;
}
.handbar {
  height: 168px;
  margin: 0 0 -22px;
  position: relative;
  z-index: 3;
  pointer-events: none;
  transition: margin-left 0.2s ease;
}
.hand-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.finger-guide .skin {
  fill: url(#skin);
  stroke: #b96e55;
  stroke-width: 2;
  stroke-linejoin: round;
}
.finger-guide .finger-sheen { fill: rgba(255, 250, 244, 0.45); pointer-events: none; }
.finger-guide .tip-shadow { fill: rgba(38, 18, 10, 0.22); filter: blur(3px); }
.wrist { fill: url(#wristFade); }
.palm {
  fill: url(#back);
  stroke: #c57a60;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.palm-cover { fill: url(#back); }
.palm-shine { fill: url(#shine); }
.thumb-fold { fill: none; stroke: #d4896f; stroke-width: 1.6; stroke-linecap: round; opacity: 0.48; }
.tendon { fill: none; stroke: rgba(255, 248, 242, 0.45); stroke-width: 2.2; stroke-linecap: round; }
.hand-shadow { fill: rgba(18, 9, 5, 0.32); filter: blur(7px); }
.knuckle-arc {
  fill: none;
  stroke: #d4896f;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.62;
}
.palm-line, .crease {
  fill: none;
  stroke: #ce8268;
  stroke-width: 1.45;
  stroke-linecap: round;
  opacity: 0.58;
}
.crease.soft { stroke-width: 1.15; opacity: 0.36; }
.sleeve-shadow { fill: rgba(36, 16, 10, 0.22); }
.sleeve { fill: url(#cuffGrad); stroke: #a84e42; stroke-width: 1.6; stroke-linejoin: round; }
.sleeve-rib path { stroke: rgba(255, 238, 228, 0.34); stroke-width: 2.8; stroke-linecap: round; }
.sleeve-edge { fill: none; stroke: #a84e42; stroke-width: 2.2; stroke-linecap: round; }
.finger-guide {
  opacity: 0.72;
  transform: translateY(-6px);
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.finger-guide .nail { fill: #fdeae1; stroke: #dea38c; stroke-width: 1.15; }
.finger-guide .nail-lunula { fill: none; stroke: rgba(255, 252, 249, 0.85); stroke-width: 1.8; stroke-linecap: round; }
.finger-guide .nail-shine { fill: #ffffff; opacity: 0.78; }
.finger-guide .glow { fill: transparent; filter: blur(4px); }
.finger-guide .badge-halo { fill: rgba(255, 250, 244, 0.45); }
.finger-guide .badge { fill: #fff8f4; stroke: #fffaf5; stroke-width: 2.2; }
.finger-guide .num {
  fill: #fffaf6;
  font-family: Fraunces, Palatino, serif;
  font-size: 19px;
  font-weight: 650;
}
.finger-guide.do { --tint: var(--do); }
.finger-guide.re { --tint: var(--re); }
.finger-guide.mi { --tint: var(--mi); }
.finger-guide.fa { --tint: var(--fa); }
.finger-guide.sol { --tint: var(--sol); }
.finger-guide.la { --tint: var(--la); }
.finger-guide.si { --tint: var(--si); }
.finger-guide.sib { --tint: var(--sib); }
.finger-guide.do .badge { fill: var(--do); }
.finger-guide.re .badge { fill: var(--re); }
.finger-guide.mi .badge { fill: var(--mi); }
.finger-guide.fa .badge { fill: var(--fa); }
.finger-guide.sol .badge { fill: var(--sol); }
.finger-guide.la .badge { fill: var(--la); }
.finger-guide.si .badge { fill: var(--si); }
.finger-guide.sib .badge { fill: var(--sib); }
.finger-guide.repos .badge { fill: #f8ebe3; stroke: #e4c2b0; stroke-width: 1.6; }
.finger-guide.repos .num { fill: #9a5c4c; }
.finger-guide.repos.active .num { fill: #fffaf6; }
.handbar.is-model .finger-guide,
.finger-guide.placed { opacity: 1; transform: none; }
.handbar .finger-guide.active {
  opacity: 1;
  transform: translate(var(--reach, 0px), 26px);
}
.handbar .finger-guide.active.on-black {
  transform: translate(var(--reach, 0px), -8px);
}
.handbar .finger-guide.active.lift {
  transform: translate(var(--reach, 0px), -18px);
  transition: none;
}
.finger-guide.active .glow { fill: var(--active-tint, var(--tint)); opacity: 0.9; }
.finger-guide.active .badge-halo { fill: var(--active-tint, var(--tint)); opacity: 0.35; r: 22px; }
.finger-guide.active .badge { fill: var(--active-tint, var(--tint)); stroke: #fff; stroke-width: 3.2; r: 17.5px; }
.finger-guide.active .num { font-size: 22px; }
.finger-guide.active .nail { fill: #fff; stroke: var(--active-tint, var(--tint)); stroke-width: 2; }
.keys { position: relative; height: 196px; user-select: none; touch-action: none; display: flex; }
.white {
  position: relative;
  flex: 1;
  margin: 0 3px;
  border: 0;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #fffdf8 0%, #f3ecdf 78%, #e7dfd0 100%);
  box-shadow: inset 0 -8px 0 rgba(70, 50, 30, 0.06), 0 8px 0 rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 0;
}
.white .face {
  position: absolute;
  left: 4px; right: 4px; bottom: 18px;
  height: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}
.white .nm {
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
}
.white.do .nm { color: var(--do); }
.white.re .nm { color: var(--re); }
.white.mi .nm { color: var(--mi); }
.white.fa .nm { color: var(--fa); }
.white.sol .nm { color: var(--sol); }
.white.la .nm { color: var(--la); }
.white.si .nm { color: var(--si); }
.white .fn {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.72;
}
.white .kb { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--ink-soft); }
.white.rest { color: var(--fa); }
.white.rest .fn, .white.rest .nm { opacity: 0.75; }
.black.sounding { filter: none; }
.black.free .blab { display: none; }
.black .blab {
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  color: #f4efe4;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
  line-height: 1;
}
@keyframes expect {
  0%, 100% { outline-color: transparent; }
  50% { outline-color: var(--tint); }
}
.band {
  position: absolute;
  left: 10px; right: 10px; bottom: 6px;
  height: 4px;
  border-radius: 4px;
}
.do .band { background: var(--do); }
.re .band { background: var(--re); }
.mi .band { background: var(--mi); }
.fa .band { background: var(--fa); }
.sol .band { background: var(--sol); }
.la .band { background: var(--la); }
.si .band { background: var(--si); }
.do .band { background: var(--do); }
.black {
  position: absolute;
  top: 0;
  width: 10%;
  height: 58%;
  border: 0;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(180deg, #3c4248, #121416);
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.35);
  z-index: 2;
  padding: 0;
}
.black.is-down { transform: translateY(4px); }
.black .bfn {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  color: #f4efe4;
  font-family: var(--serif);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1;
}
.black.sounding .bfn, .black.is-down .bfn, .black.is-expected .bfn { color: #1c2822; }
.white, .black { --tint: #c9a24a; transition: background 90ms ease, box-shadow 120ms ease, transform 90ms ease; }
.white.do { --tint: var(--do); }
.white.re { --tint: var(--re); }
.white.mi { --tint: var(--mi); }
.white.fa { --tint: var(--fa); }
.white.sol { --tint: var(--sol); }
.white.la { --tint: var(--la); }
.white.si { --tint: var(--si); }
.black.sib { --tint: var(--sib-glow); }
@keyframes keytap {
  0% { transform: translateY(0); }
  42% { transform: translateY(10px); }
  100% { transform: translateY(7px); }
}
.white.tap, .black.tap { animation: keytap 0.34s ease-out; }
.white.sounding, .white.is-down, .white.is-expected {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 22%, #fff) 0%, color-mix(in srgb, var(--tint) 58%, #fff) 100%);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--tint) 75%, #fff), 0 6px 18px color-mix(in srgb, var(--tint) 35%, transparent);
  transform: translateY(5px);
  z-index: 3;
}
.white.is-expected, .black.is-expected {
  outline: 5px solid transparent;
  outline-offset: 3px;
  animation: expect 1.15s ease-in-out infinite;
}
.white.sounding .face, .white.is-down .face, .white.is-expected .face { opacity: 1; }
.white.sounding .fn, .white.is-down .fn, .white.is-expected .fn {
  color: var(--tint);
  opacity: 1;
}
.white.sounding .nm, .white.is-down .nm, .white.is-expected .nm {
  color: var(--ink);
}
.white.sounding .band, .white.is-down .band, .white.is-expected .band { height: 9px; }
.black.sounding, .black.is-down, .black.is-expected {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 40%, #222) 0%, color-mix(in srgb, var(--tint) 85%, #111) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 50%, #fff), 0 4px 14px color-mix(in srgb, var(--tint) 40%, transparent);
  transform: translateY(4px);
  filter: none;
  opacity: 1;
  z-index: 4;
}
.black.sounding .blab, .black.is-down .blab, .black.is-expected .blab {
  color: #1c2822;
  font-size: 0.78rem;
}
.white.got-it, .black.got-it { animation: gotit 0.45s ease; }
@keyframes gotit {
  0% { filter: brightness(1.35); }
  100% { filter: none; }
}
.white.ping::after, .black.ping::after {
  content: "";
  position: absolute;
  left: 50%; top: 18px;
  width: 28px; height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--tint) 45%, transparent);
  animation: keyping 0.6s ease-out forwards;
}
@keyframes keyping {
  0% { transform: scale(0.35); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

.cover {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px 40px;
}
.cover-card { width: min(880px, 100%); text-align: center; }
.cover-card h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  margin: 8px 0 0;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-style: italic;
}
.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 800;
  font-size: 0.78rem;
}
.cover-card .sub {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  margin: 14px 0 0;
}
.order {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 26px 0;
  color: var(--gold-2);
  font-weight: 800;
}
.order b { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 560; color: var(--cream); }
.today {
  width: min(640px, 100%);
  margin: 26px auto 8px;
  padding: 22px 22px 18px;
  text-align: left;
  color: var(--ink);
}
.today h2 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.5rem, 3.2vw, 1.9rem);
  letter-spacing: -0.02em;
  margin: 14px 0 4px;
}
.today-lede { margin: 0 0 14px; color: var(--ink-soft); line-height: 1.45; }
.week {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.week li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.week li.is-today { box-shadow: inset 0 0 0 1.5px var(--gold); background: rgba(166, 124, 69, 0.07); }
.d-letter { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-soft); }
.d-mark { height: 18px; width: 18px; display: grid; place-items: center; }
.d-mark .star { width: 18px; height: 18px; }
.d-mark .star path { fill: var(--gold); }
.d-mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); }
.d-tag { min-height: 0.9em; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.week-sum { margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.plan { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 2px; }
.plan li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}
.plan li:last-child { border-bottom: 0; }
.plan-num {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold-2);
}
.plan-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.plan-text b { font-family: var(--serif); font-weight: 560; font-size: 1.08rem; }
.plan-text small { font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-min { flex: none; font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); }
.today-go { width: 100%; padding: 14px 18px; font-size: 1.05rem; }
.teacher-note, .tip {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
}
.teacher-note span, .tip span {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.tip { margin: 14px 0 6px; font-size: 0.98rem; color: var(--ink-soft); }
.focus-edit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.focus-edit summary { font-size: 0.9rem; }
.focus-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.focus-edit select, .focus-edit textarea {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  resize: vertical;
}
.focus-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.focus-ok { font-size: 0.88rem; font-weight: 800; color: var(--fa); }
.session-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  background: rgba(247, 243, 234, 0.1);
  box-shadow: inset 0 0 0 1px rgba(247, 243, 234, 0.16);
  color: var(--cream);
}
.sb-steps { display: flex; gap: 5px; flex: none; }
.sb-steps i { width: 8px; height: 8px; border-radius: 50%; background: rgba(247, 243, 234, 0.22); }
.sb-steps i.done { background: var(--gold-2); }
.sb-steps i.on { background: var(--gold); box-shadow: 0 0 0 3px rgba(166, 124, 69, 0.3); }
.sb-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.sb-text b { font-family: var(--serif); font-weight: 560; font-size: 1.05rem; white-space: nowrap; }
.sb-text span { font-size: 0.88rem; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-goods { display: flex; gap: 4px; flex: none; }
.sb-goods i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.sb-goods i.on { background: var(--gold); box-shadow: none; }
.sb-time { flex: none; font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 800; opacity: 0.75; }
.sb-time.over { color: var(--gold-2); opacity: 1; }
.session-bar .btn { padding: 8px 14px; font-size: 0.88rem; }
.session-bar .btn.ghost { color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(247, 243, 234, 0.3); }
.session-bar .tiny { margin: 0; color: rgba(247, 243, 234, 0.7); }
.parent-step { margin: 0; font-size: 0.92rem; line-height: 1.45; color: var(--ink-soft); }
.parent-step strong { color: var(--ink); }
.path-group { text-align: left; margin: 0 auto 22px; width: min(640px, 100%); }
.path-group h2 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.3rem;
  color: var(--gold-2);
  margin: 0;
}
/* Chaque groupe du parcours se replie : l’accueil tient sur l’écran. */
.path-group > summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 8px 4px;
  margin-bottom: 4px;
  cursor: pointer;
  border-bottom: 1px solid rgba(231, 211, 174, 0.22);
  -webkit-tap-highlight-color: transparent;
}
.path-group > summary::-webkit-details-marker { display: none; }
.path-group > summary::after {
  content: "›";
  margin-left: auto;
  align-self: center;
  color: var(--gold-2);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}
.path-group:not([open]) > summary::after { transform: rotate(0deg); }
.path-group > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.path-count {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(247, 243, 234, 0.7);
}
.path-group[open] > .path { margin-top: 8px; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.path-later { margin-top: 10px; }
.path-later summary {
  cursor: pointer;
  color: var(--gold-2);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 6px 4px 8px;
}
.path-later .path { margin-top: 4px; }
.path-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 16px;
  background: rgba(247, 243, 234, 0.1);
  box-shadow: inset 0 0 0 1px rgba(247, 243, 234, 0.12);
  color: var(--cream);
  text-align: left;
  transition: background 120ms ease, transform 120ms ease;
}
.path-item:hover { background: rgba(247, 243, 234, 0.16); }
.path-item.open, .path-item.known { background: var(--paper); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.path-item.open:hover, .path-item.known:hover { transform: translateY(-1px); }
.path-item.next { box-shadow: 0 0 0 3px var(--gold-2), 0 10px 26px rgba(0, 0, 0, 0.3); }
.path-item.locked, .path-item.soon { opacity: 0.62; }
.path-badge {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.15rem;
  background: rgba(247, 243, 234, 0.14);
}
.path-item.open .path-badge { background: var(--gold); color: var(--cream); }
.path-item.known .path-badge { background: var(--fa); color: var(--cream); }
.path-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.path-text b { font-family: var(--serif); font-weight: 560; font-size: 1.12rem; line-height: 1.2; }
.path-text small { font-size: 0.8rem; opacity: 0.75; font-weight: 800; }
.path-tag { flex: none; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.path-item.next .path-tag { color: var(--gold); opacity: 1; }
.path-note {
  width: min(640px, 100%);
  margin: 0 auto 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(247, 243, 234, 0.12);
  color: var(--cream);
  line-height: 1.45;
}
.path-note .tiny { margin-left: 6px; color: var(--gold-2); }
.fine.dark { color: var(--ink-soft); }
.piece-row { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.piece-row .btn { min-width: min(100%, 320px); }
.scene { width: min(640px, 100%); margin: 10px auto 8px; }
.fine {
  color: rgba(247, 243, 234, 0.78);
  max-width: 38rem;
  margin: 8px auto 0;
  line-height: 1.45;
}
.encore {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px var(--line);
}
.encore h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 560; font-size: 1.4rem; }
.encore p { margin: 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.45; }
.school { display: flex; gap: 18px; width: min(100%, 280px); margin: 8px 0 4px; }
.school span { flex: 1; }
.swim { animation: swim 7s ease-in-out infinite; }
@keyframes swim {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

.mic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.mic-pill i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--fa); display: block;
}
.mic-pill.hot i { background: var(--mi); }

.impro-grid { display: grid; gap: 8px; margin: 14px 0 12px; }
.impro-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.impro-row > span {
  width: 108px;
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: 600 0.9rem var(--sans);
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.chip:hover { border-color: rgba(166, 124, 69, 0.5); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.impro-live {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
}
.impro-chord { display: grid; min-width: 64px; }
.impro-chord small { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.impro-chord b { font: 600 1.7rem var(--serif); color: var(--ink); line-height: 1.1; }
.impro-beats { flex: 1; display: flex; gap: 4px; }
.impro-beats span {
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--paper-2);
  font: italic 0.95rem var(--serif);
  color: var(--ink-soft);
  transition: background 0.12s, color 0.12s;
}
.impro-live.on .impro-beats span.on { background: var(--gold-2); color: var(--ink); }
.impro-phase { min-width: 92px; text-align: right; font: italic 1rem var(--serif); color: var(--ink-soft); }
.impro-phase.you { color: var(--gold); font-weight: 600; }
.white.is-chord, .black.is-chord { box-shadow: inset 0 -5px 0 var(--gold); }
@media (max-width: 860px) {
  .impro-row > span { width: 100%; }
  .impro-live { flex-wrap: wrap; }
  .impro-beats { order: 3; flex-basis: 100%; }
}

@media (max-width: 860px) {
  html, body { height: auto; min-height: 100%; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100dvh; overscroll-behavior-y: none; }
  body.is-lesson { overflow-x: hidden; }
  select, textarea, input:not([type="range"]) { font-size: 16px; }
  input[type="range"] { min-height: 28px; }

  .cover {
    display: block;
    min-height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
  }
  .cover-card { width: 100%; }
  .cover-card h1 { font-size: clamp(2.35rem, 12vw, 3.4rem); }
  .cover-card .sub { font-size: 1.08rem; margin-top: 10px; }
  .scene { width: 100%; max-width: 100%; margin: 6px auto 4px; }
  .scene svg { width: 100%; height: auto; display: block; }
  .week { gap: 3px; }
  .week li { padding: 6px 0 4px; min-width: 0; }
  .d-letter { font-size: 0.7rem; }
  .d-tag { font-size: 0.5rem; letter-spacing: 0.02em; }
  .today { padding: 16px 14px 14px; margin-top: 16px; width: 100%; }
  .today-go, .ear-cover-cta .btn { width: 100%; min-height: 48px; }
  .order { flex-wrap: wrap; justify-content: space-around; gap: 10px 16px; margin: 16px 0; }
  .order b { font-size: 1.2rem; }
  .path-group { width: 100%; }
  .path-item { min-height: 52px; padding: 12px 12px; gap: 10px; }
  .path-tag { font-size: 0.64rem; letter-spacing: 0.04em; }
  .ear-cover-cta { padding: 14px; gap: 12px; }
  .focus-edit select, .focus-edit textarea { font-size: 16px; min-height: 44px; }
}

@media (max-width: 860px), (max-height: 520px) and (orientation: landscape) {
  .workspace { grid-template-columns: 1fr; }
  .setup { grid-template-columns: 1fr; }
  .stage { min-height: 0; }
  .shell {
    width: calc(100% - 16px);
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: calc(268px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .piano {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    padding: 0 4px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, #071c22 22%);
    z-index: 4;
  }
  .top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand jump mic parent"
      "meters meters meters meters";
    align-items: center;
    gap: 8px;
  }
  .brand { grid-area: brand; min-width: 0; }
  .brand em { font-size: 1.22rem; }
  .brand span { display: none; }
  .piece-jump { grid-area: jump; max-width: none; width: 100%; min-width: 0; }
  .piece-jump-lab { display: none; }
  .piece-jump-btn {
    font-size: 16px;
    padding: 8px 28px 8px 10px;
    min-height: 42px;
    width: 100%;
  }
  .piece-jump-menu {
    width: min(320px, calc(100vw - 16px));
    max-height: min(50dvh, 360px);
  }
  .top-back {
    grid-area: jump;
    justify-self: start;
    padding: 8px 12px;
    font-size: 0.86rem;
    color: var(--cream);
    box-shadow: inset 0 0 0 1.5px rgba(247, 243, 234, 0.35);
  }
  .mic-top-btn { grid-area: mic; min-height: 42px; padding: 8px 10px; }
  .guide-btn { grid-area: parent; min-height: 42px; padding: 8px 12px; }
  .stamps { display: none; }
  .meters {
    grid-area: meters;
    flex-basis: auto;
    justify-content: stretch;
    width: 100%;
    gap: 12px;
  }
  .meters .vol { flex: 1; min-width: 0; font-size: 0.65rem; }
  .vol input, .speed input { width: 100%; max-width: none; }
  .speed #speedword { min-width: 0; font-size: 0.72rem; }
  .nav {
    margin: 0 -8px;
    padding: 2px 12px 6px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }
  .nav button {
    padding: 10px 14px;
    min-height: 42px;
    font-size: 0.86rem;
    scroll-snap-align: start;
  }
  .stage { padding: 12px 14px 10px; border-radius: 18px; }
  .stage .kicker { display: none; }
  .stage h1 { font-size: 1.28rem; }
  .stage .lede:not(.lede-lire) { display: none; }
  .write-toggle { align-self: flex-start; margin-top: 4px; padding: 6px 12px; font-size: 0.8rem; }
  .speed #speedword { display: none; }
  .score-wrap { padding: 2px 0; margin-left: -6px; margin-right: -6px; }
  .phrase-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px 2px;
    -webkit-overflow-scrolling: touch;
  }
  .phrase-tabs::-webkit-scrollbar { display: none; }
  .phrase-tabs button { padding: 8px 12px; min-height: 40px; white-space: nowrap; flex: none; }
  .phrase-tabs .tab-part { flex: none; margin: 0 2px 0 8px; align-self: center; white-space: nowrap; }
  .phrase-tabs .tab-part:first-child { margin-left: 0; }
  .stage:has(.phrase-tabs) h1 { display: none; }
  .stage > .note-msg, .stage > .cue, .stage > .actions-row { order: 1; }
  .stage > .score-wrap, .stage > .lyrics, .stage > .staff-wrap, .stage > .dots, .stage > .drop-row { order: 2; }
  .stage > .actions-row { margin-bottom: 6px; }
  .rail { padding: 4px 6px 6px; border-radius: 14px 14px 10px 10px; }
  .legend { display: none; }
  .handbar { height: auto; aspect-ratio: 720 / 184; max-height: 110px; margin-bottom: -14px; }
  .keys { height: min(148px, 24dvh); }
  .white .nm { font-size: clamp(0.88rem, 4.2vw, 1.15rem); }
  .white .fn { font-size: clamp(0.8rem, 3.6vw, 1rem); }
  .white .kb { display: none; }
  .white { margin: 0 2px; }
  .white .face { bottom: 10px; left: 2px; right: 2px; }
  .black { height: 54%; }
  .parent { padding: 16px 14px 14px; }
  .say { font-size: 1.18rem; }
  .toggles button { min-height: 44px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .shell {
    width: 46%;
    margin: 0;
    padding: calc(6px + env(safe-area-inset-top)) 0 calc(10px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
    gap: 6px;
  }
  .top {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand jump mic parent"
      "meters meters meters meters";
    gap: 6px;
  }
  .brand em { font-size: 1.05rem; }
  .meters { width: auto; }
  .nav { margin: 0; padding: 0 2px 2px; }
  .nav button { padding: 6px 10px; min-height: 40px; font-size: 0.8rem; }
  .stage { padding: 10px 12px; }
  .stage h1 { font-size: 1.2rem; }
  .stage .lede:not(.lede-lire), .write-toggle { display: none; }
  .phrase-tabs { margin-top: 8px; }
  .piano, .piano.dense {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    width: 54%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) 8px;
    background: none;
  }
  .handbar { height: 92px; margin-bottom: -14px; }
  .keys { height: min(220px, calc(100dvh - 130px)); }
}
html { touch-action: manipulation; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.piano, .piano * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.focus-edit select, .focus-edit textarea { font-size: 16px; }
.keys, .keys * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.note-msg:empty { display: none; }
.score-playhead { transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s ease; pointer-events: none; }
.score-note.passed { opacity: 0.38; }
.loop-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--gold-2);
  border: 1px solid rgba(166, 124, 69, 0.35);
  color: var(--ink);
  font: 600 0.86rem var(--sans);
}
.loop-dots { display: inline-flex; gap: 6px; }
.loop-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(28, 40, 34, 0.18);
  transition: transform 0.2s ease, background 0.2s ease;
}
.loop-dots i.now { background: var(--gold); transform: scale(1.25); }
.loop-dots i.done { background: #3b8c5a; }
.count-in {
  margin-top: 8px;
  padding: 8px 18px;
  border-radius: 14px;
  background: var(--gold-2);
  border: 1.5px solid var(--gold);
  color: var(--ink);
  font: 600 1.25rem var(--serif);
  text-align: center;
  animation: countPulse 0.45s ease;
}
@keyframes countPulse {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.celebrate {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fbf3dc 0%, #f5e6bc 100%);
  border: 1.5px solid rgba(196, 146, 52, 0.45);
  box-shadow: 0 8px 22px rgba(166, 124, 69, 0.14);
  animation: celPop 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes celPop {
  0% { transform: translateY(6px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.cel-stars { display: inline-flex; gap: 4px; flex-shrink: 0; }
.cel-star { width: 28px; height: 28px; display: inline-flex; opacity: 0.35; }
.cel-star.on { opacity: 1; animation: starBounce 0.48s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cel-star svg { width: 100%; height: 100%; }
@keyframes starBounce {
  0% { transform: scale(0.4) rotate(-14deg); opacity: 0; }
  65% { transform: scale(1.22) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.cel-text { display: flex; flex-direction: column; gap: 2px; }
.cel-text strong { font: 600 1.12rem var(--serif); color: var(--ink); }
.cel-text span { font: 500 0.86rem var(--sans); color: var(--ink-soft); }
.ear-cover-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(231, 211, 174, 0.16) 0%, rgba(196, 146, 52, 0.08) 100%);
  border: 1.5px solid rgba(231, 211, 174, 0.35);
  text-align: left;
}
.ear-cover-text { display: flex; flex-direction: column; gap: 4px; }
.ear-cover-text b { font: 600 1.12rem var(--serif); color: var(--gold-2); }
.ear-cover-text span { font-size: 0.9rem; color: rgba(247, 243, 234, 0.82); }
.ear-studio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.ear-hero {
  --ear-c: var(--do);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f5efe2 100%);
  border: 2px solid var(--ear-c);
  box-shadow: 0 8px 20px rgba(28, 40, 34, 0.07);
  animation: celPop 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.ear-hero.do { --ear-c: var(--do); }
.ear-hero.re { --ear-c: var(--re); }
.ear-hero.mi { --ear-c: var(--mi); }
.ear-hero.fa { --ear-c: var(--fa); }
.ear-hero.sol { --ear-c: var(--sol); }
.ear-hero.la { --ear-c: var(--la); }
.ear-hero.si, .ear-hero.sib { --ear-c: var(--sib); }
.ear-hero.is-waiting {
  border-color: var(--line);
  border-style: dashed;
  justify-content: center;
}
.ear-orb {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  min-width: 195px;
  border-radius: 13px;
  background: var(--ear-c);
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}
.ear-orb.waiting {
  background: var(--paper-2);
  color: var(--ink);
}
.ear-note-name {
  font: 650 2.2rem/1 var(--serif);
  letter-spacing: -0.02em;
}
.ear-note-oct {
  font: 700 0.78rem var(--sans);
  opacity: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ear-details { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ear-finger-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ear-fnum {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ear-c);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font: 800 0.85rem var(--sans);
}
.ear-src-pill {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
}
.ear-seat {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
.ear-tuner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.ear-tuner-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(28, 40, 34, 0.12);
}
.ear-tuner-center {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: rgba(28, 40, 34, 0.45);
}
.ear-tuner-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3b8c5a;
  transform: translate(-50%, -50%);
  transition: left 0.15s ease;
}
.ear-staff-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px 12px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid var(--line);
  max-height: min(48vh, 560px);
  overflow-y: auto;
}
.ear-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 2px 4px 6px;
  font: 800 0.72rem var(--sans);
  color: var(--ink-soft);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  z-index: 1;
}
.ear-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ear-dur {
  display: inline-block;
  width: 18px;
  height: 14px;
  background: no-repeat center / contain;
}
.ear-dur.croche {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'><ellipse cx='5' cy='11' rx='4' ry='2.8' transform='rotate(-20 5 11)' fill='%231c2822'/><line x1='8.4' y1='10' x2='8.4' y2='2' stroke='%231c2822' stroke-width='1.4'/><path d='M8.4 2 C12 3.5 13 7 9.5 10' fill='none' stroke='%231c2822' stroke-width='1.4'/></svg>");
}
.ear-dur.noire {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'><ellipse cx='5' cy='11' rx='4' ry='2.8' transform='rotate(-20 5 11)' fill='%231c2822'/><line x1='8.4' y1='10' x2='8.4' y2='2' stroke='%231c2822' stroke-width='1.4'/></svg>");
}
.ear-dur.blanche {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'><ellipse cx='5' cy='11' rx='4' ry='2.8' transform='rotate(-20 5 11)' fill='none' stroke='%231c2822' stroke-width='1.5'/><line x1='8.4' y1='10' x2='8.4' y2='2' stroke='%231c2822' stroke-width='1.4'/></svg>");
}
.ear-dur.ronde {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'><ellipse cx='9' cy='8' rx='5.2' ry='3.4' transform='rotate(-20 9 8)' fill='none' stroke='%231c2822' stroke-width='1.8'/></svg>");
}
.ear-legend-acc { margin-left: auto; letter-spacing: 0.08em; }
.ear-staff {
  width: 100%;
  height: auto;
  overflow: visible;
}
.ear-staff-note { cursor: pointer; transition: transform 0.18s ease, opacity 0.18s ease; }
.ear-staff-note.is-latest { animation: celPop 0.26s cubic-bezier(0.22, 1, 0.36, 1); }
.ear-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: earRing 1.4s ease-out infinite;
}
@keyframes earRing {
  0% { transform: scale(0.75); opacity: 0.75; }
  100% { transform: scale(1.45); opacity: 0; }
}
.ear-quest {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 16px;
  border-radius: 14px;
  background: var(--gold-2);
  border: 1.5px solid var(--gold);
  color: var(--ink);
  font-size: 0.95rem;
}
.ear-streak {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--gold-2);
  font-style: normal;
  font-weight: 800;
  font-size: 0.82rem;
}
@media (max-width: 860px) {
  .ear-studio { grid-template-columns: 1fr; gap: 10px; }
  .ear-cover-cta { flex-direction: column; align-items: stretch; }
  .ear-hero { flex-direction: column; align-items: stretch; padding: 10px 12px; gap: 10px; }
  .ear-orb { min-width: 0; width: 100%; }
  .ear-note-name { font-size: 1.7rem; }
  .ear-staff-card { max-height: min(32vh, 280px); }
  .ear-src-pill { margin-left: 0; }
}
.actions-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
@media (min-width: 861px) and (min-height: 521px) and (max-height: 1100px) {
  .shell { padding: 8px 0 8px; gap: 8px; }
  .stage { padding: 14px 24px 14px; }
  .stage .kicker { display: none; }
  .stage h1 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
  .lede { margin-top: 4px; font-size: 0.98rem; }
  .write-toggle { margin-top: 6px; padding: 5px 12px; }
  .score-wrap { margin-top: 6px; }
  .actions { margin-top: 8px; }
  .rail { padding: 8px 10px 8px; }
  .legend { padding-bottom: 2px; }
}
@media (min-width: 861px) and (min-height: 521px) and (max-height: 1100px) {
  .handbar { height: 120px; margin-bottom: -26px; }
  .keys { height: 124px; }
  .legend { display: none; }
  .stage { padding: 12px 22px 10px; }
  .actions { margin-top: 6px; }
  .shell { gap: 6px; padding-bottom: 4px; }
}
@media (min-width: 861px) and (min-height: 521px) and (max-height: 760px) {
  .shell { padding-top: 4px; }
  .stage .lede:not(.lede-lire) { display: none; }
  .scale-row { margin-top: 4px; }
}
@media (max-width: 860px), (max-height: 520px) and (orientation: landscape) {
  .actions-row { align-items: stretch; }
  .actions {
    width: 100%;
    margin-top: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .actions::-webkit-scrollbar { display: none; }
  .actions .btn {
    flex: 0 0 auto;
    padding: 9px 14px;
    min-height: 42px;
    font-size: 0.88rem;
    white-space: nowrap;
  }
  .today { padding: 16px 14px 14px; margin-top: 16px; }
  .session-bar { flex-wrap: wrap; border-radius: 16px; gap: 8px 10px; padding: 8px 12px; }
  .sb-text { flex-basis: calc(100% - 60px); order: -1; }
  .sb-text span { display: none; }
  .sb-steps { order: -2; }
  .session-bar .btn { margin-left: auto; min-height: 40px; }
  .score-nav { width: 44px; height: 44px; }
  .score-page { display: none; }
  .score-pages { gap: 14px; }
  .write-toggle { min-height: 40px; }
  .meters .vol { font-size: 0.72rem; }
}
@media (min-width: 700px) and (max-width: 860px) and (min-height: 900px) {
  .piano .rail { max-width: 640px; margin-left: auto; margin-right: auto; }
  .keys { height: 210px; }
  .handbar { max-height: 150px; }
  .stage .lede:not(.lede-lire) { display: block; }
}
@media (hover: none) {
  .path-item:hover, .path-item.open:hover { transform: none; }
}
/* ——— Finition design & UX ———
   Hiérarchie plus nette, cibles tactiles plus franches, éléments qui
   accompagnent le défilement. Aucune règle pédagogique ne change. */

/* Boutons : une vraie hiérarchie entre l’action principale et les autres. */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn:active { transform: scale(0.97); }
.btn.gold {
  background: linear-gradient(180deg, #bb8d52, var(--gold));
  box-shadow: 0 6px 18px rgba(166, 124, 69, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.gold:hover { box-shadow: 0 8px 22px rgba(166, 124, 69, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.ghost { background: rgba(255, 255, 255, 0.55); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.85); }

/* Curseurs (vitesse, son) : un pouce facile à attraper sur tablette. */
input[type="range"] { height: 28px; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold-2);
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold-2);
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Barre du haut : tout tient sur une ligne, le nom du morceau respire. */
.mic-top-btn, .guide-btn { white-space: nowrap; }
.meters { flex-direction: column; align-items: flex-end; gap: 2px; }
.meters .vol input { width: 60px; }
.meters .speed input { width: 72px; }
.speed #speedword { min-width: 0; font-size: 0.78rem; }
.stamps { gap: 3px; flex-wrap: nowrap; }
.stamp { width: 26px; }

/* La feuille de leçon : un papier posé, pas une boîte plate. */
.paper {
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.score-wrap {
  background: linear-gradient(180deg, #fffdf8, #faf5ea);
  box-shadow: inset 0 0 0 1px var(--line), 0 4px 14px rgba(28, 40, 34, 0.06);
}
.cue {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 8px 16px 8px 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.phrase-tabs button { transition: background 0.14s ease, color 0.14s ease, transform 0.12s ease; }
.phrase-tabs button:active { transform: scale(0.96); }
.phrase-tabs button.done {
  background: rgba(231, 211, 174, 0.55);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.card { transition: transform 0.14s ease, box-shadow 0.14s ease; }
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), 0 8px 20px rgba(28, 40, 34, 0.08); }

/* Le piano : un meuble, avec son ombre propre. */
.rail {
  border: 1px solid rgba(231, 211, 174, 0.22);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.legend { letter-spacing: 0.07em; text-transform: uppercase; font-size: 0.7rem; opacity: 0.92; }

/* Accueil : l’ordre de la leçon devient un petit chemin en quatre pas. */
.cover-card h1 { text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35); }
.order > div {
  background: rgba(247, 243, 234, 0.08);
  border: 1px solid rgba(231, 211, 174, 0.22);
  border-radius: 999px;
  padding: 8px 18px 10px;
  min-width: 108px;
}
.today {
  border-top: 5px solid var(--gold);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.today-go { min-height: 52px; font-size: 1.08rem; }
.plan li { border-radius: 10px; transition: background 0.14s ease; }
.plan li:hover { background: rgba(166, 124, 69, 0.06); }
.ear-cover-cta { transition: border-color 0.16s ease, background 0.16s ease; }
.ear-cover-cta:hover { border-color: var(--gold-2); }
.path-item { position: relative; }
.path-item::after {
  content: "›";
  flex: none;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.45;
}
.path-tag {
  background: rgba(247, 243, 234, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
}
.path-item.open .path-tag, .path-item.known .path-tag { background: rgba(28, 40, 34, 0.08); }
.fine { line-height: 1.6; }

/* La séance du jour reste visible pendant que vous faites défiler. */
.session-bar {
  position: sticky;
  top: 92px;
  z-index: 25;
  background: linear-gradient(180deg, rgba(17, 64, 73, 0.97), rgba(7, 28, 34, 0.97));
  border: 1px solid rgba(231, 211, 174, 0.25);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Guide adulte : la phrase à dire devient un repère qu’on retrouve d’un coup d’œil. */
.parent .say {
  background: rgba(166, 124, 69, 0.09);
  border-left: 4px solid var(--gold);
  border-radius: 0 14px 14px 0;
  padding: 12px 14px;
}
@media (min-width: 861px) and (min-height: 521px) {
  .parent {
    position: sticky;
    top: 92px;
    max-height: calc(100dvh - 108px);
    overflow-y: auto;
  }
}

/* Écrans intermédiaires : les tampons cèdent la place au nom du morceau. */
@media (max-width: 1180px) {
  .stamps { display: none; }
}

@media (max-width: 860px), (max-height: 520px) and (orientation: landscape) {
  /* Au téléphone, la barre du haut redevient simple : elle ne colle pas. */
  .top { position: static; padding: 8px 10px; border-radius: 16px; }
  .nav { background: transparent; border: 0; border-radius: 0; align-self: stretch; }
  .piece-jump { flex: none; max-width: none; }
  .session-bar { top: 8px; }
  .meters { flex-direction: row; align-items: center; }
  .actions .btn { min-height: 44px; }
  /* L’action principale reste au bord du doigt, même si la rangée défile. */
  .actions .btn.gold { position: sticky; left: 0; z-index: 2; }
  .order > div { min-width: 0; flex: 1; padding: 7px 8px 9px; }
  .path-item::after { display: none; }
}
/* Accueil : l’écoute en boucle, les musiques que Diane choisit. */
.juke {
  width: min(640px, 100%);
  margin: 18px auto 8px;
  padding: 20px 22px 16px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf8, #faf5ea);
  border-radius: 22px;
  border-top: 5px solid var(--gold);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.juke h2 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.juke-lede { margin: 0 0 10px; color: var(--ink-soft); line-height: 1.45; }
.juke-now { min-height: 1.4em; margin: 0 0 8px; font-weight: 800; color: var(--gold); }
.juke.is-on .juke-lede,
.juke.is-on .juke-list,
.juke.is-on .juke-count,
.juke.is-on .juke-now { display: none; }
.juke-stage { text-align: center; margin: 4px 0 12px; }
.juke-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.juke-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  letter-spacing: -0.02em;
}
.juke-sub { margin: 2px 0 10px; color: var(--ink-soft); font-weight: 700; }
.juke-orb {
  width: 108px;
  height: 108px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 40% 35%, #fffdf8, #f3e6cf);
  border: 3px solid var(--gold);
  box-shadow: 0 12px 28px rgba(166, 124, 69, 0.28);
  color: var(--ink);
}
.juke-orb b { font-family: var(--serif); font-weight: 560; font-size: 2rem; line-height: 1; }
.juke-orb span { min-height: 1em; font-size: 0.72rem; font-weight: 800; color: var(--ink-soft); }
.juke-orb.do { background: var(--do); color: #fff; border-color: transparent; }
.juke-orb.re { background: var(--re); color: #fff; border-color: transparent; }
.juke-orb.mi { background: var(--mi); color: #fff; border-color: transparent; }
.juke-orb.fa { background: var(--fa); color: #fff; border-color: transparent; }
.juke-orb.sol { background: var(--sol); color: #fff; border-color: transparent; }
.juke-orb.la { background: var(--la); color: #fff; border-color: transparent; }
.juke-orb.sib, .juke-orb.si { background: var(--si); color: #fff; border-color: transparent; }
.juke-orb.do span, .juke-orb.re span, .juke-orb.mi span, .juke-orb.fa span, .juke-orb.sol span, .juke-orb.la span, .juke-orb.sib span, .juke-orb.si span { color: rgba(255, 255, 255, 0.88); }
.juke-score { text-align: left; margin: 0 0 8px; }
.juke-words {
  min-height: 1.6em;
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.45;
}
.juke-words span { margin: 0 0.12em; color: var(--ink-soft); }
.juke-words span.on { color: var(--gold); font-weight: 650; }
.juke-words span.done { opacity: 0.4; }
.juke-bar { height: 4px; border-radius: 99px; background: rgba(28, 40, 34, 0.1); overflow: hidden; }
.juke-bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.juke-families {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.juke-family {
  flex: 1 1 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  white-space: nowrap;
}
.juke-modes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.juke-all { margin-left: auto; }
.juke-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 264px;
  overflow-y: auto;
}
.juke-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.juke-item:hover { border-color: rgba(166, 124, 69, 0.5); }
.juke-item:has(input:checked) { background: rgba(231, 211, 174, 0.4); border-color: rgba(166, 124, 69, 0.55); }
.juke-item.now { border-color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.juke-item input { width: 20px; height: 20px; flex: none; accent-color: var(--gold); cursor: pointer; }
.juke-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.juke-text b { font-weight: 800; font-size: 0.92rem; line-height: 1.2; }
.juke-text small { color: var(--ink-soft); font-size: 0.76rem; font-weight: 700; }
.juke-eq { display: none; color: var(--gold); font-weight: 800; }
.juke-item.now .juke-eq { display: block; }
.juke-actions { justify-content: flex-start; }
.juke-actions .btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.juke-count { margin: 4px 0 0; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 860px) {
  .juke { padding: 16px 14px 14px; width: 100%; }
  .juke-family { padding: 8px 10px; font-size: 0.84rem; }
  .juke-list { grid-template-columns: 1fr; max-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
