:root {
  --bg: #1C1510;
  --surface: #261D17;
  --surface-2: #31251D;
  --surface-3: #3D2E24;
  --border: rgba(245, 224, 194, 0.12);
  --text: #F7EFE4;
  --text-muted: #B9A896;
  --amber: #E8A849;
  --amber-glow: rgba(232, 168, 73, 0.25);
  --terracotta: #D96B38;
  --sage: #72A875;
  --danger: #E06C65;
  --radius: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100%;
  overscroll-behavior-y: contain;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(136px + env(safe-area-inset-bottom));
}

/* ---- Top Header ---- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(28, 21, 16, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.song-picker-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-select-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.song-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23E8A849' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text);
  border: 1px solid rgba(232, 168, 73, 0.35);
  border-radius: 10px;
  padding: 5px 30px 5px 10px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  min-height: 36px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.song-select:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.library-trigger, .landscape-trigger {
  min-height: 36px !important;
  min-width: 36px;
  padding: 6px 8px !important;
}

.landscape-trigger.active {
  background: rgba(232, 168, 73, 0.22);
  color: var(--amber);
  border-color: rgba(232, 168, 73, 0.55);
}

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

.header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chord-pill-group {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px 3px 4px;
}

.chord-badge {
  background: var(--amber);
  color: #1A120B;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 3px 9px;
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
}

.next-chord-chip {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
  background: var(--surface);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--border);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 4px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 34px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.active {
  background: var(--surface-3);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(232, 168, 73, 0.25);
}

/* ---- Main Views ---- */
.main-content {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.view.active {
  display: flex;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.card h2, .card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

/* ---- Buttons ---- */
.icon-btn, .pill-btn, .toggle-chip, .step-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.82rem;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:active, .pill-btn:active, .play-btn:active, .step-btn:active {
  transform: scale(0.96);
}

.mixer-trigger {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.pill-btn.primary {
  background: var(--amber);
  color: #1A120B;
  border-color: transparent;
}

.pill-btn.danger {
  border-color: rgba(224, 108, 101, 0.5);
  color: var(--danger);
}

.pill-btn.active, .toggle-chip.active, .toggle-btn.active {
  background: rgba(232, 168, 73, 0.18);
  color: var(--amber);
  border-color: rgba(232, 168, 73, 0.5);
}

/* ---- Section Strip & Drill Banner ---- */
.section-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.section-strip::-webkit-scrollbar { display: none; }

.section-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.section-chip.active {
  background: var(--terracotta);
  color: #FFF7EE;
  border-color: transparent;
}

.drill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(114, 168, 117, 0.14);
  border: 1px solid rgba(114, 168, 117, 0.4);
  border-radius: var(--radius);
  padding: 8px 12px;
}

.drill-banner-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.drill-tag {
  background: var(--sage);
  color: #112012;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.speed-trainer-pill {
  font-size: 0.74rem;
  color: var(--amber);
  background: rgba(232, 168, 73, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
}

.countin-banner {
  text-align: center;
  background: rgba(232, 168, 73, 0.2);
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: 12px;
  padding: 6px;
  font-size: 0.96rem;
  font-weight: 700;
}

/* ---- Continuous Horizontal Tab Ribbon ---- */
.tab-stage-card {
  padding: 10px 12px;
}

.tab-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stage-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-transform: uppercase;
}

.pattern-badge {
  font-size: 0.71rem;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: 999px;
}

.ab-loop-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ab-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 7px;
  cursor: pointer;
  min-height: 26px;
}

.ab-btn.active {
  background: rgba(114, 168, 117, 0.22);
  color: var(--sage);
  border-color: var(--sage);
}

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

.b-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.b-dot.half {
  width: 18px;
  font-size: 0.66rem;
  opacity: 0.8;
}

.b-dot.active {
  background: var(--amber);
  color: #1A120B;
  border-color: transparent;
  box-shadow: 0 0 12px var(--amber-glow);
}

.tab-ribbon {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.tab-bar-box {
  flex: 0 0 clamp(256px, 68vw, 310px);
  background: #140F0B;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.tab-bar-box.is-current {
  border-color: rgba(232, 168, 73, 0.72);
  box-shadow: 0 0 0 1px rgba(232, 168, 73, 0.24);
  background: #19120C;
}

.tab-bar-box.is-in-loop {
  border-color: rgba(114, 168, 117, 0.55);
}

.tab-bar-box.is-past {
  opacity: 0.52;
}

.tab-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 0.73rem;
}

.tab-box-head strong {
  color: var(--amber);
}

.tab-grid {
  display: grid;
  row-gap: 2px;
  align-items: center;
  font-family: var(--font-mono);
}

.tab-str-lbl {
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 700;
  text-align: center;
}

.tab-cell {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.tab-cell::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(245, 224, 194, 0.2);
  z-index: 0;
}

.tab-cell.beat-active {
  background: rgba(232, 168, 73, 0.14);
}

.note-pill {
  position: relative;
  z-index: 1;
  background: var(--surface-3);
  border: 1px solid rgba(232, 168, 73, 0.45);
  color: #FFF4E0;
  border-radius: 6px;
  padding: 0 4px;
  line-height: 18px;
  min-width: 20px;
  text-align: center;
  font-size: 0.78rem;
}

.note-pill.bass-hop {
  border-color: var(--terracotta);
  color: #FFC4A8;
}

.tab-cell.beat-active .note-pill {
  background: var(--amber);
  color: #1A120B;
  border-color: #FFF3DC;
  box-shadow: 0 0 12px var(--amber-glow);
  transform: scale(1.08);
}

.tab-pick-cell {
  text-align: center;
  font-size: 0.7rem;
  color: var(--sage);
  font-weight: 700;
  padding-top: 3px;
}

.tab-pick-cell.beat-active {
  color: var(--amber);
}

.rh-legend-row {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.rh-legend-row strong {
  color: var(--sage);
}

/* ---- Scrubber ---- */
.bar-scrubber-wrap {
  margin-top: 8px;
}

.bar-scrubber {
  display: flex;
  gap: 2px;
  height: 14px;
  align-items: center;
}

.scrub-seg {
  flex: 1;
  height: 7px;
  background: var(--surface-3);
  border-radius: 3px;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.scrub-seg.is-done {
  background: rgba(232, 168, 73, 0.42);
}

.scrub-seg.is-in-loop {
  background: rgba(114, 168, 117, 0.65);
}

.scrub-seg.is-active {
  height: 13px;
  background: var(--amber);
}

/* ---- Controls Strip ---- */
.controls-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
  min-height: 32px;
}

.seg-btn.active {
  background: var(--surface-3);
  color: var(--amber);
}

/* ---- Secondary Split Grid (Lyrics + Fretboard) ---- */
.play-secondary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ---- Auto-Scrolling Lyrics Window ---- */
.lyric-card {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  display: flex;
  flex-direction: column;
}

.lyric-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.coach-hint-inline {
  font-size: 0.74rem;
  color: var(--sage);
  font-weight: 600;
}

.lyrics-scroller {
  height: 120px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lyric-scroll-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  opacity: 0.6;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.lyric-scroll-row.is-upcoming {
  opacity: 0.85;
}

.lyric-scroll-row.is-active {
  opacity: 1;
  background: rgba(232, 168, 73, 0.14);
  border-color: rgba(232, 168, 73, 0.4);
}

.lyric-row-chord {
  min-width: 44px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--terracotta);
}

.lyric-scroll-row.is-active .lyric-row-chord {
  color: var(--amber);
}

.lyric-row-text {
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text);
}

.lyric-scroll-row.is-active .lyric-row-text {
  font-weight: 700;
  color: #FFF9EE;
}

/* ---- Fretboard Diagram ---- */
.fretboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.fretboard-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.slide-alert {
  background: rgba(217, 107, 56, 0.22);
  border: 1px solid var(--terracotta);
  color: #FFB28E;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.fretboard-svg-wrap {
  width: 100%;
  overflow: hidden;
}

.fretboard-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Drills View ---- */
.drills-top-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.switch-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.switch-card input {
  width: 20px;
  height: 20px;
  accent-color: var(--amber);
}

.switch-card span {
  display: flex;
  flex-direction: column;
}

.switch-card small {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.drills-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drill-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drill-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.drill-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--amber);
  padding: 3px 8px;
  border-radius: 999px;
}

