/* ============================================================
   Comfort y música para volar — guía de teclado
   World: programa de mano / J-card de rock argentino impreso en
   papel mate, con bandas de luz de escenario y grilla de registro.
   ============================================================ */

:root {
  --paper: #f4efe4;
  --paper-2: #ece5d6;
  --paper-3: #e3dac7;
  --ink: #171512;
  --muted: #6d6558;
  --line: #cfc5b2;
  --line-strong: #a99e8a;
  --cobalt: #1f3a93;
  --cobalt-2: #2d4fbd;
  --amber: #d9772b;
  --amber-ink: #9a4f16;
  --rose: #c94f6d;
  --stage: #0b0b0d;
  --stage-2: #141419;
  --stage-line: #2c2c35;
  --white: #f7f3ea;
  --print-ink: #000000;
  --print-paper: #ffffff;
  --print-line: #999999;
  --print-muted: #333333;
  --display: "Liberation Sans", "Helvetica Neue", Arial, sans-serif;
  --body: "Liberation Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Liberation Mono", "SFMono-Regular", "Cascadia Code", monospace;
  --max: 1240px;
  --pad: clamp(18px, 4vw, 48px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.55), transparent 34rem),
    radial-gradient(circle at 88% 100%, rgba(217, 119, 43, 0.07), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--amber);
  color: var(--stage);
}

a {
  color: var(--cobalt);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: inherit;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
}

.hero a,
.song-hero a {
  color: var(--white);
}

.hero a:hover,
.song-hero a:hover {
  color: var(--amber);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 12px 16px;
  z-index: 100;
}

.skip:focus {
  left: 12px;
}

.wrap {
  width: min(100% - 2 * var(--pad), var(--max));
  margin-inline: auto;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand strong {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- type ---------- */

.kicker {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.05;
  text-transform: uppercase;
}

h1.display {
  font-size: clamp(3.2rem, 10.5vw, 9.2rem);
}

h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h3 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

p {
  margin: 0 0 14px;
  max-width: 72ch;
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.45;
  max-width: 62ch;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--stage);
  color: var(--white);
  border-bottom: 1px solid var(--stage-line);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background:
    linear-gradient(180deg, rgba(11, 11, 13, 0) 0%, rgba(31, 58, 147, 0.55) 48%, rgba(201, 79, 109, 0.7) 100%);
  opacity: 0.72;
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  right: clamp(18px, 5vw, 70px);
  top: clamp(18px, 5vw, 60px);
  width: 28px;
  height: 28px;
  background:
    linear-gradient(var(--white), var(--white)) center / 1px 100% no-repeat,
    linear-gradient(var(--white), var(--white)) center / 100% 1px no-repeat;
  opacity: 0.5;
}

.hero .wrap {
  position: relative;
  padding-block: clamp(54px, 9vw, 112px) clamp(46px, 8vw, 96px);
}

.hero .kicker {
  color: rgba(247, 243, 234, 0.65);
}

.hero-sub {
  margin: 24px 0 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.4;
  color: rgba(247, 243, 234, 0.78);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(247, 243, 234, 0.18);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.72);
}

.hero-stats strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--white);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
}

.btn--ghost {
  border-color: rgba(247, 243, 234, 0.32);
  color: var(--white);
}

.btn--ghost:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--stage);
}

.btn--small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

.btn--icon {
  width: 42px;
  padding: 0;
}

.btn[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--stage);
}

/* ---------- dashboard setlist ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 56px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  margin: 0;
}

.section-head .mono {
  font-size: 11px;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 8px;
}

.search {
  flex: 1 1 220px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.search::placeholder {
  color: var(--muted);
}

.filter-btn {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--white);
}

.setlist {
  margin-top: 26px;
  border-bottom: 1px solid var(--line-strong);
}

.song-row[hidden] {
  display: none;
}

.song-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(220px, 1.4fr) 86px 70px 76px minmax(120px, 0.8fr) 130px 22px;
  gap: 16px;
  align-items: center;
  padding: 16px 10px 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 160ms ease;
}

.song-row:hover {
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}

.song-row.is-learned {
  background: color-mix(in srgb, var(--cobalt) 5%, transparent);
}

.song-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.song-title {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.song-tagline {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.song-key,
.song-bpm,
.song-duration {
  font-family: var(--mono);
  font-size: 12px;
}

.song-key {
  font-weight: 700;
}

.song-patch {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.song-progress {
  min-width: 110px;
}

.progress-track {
  height: 4px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--cobalt);
  transition: width 300ms ease;
}

.song-progress .mono {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}

.song-arrow {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted);
}

.song-row:hover .song-arrow {
  color: var(--cobalt);
}

.overall {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.overall .progress-track {
  flex: 1;
  max-width: 360px;
}

.reset-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reset-link:hover {
  color: var(--cobalt);
}

/* ---------- how to ---------- */

