/* Sidebar YouTube button style */
html { overflow-y: scroll; }

.yt-trigger-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 18px 0 14px 0;
  padding: 12px 18px;
  border-radius: 32px;
  border: 1.5px solid #ff6b6b;
  background: linear-gradient(90deg, rgba(255,40,40,0.13) 0%, rgba(255,40,40,0.08) 100%);
  color: #ff6b6b;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.yt-trigger-sidebar:hover {
  background: rgba(255,40,40,0.22);
  border-color: #ff6b6b;
  color: #fff;
}
.yt-trigger-sidebar .yt-icon {
  font-size: 1.2em;
  margin-right: 2px;
}
.yt-trigger-sidebar .yt-label {
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.01em;
}
/* ── YouTube panel ─────────────────────────────── */
.yt-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 50px;
  border: 1px solid rgba(255, 61, 61, 0.45);
  background: rgba(255, 40, 40, 0.1);
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.yt-trigger:hover {
  background: rgba(255, 40, 40, 0.2);
  border-color: rgba(255, 61, 61, 0.7);
}

.yt-icon {
  font-size: 12px;
}

.yt-panel {
  margin: 8px 0 18px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.yt-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}

.yt-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.yt-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yt-fulllink {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.yt-fulllink:hover {
  color: var(--gold-bright);
}

.yt-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.yt-close:hover {
  color: var(--text);
}

.spotify-panel {
  margin: 8px 0 18px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.spotify-embed {
  width: 100%;
  height: 152px;
  border: none;
  display: block;
}

.spotify-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.spotify-fulllink {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.spotify-fulllink:hover {
  color: #9ee3bf;
}

.spotify-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.spotify-close:hover {
  color: var(--text);
}
:root {
  --bg-top: var(--site-bg-top, #0c1d3f);
  --bg-bottom: var(--site-bg-bottom, #112244);
  --panel: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #f5f7fb;
  --muted: #b9c0cf;
  --gold: #e2b95f;
  --gold-bright: #f0c45b;
  --teal-active-chord-dot: #f0c45b;
  --dot: radial-gradient(circle at 28% 22%, #fff3b9, #f0c45b 72%);
  --dot-dim: radial-gradient(circle at 30% 24%, rgba(255, 245, 196, 0.88), rgba(196, 206, 224, 0.52) 78%);
  --grid: rgba(255, 255, 255, 0.08);
  --barline: rgba(255, 255, 255, 0.22);
  --active-glow: rgba(240, 196, 91, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 0;
  animation: none !important;
  transform: none !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.14), transparent 28%),
    radial-gradient(circle at 70% 80%, rgba(240, 196, 91, 0.07), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page-brand {
  max-width: 1320px;
  margin: 0 auto 14px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(19, 39, 70, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(10, 20, 50, 0.18);
  margin: 0 0 14px;
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.nav-inner {
  max-width: 1320px;
  width: 100%;
  height: 64px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.logo-dot {
  color: var(--text);
}

.logo-beat {
  color: var(--gold);
}

.logo-tm {
  display: inline-block;
  margin-left: 1px;
  font-size: 13px;
  color: var(--text);
  opacity: 0.9;
  vertical-align: text-top;
  transform: translateY(-0.14em);
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.14s;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.nav-link.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(240, 196, 91, 0.18), rgba(240, 196, 91, 0.08));
  border-color: rgba(240, 196, 91, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 20px rgba(15, 23, 42, 0.16);
}

.layout {
  max-width: 1320px;
  margin: 0 auto;
  display: block;
}

.sheet {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border-radius: 24px;
  padding: 26px 28px 22px;
  min-width: 340px;
}



.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 4px;
}

.header-card {
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.title-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-bottom: 8px;
}

.title-card-mobile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.instruction-card {
  display: grid;
  gap: 6px;
  align-content: start;
}

.title-card h1 {
  margin: 0 0 4px;
  line-height: 1.06;
}

.instruction-card-label {
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.instruction-card-copy,
.instruction-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.instruction-card-disclaimer {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.instruction-card-copy strong {
  color: var(--text);
}

.instruction-card-note {
  color: rgba(245, 247, 251, 0.82);
}

.title-block h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 100px;
  background: rgba(90, 170, 220, 0.13);
  border: 1px solid rgba(90, 170, 220, 0.22);
  color: var(--muted);
  font-size: 13px;
}

.meta-pill strong {
  color: var(--gold-bright);
}

.song-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.song-meta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -2px;
}

.title-card-note {
  margin: 6px 0 0;
  max-width: 62ch;
  color: rgba(245, 247, 251, 0.76);
  font-size: 13px;
  line-height: 1.5;
}

.song-meta strong {
  color: var(--gold-bright);
  font-weight: 700;
}

.yt-trigger-inline {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.yt-trigger-circle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  margin-top: 0;
  border-radius: 50%;
  justify-content: center;
}

.yt-trigger-circle .yt-icon {
  margin: 0;
  font-size: 13px;
}

.yt-trigger-circle .yt-icon-img {
  width: 22px;
  height: 22px;
  display: block;
  opacity: 0.8;
  filter: saturate(0.66) brightness(0.8);
  transition: opacity 120ms ease, filter 120ms ease;
}

.yt-trigger-circle.is-open {
  box-shadow: 0 0 0 2px rgba(255, 61, 61, 0.28) inset;
}

.yt-trigger-circle:hover .yt-icon-img,
.yt-trigger-circle:focus-visible .yt-icon-img {
  opacity: 0.9;
  filter: saturate(0.78) brightness(0.88);
}

.music-link-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  appearance: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.music-link-circle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.34);
}

.spotify-link-circle img {
  width: 22px;
  height: 22px;
  display: block;
  opacity: 0.8;
  filter: saturate(0.66) brightness(0.8);
  transition: opacity 120ms ease, filter 120ms ease;
}

.spotify-link-circle:hover img,
.spotify-link-circle:focus-visible img {
  opacity: 0.9;
  filter: saturate(0.78) brightness(0.88);
}

.spotify-link-circle.is-open {
  box-shadow: 0 0 0 2px rgba(30, 215, 96, 0.22) inset;
  border-color: rgba(30, 215, 96, 0.4);
  background: rgba(30, 215, 96, 0.08);
}

.yt-actions-inline {
  display: flex;
  align-items: center;
  width: auto;
  gap: 8px;
  justify-content: flex-start;
}

.yt-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.yt-launch-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(145, 186, 224, 0.26);
  background: rgba(90, 170, 220, 0.1);
  color: rgba(223, 236, 251, 0.86);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  margin-left: 2px;
}

.yt-launch-link:hover {
  background: rgba(90, 170, 220, 0.24);
  border-color: rgba(90, 170, 220, 0.5);
  color: #fff;
}

.yt-fallback-hint {
  margin: 6px 0 0;
  color: rgba(214, 229, 247, 0.68);
  font-size: 11px;
  line-height: 1.35;
}

.title-card .yt-actions-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yt-fallback-hint strong {
  color: rgba(195, 220, 248, 0.9);
  font-weight: 700;
}

.playbar-restore-btn {
  position: sticky;
  top: 78px;
  z-index: 40;
  display: block;
  margin-bottom: 18px;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid rgba(240, 196, 91, 0.22);
  background: rgba(8, 22, 52, 0.92);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.playbar-restore-btn:hover {
  color: var(--text);
  border-color: rgba(240, 196, 91, 0.42);
}

.sticky-playbar {
  position: sticky;
  top: 78px;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 16px 18px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(23, 42, 74, 0.93), rgba(16, 33, 62, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 36px rgba(4, 10, 24, 0.32);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.sticky-playbar-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
  justify-items: end;
}

.live-chord-card {
  min-width: 130px;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.live-chord-card-next {
  background: rgba(255, 255, 255, 0.04);
}

.live-chord-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-chord-name {
  color: var(--teal-active-chord-dot);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.live-chord-name.is-pickup {
  color: rgba(245, 247, 251, 0.7);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.live-chord-name-next {
  color: var(--text);
  font-size: 24px;
}

.live-chord-diagram-wrap {
  display: grid;
  place-items: center;
  min-height: 90px;
  margin-top: 10px;
}

.live-chord-card .chord-diagram {
  width: 72px;
  height: 88px;
}

.sticky-playbar-main,
.sticky-control-meta,
.sticky-control-actions,
.sticky-control-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sticky-control-meta,
.sticky-control-actions,
.sticky-control-toggles {
  justify-content: flex-end;
  min-width: 0;
}

.sticky-control-keytime {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.song-index-button {
  appearance: none;
  cursor: pointer;
}

.sticky-control-meta > *,
.sticky-control-actions > *,
.sticky-control-toggles > * {
  flex: 0 0 auto;
}

.sticky-control-toggles .toggle {
  gap: 8px;
}

.pattern-preview-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.pattern-preview-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pattern-preview-select {
  min-height: 40px;
  min-width: 180px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 22, 52, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.title-card-mobile-pattern {
  display: none;
}

.sticky-control-toggles .song-index-button {
  width: auto;
  max-width: 170px;
  min-height: 42px;
  padding: 0 14px;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 100px;
  background: rgba(90, 170, 220, 0.13);
  border: 1px solid rgba(90, 170, 220, 0.22);
  color: var(--text);
  font-size: 14px;
}

.context-pill strong {
  color: var(--gold-bright);
}

.sticky-playbar-controls #playBtn,
.sticky-playbar-controls #stopBtn {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  flex: 0 0 120px;
}

.chord-drawer {
  margin: 12px 0 18px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.chord-reference-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.chord-reference-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.chord-drawer-close {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.chord-list-inline {
  grid-template-columns: repeat(auto-fill, 180px);
  justify-content: start;
  align-items: start;
  gap: 12px;
}

.chord-list-inline .chord-card {
  width: 180px;
  max-width: 180px;
  justify-self: start;
  justify-items: center;
}

.chord-list-inline .chord-card {
  padding: 12px 12px 10px;
}

.chord-list-inline .chord-card-name {
  margin-bottom: 6px;
  justify-self: start;
}

.chord-list-inline .chord-card-meta {
  margin-top: 6px;
  justify-self: center;
}

.chord-list-inline .chord-diagram {
  width: 72px;
  height: 88px;
}

@media (max-width: 760px) {
  .chord-list-inline {
    grid-template-columns: minmax(0, 1fr);
  }

  .chord-list-inline .chord-card {
    width: 100%;
    max-width: none;
  }
}

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

.btn {
  border: 0;
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover {
  transform: none;
}

.btn-play {
  min-width: 116px;
  min-height: 42px;
  padding: 0 16px;
  font-size: 15px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #74d8d0, #58b8b0);
  color: #0d3533;
  box-shadow: 0 14px 28px rgba(88, 184, 176, 0.18), 0 0 24px rgba(88, 184, 176, 0.14);
}

.btn-stop {
  min-width: 88px;
  min-height: 42px;
  padding: 0 16px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-dev {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-dev:hover,
.btn-dev.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.tempo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 14px;
}

.tempo-label {
  color: rgba(245, 247, 251, 0.78);
  font-size: 13px;
  font-weight: 600;
}

.tempo-readout {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.tempo-slider {
  width: 96px;
  accent-color: #2a9db5;
  cursor: pointer;
}

.tempo-btn {
  border: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.tempo-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.toggle input[type="checkbox"] {
  accent-color: var(--gold-bright);
  cursor: pointer;
}

.song-index-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(90, 170, 220, 0.13);
  border: 1px solid rgba(90, 170, 220, 0.22);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.source-panel {
  margin: -4px 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.source-panel-title {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--gold-bright);
}

.source-grid {
  display: grid;
  gap: 8px;
}

.source-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.source-row strong {
  color: var(--text);
}

.context-pill-pattern {
  gap: 10px;
  max-width: 340px;
}

.context-pill-main {
  font-weight: 600;
}

.context-pill-sub {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.transport-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.transport-group .btn {
  min-width: 150px;
}

.song-index-link strong {
  color: var(--gold-bright);
}

.instruction {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.next-step-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -6px 0 22px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.next-step-prompt.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.next-step-copy {
  display: grid;
  gap: 4px;
}

.next-step-copy strong {
  color: var(--gold-bright);
  font-size: 14px;
}

.next-step-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.next-step-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.next-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.song-end-actions {
  margin: 18px 0 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.next-step-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.section + .section {
  margin-top: 14px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-title span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.song-line {
  padding: 8px 10px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 180ms ease, background 180ms ease;
}

.song-line.is-active {
  border-color: rgba(242, 196, 76, 0.2);
  background: linear-gradient(180deg, rgba(242, 196, 76, 0.06), rgba(255, 255, 255, 0.015));
}

.song-line + .song-line {
  margin-top: 18px;
}

.measures {
  --measure-gap: 10px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--measure-gap);
}

.lyrics-track {
  display: flex;
  width: 100%;
  margin-top: 6px;
  gap: var(--measure-gap, 10px);
}

.song-line.lyric-only .lyrics-track {
  margin-top: 0;
}

.lyrics-track-plain {
  display: block;
}

.lyrics-track-grid {
  display: grid;
  gap: var(--measure-gap, 10px);
  align-items: start;
}

.lyric-slot {
  flex: 0 0 calc(((100% - (3 * var(--measure-gap, 10px))) / 4) * var(--measure-ratio, 1));
  min-width: 0;
}

.line-playhead {
  position: absolute;
  top: 0;
  height: 0;
  width: 2px;
  z-index: 8;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(250, 250, 255, 0.42), rgba(240, 196, 91, 0.28));
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition: opacity 0.15s ease;
}

.measure {
  position: relative;
  min-width: 0;
  flex: 0 0 calc(((100% - (3 * var(--measure-gap))) / 4) * var(--measure-ratio, 1));
  padding: 36px 8px 0 0;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.measure.pickup {
  opacity: 0.94;
}

.measure.pickup[data-chord=""] {
  padding-top: 12px;
}

.measure.pickup[data-chord=""] .chord-rail {
  min-height: 8px;
}

.measure.pickup[data-chord=""] .timeline {
  min-height: 46px;
  padding-top: 0;
}

.measure.pickup[data-chord=""] .timeline::before {
  top: 6%;
  height: 82%;
}

.measure.pickup .timeline::before {
  content: "";
  position: absolute;
  top: 12%;
  left: 0;
  width: 1px;
  height: 76%;
  background: rgba(255, 255, 255, 0.09);
}

.measure.current {
  box-shadow: 0 10px 22px rgba(240, 196, 91, 0.08);
  transform: translateY(-1px);
}

.measure.current .chord-change {
  color: var(--teal-active-chord-dot) !important;
}

.chord-rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 8px;
  min-height: 28px;
}

.chord-change {
  position: absolute;
  top: 0;
  left: calc((var(--chord-step, 1) - 0.5) * (100% / var(--timeline-steps, 8)));
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  color: rgba(208, 230, 248, 0.92);
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.chord-change:hover,
.chord-change:focus-visible {
  color: rgba(236, 248, 255, 0.98);
  text-decoration: none;
  outline: none;
}

.chord-helper-bubble {
  position: absolute;
  z-index: 1200;
  width: 132px;
  padding: 10px 10px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(18, 34, 60, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

.chord-helper-name {
  margin-bottom: 6px;
  color: var(--gold-bright);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.chord-helper-diagram {
  display: flex;
  justify-content: center;
}

.chord-helper-diagram .chord-diagram {
  width: 78px;
  height: 94px;
}

.chord-change.is-late {
  top: 2px;
  font-size: 17px;
  color: rgba(214, 236, 252, 0.95);
}

.chord-change.is-late::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 1px;
  height: 14px;
  transform: translateX(-50%);
  background: rgba(218, 236, 255, 0.5);
  box-shadow: none;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--timeline-steps, 8), minmax(0, 1fr));
  grid-template-rows: 1fr;
  align-items: start;
  min-height: 54px;
  gap: 4px;
  padding-top: 14px;
  padding-right: 4px;
  overflow: hidden;
  white-space: nowrap;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--beat-width, 25%) - 1px),
      rgba(255, 255, 255, 0.04) calc(var(--beat-width, 25%) - 1px),
      rgba(255, 255, 255, 0.04) var(--beat-width, 25%)
    );
}

.timeline::after {
  content: "";
  position: absolute;
  top: 10%;
  right: 0;
  width: 2px;
  height: 80%;
  background: rgba(218, 236, 255, 0.42);
  z-index: 2;
}

.timeline::before {
  content: none;
}

.rest-slot {
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  transform: translateY(18px);
  color: rgba(255, 255, 255, 0.38);
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

.stroke {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 3px;
  margin-top: 0;
  opacity: 0.92;
  transition: transform 0.14s ease, opacity 0.14s ease;
  grid-row: 1;
}

.stroke-dot {
  width: var(--dot-size, 12px);
  height: var(--dot-size, 12px);
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.58);
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

/* Direction-based dot colors and sizes — mirrors patterns page */
.timeline .stroke .stroke-dot {
  width: 13px;
  height: 13px;
}

.timeline .stroke.down .stroke-dot {
  width: 17px;
  height: 17px;
  background: radial-gradient(circle at 28% 22%, #ecfccb, #65a30d 76%);
  box-shadow: 0 0 0 1px rgba(220, 252, 180, 0.6);
}

.timeline .stroke.up .stroke-dot {
  background: radial-gradient(circle at 28% 22%, #bfdbfe, #2563eb 76%);
  box-shadow: 0 0 0 1px rgba(191, 219, 254, 0.62);
}

.timeline .stroke.mute .stroke-dot {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(240, 196, 91, 0.94) 0%, rgba(180, 115, 21, 0.98) 100%);
  box-shadow: 0 0 0 1px rgba(255, 243, 210, 0.58);
}

.stroke-label {
  color: rgba(255, 248, 225, 0.92);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
}

.stroke.ghost {
  opacity: 0.05;
}

.stroke.ghost .stroke-dot {
  background: rgba(10, 20, 40, 0.08);
  box-shadow: none;
}

.stroke.light .stroke-dot {
  opacity: 0.78;
}

.stroke.ghost .stroke-label {
  color: rgba(10, 20, 40, 0.06);
}

.stroke.strong .stroke-label {
  color: rgba(255, 240, 183, 0.98);
}

.stroke.light .stroke-label {
  color: rgba(255, 251, 233, 0.78);
}

.stroke.mute .stroke-label {
  font-size: 13px;
  font-weight: 800;
}

.stroke.active {
  opacity: 1;
  transform: translateY(-1px);
}

.stroke.active .stroke-dot {
  background: var(--teal-active-chord-dot);
  box-shadow: 0 0 0 1px rgba(255, 233, 176, 0.72);
  transform: scale(1.08);
}

.stroke.ghost.active .stroke-dot {
  background: rgba(10, 20, 40, 0.08);
  box-shadow: none;
  transform: none;
}

.stroke.active .stroke-label {
  color: var(--teal-active-chord-dot);
}

/* Rest strokes: dash and muted arrow, no dot */
.stroke.rest .stroke-dot {
  display: none;
}

.stroke.rest .stroke-dash {
  display: block;
  opacity: 0.25;
  color: rgba(255, 255, 255, 0.25);
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
}

.stroke.rest .stroke-label {
  opacity: 0.25;
}

.stroke.rest.active {
  transform: none;
}

.stroke.rest.active .stroke-dot {
  background: var(--dot-dim);
  box-shadow: none;
  transform: none;
  opacity: 0.30;
}

.stroke.rest.active .stroke-label {
  color: rgba(255, 255, 255, 0.40);
}

.lyrics {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.54;
  letter-spacing: 0.014em;
  word-spacing: 0.07em;
  transition: color 180ms ease;
}

.lyrics-full {
  display: block;
  width: 100%;
  max-width: none;
}

.lyrics-cell {
  min-width: 0;
  padding-right: 6px;
}

.song-line.is-active .lyrics {
  color: var(--text);
}

.sidebar-title {
  margin: 0 0 12px;
  color: var(--gold-bright);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chord-list {
  display: grid;
  gap: 12px;
}

.chord-card {
  display: grid;
  justify-items: center;
  border-radius: 16px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.chord-card.active {
  background: rgba(240, 196, 91, 0.08);
  border-color: rgba(240, 196, 91, 0.42);
  box-shadow: 0 12px 28px rgba(240, 196, 91, 0.12);
  transform: translateY(-1px);
}

.chord-card-name {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  justify-self: start;
}

.chord-card-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  justify-self: center;
  text-align: center;
}

.chord-diagram {
  width: 92px;
  height: 114px;
  max-width: none;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.diagram-grid,
.diagram-top {
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 1.4;
}

.diagram-top {
  stroke-width: 2.4;
}

.diagram-dot {
  fill: var(--gold-bright);
}

#currentChordDiagram .diagram-dot,
.chord-card.active .diagram-dot {
  fill: var(--teal-active-chord-dot) !important;
}

.diagram-finger {
  fill: #1b2137;
  font-size: 8px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.diagram-open {
  fill: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  text-anchor: middle;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .chord-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .layout {
    padding: 0 8px;
  }

  .sheet {
    width: 100%;
    min-width: 0;
    padding: 22px 20px 20px;
  }

  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .title-row {
    grid-template-columns: 1fr;
  }

  .yt-actions-inline {
    flex-wrap: wrap;
  }

  .yt-launch-link {
    margin-left: 0;
  }

  .song-meta {
    text-align: left;
  }

  .controls {
    gap: 10px;
  }

  .sticky-playbar,
  .chord-reference-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-playbar {
    top: 96px;
    gap: 12px;
    padding: 16px;
    background: rgba(10, 22, 46, 0.94);
    box-shadow: 0 14px 30px rgba(4, 10, 24, 0.22);
  }

  .sticky-playbar-main,
  .sticky-playbar-controls {
    width: 100%;
  }

  .sticky-playbar-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .live-chord-card {
    min-width: 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.025);
    box-shadow: none;
  }

  .live-chord-card-next {
    background: rgba(255, 255, 255, 0.015);
  }

  .live-chord-diagram-wrap {
    min-height: 84px;
    margin-top: 6px;
  }

  .live-chord-card .chord-diagram {
    width: 68px;
    height: 84px;
  }

  .live-chord-name {
    font-size: 30px;
  }

  .live-chord-name-next {
    font-size: 22px;
  }

  .sticky-playbar-controls {
    justify-items: stretch;
    gap: 8px;
  }

  .sticky-control-meta,
  .sticky-control-actions,
  .sticky-control-toggles {
    justify-content: flex-start;
    width: 100%;
  }

  .sticky-control-keytime {
    width: 100%;
  }

  .sticky-control-keytime .context-pill {
    flex: 1 1 0;
    min-width: 0;
  }

  .sticky-control-meta > .context-pill-pattern {
    width: 100%;
  }

  .sticky-control-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .tempo-pill,
  .transport-group,
  .sticky-control-toggles .song-index-button {
    width: 100%;
  }

  .tempo-pill {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    min-height: 42px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.03);
  }

  .context-pill,
  .song-index-link {
    background: rgba(90, 170, 220, 0.13);
    box-shadow: none;
  }

  .tempo-readout {
    justify-self: end;
  }

  .tempo-slider {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0 8px;
  }

  .tempo-btn {
    display: none;
  }

  .transport-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .transport-group .btn {
    min-width: 0;
    width: 100%;
    min-height: 42px;
  }

  .sticky-playbar-controls #playBtn,
  .sticky-playbar-controls #stopBtn {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    min-height: 42px;
  }

  .sticky-control-toggles {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 8px;
    align-items: center;
  }

  .sticky-control-toggles .song-index-button {
    grid-column: 1 / -1;
    max-width: none;
    justify-content: center;
  }

  .pattern-preview-control {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }

  .pattern-preview-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .toggle {
    min-height: 40px;
    font-size: 13px;
    white-space: nowrap;
  }

  .source-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .btn,
  .tempo-pill,
  .song-index-link {
    min-height: 44px;
  }

  .btn-play {
    min-width: 132px;
    min-height: 46px;
    font-size: 16px;
  }

  .meta-grid {
    gap: 6px;
  }

  .next-step-prompt {
    align-items: flex-start;
  }

  .meta-pill {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .song-line {
    background: rgba(255, 255, 255, 0.018);
    box-shadow: none;
  }

  .measures,
  .lyrics-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .measure,
  .lyric-slot {
    min-width: 0;
    width: auto;
    flex: none;
    grid-column: span var(--measure-span, 2);
  }

  .measure {
    padding-right: 0;
  }

  .song-line.lyric-only .lyrics-track {
    display: block;
    grid-template-columns: none;
  }
}

@media (max-width: 560px) {
  body {
    padding: 12px;
  }

  .layout {
    padding: 0 6px;
  }

  .sheet {
    width: 100%;
    min-width: 0;
    padding: 18px 16px;
  }

  .sticky-playbar.is-fixed-mobile {
    position: fixed;
    z-index: 120;
    margin-bottom: 0;
    max-height: calc(100svh - 84px);
    overflow-y: auto;
  }

  .title-block h1 {
    font-size: 28px;
  }

  .title-card-mobile-pattern {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
  }

  .title-card-mobile-pattern-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .title-card-mobile-pattern-select {
    min-height: 40px;
    width: 100%;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(8, 22, 52, 0.88);
    color: var(--text);
    font: inherit;
    font-size: 13px;
  }

  .subtitle,
  .instruction,
  .lyrics {
    font-size: 16px;
  }

  .brand {
    font-size: 22px;
  }

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

  .live-chord-name {
    font-size: 28px;
  }

  .live-chord-name-next {
    font-size: 21px;
  }

.tempo-unit {
    display: none;
  }

  .tempo-pill {
    font-size: 13px;
  }

  .tempo-readout {
    gap: 2px;
  }

  /* Compact sticky bar on phones */
  .sticky-playbar-main {
    display: none;
  }
  .live-chord-diagram-wrap {
    display: none;
  }

  .live-chord-label {
    display: none;
  }

  .live-chord-card {
    padding: 8px 10px;
  }

  .live-chord-name {
    font-size: 26px;
  }

  .live-chord-name-next {
    font-size: 19px;
  }

  .sticky-control-meta {
    display: none;
  }
}