/* ---- Full Tab View (Zero Sideways Scroll) ---- */
.fulltab-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fulltab-sub {
  margin: 0 0 10px;
}

.visual-fulltab {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fulltab-sec-title {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 0.88rem;
  font-weight: 800;
}

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

@media (min-width: 620px) {
  .fulltab-bars-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.fulltab-mini-bar {
  background: #140F0B;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px;
  cursor: pointer;
  min-width: 0;
}

.fulltab-mini-bar:hover {
  border-color: var(--amber);
}

.fulltab-mini-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.fulltab-mini-head strong {
  color: var(--amber);
}

.fulltab-mini-bar .tab-str-lbl {
  font-size: 0.62rem;
}

.fulltab-mini-bar .tab-cell {
  height: 17px;
  font-size: 0.68rem;
}

.fulltab-mini-bar .note-pill {
  font-size: 0.64rem;
  line-height: 14px;
  min-width: 14px;
  padding: 0 2px;
  border-radius: 4px;
}

.fulltab-mini-bar .tab-pick-cell {
  font-size: 0.58rem;
  padding-top: 2px;
}

.ascii-details {
  padding: 10px 14px;
}

.ascii-summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--amber);
  font-size: 0.92rem;
}

.ascii-tab-pre {
  background: #130E0A;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: clamp(9.5px, 2.55vw, 13px);
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  color: #F4E7D4;
  margin: 10px 0 0;
}

.tips-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-box {
  background: var(--surface-2);
  border-left: 3px solid var(--sage);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
}