.how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 70px 0 30px;
  border-top: 1px solid var(--line-strong);
}

.how-step {
  padding: 22px 26px 22px 0;
  border-right: 1px solid var(--line);
}

.how-step:last-child {
  border-right: 0;
  padding-right: 0;
  padding-left: 26px;
}

.how-step:not(:first-child) {
  padding-left: 26px;
}

.how-step .num {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber-ink);
}

.how-step h3 {
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.03em;
  text-transform: none;
}

.how-step p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ---------- song page hero ---------- */

.song-hero {
  position: relative;
  overflow: hidden;
  background: var(--stage);
  color: var(--white);
  border-bottom: 1px solid var(--stage-line);
  isolation: isolate;
}

.song-hero::before {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0) 0%, rgba(31, 58, 147, 0.42) 60%, rgba(201, 79, 109, 0.55) 100%);
  opacity: 0.7;
  z-index: -1;
}

.song-hero .wrap {
  position: relative;
  padding-block: 40px 42px;
}

.song-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
}

.song-hero .track-number {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.6);
}

.song-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 6.6vw, 6.4rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-transform: uppercase;
}

.song-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(247, 243, 234, 0.24);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.78);
}

.chip strong {
  color: var(--white);
}

.song-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 150px;
}

/* ---------- song layout ---------- */

.song-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(26px, 4vw, 54px);
  align-items: start;
  padding-block: 34px 70px;
}

.rail {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 14px;
}

.rail-card {
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  padding: 16px;
}

.rail-card h2 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.stat .label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat .value {
  display: block;
  margin-top: 3px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.confidence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.dot--alta { background: #3f7a4f; }
.dot--media { background: var(--amber); }
.dot--baja { background: var(--rose); }

/* metronome */

.metronome {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  padding: 14px;
}

.metro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.metro-top h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.metro-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  font-size: 16px;
}

.metro-play:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
}

.metro-play[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--stage);
}

