:root {
  color-scheme: dark;
  --bg: #090b09;
  --surface: #101310;
  --surface-raised: #171b16;
  --surface-hover: #1c211b;
  --line: rgba(238, 242, 232, 0.13);
  --line-strong: rgba(238, 242, 232, 0.24);
  --text: #f0f3eb;
  --muted: #9da69b;
  --faint: #697168;
  --accent: #d9ee5f;
  --accent-strong: #eeff7a;
  --accent-ink: #111408;
  --good: #8ed89b;
  --warn: #e8ba70;
  --bad: #ef8b82;
  --radius: 0.75rem;
  --sidebar-width: 18.5rem;
  --shadow-raised: 0 1.2rem 4rem rgba(0, 0, 0, 0.3);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 20rem;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 62% -12%, rgba(217, 238, 95, 0.07), transparent 30rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  min-height: 2.75rem;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

a {
  color: inherit;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

h1,
h2,
.current-chord,
.current-gesture,
.tempo-reading,
.chord-track strong,
.string-map strong {
  letter-spacing: -0.035em;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 0.9rem;
  border-radius: 0.35rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100svh;
}

/* Bibliothèque */

.library {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
  padding: 1.25rem 1.1rem 2rem;
  border-right: 1px solid var(--line);
  background: rgba(12, 14, 12, 0.96);
  scrollbar-color: var(--line-strong) transparent;
}

.library-heading,
.brand,
.song-context,
.transport,
.hand-heading,
.section-heading,
.feedback-heading,
.match-copy {
  display: flex;
  align-items: center;
}

.library-heading {
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  min-width: 0;
  gap: 0.72rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.58rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.brand-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-close {
  display: none;
  width: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
}

.library-intro {
  display: grid;
  gap: 0.35rem;
  margin: 2.35rem 0 1rem;
}

.library-intro > p:last-child {
  max-width: 14rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.section-kicker,
.eyebrow,
.control-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
}

.segmented,
.mode-switch {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 0.55rem;
  background: var(--surface-raised);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.segment,
.mode-button {
  min-width: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.segment:hover,
.mode-button:hover {
  color: var(--text);
}

.segment.active,
.segment[aria-selected="true"],
.mode-button.active,
.mode-button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.song-list {
  display: grid;
  gap: 0;
  margin-top: 1rem;
}

.song-button {
  position: relative;
  width: 100%;
  min-height: 4rem;
  padding: 0.78rem 0.65rem 0.78rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.song-button::before {
  position: absolute;
  top: 0.72rem;
  bottom: 0.72rem;
  left: 0;
  width: 0.18rem;
  border-radius: 99px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.35);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.song-button:hover {
  background: rgba(255, 255, 255, 0.025);
}

.song-button.active {
  background: rgba(217, 238, 95, 0.06);
}

.song-button.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.song-button strong {
  display: block;
  margin-bottom: 0.24rem;
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-meta {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* En-tête et réglages */

.practice {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1rem clamp(1rem, 2.35vw, 2.25rem) 2.5rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
  animation: fade-in 350ms ease both;
}

.song-context {
  min-width: 0;
  gap: 0.8rem;
}

.song-copy {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.65rem;
}

.song-copy .eyebrow {
  grid-column: 1;
  grid-row: 1;
}

.song-copy h1 {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  font-size: clamp(1.22rem, 2vw, 1.65rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-detail {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.4;
}

.library-toggle {
  display: none;
}

.secondary-button,
.transport-button,
.primary-button,
.audition-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  padding: 0 0.86rem;
  white-space: nowrap;
}

.secondary-button,
.transport-button,
.audition-button {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.transport {
  gap: 0.42rem;
}

.transport-button,
.primary-button {
  font-size: 0.8rem;
  font-weight: 750;
}

.transport-button:hover,
.audition-button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.primary-button {
  min-width: 6.3rem;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 900;
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.primary-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 0 0 0.28rem rgba(217, 238, 95, 0.1);
}

.primary-button:active,
.segment:active,
.mode-button:active {
  transform: translateY(1px);
}

.button-icon {
  font-size: 1.1em;
}

.play-glyph {
  width: 0;
  height: 0;
  margin-left: 0.1rem;
  border-top: 0.33rem solid transparent;
  border-bottom: 0.33rem solid transparent;
  border-left: 0.52rem solid currentColor;
}

.primary-button.playing .play-glyph,
.primary-button[aria-pressed="true"] .play-glyph {
  width: 0.54rem;
  height: 0.7rem;
  margin-left: 0;
  border: 0;
  border-inline: 0.17rem solid currentColor;
}

.mic-glyph {
  position: relative;
  width: 0.6rem;
  height: 0.85rem;
  border: 1.5px solid currentColor;
  border-radius: 99px;
}

.mic-glyph::after {
  position: absolute;
  right: -0.27rem;
  bottom: -0.3rem;
  left: -0.27rem;
  height: 0.42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  border-radius: 0 0 99px 99px;
  content: "";
}

.transport-button.listening,
.transport-button[aria-pressed="true"] {
  border-color: rgba(142, 216, 155, 0.45);
  background: rgba(142, 216, 155, 0.08);
  color: var(--good);
}

.menu-glyph {
  position: relative;
  width: 1rem;
  height: 0.7rem;
  border-block: 1.5px solid currentColor;
}

.menu-glyph::after {
  position: absolute;
  top: calc(50% - 0.75px);
  right: 0;
  left: 0;
  border-top: 1.5px solid currentColor;
  content: "";
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(15rem, 1.25fr) auto minmax(9rem, 0.55fr) minmax(9rem, 0.65fr);
  align-items: end;
  gap: clamp(0.75rem, 1.5vw, 1.4rem);
  padding: 0.8rem 0;
  border-block: 1px solid var(--line);
  animation: fade-in 350ms 60ms ease both;
}

.tempo-control,
.select-control,
.mode-control {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.tempo-control {
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.8rem;
}

.tempo-control .control-label {
  grid-column: 1;
}

.tempo-reading {
  grid-column: 2;
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
}

.tempo-reading strong {
  color: var(--text);
  font-size: 0.95rem;
}

.tempo-control input {
  grid-column: 1 / -1;
}

input[type="range"] {
  width: 100%;
  height: 1.25rem;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 0.22rem;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--line-strong));
}

input[type="range"]::-webkit-slider-thumb {
  width: 1rem;
  height: 1rem;
  margin-top: -0.39rem;
  appearance: none;
  border: 0.22rem solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

input[type="range"]::-moz-range-track {
  height: 0.22rem;
  border-radius: 99px;
  background: var(--line-strong);
}

input[type="range"]::-moz-range-progress {
  height: 0.22rem;
  border-radius: 99px;
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 0.65rem;
  height: 0.65rem;
  border: 0.22rem solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.mode-switch {
  min-height: 2.75rem;
}

.mode-button {
  min-height: 2.35rem;
  padding: 0 0.65rem;
}

.select-control select {
  width: 100%;
  min-height: 2.75rem;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0.48rem;
  padding: 0 2rem 0 0.72rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 0.9rem) 52% / 0.35rem 0.35rem no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 0.56rem) 52% / 0.35rem 0.35rem no-repeat,
    var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

/* Pupitre principal */

.workspace {
  min-width: 0;
}

.practice-stage {
  min-width: 0;
  padding-top: 1rem;
  animation: stage-in 440ms 90ms ease both;
}

.stage-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.count-in {
  min-width: 3.5rem;
  color: var(--accent);
  text-align: right;
}

.count-in:empty {
  display: none;
}

.two-hand-cue {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: clamp(12.5rem, 24vw, 18rem);
  overflow: hidden;
  border-block: 1px solid var(--line-strong);
  background:
    linear-gradient(115deg, rgba(217, 238, 95, 0.055), transparent 42%),
    var(--surface);
}

.two-hand-cue::after {
  position: absolute;
  top: 1.2rem;
  bottom: 1.2rem;
  left: 50%;
  border-left: 1px solid var(--line);
  content: "";
  pointer-events: none;
}

.hand-cue {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.2rem, 2.6vw, 2.3rem);
}

.hand-heading {
  justify-content: space-between;
  gap: 1rem;
}

.hand-instruction {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.audition-button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.speaker-glyph {
  position: relative;
  width: 0.58rem;
  height: 0.65rem;
  border-radius: 0.08rem;
  background: currentColor;
}

.speaker-glyph::before {
  position: absolute;
  top: -0.15rem;
  right: -0.37rem;
  width: 0;
  height: 0;
  border-top: 0.48rem solid transparent;
  border-bottom: 0.48rem solid transparent;
  border-left: 0.48rem solid currentColor;
  content: "";
}

.current-chord {
  display: block;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(4.5rem, 10vw, 8.75rem);
  font-weight: 850;
  line-height: 0.78;
}

.gesture-reading {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  min-width: 0;
}

.current-gesture {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(4.2rem, 9vw, 8rem);
  font-weight: 500;
  line-height: 0.78;
}

.gesture-reading > span {
  max-width: 13rem;
  padding-bottom: 0.35rem;
  color: var(--text);
  font-size: clamp(0.95rem, 1.7vw, 1.3rem);
  font-weight: 750;
  line-height: 1.15;
}

.timeline {
  border-bottom: 1px solid var(--line);
}

.timeline-row {
  display: grid;
  grid-template-columns: clamp(7.2rem, 12vw, 10rem) minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  border-top: 1px solid var(--line);
}

.timeline-row:first-child {
  border-top: 0;
}

.timeline-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.85rem 1rem 0.85rem 0;
}

.timeline-heading span {
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.35;
}

.chord-track,
.strum-grid {
  display: grid;
  min-width: 0;
  grid-auto-flow: column;
  grid-auto-columns: minmax(4.75rem, 1fr);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.chord-track > *,
.strum-grid > * {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  scroll-snap-align: start;
}

.chord-track > * {
  min-height: 4.5rem;
}

.chord-track strong,
.chord-track .chord-name,
.chord-track .track-chord {
  color: var(--text);
  font-size: 1.05rem;
}

.chord-track .active,
.chord-track .current,
.chord-track .is-active,
.chord-track > .active,
.chord-track > .current,
.chord-track > .is-active {
  color: var(--accent);
}

.chord-track > .active::after,
.chord-track > .current::after,
.chord-track > .is-active::after {
  position: absolute;
  right: 0.65rem;
  bottom: 0;
  left: 0.65rem;
  height: 0.18rem;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

.strum-grid > * {
  min-height: 3.65rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 750;
}

.strum-grid .beat-number,
.strum-grid .beat-label {
  position: absolute;
  top: 0.3rem;
  color: var(--faint);
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 650;
}

.strum-grid .active,
.strum-grid .current,
.strum-grid .is-active,
.strum-grid > .active,
.strum-grid > .current,
.strum-grid > .is-active {
  background: rgba(217, 238, 95, 0.1);
  color: var(--accent);
}

.strum-grid .accent,
.strum-grid .accented,
.strum-grid .is-accent {
  color: var(--accent);
  font-size: 1.6rem;
}

.strum-grid .rest,
.strum-grid .is-rest {
  color: var(--faint);
}

.strings-section {
  padding: 1.4rem 0 1.15rem;
}

.section-heading,
.feedback-heading,
.match-copy {
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2,
.feedback-heading h2,
.next-zone h2 {
  margin-top: 0.26rem;
}

.section-heading > p,
.fretboard-legend {
  color: var(--muted);
  font-size: 0.7rem;
}

.string-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(7.5rem, 1fr));
  min-width: 0;
  margin-top: 0.85rem;
  overflow-x: auto;
  border-block: 1px solid var(--line);
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
  scroll-snap-type: inline proximity;
}

.string-map > * {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 7rem;
  place-content: center;
  gap: 0.18rem;
  padding: 0.7rem;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: center;
  scroll-snap-align: start;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.string-map > *:first-child {
  border-left: 0;
}

.string-map > button:hover {
  background: var(--surface-raised);
}

.string-map .active,
.string-map .current,
.string-map .is-active,
.string-map > .active,
.string-map > .current,
.string-map > .is-active,
.string-map > [aria-pressed="true"] {
  background: rgba(217, 238, 95, 0.08);
}

.string-map .string-name,
.string-map .string-label,
.string-map small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.string-map strong,
.string-map .note-name,
.string-map .note {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.string-map .fret,
.string-map .finger,
.string-map .position {
  color: var(--muted);
  font-size: 0.7rem;
}

.string-map .muted,
.string-map .is-muted {
  color: var(--bad);
}

/* Coach */

.coach {
  display: grid;
  grid-template-columns: minmax(17rem, 1.1fr) minmax(17rem, 1fr) minmax(12rem, 0.68fr);
  min-width: 0;
  border-top: 1px solid var(--line-strong);
  animation: fade-in 420ms 160ms ease both;
}

.fretboard-zone,
.feedback-zone,
.next-zone {
  min-width: 0;
  padding: 1.35rem clamp(1rem, 2vw, 1.6rem);
}

.fretboard-zone {
  padding-left: 0;
}

.feedback-zone,
.next-zone {
  border-left: 1px solid var(--line);
}

.next-zone {
  padding-right: 0;
}

.fretboard {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  width: 100%;
  height: 13.5rem;
  margin-top: 2.25rem;
  border-top: 0.28rem solid rgba(240, 243, 235, 0.8);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(20% - 1px),
    var(--line-strong) calc(20% - 1px),
    var(--line-strong) 20%
  );
}

.fret-string {
  grid-row: 1 / -1;
  border-left: 1px solid rgba(240, 243, 235, 0.26);
}

.fret-string:last-child {
  border-right: 1px solid rgba(240, 243, 235, 0.26);
}

.finger-dot {
  position: absolute;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0.2rem rgba(217, 238, 95, 0.1);
}

.open-muted-row {
  position: absolute;
  top: -1.7rem;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.feedback-heading {
  align-items: flex-start;
}

.mic-status {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.mic-status::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--faint);
  content: "";
}

.mic-status.listening,
.mic-status.active,
.mic-status[data-active="true"] {
  color: var(--good);
}

.mic-status.listening::before,
.mic-status.active::before,
.mic-status[data-active="true"]::before {
  background: var(--good);
  box-shadow: 0 0 0 0.24rem rgba(142, 216, 155, 0.12);
}

.note-feedback {
  display: grid;
  gap: 0;
  margin-top: 1.15rem;
}

.note-feedback > div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--line);
}

.note-feedback dt,
.match-copy span {
  color: var(--muted);
  font-size: 0.72rem;
}

.note-feedback dd {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
}

#missingNotes:not(:empty) {
  color: var(--warn);
}

.match-block {
  margin-top: 1.05rem;
}

.match-copy strong {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
}

.match-track {
  height: 0.34rem;
  margin-top: 0.55rem;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-hover);
}

.match-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease-out;
}

.next-list {
  display: grid;
  gap: 0;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.next-list li {
  display: flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.next-list li:first-child {
  color: var(--text);
}

.next-list strong {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
}

/* États interactifs */

:where(button, select, input, a):focus-visible {
  outline: 0.18rem solid var(--accent);
  outline-offset: 0.18rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .control-strip {
    grid-template-columns: minmax(13rem, 1fr) minmax(16rem, 1fr);
  }

  .coach {
    grid-template-columns: minmax(17rem, 1fr) minmax(17rem, 1fr);
  }

  .next-zone {
    grid-column: 1 / -1;
    padding: 1.15rem 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .next-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .next-list li {
    min-height: 3.2rem;
    padding: 0 0.75rem;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .next-list li:first-child {
    padding-left: 0;
  }

  .next-list li:last-child {
    border-right: 0;
  }
}

@media (max-width: 980px) {
  body::before {
    position: fixed;
    z-index: 45;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.library-open {
    overflow: hidden;
  }

  body.library-open::before,
  body:has(.library.open)::before {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell {
    display: block;
  }

  .library {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(22rem, calc(100vw - 1rem));
    height: 100dvh;
    border-right-color: var(--line-strong);
    box-shadow: var(--shadow-raised);
    transform: translateX(calc(-100% - 1rem));
    transition: transform 200ms ease;
  }

  body.library-open .library,
  .library.open {
    transform: translateX(0);
  }

  .library-close,
  .library-toggle {
    display: inline-flex;
  }

  .library-close {
    display: grid;
    place-items: center;
  }

  .practice {
    padding-inline: clamp(0.9rem, 3vw, 1.5rem);
  }

  .song-copy {
    display: block;
  }

  .song-copy h1 {
    margin-top: 0.18rem;
  }

  .song-detail {
    margin-top: 0.15rem;
  }

  .coach {
    grid-template-columns: minmax(15rem, 1fr) minmax(15rem, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding-block: 0.3rem 0.65rem;
  }

  .topbar .transport {
    justify-content: flex-end;
  }

  .control-strip {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, auto);
    align-items: stretch;
  }

  .tempo-control {
    grid-column: 1 / -1;
  }

  .mode-control {
    grid-column: 1;
  }

  .select-control:nth-last-child(2) {
    grid-column: 2;
    grid-row: 2;
  }

  .select-control:last-child {
    grid-column: 1 / -1;
  }

  .timeline-row {
    grid-template-columns: 7.2rem minmax(0, 1fr);
  }

  .coach {
    grid-template-columns: 1fr;
  }

  .fretboard-zone,
  .feedback-zone,
  .next-zone {
    padding-inline: 0;
  }

  .feedback-zone,
  .next-zone {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: calc(4.8rem + env(safe-area-inset-bottom));
  }

  .practice {
    padding: 0.65rem 0.75rem 1.5rem;
  }

  .topbar {
    order: 1;
    min-height: 3.8rem;
    padding-bottom: 0.55rem;
  }

  .song-context {
    gap: 0.6rem;
  }

  .library-toggle {
    width: 2.75rem;
    padding: 0;
  }

  .library-toggle > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .song-copy h1 {
    font-size: 1.12rem;
  }

  .song-detail {
    max-width: calc(100vw - 5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .transport {
    position: fixed;
    z-index: 60;
    right: 0.55rem;
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    left: 0.55rem;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 0.85fr) minmax(0, 1.25fr);
    gap: 0.35rem;
    padding: 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.75rem;
    background: rgba(18, 21, 18, 0.94);
    box-shadow: 0 0.8rem 2.8rem rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(1rem);
  }

  .transport-button,
  .primary-button {
    min-width: 0;
    min-height: 3.15rem;
    padding-inline: 0.5rem;
  }

  .control-strip {
    order: 3;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: 0.5rem;
    padding: 1rem 0;
  }

  .tempo-control,
  .mode-control,
  .select-control:nth-last-child(2) {
    grid-column: 1;
    grid-row: auto;
  }

  .select-control:last-child {
    grid-column: 1;
  }

  .workspace {
    order: 2;
  }

  .practice-stage {
    padding-top: 0.2rem;
  }

  .stage-status {
    min-height: 1.75rem;
    margin-bottom: 0.25rem;
  }

  .two-hand-cue {
    min-height: 11rem;
  }

  .hand-cue {
    padding: 0.9rem;
  }

  .hand-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .hand-instruction {
    font-size: 0.7rem;
  }

  .audition-button {
    min-height: 2.75rem;
    padding-inline: 0.65rem;
  }

  .current-chord {
    font-size: clamp(3.65rem, 19vw, 5.2rem);
  }

  .gesture-reading {
    align-items: flex-end;
    gap: 0.55rem;
  }

  .current-gesture {
    font-size: clamp(3.5rem, 17vw, 5rem);
  }

  .gesture-reading > span {
    padding-bottom: 0.18rem;
    font-size: 0.82rem;
  }

  .timeline-row {
    display: block;
  }

  .timeline-heading {
    display: flex;
    min-height: 2.8rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
  }

  .timeline-heading span {
    max-width: 12rem;
    text-align: right;
  }

  .chord-track,
  .strum-grid {
    margin-inline: -0.75rem;
    padding-inline: 0.75rem;
    scroll-padding-inline: 0.75rem;
  }

  .chord-track > *:first-child,
  .strum-grid > *:first-child {
    border-left: 0;
  }

  .strings-section {
    padding-top: 1.15rem;
  }

  .section-heading {
    align-items: flex-end;
  }

  .section-heading > p {
    max-width: 9rem;
    text-align: right;
  }

  .string-map {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(7.25rem, 37vw);
    margin-inline: -0.75rem;
    padding-inline: 0.75rem;
    scroll-padding-inline: 0.75rem;
  }

  .string-map > * {
    min-height: 6.4rem;
  }

  .coach {
    display: block;
  }

  .fretboard-zone,
  .feedback-zone,
  .next-zone {
    padding-block: 1.2rem;
  }

  .fretboard {
    height: min(12.5rem, 54vw);
    min-height: 10.5rem;
    margin-top: 2rem;
  }

  .feedback-heading {
    gap: 0.65rem;
  }

  .note-feedback > div {
    grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 1fr);
  }

  .next-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .next-list li,
  .next-list li:first-child {
    min-height: 2.75rem;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .library {
    width: calc(100vw - 0.5rem);
  }

  .transport-button,
  .primary-button {
    font-size: 0.75rem;
  }

  .hand-cue {
    padding-inline: 0.72rem;
  }

  .audition-button {
    width: 2.75rem;
    padding: 0;
  }

  .audition-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .timeline-heading span {
    font-size: 0.62rem;
  }

  .fretboard-legend {
    max-width: 7rem;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