.tip-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
  font-size: 0.9rem;
}

.tip-box p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.full-lyrics-map {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lyric-sec-block h4 {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 0.92rem;
}

.lyric-line-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(245, 224, 194, 0.06);
  font-size: 0.84rem;
}

.lyric-line-chord {
  min-width: 54px;
  color: var(--terracotta);
  font-weight: 800;
  font-family: var(--font-mono);
}

/* ---- Tuner View ---- */
.tuner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tuner-gauge {
  background: #140F0B;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  margin: 12px 0;
  text-align: center;
}

.tuner-note-readout {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
}

.tuner-freq-readout {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.tuner-meter-track {
  position: relative;
  height: 14px;
  background: var(--surface-2);
  border-radius: 999px;
  margin: 14px 0 6px;
  overflow: hidden;
}

.tuner-center-mark {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: var(--sage);
}

.tuner-needle {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 14px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
  transform: translateX(-50%);
  transition: left 0.08s linear, background 0.12s ease;
}

.tuner-cents-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.ref-strings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ref-string-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 62px;
}

.ref-string-btn strong {
  font-size: 1.15rem;
  color: var(--amber);
}

.ref-string-btn span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tap-tempo-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.tap-pad-btn {
  flex: 1;
  min-height: 64px;
  border: 2px solid var(--amber);
  background: rgba(232, 168, 73, 0.14);
  color: var(--amber);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 14px;
  cursor: pointer;
}

.tap-bpm-readout {
  min-width: 78px;
  text-align: center;
}

.tap-bpm-readout strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.tap-bpm-readout span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ---- Bottom Transport Dock ---- */
.transport-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(24, 18, 13, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 7px 14px calc(8px + env(safe-area-inset-bottom));
}

.transport-dock > * {
  max-width: 1092px;
  margin-left: auto;
  margin-right: auto;
}

.bpm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.speed-presets {
  display: inline-flex;
  gap: 3px;
  flex-shrink: 0;
}

.speed-pct-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 7px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
  min-height: 30px;
}

.speed-pct-btn.active {
  background: rgba(232, 168, 73, 0.22);
  color: var(--amber);
  border-color: rgba(232, 168, 73, 0.55);
}

.bpm-slider-wrap {
  flex: 1;
  min-width: 80px;
}

.bpm-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.bpm-label-row strong {
  color: var(--amber);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.step-btn {
  min-width: 38px;
  min-height: 32px;
  padding: 3px 6px;
  font-size: 0.76rem;
}

.transport-row {
  display: grid;
  grid-template-columns: 44px 60px 1fr 68px 62px;
  gap: 7px;
  align-items: center;
}

.play-btn {
  border: 0;
  background: linear-gradient(135deg, #F0B65A 0%, #D96B38 100%);
  color: #1A120B;
  font-weight: 800;
  font-size: 0.96rem;
  min-height: 44px;
  border-radius: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(217, 107, 56, 0.3);
}

.mute-tag {
  font-size: 0.72rem;
}

.icon-btn.is-muted {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---- Bottom Sheets (Mixer & Library) ---- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 50;
}

.mixer-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  max-height: 85dvh;
  overflow-y: auto;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto 10px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sheet-header h3 {
  margin: 0;
}

.library-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.library-note {
  margin: 8px 0 12px;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.library-song-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.library-song-card.is-active {
  border-color: var(--amber);
  background: rgba(232, 168, 73, 0.1);
}

.library-song-info {
  min-width: 0;
  flex: 1;
}

.library-song-info strong {
  display: block;
  font-size: 0.94rem;
}

.library-song-meta {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.library-song-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mixer-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
}

.slider-label strong {
  color: var(--amber);
}

.capo-pills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 4px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--surface-3);
  border: 1px solid var(--amber);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ---- Horizontal / Landscape Music-Stand Layout ---- */
@media (min-width: 620px), (orientation: landscape) {
  .app-shell {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .top-header {
    padding: calc(6px + env(safe-area-inset-top)) 14px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .brand-row {
    flex: 1.3;
    min-width: 0;
  }

  .tab-nav {
    margin-top: 0;
    flex: 1;
    max-width: 340px;
  }

  .song-meta {
    display: none;
  }

  .play-secondary-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: stretch;
  }

  .lyrics-scroller {
    height: 145px;
  }

  .tab-bar-box {
    flex: 0 0 clamp(225px, 28vw, 270px);
  }

  .transport-dock {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
  }

  .bpm-row {
    flex: 1.15;
    margin-bottom: 0;
  }

  .transport-row {
    flex: 1;
    grid-template-columns: 38px 54px 1fr 64px 58px;
  }

  .play-btn {
    min-height: 38px;
  }
}

@media (max-width: 440px) {
  .hide-on-tight {
    display: none;
  }
}

@media print {
  .top-header, .transport-dock, .controls-strip, .section-strip, .bar-scrubber-wrap {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card {
    border-color: #ccc;
    background: #fff;
  }
}