.metro-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bpm-wrap {
  display: flex;
  align-items: baseline;
  gap: 5px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.bpm-input {
  width: 64px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.bpm-input:focus {
  outline: none;
}

.bpm-wrap:focus-within {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

body.stage-mode .bpm-wrap:focus-within {
  outline-color: var(--white);
}

.bpm-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.beat-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.beat-dot {
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  background: transparent;
}

.beat-dot.is-active {
  background: var(--amber);
  border-color: var(--amber);
}

.metro-hint {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

/* progress in rail */

.rail-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.rail-progress .progress-track {
  flex: 1;
}

.rail-progress .mono {
  font-size: 11px;
  color: var(--muted);
}

.rail-actions {
  display: grid;
  gap: 8px;
}

/* content */

.song-content {
  min-width: 0;
}

.content-section {
  padding: 0 0 38px;
  margin: 0 0 38px;
  border-bottom: 1px solid var(--line);
}

.content-section:last-child {
  border-bottom: 0;
}

.section-kicker {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 8px;
}

.section-kicker h2 {
  margin: 0;
}

.section-kicker .mono {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* timeline */

.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding-bottom: 6px;
}

.section-block {
  position: relative;
  flex: 1 1 120px;
  min-width: 120px;
  padding: 12px 10px 11px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.section-block:hover {
  border-color: var(--cobalt);
}

.section-block.is-active {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--white);
}

.section-block .bars {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.section-block.is-active .bars {
  color: rgba(247, 243, 234, 0.65);
}

.section-block .time {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.section-block.is-active .time {
  color: rgba(247, 243, 234, 0.72);
}

.section-block .name {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-block .chords {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  white-space: normal;
}

.section-block.is-active .chords {
  color: rgba(247, 243, 234, 0.82);
}

.section-block .cue-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.section-block.is-active .cue-dot {
  background: var(--white);
}

.timeline-hint {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.cue-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.cue-chips > .mono {
  margin-right: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cue-chip {
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px 9px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
}

.cue-chip .mono {
  margin-right: 6px;
  color: var(--muted);
}

.cue-chip:hover {
  border-color: var(--cobalt);
  background: var(--paper-2);
}

.section-list {
  margin-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.section-row {
  display: grid;
  grid-template-columns: 28px 92px minmax(150px, 1.1fr) minmax(120px, 1fr) minmax(170px, 1.2fr);
  gap: 12px;
  align-items: start;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease;
}

.section-row:hover {
  background: color-mix(in srgb, var(--paper-2) 60%, transparent);
}

.section-row.is-active {
  background: color-mix(in srgb, var(--cobalt) 7%, transparent);
}

.section-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.section-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--cobalt);
  cursor: pointer;
}

.section-time {
  font-size: 11px;
  color: var(--muted);
  padding-top: 2px;
}

.section-time .bars {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.section-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-chords {
  font-size: 11px;
  line-height: 1.4;
}

.section-keyboard {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* cue list */

.cue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: cue;
}

.cue-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  counter-increment: cue;
}

.cue-item::before {
  content: counter(cue, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cobalt);
}

.cue-item h4,
.cue-item p {
  grid-column: 2;
}

.cue-item h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
}

.cue-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* chord cards */

.chord-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chord-card {
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  padding: 16px;
  break-inside: avoid;
}

.chord-card h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chord-card pre {
  margin: 0;
  padding: 10px 0 0;
  border-top: 2px solid var(--cobalt);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}

.chord-notes {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.chord-notes ul {
  margin: 0;
  padding-left: 18px;
}

.chord-notes li {
  margin-bottom: 5px;
}

.chord-notes p {
  margin: 0 0 8px;
  max-width: none;
}

/* MIDI player */

.midi-player {
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  padding: 16px;
}

.midi-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.midi-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
}

.midi-play[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--stage);
}

.midi-seek {
  flex: 1 1 180px;
  min-width: 120px;
  accent-color: var(--cobalt);
}

.midi-time {
  font-size: 11px;
  color: var(--muted);
  min-width: 92px;
  text-align: right;
}

.midi-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin-top: 16px;
}

.midi-track {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.midi-track input {
  accent-color: var(--cobalt);
  flex: 0 0 auto;
}

.midi-track span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.midi-track .mono {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.midi-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.midi-dl {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.midi-hint {
  margin: 14px 0 0;
  max-width: 72ch;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

/* generic prose */

.prose ul {
  margin: 0;
  padding-left: 20px;
}

.prose li {
  margin-bottom: 8px;
}

.prose p {
  max-width: 72ch;
}

.prose table,
.sources table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.prose th,
.prose td,
.sources th,
.sources td {
  border-top: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.prose th,
.sources th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose tr:last-child td,
.sources tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.callout {
  border-top: 3px solid var(--amber);
  background: color-mix(in srgb, var(--amber) 7%, transparent);
  padding: 14px 16px;
}

.callout p:last-child {
  margin-bottom: 0;
}

details {
  border-top: 1px solid var(--line-strong);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cobalt);
}

details[open] summary {
  margin-bottom: 12px;
}

/* mobile practice bar */

.mobile-bar {
  display: none;
}

/* ---------- stage mode ---------- */

body.stage-mode {
  background: var(--stage);
  color: var(--white);
}

body.stage-mode a {
  color: var(--amber);
}

body.stage-mode a:hover {
  color: var(--white);
}

body.stage-mode :focus-visible {
  outline-color: var(--white);
}

body.stage-mode .topbar {
  background: rgba(11, 11, 13, 0.92);
  border-color: var(--stage-line);
}

body.stage-mode .brand,
body.stage-mode .brand strong {
  color: var(--white);
}

body.stage-mode .btn {
  border-color: rgba(247, 243, 234, 0.3);
  color: var(--white);
}

body.stage-mode .btn:hover {
  background: var(--white);
  color: var(--stage);
}

body.stage-mode .btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--stage);
}

body.stage-mode .btn[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--stage);
}

body.stage-mode .song-hero {
  border-color: var(--stage-line);
}

body.stage-mode .song-hero-actions {
  display: none;
}

body.stage-mode .song-hero::before {
  opacity: 0.4;
}

body.stage-mode .song-layout {
  grid-template-columns: 240px minmax(0, 1fr);
  padding-top: 22px;
}

body.stage-mode .rail-card,
body.stage-mode .metronome {
  background: var(--stage-2);
  border-color: var(--stage-line);
}

body.stage-mode .rail-card h2,
body.stage-mode .stat .label,
body.stage-mode .confidence,
body.stage-mode .metro-top h2,
body.stage-mode .bpm-label,
body.stage-mode .metro-hint,
body.stage-mode .section-kicker .mono,
body.stage-mode .timeline-hint {
  color: rgba(247, 243, 234, 0.55);
}

body.stage-mode .stat {
  border-color: var(--stage-line);
}

body.stage-mode .stat .value {
  color: var(--white);
}

body.stage-mode .bpm-input {
  color: var(--white);
}

body.stage-mode .bpm-wrap {
  border-color: rgba(247, 243, 234, 0.3);
}

body.stage-mode .beat-dot {
  border-color: rgba(247, 243, 234, 0.35);
}

body.stage-mode .content-section {
  border-color: var(--stage-line);
}

body.stage-mode .section-kicker {
  border-color: var(--stage-line);
}

body.stage-mode .section-block {
  background: var(--stage-2);
  border-color: var(--stage-line);
  color: var(--white);
}

body.stage-mode .section-block .time,
body.stage-mode .section-block .chords {
  color: rgba(247, 243, 234, 0.55);
}

body.stage-mode .section-block.is-active {
  background: var(--cobalt);
  border-color: var(--cobalt);
}

body.stage-mode .section-block.is-active .time,
body.stage-mode .section-block.is-active .chords {
  color: rgba(247, 243, 234, 0.82);
}

body.stage-mode .cue-chips > .mono {
  color: rgba(247, 243, 234, 0.55);
}

body.stage-mode .cue-chip {
  border-color: var(--stage-line);
  color: var(--white);
}

body.stage-mode .cue-chip .mono {
  color: var(--amber);
}

body.stage-mode .section-list {
  border-color: var(--stage-line);
}

body.stage-mode .section-row {
  grid-template-columns: 92px minmax(150px, 1.1fr) minmax(120px, 1fr) minmax(170px, 1.2fr);
  border-color: var(--stage-line);
}

body.stage-mode .section-row:hover,
body.stage-mode .cue-chip:hover {
  background: rgba(247, 243, 234, 0.06);
}

body.stage-mode .section-row.is-active {
  background: rgba(31, 58, 147, 0.22);
}

body.stage-mode .section-check {
  display: none;
}

body.stage-mode .section-name {
  color: var(--white);
}

body.stage-mode .section-time,
body.stage-mode .section-chords,
body.stage-mode .section-keyboard {
  color: rgba(247, 243, 234, 0.6);
}

body.stage-mode .chord-card {
  background: var(--stage-2);
  border-color: var(--stage-line);
}

body.stage-mode .chord-card h3 {
  border-color: var(--stage-line);
  color: rgba(247, 243, 234, 0.7);
}

body.stage-mode .chord-card pre {
  border-color: var(--amber);
  color: var(--white);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.6;
}

body.stage-mode .chord-notes,
body.stage-mode .study-only,
body.stage-mode .sources,
body.stage-mode .callout,
body.stage-mode .prose,
body.stage-mode .lead,
body.stage-mode .section-kicker .mono {
  display: none;
}

body.stage-mode .cue-list {
  display: block;
}

body.stage-mode .cue-item {
  border-color: var(--stage-line);
}

body.stage-mode .cue-item h3 {
  color: var(--white);
}

body.stage-mode .cue-item p {
  color: rgba(247, 243, 234, 0.65);
}

body.stage-mode .cue-item::before {
  color: var(--amber);
}

body.stage-mode .song-content {
  max-width: 980px;
}

body.stage-mode .chord-grid {
  grid-template-columns: 1fr;
}

body.stage-mode .section-block .name {
  font-size: 16px;
}

body.stage-mode .section-block .chords,
body.stage-mode .section-block .bars {
  font-size: 12px;
}

body.stage-mode .section-row .section-name {
  font-size: 20px;
}

body.stage-mode .section-keyboard {
  font-size: 14px;
}

body.stage-mode .section-chords {
  font-size: 13px;
}

body.stage-mode .cue-item h3 {
  font-size: 22px;
}

body.stage-mode .cue-item p {
  font-size: 16px;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line-strong);
  padding: 26px 0 40px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.footer p {
  margin: 0;
  max-width: 80ch;
}

/* ---------- responsive ---------- */

@media screen and (max-width: 980px) {
  .song-row {
    grid-template-columns: 42px minmax(0, 1fr) 70px 60px 22px;
  }

  .song-patch,
  .song-duration,
  .song-progress {
    display: none;
  }

  .song-row .song-progress {
    grid-column: 2 / -1;
    display: block;
    margin-top: 6px;
  }

  .song-layout {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .rail-actions {
    grid-column: 1 / -1;
  }

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

  .how-step,
  .how-step:not(:first-child),
  .how-step:last-child {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .how-step:last-child {
    border-bottom: 0;
  }
}

@media screen and (max-width: 720px) {
  body {
    font-size: 16px;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .topbar-inner {
    min-height: 52px;
  }

  .brand strong {
    display: none;
  }

  .brand {
    white-space: nowrap;
    font-size: 11px;
  }

  .topbar-actions .btn:not([data-stage-toggle]) {
    display: none;
  }

  .topbar-actions .btn[data-stage-toggle] {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .rail {
    display: none;
  }

  .timeline {
    display: none;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  }

  .mobile-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--white);
    font-size: 16px;
  }

  .mobile-play[aria-pressed="true"] {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--stage);
  }

  .mobile-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 40px;
    flex: 0 0 36px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1;
  }

  .mobile-step:hover {
    border-color: var(--cobalt);
  }

  body.stage-mode .mobile-step {
    border-color: rgba(247, 243, 234, 0.3);
    color: var(--white);
  }

  .mobile-bpm {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .mobile-bpm strong {
    font-size: 18px;
    color: var(--ink);
  }

  .mobile-link,
  .mobile-stage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .mobile-link {
    margin-left: auto;
  }

  .mobile-stage[aria-pressed="true"] {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--stage);
  }

  .mobile-progress {
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 2px;
    background: transparent;
  }

  .mobile-progress .progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--cobalt);
    transition: width 300ms ease;
  }

  body.stage-mode .mobile-bar {
    background: var(--stage-2);
    border-color: var(--stage-line);
    box-shadow: none;
  }

  body.stage-mode .mobile-bpm,
  body.stage-mode .mobile-bpm strong {
    color: var(--white);
  }

  body.stage-mode .mobile-link,
  body.stage-mode .mobile-stage {
    border-color: rgba(247, 243, 234, 0.3);
    color: var(--white);
  }

  body.stage-mode .mobile-stage[aria-pressed="true"] {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--stage);
  }

  .song-hero-grid {
    grid-template-columns: 1fr;
  }

  .song-hero-actions {
    display: flex;
    flex-direction: row;
  }

  .song-hero-actions [data-stage-toggle] {
    display: none;
  }

  .song-hero-actions [data-print] {
    flex: 1 1 auto;
  }

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

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

  .midi-tracks {
    grid-template-columns: 1fr;
  }

  .midi-time {
    text-align: left;
  }

  .section-block {
    width: 100%;
    min-width: 0;
  }

  .section-row {
    grid-template-columns: 28px 1fr;
    gap: 4px 10px;
  }

  body.stage-mode .section-row {
    grid-template-columns: 1fr;
  }

  body.stage-mode .section-row .section-time,
  body.stage-mode .section-row .section-name,
  body.stage-mode .section-row .section-chords,
  body.stage-mode .section-row .section-keyboard {
    grid-column: 1;
  }

  .section-check {
    grid-row: 1 / span 4;
    justify-content: flex-start;
  }

  .section-time,
  .section-name,
  .section-chords,
  .section-keyboard {
    grid-column: 2;
  }

  .section-name {
    font-size: 15px;
  }

  .song-row {
    grid-template-columns: 36px minmax(0, 1fr) 56px 22px;
    gap: 10px;
  }

  .song-bpm {
    display: none;
  }

  .song-progress {
    grid-column: 2 / -1;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .prose table,
  .sources table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .midi-index table {
    display: table;
    white-space: normal;
  }

  .midi-index th:nth-child(4),
  .midi-index td:nth-child(4),
  .midi-index th:nth-child(5),
  .midi-index td:nth-child(5) {
    display: none;
  }

  .midi-index .btn {
    padding: 7px 7px;
  }
}

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

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

/* ---------- print ---------- */

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: var(--print-paper);
    color: var(--print-ink);
    font-size: 10.5pt;
  }

  .topbar,
  .rail,
  .metronome,
  .song-hero-actions,
  .filters,
  .overall,
  .footer,
  .section-check,
  .timeline-hint,
  .btn {
    display: none !important;
  }

  .hero,
  .song-hero {
    background: var(--print-paper) !important;
    color: var(--print-ink) !important;
    border-bottom: 2px solid var(--print-ink);
  }

  .hero::before,
  .song-hero::before,
  .hero::after {
    display: none;
  }

  .hero .kicker,
  .hero-sub,
  .hero-stats,
  .song-hero .track-number,
  .song-chips {
    color: var(--print-ink) !important;
  }

  .chip,
  .chip strong {
    color: var(--print-ink) !important;
    border-color: var(--print-line) !important;
  }

  .hero-stats strong {
    color: var(--print-ink) !important;
  }

  .song-layout {
    display: block;
    padding: 0;
  }

  .song-row {
    grid-template-columns: 30px minmax(140px, 1.4fr) 55px 45px 50px minmax(90px, 0.8fr) 70px 12px;
    gap: 6px;
  }

  .content-section {
    break-inside: avoid;
    border-color: var(--print-line);
    padding-bottom: 12pt;
    margin-bottom: 12pt;
  }

  .chord-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8pt;
  }

  .chord-card {
    border: 1px solid var(--print-line);
    background: var(--print-paper);
    padding: 8pt;
  }

  .chord-card pre {
    border-color: var(--print-ink);
    font-size: 9pt;
  }

  .section-block {
    background: var(--print-paper) !important;
    color: var(--print-ink) !important;
    border-color: var(--print-line);
  }

  .section-block .time,
  .section-block .chords {
    color: var(--print-muted) !important;
  }

  details {
    display: block;
  }

  details > summary {
    display: block;
    color: var(--print-ink);
  }

  a {
    color: var(--print-ink);
    text-decoration: none;
  }

  body.stage-mode {
    background: var(--print-paper) !important;
    color: var(--print-ink) !important;
  }

  body.stage-mode .section-name,
  body.stage-mode .cue-item h3,
  body.stage-mode .chord-card pre,
  body.stage-mode .section-time,
  body.stage-mode .section-chords,
  body.stage-mode .section-keyboard,
  body.stage-mode .cue-item p,
  body.stage-mode .section-block .name,
  body.stage-mode .section-block .time,
  body.stage-mode .section-block .chords,
  body.stage-mode .section-block .bars,
  body.stage-mode .chord-card h3,
  body.stage-mode .timeline-hint,
  body.stage-mode .cue-chips > .mono {
    color: var(--print-ink) !important;
  }

  body.stage-mode .chord-card,
  body.stage-mode .section-row,
  body.stage-mode .section-block {
    background: var(--print-paper) !important;
    border-color: var(--print-line) !important;
  }

  body.stage-mode .cue-chip,
  body.stage-mode .cue-chip .mono,
  body.stage-mode .cue-item::before {
    color: var(--print-ink) !important;
    border-color: var(--print-line) !important;
  }

  body.stage-mode .cue-chip {
    background: var(--print-paper) !important;
  }

  body.stage-mode a,
  body.stage-mode .btn {
    color: var(--print-ink) !important;
  }

  .timeline {
    display: flex !important;
  }

  .mobile-bar {
    display: none !important;
  }

  .midi-player,
  #escuchar {
    display: none !important;
  }
}
