.practice-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.key-picker select:focus-visible,
.exercise-card:focus-visible,
.metronome-controls input:focus-visible,
.metronome-controls select:focus-visible,
.play-button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.practice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  align-items: end;
  margin-bottom: 64px;
}

.practice-hero h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.25rem);
  font-weight: 400;
  line-height: 0.9;
  text-wrap: balance;
}

.practice-hero h1 span {
  color: var(--accent);
}

.key-picker {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.key-picker label {
  font-size: 0.72rem;
  font-weight: 700;
}

.key-picker select,
.player-actions select,
#bpm-number {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.key-picker select {
  width: 100%;
  padding: 0 12px;
}

.key-picker small {
  color: var(--muted);
  font-size: 0.7rem;
  text-wrap: pretty;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.section-heading h2,
.player-heading h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  text-wrap: balance;
}

.section-heading > p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.chord-reference {
  margin-bottom: 64px;
}

#practice-chords {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-chord {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.reference-chord b,
.reference-chord strong,
.reference-chord small {
  display: block;
}

.reference-chord b {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.reference-chord strong {
  overflow: hidden;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-chord small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.58rem;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: start;
}

.exercise-library,
.player {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.exercise-list {
  display: grid;
  gap: 10px;
}

.exercise-card {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.exercise-card[aria-pressed="true"] {
  border-color: var(--dark-ring);
  color: var(--surface);
  background: var(--dark-ring);
}

.exercise-card strong,
.exercise-card span {
  display: block;
}

.exercise-card strong {
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.exercise-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-card[aria-pressed="true"] span {
  color: var(--accent-soft);
}

.player-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.status {
  margin: 4px 0 0;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.68rem;
  font-weight: 700;
}

.status.is-running {
  color: var(--surface);
  background: var(--accent);
}

.active-sequence {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 24px;
  padding: 0 0 8px;
  list-style: none;
  scrollbar-width: thin;
}

.sequence-chord {
  flex: 1 0 84px;
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
}

.sequence-chord b,
.sequence-chord span {
  display: block;
}

.sequence-chord b {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.sequence-chord span {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.35rem;
}

.sequence-chord.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sequence-chord.is-active::after {
  display: block;
  margin-top: 5px;
  content: "NOW";
  color: var(--ink);
  font-size: 0.5rem;
  font-weight: 700;
}

.current-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding: 20px;
  border-radius: 14px;
  color: var(--surface);
  background: var(--dark-ring);
}

.current-readout span,
.current-readout strong {
  display: block;
}

.current-readout span {
  margin-bottom: 3px;
  color: var(--accent-soft);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.current-readout strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2.7rem;
  font-weight: 400;
  line-height: 0.9;
}

.beat-dots {
  display: flex;
  gap: 8px;
}

.beat-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  opacity: 0.55;
  transition: transform 100ms ease-out, opacity 100ms ease-out;
}

.beat-dot.is-active {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  opacity: 1;
  transform: scale(1.25);
}

.metronome-controls {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.tempo-control {
  margin-bottom: 22px;
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.control-label label,
.player-actions label {
  font-size: 0.75rem;
  font-weight: 700;
}

.control-label div {
  display: flex;
  align-items: center;
  gap: 7px;
}

#bpm-number {
  width: 68px;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.control-label span {
  color: var(--muted);
  font-size: 0.65rem;
}

#bpm-range {
  width: 100%;
  accent-color: var(--accent);
}

.player-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.player-actions label {
  display: grid;
  gap: 7px;
}

.player-actions select {
  min-width: 130px;
  padding: 0 10px;
}

.play-button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: var(--surface);
  background: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.play-button[aria-pressed="true"] {
  background: var(--dark-ring);
}

.audio-help {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (max-width: 900px) {
  .practice-hero,
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .practice-hero {
    gap: 32px;
  }

  #practice-chords {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .practice-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 24px;
  }

  .practice-hero {
    margin-bottom: 48px;
  }

  #practice-chords {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exercise-library,
  .player {
    padding: 20px;
    border-radius: 16px;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .active-sequence {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .sequence-chord {
    flex: 1 1 calc(50% - 4px);
  }

  .player-actions {
    display: grid;
  }

  .play-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beat-dot {
    transition: none;
  }
}
