/* ──────────────────────────────────────────────────────────────────────
   TabForge — dark studio theme
   Near-black DAW chrome, electric-lime accent, glass panels. The score sheet
   stays light "paper" because alphaTab renders black notation that would be
   invisible on a dark background.
   ────────────────────────────────────────────────────────────────────── */

:root {
  --bg:        #08080a;
  --bg-1:      #0e0e11;   /* rail / large panels */
  --bg-2:      #15151a;   /* raised cards */
  --bg-3:      #1c1c22;   /* inputs / controls */
  --bg-hover:  #232329;

  --line:        rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text:   #f4f4f6;
  --text-2: #a6a6b0;
  --text-3: #858590;

  --accent:       #c5f048;   /* electric lime */
  --accent-soft:  rgba(197, 240, 72, 0.14);
  --accent-press: #b2e02f;
  --accent-ink:   #14180a;   /* text on the accent */

  --amber:  #f5b945;
  --danger: #ff6b6b;
  --ok:     var(--accent);

  --paper:     #f7f5ee;      /* score sheet */
  --paper-ink: #15130d;

  --radius:    16px;
  --radius-sm: 11px;
  --radius-xs: 8px;

  --rail-w: 304px;

  --font-ui:   "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow:    0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 8px 24px -16px rgba(0, 0, 0, 0.7);
  --glow:      0 0 0 1px rgba(197, 240, 72, 0.25), 0 8px 28px -10px rgba(197, 240, 72, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px;
}
/* Make the [hidden] attribute authoritative — several sections set an explicit
   display (flex/grid) which would otherwise beat the UA [hidden] rule and keep
   a "hidden" element visible (e.g. the score/transport behind the UG reader). */
[hidden] { display: none !important; }

body {
  background:
    radial-gradient(1100px 600px at 78% -8%, rgba(197, 240, 72, 0.06), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, rgba(120, 120, 255, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent-soft); }

/* ── App shell ───────────────────────────────────────────────────────── */

.app {
  display: block;
  min-height: 100vh;
}

/* ── Left rail ───────────────────────────────────────────────────────── */

.rail {
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  border-right: 1px solid var(--line);
  padding: 22px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: min(370px, calc(100vw - 24px));
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(calc(-100% - 20px));
  visibility: hidden;
  transition: transform 180ms ease, visibility 180ms;
  box-shadow: 24px 0 70px rgba(0, 0, 0, 0.62);
}
.rail.is-open { transform: translateX(0); visibility: visible; }
.rail-browser-slot {
  display: none;
  min-width: 0;
  min-height: 0;
}
.rail.browser-mounted {
  width: min(780px, calc(100vw - 18px));
  overflow: hidden;
}
.rail.browser-mounted .rail-browser-slot {
  display: flex;
  flex: 1;
}
.rail.browser-mounted > .search,
.rail.browser-mounted > #searchSection,
.rail.browser-mounted > .rail-section.library {
  display: none;
}
.rail.browser-mounted .browse {
  width: 100%;
  min-height: 0;
  gap: 10px;
}
.rail.browser-mounted .browse-title,
.rail.browser-mounted #browseClose,
.rail.browser-mounted .browse-tools > a,
.rail.browser-mounted .install-app {
  display: none !important;
}
.rail.browser-mounted .browse-head,
.rail.browser-mounted .browse-tools {
  width: 100%;
}
.rail.browser-mounted .browse-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.rail.browser-mounted .browse-tools input[type="search"] {
  width: 100%;
  max-width: none;
}
.rail.browser-mounted .browse-modes {
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.rail.browser-mounted .browse-body {
  padding: 0 4px 16px 0;
}
.rail.browser-mounted .browse-group > h3 {
  background: linear-gradient(rgba(12,12,15,.985) 72%, transparent);
}
.rail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  border: 0;
  padding: 0;
  background: rgba(3, 3, 5, 0.68);
  backdrop-filter: blur(3px);
  cursor: default;
}
.rail-backdrop[hidden] { display: none; }
body.rail-open { overflow: hidden; }
.rail::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.rail::-webkit-scrollbar-track { background: transparent; }

.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 2px;
}
.rail-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
}
.rail-close:hover { color: var(--text); border-color: var(--line-strong); }
.brand-home {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.logomark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: var(--glow);
}
.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-text p {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 2px;
}

/* Search */
.search {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 40px 36px;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 6px 4px 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  border-color: rgba(197, 240, 72, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-icon { text-align: center; color: var(--text-3); font-size: 16px; }
.search input {
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 2px;
  color: var(--text);
  min-width: 0;
}
.search input::placeholder { color: var(--text-3); }
.search button {
  border: none;
  background: var(--bg-hover);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.search button:hover { background: var(--accent); color: var(--accent-ink); }
.search .ug-quick-fetch {
  width: 36px;
  margin-right: 3px;
  background: rgba(255, 107, 53, 0.13);
  color: #ff8a5c;
  font: 700 10px/1 var(--font-ui);
  letter-spacing: 0.03em;
}
.search .ug-quick-fetch:hover {
  background: #ff6b35;
  color: #fff;
}
.search .ug-quick-fetch:disabled {
  cursor: wait;
  opacity: 0.75;
}

/* Rail sections */
/* Sections take their natural height and the rail itself scrolls — using
   flex:1 here squished the library when search results were open, so its rows
   overflowed and overlapped the footer. */
.rail-section { display: flex; flex-direction: column; gap: 10px; flex: none; }
.rail-section h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}
.rail-section h2 .ord { color: var(--accent); }
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  border-radius: var(--radius-xs);
  min-height: 32px;
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.14s;
}
.rail-section h2 .upload-btn:first-of-type { margin-left: auto; }
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }

.result-list, .library-list { display: flex; flex-direction: column; gap: 4px; }

.library-controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 4px; }
.library-controls input, .library-controls select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  min-width: 0;
}
.library-controls input:focus, .library-controls select:focus { border-color: rgba(197,240,72,0.5); }
.library-controls select { cursor: pointer; }
.library-empty { padding: 14px 8px; color: var(--text-3); font-size: 12.5px; font-style: italic; }
.library-more {
  padding: 10px 8px 2px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.45;
}
.library-more a { color: var(--accent); text-decoration: none; }
.library-more a:hover { text-decoration: underline; }
.setlist-list { display: grid; gap: 6px; }
.setlist-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  overflow: hidden;
}
.setlist-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}
.setlist-card > summary::-webkit-details-marker { display: none; }
.setlist-card > summary strong { font-size: 12px; }
.setlist-card > summary span { color: var(--text-3); font: 9px var(--font-mono); }
.setlist-songs { display: grid; border-top: 1px solid var(--line); }
.setlist-song {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: stretch;
  min-height: 40px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}
.setlist-song > button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.setlist-song > button:hover { color: var(--accent); background: var(--bg-hover); }
.setlist-song > button:disabled { opacity: .25; cursor: default; }
.setlist-open {
  min-width: 0;
  padding: 7px 9px;
  overflow-wrap: anywhere;
  text-align: left;
}
.setlist-open small { display: block; margin-top: 2px; color: var(--text-3); }
.setlist-actions { display: flex; gap: 5px; padding: 7px; }
.setlist-actions button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 10px;
  cursor: pointer;
}
.setlist-actions button:first-child { flex: 1; }
.setlist-actions button:disabled { opacity: .35; cursor: default; }
.offline-storage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 4px 5px;
  color: var(--text-3);
  font: 9px/1.3 var(--font-mono);
}
.offline-storage button {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 9px;
  cursor: pointer;
}
.offline-storage button:hover { color: var(--danger); }
.search-warning {
  margin-bottom: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: var(--radius-xs);
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  font-size: 11.5px;
}

.library-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px; }
.library-row .library-item { flex: none; }
.fav-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.14s, background 0.14s;
}
.fav-btn:hover { background: var(--bg-2); color: var(--accent); }
.fav-btn.active { color: var(--accent); }
.title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.title-row .title { min-width: 0; }
.song-favorite {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font: 24px/1 var(--font-ui);
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s, transform .1s;
}
.song-favorite:hover,
.song-favorite:focus-visible {
  border-color: rgba(197,240,72,.4);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}
.song-favorite:active { transform: scale(.92); }
.song-favorite.is-favorite {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(197,240,72,.24);
}
.song-favorite:disabled { opacity: .45; cursor: wait; }

/* Result + library items share a card look */
.result-item, .library-item {
  text-align: left;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.14s, border-color 0.14s, transform 0.08s;
}
.library-item { color: inherit; text-decoration: none; }
.result-item:hover, .library-item:hover { background: var(--bg-2); border-color: var(--line); }
.result-item:active, .library-item:active { transform: scale(0.99); }
.library-item.is-active {
  background: var(--accent-soft);
  border-color: rgba(197, 240, 72, 0.35);
}
.result-item.is-loading { opacity: 0.55; pointer-events: none; }
.result-item.is-loading::after {
  content: "importing…";
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

.result-title, .library-title {
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-artist, .library-artist {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-meta, .library-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.src-badge {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  flex: none;
}
.src-gp { background: var(--accent); color: var(--accent-ink); }       /* real GP file = best */
.src-ss { background: var(--bg-hover); color: var(--text-2); }
.src-ug { background: #ff6b35; color: #fff; }
.ug-fetch {
  margin-bottom: 4px;
  border-color: rgba(255,107,53,.38);
  background: rgba(255,107,53,.07);
}
.ug-fetch:hover { border-color: rgba(255,107,53,.75); background: rgba(255,107,53,.12); }
.search-empty {
  padding: 8px 12px;
  color: var(--text-3);
  font-size: 12px;
  font-style: italic;
}

.recent-line {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 2px 6px;
}
.recent-chip {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.14s;
  text-decoration: none;
}
.recent-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Rail footer / status */
.rail-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}
.rail-status { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-3);
  flex: none;
  box-shadow: 0 0 0 0 transparent;
}
.status-idle { background: var(--text-3); }
.status-ok   { background: var(--accent); box-shadow: 0 0 10px rgba(197, 240, 72, 0.7); }
.status-busy { background: var(--amber); animation: pulse 1s ease-in-out infinite; }
.status-err  { background: var(--danger); box-shadow: 0 0 10px rgba(255, 107, 107, 0.6); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Recent activity stays available while a score is playing, rather than
   replacing the workspace and interrupting practice. */
.activity-panel {
  position: fixed;
  z-index: 50;
  inset: 14px 14px 14px auto;
  width: min(470px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(14, 14, 17, 0.97);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(20px);
}
.activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.activity-head h2 { margin-top: 2px; font-size: 22px; letter-spacing: -0.02em; }
.activity-kicker {
  font: 10px/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.activity-actions { display: flex; gap: 7px; }
.activity-help,
.activity-empty { color: var(--text-3); font-size: 12px; }
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
}
.activity-item {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.activity-mark {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--text-3);
}
.activity-item.is-busy .activity-mark { background: var(--amber); animation: pulse 1s ease-in-out infinite; }
.activity-item.is-ok .activity-mark { background: var(--accent); }
.activity-item.is-error .activity-mark { background: var(--danger); }
.activity-message { color: var(--text); font-size: 13px; overflow-wrap: anywhere; text-decoration: none; }
a.activity-message:hover { color: var(--accent); text-decoration: underline; }
.activity-detail {
  margin-top: 3px;
  color: var(--text-3);
  font: 10.5px/1.45 var(--font-mono);
  overflow-wrap: anywhere;
}
.activity-time {
  color: var(--text-3);
  font: 10px/1.5 var(--font-mono);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .activity-panel { inset: 0; width: 100vw; border-radius: 0; padding: 16px 13px; }
  .activity-head { flex-direction: column; }
  .activity-actions { width: 100%; }
  .activity-actions .btn { flex: 1; }
  .activity-item { grid-template-columns: 11px minmax(0, 1fr); }
  .activity-time { grid-column: 2; }
}

/* ── Workspace ───────────────────────────────────────────────────────── */

.workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  padding: 24px 30px 30px;
  gap: 18px;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
}

/* Public edition welcome screen. The private practice room never sees this;
   the public hostname starts with one obvious action instead of an empty
   personal-library browser. */
.public-landing {
  width: min(1180px, 100%);
  margin: auto;
  padding: clamp(24px, 5vw, 72px) clamp(12px, 4vw, 48px) 48px;
}
.public-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  border: 1px solid rgba(197,240,72,.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 12%, rgba(197,240,72,.15), transparent 34%),
    linear-gradient(145deg, #15161a, #0c0c0f 65%);
  box-shadow: 0 35px 90px -48px #000;
}
.public-eyebrow {
  margin-bottom: 14px;
  color: var(--accent);
  font: 600 10px var(--font-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.public-hero h2 {
  max-width: 820px;
  color: #f5f5f7;
  font: 750 clamp(42px, 7.4vw, 94px)/.92 var(--font-ui);
  letter-spacing: -.065em;
}
.public-hero h2 span { color: var(--accent); }
.public-lede {
  max-width: 730px;
  margin-top: 24px;
  color: #b5b5bf;
  font-size: clamp(15px, 1.8vw, 20px);
  line-height: 1.6;
}
.public-search { max-width: 800px; margin-top: 34px; }
.public-search > label {
  display: block;
  margin-bottom: 9px;
  color: #dddde5;
  font-size: 13px;
  font-weight: 650;
}
.public-search > div {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(5,5,7,.72);
}
.public-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: white;
  font-size: 17px;
  outline: 0;
}
.public-search button,
.public-file-row > button {
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 750;
  cursor: pointer;
}
.public-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--text-3);
  font: 10px var(--font-mono);
}
.public-examples button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.public-file-row {
  max-width: 800px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}
.public-file-row > button {
  flex: none;
  border: 1px solid rgba(197,240,72,.4);
  background: transparent;
  color: var(--accent);
}
.public-file-row p { color: var(--text-3); font-size: 11px; line-height: 1.45; }
.public-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.public-feature-grid article {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
}
.public-feature-grid span { color: var(--accent); font: 9px var(--font-mono); }
.public-feature-grid h3 { margin-top: 22px; color: var(--text); font-size: 16px; }
.public-feature-grid p { margin-top: 7px; color: var(--text-3); font-size: 12px; line-height: 1.5; }
body.public-home .masthead,
body.public-home .transport,
body.public-home .score-wrap,
body.public-home .desktop-studio-bar,
body.public-home .desktop-track-bar,
body.public-home .library-dock-edge,
body.public-home .practice-dock-edge { display: none !important; }
body.public-edition #importBtn,
body.public-edition #refreshRatingsBtn,
body.public-edition #ugQuickFetchBtn,
body.public-edition .rail-section.setlists,
body.public-edition .activity-launch { display: none !important; }
@media (max-width: 720px) {
  .public-landing { padding: 12px 8px 80px; }
  .public-hero { padding: 26px 18px; border-radius: 20px; }
  .public-hero h2 { font-size: clamp(38px, 13vw, 58px); }
  .public-search > div { grid-template-columns: auto minmax(0,1fr); }
  .public-search button { grid-column: 1 / -1; width: 100%; }
  .public-file-row { align-items: flex-start; flex-direction: column; }
  .public-feature-grid { grid-template-columns: 1fr; }
}

/* Masthead */
.masthead {
  display: grid;
  /* The actions column must NOT be plain `auto`: it sizes to max-content, and
     with every control shown (track + sound + mixer + GP + UG + delete) it
     grew wide enough to crush the minmax(0,1fr) title column to 0px, stacking
     the kicker one word per line. Giving the title a real minimum forces the
     actions to wrap instead. */
  grid-template-columns: minmax(480px, 0.9fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 980px) {
  .masthead { grid-template-columns: minmax(0, 1fr); }
  .masthead-actions { justify-content: flex-start; }
}
.masthead-meta { min-width: 0; }
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}
.title {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
}
.byline {
  font-size: 15px;
  color: var(--text-2);
  margin-top: 6px;
}
.masthead-context-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.masthead-context-link:hover,
.masthead-context-link:focus-visible {
  border-bottom-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.folder-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.folder-nav[hidden] { display: none; }
.folder-nav button {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--text-2);
  font: 600 10px/1 var(--font-ui);
  cursor: pointer;
}
.folder-nav button:hover:not(:disabled),
.folder-nav button:focus-visible {
  border-color: rgba(197,240,72,.55);
  color: var(--accent);
  outline: none;
}
.folder-nav button:disabled { opacity: .32; cursor: default; }
.folder-nav span {
  max-width: 180px;
  overflow: hidden;
  color: var(--text-3);
  font: 9px/1.2 var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masthead-actions {
  display: flex;
  align-items: center;
  align-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
  justify-self: end;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
}
.library-launch { border-color: rgba(197,240,72,.28); }
.library-launch span { color: var(--accent); }
.track-picker {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.track-picker span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-left: 2px;
}
.track-picker select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 9px 30px 9px 12px;
  min-height: 40px;
  color: var(--text);
  min-width: 0;
  width: 248px;
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 13.5px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
                    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.track-picker select option { background: var(--bg-2); color: var(--text); }
.track-picker select:disabled { opacity: 0.45; cursor: not-allowed; }
.track-picker select:focus-visible { border-color: rgba(197, 240, 72, 0.5); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.track-quick {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  width: auto;
  max-width: none;
  overflow: visible;
  padding: 0;
}
.track-quick[hidden] { display: none; }
#trackPicker { display: none !important; }
.track-control {
  display: flex;
  align-items: stretch;
  min-width: 0;
  flex: none;
}
.track-chip {
  flex: none;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  font: 11px var(--font-mono);
  cursor: pointer;
  white-space: nowrap;
}
.track-chip:hover { color: var(--text); border-color: var(--line-strong); }
.track-chip.is-on { color: var(--accent); border-color: rgba(197,240,72,.5); background: var(--accent-soft); }
.track-control:not(.track-control-all) .track-chip {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px 0 0 8px;
  text-overflow: ellipsis;
}
.track-mix-toggle {
  width: 27px;
  min-height: 32px;
  margin-left: -1px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text-3);
  font: 700 9px var(--font-mono);
  cursor: pointer;
}
.track-mix-toggle:last-child { border-radius: 0 8px 8px 0; }
.track-mix-toggle:hover { position: relative; color: var(--text); border-color: var(--line-strong); }
.track-mix-toggle.mute.active {
  position: relative;
  border-color: rgba(255,116,92,.65);
  background: rgba(255,116,92,.15);
  color: #ff8b78;
}
.track-mix-toggle.solo.active {
  position: relative;
  border-color: rgba(197,240,72,.6);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Desktop edge dock: keeps track selection and video tools immediately
   available without permanently reducing the score's canvas. */
.practice-dock-edge { display: none; }
@media (min-width: 1101px) {
  .practice-dock-edge {
    display: block;
    position: fixed;
    z-index: 42;
    top: 14vh;
    right: 0;
    width: 20px;
    height: min(72vh, 720px);
    pointer-events: none;
  }
  .practice-dock-edge[hidden] { display: none; }
  .practice-dock-edge:hover,
  .practice-dock-edge.is-open,
  .practice-dock-edge:focus-within {
    width: min(440px, 92vw);
  }
  .practice-dock-tab {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    left: auto;
    right: calc(100% - 20px);
    z-index: 2;
    width: 28px;
    min-height: 142px;
    padding: 12px 5px;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    rotate: 180deg;
    border: 1px solid rgba(197,240,72,.42);
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: rgba(23,23,27,.96);
    color: var(--accent);
    font: 600 10px/1 var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: -8px 0 22px rgba(0,0,0,.28);
  }
  .practice-dock {
    pointer-events: auto;
    position: absolute;
    inset: 0 0 0 auto;
    width: min(420px, calc(100vw - 28px));
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    background: rgba(18,18,21,.98);
    box-shadow: -18px 0 50px rgba(0,0,0,.48);
    transform: translateX(calc(100% + 12px));
    opacity: 0;
    visibility: hidden;
    transition: transform .18s ease, opacity .18s ease, visibility .18s;
  }
  .practice-dock-edge:hover .practice-dock,
  .practice-dock-edge.is-open .practice-dock,
  .practice-dock-edge:focus-within .practice-dock {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }
  .practice-dock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .practice-dock-head span {
    display: block;
    color: var(--text-3);
    font: 9px/1.3 var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
  }
  .practice-dock-head strong { display: block; margin-top: 2px; font-size: 15px; }
  .practice-dock-head button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-3);
    color: var(--text-2);
    cursor: pointer;
  }
  .practice-dock-body { display: grid; gap: 12px; }
  .practice-dock-body > .track-quick {
    width: 100%;
    padding: 2px 0 10px;
    border-bottom: 1px solid var(--line);
  }
  .practice-dock-body > .yt-sync {
    width: 100%;
    padding: 12px;
  }
  .practice-dock-body .yt-sync-body { grid-template-columns: 1fr; }
  .practice-dock-body .yt-form { max-width: none; }
}

/* Sound picker + "add by URL" button sit on one row; the select flexes. */
.sound-row { display: flex; gap: 6px; align-items: stretch; max-width: 100%; min-width: 0; }
.sound-row select { width: 200px; flex: 1 1 auto; min-width: 0; }
.sf-add-btn {
  flex: 0 0 auto;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 0 10px;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.sf-add-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.sf-add-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Buttons */
.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.activity-launch {
  color: var(--accent);
  border-color: rgba(197, 240, 72, 0.42);
  background: var(--accent-soft);
}
.btn.activity-launch:hover:not(:disabled),
.btn.activity-launch[aria-expanded="true"] {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}
.activity-launch-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.activity-launch-icon::before,
.activity-launch-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 1.5px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 50% 100%;
}
.activity-launch-icon::after {
  transform: rotate(125deg);
  height: 3px;
}
.btn.gp-btn { color: var(--accent); border-color: rgba(197, 240, 72, 0.35); background: var(--accent-soft); }
.btn.gp-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(197, 240, 72, 0.18); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.07); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 107, 107, 0.16); border-color: var(--danger); }
.export-tools { position: relative; }
.export-tools[hidden], .export-menu[hidden] { display: none; }
.export-menu {
  position: absolute;
  z-index: 35;
  right: 0;
  top: calc(100% + 7px);
  width: 210px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.export-menu button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  font: 12px var(--font-ui);
  cursor: pointer;
}
.export-menu button:hover, .export-menu button:focus-visible {
  outline: none;
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Transport bar ───────────────────────────────────────────────────── */

.transport {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.transport-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.transport-seek {
  display: flex;
  align-items: center;
  min-width: 90px;
}
.transport-seek input { width: 100%; }
.transport-seek input:disabled { opacity: .38; cursor: not-allowed; }
.skip-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: var(--font-mono);
}
.skip-control span { font-size: 9px; font-weight: 700; }
.play {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--glow);
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.15s;
}
.play:hover:not(:disabled) { transform: scale(1.06); }
.play:disabled { background: var(--bg-3); color: var(--text-3); box-shadow: none; cursor: not-allowed; }
.play.is-playing { animation: playpulse 1.6s ease-in-out infinite; }
@keyframes playpulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(197,240,72,0.3), 0 8px 28px -10px rgba(197,240,72,0.4); }
  50%      { box-shadow: 0 0 0 1px rgba(197,240,72,0.5), 0 8px 40px -6px rgba(197,240,72,0.7); }
}
.ghost {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  flex: none;
  transition: all 0.15s;
}
.ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.time-readout {
  font-family: var(--font-mono);
  font-size: 14px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.time-now { color: var(--text); font-weight: 600; }
.time-sep { color: var(--text-3); }
.time-total { color: var(--text-3); }
.audio-source {
  padding: 5px 8px;
  border: 1px solid rgba(197,240,72,.3);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 10px var(--font-mono);
  white-space: nowrap;
}
.audio-source[hidden] { display: none; }

.transport-knobs {
  display: grid;
  /* Same trap as .masthead: a plain `auto` third column sizes to max-content,
     and the toggle row is wide enough to collapse both 1fr slider columns to
     0px — Tempo/Zoom became invisible with their labels stacked on the track.
     Real minimums keep the sliders usable and push the toggles to wrap. */
  grid-template-columns: minmax(148px, 1fr) minmax(148px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .transport-knobs { grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr); }
  .transport-knobs .toggles { grid-column: 1 / -1; }
}
.knob { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.knob > span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.knob-row { display: grid; grid-template-columns: 1fr 46px; align-items: center; gap: 10px; min-width: 0; }
.knob-row output {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-align: right;
}

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-hover);
  outline: none;
  min-width: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-2);
  box-shadow: 0 0 0 1px rgba(197,240,72,0.5), 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-2);
  cursor: pointer;
}

/* Toggles */
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.toggle:hover { border-color: var(--line-strong); color: var(--text); }
.toggle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all 0.15s;
}
.toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(197, 240, 72, 0.4);
  color: var(--accent);
}
.toggle[aria-pressed="true"] .toggle-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(197, 240, 72, 0.8);
}
.loop-ab { display: inline-flex; gap: 4px; }
.loop-range-readout {
  align-self: center;
  max-width: 190px;
  color: var(--text-3);
  font: 10px var(--font-mono);
  line-height: 1.3;
}
.toggle.compact { padding: 7px 10px; min-width: 30px; justify-content: center; font-weight: 700; }
.toggle.compact.active { background: var(--accent-soft); border-color: rgba(197,240,72,0.4); color: var(--accent); }

/* ── Mixer ───────────────────────────────────────────────────────────── */

.mixer {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.mixer[hidden] { display: none; }
.mixer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mixer-actions { display: flex; gap: 6px; }
.mixer-head h3 { font-size: 14px; font-weight: 700; }
.mixer-hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.mixer-tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
.mixer-track {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto minmax(90px, 120px) minmax(70px, 95px) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.mixer-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mixer-base { font: 10px var(--font-mono); color: var(--text-3); white-space: nowrap; }
.mixer-toggle {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text-3);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.14s;
}
.mixer-toggle.mute.active { background: var(--danger); border-color: var(--danger); color: #fff; }
.mixer-toggle.solo.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mixer-vol { width: 120px; }
.mixer-pan { width: 95px; }
.mixer-pitch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font: 9px var(--font-mono);
  text-transform: uppercase;
}
.mixer-pitch label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mixer-pitch input {
  width: 46px;
  min-height: 29px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-3);
  color: var(--text);
  font: 11px var(--font-mono);
}
.btn.is-open { border-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) {
  .mixer-tracks { grid-template-columns: 1fr; }
  .mixer-track { grid-template-columns: minmax(100px, 1fr) auto auto; }
  .mixer-base { grid-column: 1 / -1; }
  .mixer-vol, .mixer-pan { width: 100%; }
  .mixer-vol { grid-column: 1 / 3; }
  .mixer-pitch { grid-column: 1 / -1; }
}

/* ── Score ───────────────────────────────────────────────────────────── */

.score-wrap { display: flex; }
.score-shell {
  flex: 1;
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  /* Fixed-height pane: the score scrolls INSIDE it, so progressive/lazy
     rendering grows the inner content instead of stretching the whole page
     (which caused the "tab area keeps shifting while it loads" jank). */
  height: 72vh;
  min-height: 360px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.score-shell.content-fit {
  height: var(--score-content-height) !important;
  min-height: 0 !important;
}
.alpha-tab {
  flex: 1;
  position: relative;
  overflow: auto;
  /* alphaTab sizes its SVG to clientWidth. Horizontal padding was then added
     outside that SVG, creating a needless 60px side-scroll and clipping the
     last measure on phones. The renderer already supplies page margins. */
  padding: 26px 0;
  color: var(--paper-ink);
}
/* Anchor our cursor's coordinate space to the render surface. */
.alpha-tab .at-surface { position: relative; }
.alpha-tab[data-hidden="true"] { display: none; }
.alpha-tab::-webkit-scrollbar { width: 10px; height: 10px; }
.alpha-tab::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 999px; }

/* alphaTab 1.8.3's built-in playback cursor sticks on the first beat for these
   scores, so we hide it and drive our own (.tf-cursor) from tickPosition. */
.alpha-tab .at-cursor-bar,
.alpha-tab .at-cursor-beat {
  display: none !important;
}
/* The exact sounding beat is a red playhead with a light wash. */
.alpha-tab > .tf-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  transform-origin: left top;
  background: rgba(220, 48, 48, 0.14);
  border-left: 3px solid #dc3030;
  border-radius: 2px;
  pointer-events: none;
  will-change: transform;
}
.alpha-tab > .tf-range-handle {
  position: absolute;
  z-index: 8;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: #151719;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,.38);
  touch-action: none;
  cursor: ew-resize;
}
.alpha-tab > .tf-range-handle::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 25px;
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--accent);
}
.alpha-tab > .tf-range-handle[hidden] { display: none; }
.alpha-tab .at-selection div {
  background: rgba(197, 240, 72, 0.22);
}
/* Currently-sounding notes (element highlighting) tinted to match. */
.alpha-tab .at-highlight * {
  fill: #d2531a !important;
  stroke: #d2531a !important;
}

/* ── Live practice HUD ──────────────────────────────────────────────── */

.practice-live {
  display: grid;
  grid-template-columns: minmax(190px, .75fr) minmax(360px, 1.7fr);
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-2), rgba(197,240,72,.045));
  box-shadow: var(--shadow-sm);
}
.practice-live[hidden] { display: none; }
.practice-live-copy { min-width: 0; }
.practice-live-kicker {
  margin-bottom: 3px;
  color: var(--text-3);
  font: 9px var(--font-mono);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.practice-live-copy strong {
  display: block;
  min-height: 27px;
  overflow: hidden;
  color: var(--accent);
  font: 600 20px var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.practice-live-copy > span {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font: 10px var(--font-mono);
}
.listen-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}
.listen-controls button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 9px;
  cursor: pointer;
}
.listen-controls button[aria-pressed="true"] {
  border-color: rgba(197,240,72,.55);
  color: var(--accent);
}
.listen-controls span { color: var(--text-3); font: 8.5px/1.3 var(--font-mono); }
.listen-controls span.is-match { color: var(--accent); }
.listen-controls span.is-miss { color: #ffb45e; }
.fretboard-wrap { min-width: 0; overflow-x: auto; padding: 4px 0; }
.fretboard-labels, .live-fretboard {
  display: grid;
  grid-template-columns: repeat(13, minmax(25px, 1fr));
  min-width: 390px;
}
.fretboard-labels span {
  color: var(--text-3);
  font: 8px var(--font-mono);
  text-align: center;
}
.live-fretboard { grid-template-rows: repeat(6, 9px); margin-top: 2px; }
.fret-cell {
  position: relative;
  border-right: 1px solid rgba(255,255,255,.18);
  border-bottom: 1px solid rgba(255,255,255,.22);
}
.fret-cell:nth-child(13n + 1) { border-right-width: 3px; border-right-color: rgba(255,255,255,.55); }
.fret-cell.is-active::after {
  content: attr(data-fret);
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 8px var(--font-mono);
  box-shadow: 0 0 10px rgba(197,240,72,.6);
}

/* Empty state (on paper) */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 40px;
  color: var(--paper-ink);
}
.empty-state[hidden] { display: none; }
.empty-mark { color: #b8b2a0; }
.empty-state h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.empty-state p { max-width: 440px; color: #6a6453; font-size: 14px; }
.empty-steps {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin-top: 6px;
  counter-reset: step;
  flex-wrap: wrap;
  justify-content: center;
}
.empty-steps li {
  counter-increment: step;
  font-size: 12.5px;
  color: #6a6453;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 6px 14px 6px 30px;
  position: relative;
}
.empty-steps li::before {
  content: counter(step);
  position: absolute;
  left: 6px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper-ink);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.kbd {
  font-family: var(--font-mono);
  background: var(--paper-ink);
  color: var(--paper);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
}

/* ── YouTube sync ────────────────────────────────────────────────────── */

.yt-sync {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.yt-sync-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.yt-sync-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.yt-sync-head h3::before { content: "▸ "; color: var(--accent); }
.yt-form { display: flex; gap: 8px; flex: 1; max-width: 460px; min-width: 0; }
.yt-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.yt-form input::placeholder { color: var(--text-3); }
.yt-form input:focus { border-color: rgba(197,240,72,0.5); box-shadow: 0 0 0 3px var(--accent-soft); }
.yt-form input:disabled { opacity: 0.45; }
.yt-search-results {
  flex: 1 1 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
}
.yt-search-results[hidden] { display: none; }
.yt-result {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  text-align: left;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.yt-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.yt-result img { width: 104px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.yt-result-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.yt-result-text strong {
  font-size: 12.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-result-text span, .yt-search-status { color: var(--text-3); font: 10.5px var(--font-mono); }

.yt-sync-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -4px;
}
.yt-sync-readout {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}
.yt-anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -6px;
}
.yt-anchor-help {
  color: var(--text-3);
  font-size: 12px;
  max-width: 760px;
}
.yt-anchor {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-3);
}
.yt-anchor button {
  min-height: 34px;
  border: 0;
  padding: 6px 10px;
  background: transparent;
  color: var(--text-2);
  font: 10.5px var(--font-mono);
  cursor: pointer;
}
.yt-anchor button:first-child:hover { color: var(--accent); }
.yt-anchor button:last-child { border-left: 1px solid var(--line); }
.yt-anchor button:last-child:hover { color: var(--danger); }
.yt-sync-timeline {
  position: relative;
  height: 34px;
  padding: 8px 8px 0;
}
.yt-sync-timeline-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(197,240,72,.22), rgba(197,240,72,.55));
}
.yt-sync-timeline-track > span {
  position: absolute;
  top: 12px;
  color: var(--text-3);
  font: 8px var(--font-mono);
}
.yt-sync-timeline-track > span:first-child { left: 0; }
.yt-sync-timeline-track > span:nth-child(2) { right: 0; }
.yt-sync-timeline-anchor {
  position: absolute;
  z-index: 1;
  top: 50%;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--bg-2);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 9px var(--font-mono);
  cursor: ew-resize;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(197,240,72,.5);
}
.yt-sync-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.yt-player-wrap {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.yt-player, .yt-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.yt-player-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}
.yt-player-empty[hidden] { display: none; }

.chord-diagram-strip {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(197,240,72,.035);
}
.chord-diagram-strip[hidden] { display: none; }
.chord-diagram {
  flex: 0 0 82px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-2);
  text-align: center;
}
.chord-diagram strong { display: block; margin-bottom: 5px; font-size: 11px; }
.chord-diagram small { color: var(--text-3); font: 7px var(--font-mono); }
.chord-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 48px;
  margin: 0 5px 3px;
  border-block: 1px solid rgba(255,255,255,.32);
  background: repeating-linear-gradient(to bottom, transparent 0 11px, rgba(255,255,255,.22) 11px 12px);
}
.chord-string {
  position: relative;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  border-left: 1px solid rgba(255,255,255,.28);
}
.chord-string:last-child { border-right: 1px solid rgba(255,255,255,.28); }
.chord-string::before {
  content: attr(data-mark);
  position: absolute;
  top: -12px;
  left: 50%;
  color: var(--text-3);
  font: 7px var(--font-mono);
  transform: translateX(-50%);
}
.chord-string i {
  align-self: center;
  justify-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 5px rgba(197,240,72,.4);
}

.practice-coach-summary {
  color: var(--text-2);
  font: 10px/1.45 var(--font-mono);
}
.practice-coach-history { display: grid; gap: 4px; margin: 8px 0; }
.practice-coach-pass {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(0,0,0,.16);
}
.practice-coach-pass strong { color: var(--accent); font: 700 12px var(--font-mono); }
.practice-coach-pass span { color: var(--text-3); font-size: 9px; }
.btn.is-on, #visualEditBtn.is-on {
  border-color: rgba(197,240,72,.6);
  background: var(--accent-soft);
  color: var(--accent);
}
.alpha-tab.visual-editing { cursor: crosshair; box-shadow: inset 0 0 0 3px rgba(197,240,72,.32); }

.visual-note-editor {
  position: fixed;
  inset: auto 16px 76px auto;
  z-index: 70;
  margin: 0;
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow);
}
.visual-note-editor::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.visual-note-editor form { padding: 16px; }
.visual-note-editor header,
.visual-note-editor footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.visual-note-editor header button {
  border: 0; background: transparent; color: var(--text-2); font-size: 18px; cursor: pointer;
}
.visual-note-editor small { color: var(--accent); font: 8px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }
.visual-note-editor h2 { margin-top: 2px; font-size: 20px; }
.visual-note-editor > form > p { margin: 14px 0; color: var(--text-2); font-size: 11px; }
.visual-note-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.visual-note-fields label { color: var(--text-3); font: 9px var(--font-mono); }
.visual-note-fields input {
  width: 100%; margin-top: 5px; padding: 9px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-3); color: var(--text);
}
.visual-note-fields select {
  width: 100%; margin-top: 5px; padding: 9px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-3); color: var(--text);
}
.visual-note-editor footer { justify-content: flex-end; }

.yt-markers { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.yt-markers-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.yt-markers-head h4 { font-size: 12px; font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.yt-marker-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.yt-marker {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 5px 6px 5px 5px;
}
.yt-marker-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 600;
}
.yt-marker-time:hover { background: var(--accent-press); }
.yt-marker-label {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  min-width: 0;
  font-size: 13px;
}
.yt-marker-label::placeholder { color: var(--text-3); }
.yt-marker-del {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}
.yt-marker-del:hover { color: var(--danger); background: rgba(255,107,107,0.1); }
.yt-marker-empty { font-size: 12px; color: var(--text-3); }
.yt-marker-empty[hidden] { display: none; }

/* ── Practice bar ────────────────────────────────────────────────────── */

.practice-bar {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.4fr;
  gap: 12px;
}
.practice-cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.practice-cell h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.practice-cell textarea,
.practice-cell input {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 9px 11px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.practice-cell textarea { resize: vertical; min-height: 64px; font-family: var(--font-ui); }
.practice-cell input { width: 100%; }
.practice-cell textarea:focus,
.practice-cell input:focus { border-color: rgba(197,240,72,0.5); box-shadow: 0 0 0 3px var(--accent-soft); }
.practice-cell textarea:disabled,
.practice-cell input:disabled { opacity: 0.45; }
.tuning-readout {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.practice-cell.saved-sections { grid-column: 1 / -1; }
.section-save-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 7px;
}
.section-save-form .btn { min-height: 36px; }
.saved-section-list { display: grid; gap: 5px; }
.saved-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 6px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3);
}
.saved-section-open,
.saved-section-remove {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.saved-section-open {
  min-width: 0;
  padding: 4px 0;
  overflow: hidden;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-section-open:hover { color: var(--accent); }
.saved-section-row span {
  color: var(--text-3);
  font: 9px var(--font-mono);
  white-space: nowrap;
}
.saved-section-remove { color: var(--text-3); }
.saved-section-remove:hover { color: var(--danger); }
.saved-section-empty { color: var(--text-3); font-size: 11px; line-height: 1.4; }

/* ── Loading overlay ─────────────────────────────────────────────────── */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 10, 0.8);
  backdrop-filter: blur(4px);
}
.drop-overlay[hidden] { display: none; }
.drop-card {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 48px 64px;
  text-align: center;
  background: var(--accent-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.drop-icon { font-size: 44px; color: var(--accent); }
.drop-card p { font-size: 18px; font-weight: 700; color: var(--text); }
.drop-card span { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.1em; }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 10, 0.66);
  backdrop-filter: blur(6px);
}
.loading-overlay[hidden] { display: none; }
.loading-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.loading-spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--bg-hover);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card p { font-size: 13px; color: var(--text-2); font-family: var(--font-mono); }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1040px) {
  .workspace { padding: 20px 18px 26px; }
  .masthead { grid-template-columns: 1fr; }
  .masthead-actions { justify-content: flex-start; justify-self: stretch; width: 100%; }
  .masthead-actions .activity-launch { flex: 1 1 100%; }
  .masthead-actions .track-picker { flex: 1 1 220px; }
  .track-picker select { width: 100%; }
  .yt-sync-body { grid-template-columns: 1fr; }
  .practice-bar { grid-template-columns: 1fr 1fr; }
  .practice-cell.notes { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .rail { width: 100vw; padding: 16px 13px; }
  .workspace { padding: 12px 10px 20px; gap: 12px; }
  .masthead { gap: 12px; }
  .title { font-size: clamp(26px, 9vw, 36px); }
  .masthead-actions { width: 100%; align-items: stretch; }
  .masthead-actions .track-picker { display: none; }
  .masthead-actions > .btn { min-height: 44px; flex: 1 1 calc(50% - 4px); }
  .masthead-actions > .export-tools { flex: 1 1 calc(50% - 4px); }
  .export-tools > .btn { width: 100%; min-height: 44px; }
  .export-menu { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; }
  .export-menu button { min-height: 48px; }
  .track-quick {
    order: -1;
    width: 100%;
    max-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 0 7px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .track-chip { min-height: 44px; padding-inline: 14px; scroll-snap-align: start; }
  .transport {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 12px;
    position: sticky;
    bottom: 6px;
    z-index: 20;
    box-shadow: 0 10px 36px rgba(0,0,0,.48);
  }
  .transport-left { justify-content: space-between; }
  .transport-knobs { grid-template-columns: 1fr 1fr; gap: 12px; }
  .toggles {
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }
  .toggle { min-height: 44px; flex: none; }
  .loop-range-readout { min-width: 160px; }
  .ghost { width: 44px; height: 44px; }
  .play { width: 56px; height: 56px; }
  .score-shell { height: 69dvh; min-height: 430px; border-radius: var(--radius-sm); }
  .practice-live { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .practice-live-copy strong { font-size: 17px; }
  .mixer { padding: 13px 12px; }
  .mixer-head { align-items: flex-start; }
  .mixer-head h3 { max-width: 55%; }
  .mixer-actions .btn { min-height: 40px; padding-inline: 9px; }
  .yt-sync { padding: 13px 12px; }
  .yt-sync-head { align-items: stretch; }
  .yt-form { flex: 1 1 100%; max-width: none; flex-wrap: wrap; }
  .yt-form input { flex-basis: 100%; min-height: 44px; }
  .yt-form .btn { flex: 1 1 calc(50% - 4px); min-height: 44px; }
  .yt-search-results { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
  .yt-result { flex: 0 0 min(82vw, 330px); scroll-snap-align: start; }
}

@media (max-width: 440px) {
  .workspace { padding: 16px 13px 22px; }
  .masthead-actions > .btn:not(.activity-launch) { flex: 1 1 calc(50% - 4px); }
  .masthead-actions .track-picker { flex-basis: 100%; }
  .transport-knobs { grid-template-columns: 1fr; }
  .practice-bar { grid-template-columns: 1fr; }
  .play { width: 46px; height: 46px; }
  .tree-tools { flex-basis: 100%; width: 100%; }
  .tree-tools .seg { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Ultimate Guitar text/chord reader ─────────────────────────────────── */
.text-reader { display: flex; flex-direction: column; gap: 12px; }
.reader-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: var(--shadow-sm);
}
.reader-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.reader-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em;
  color: var(--text-2); background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px; text-transform: capitalize;
}
.reader-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.reader-tool { display: inline-flex; align-items: center; gap: 5px; }
.reader-tool label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.rbtn {
  min-width: 30px; height: 28px; padding: 0 8px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-xs);
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.rbtn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
#trOut { min-width: 22px; text-align: center; font-family: var(--font-mono); font-size: 13px; color: var(--text); }
#autoScrollSpeed { width: 90px; accent-color: var(--accent); }
.reader-body {
  margin: 0; height: 72vh; min-height: 360px; overflow: auto;
  background: var(--paper); color: var(--paper-ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.55;
  white-space: pre; tab-size: 4;
}
.reader-body .rchord { color: #c2410c; font-weight: 700; }

/* ──────────────────────────────────────────────────────────────────────
   LIBRARY BROWSER
   A full-workspace view for a collection of hundreds. Songs are grouped
   artist → title, and alternate versions of the same title collapse into
   one expandable card so a 126-file artist reads as ~69 songs.
   ────────────────────────────────────────────────────────────────────── */

.browse {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.browse-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.browse-title h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.02em;
}
.browse-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}
.browse-brand img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: var(--glow);
}
.browse-brand small {
  display: block;
  color: var(--accent);
  font: 9px/1.2 var(--font-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.browse-tools .install-app { border-color: rgba(197,240,72,.45); color: var(--accent); }
.offline-badge {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 8px 13px;
  border: 1px solid rgba(255,176,32,.5);
  border-radius: 999px;
  background: rgba(22,18,10,.96);
  color: #ffc65c;
  font: 11px var(--font-mono);
  box-shadow: var(--shadow);
}
.browse-count {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
  font-family: var(--font-mono);
}
.browse-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.browse-tools input[type="search"] {
  width: 250px;
  max-width: 46vw;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.browse-tools input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.browse-tools .ug-library-search {
  border-color: rgba(197,240,72,.55);
  background: var(--accent-soft);
  color: var(--accent);
}
.browse-tools .ug-library-search:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.browse-tools select {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.external-results {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(197,240,72,.25);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(197,240,72,.055), rgba(18,18,22,.84) 42%);
}
.external-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.external-results-head span {
  color: var(--accent);
  font: 700 8px var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.external-results-head h3 { margin-top: 3px; font-size: 19px; }
.external-results-head p { color: var(--text-3); font: 10px var(--font-mono); }
.external-results-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.external-results-head .artist-import-action {
  color: var(--accent-ink);
  border-color: rgba(197,240,72,.42);
  white-space: nowrap;
}
.external-loading {
  padding: 18px;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  color: var(--text-2);
  font-size: 12px;
}
.external-group + .external-group { margin-top: 15px; }
.external-group h4 {
  margin-bottom: 7px;
  color: var(--text-3);
  font: 700 9px var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.external-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 7px;
}
.external-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8,8,10,.38);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.external-result:hover {
  border-color: rgba(197,240,72,.45);
  background: rgba(197,240,72,.07);
}
.external-result.is-loading {
  border-color: rgba(197,240,72,.52);
  background: rgba(197,240,72,.08);
  cursor: wait;
}
.external-result:disabled:not(.is-loading) {
  cursor: not-allowed;
  opacity: .58;
}
.external-result:disabled:not(.is-loading) .external-result-action {
  color: var(--text-3);
}
.external-result-copy { min-width: 0; }
.external-result-copy strong,
.external-result-copy span { display: block; }
.external-result-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.external-result-copy span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.external-result-copy .external-result-quality {
  color: var(--accent);
  font-family: var(--font-mono);
}
.external-result-action { color: var(--accent); font: 9px var(--font-mono); }
.external-result.is-loading .external-result-action { animation: pulse 1s ease-in-out infinite; }
.external-result-copy .external-result-error {
  margin-top: 6px;
  overflow: visible;
  color: var(--danger);
  text-overflow: clip;
  white-space: normal;
}

.search-result-quality {
  color: var(--accent);
  font-family: var(--font-mono);
}

.result-confidence {
  --confidence: 50%;
  --heat: #f1bc5b;
  display: block;
  width: min(210px, 100%);
  margin-top: 7px;
}
.result-confidence.is-cool { --heat: #6999c9; }
.result-confidence.is-mixed { --heat: #e7a94b; }
.result-confidence.is-strong { --heat: #b8dc50; }
.result-confidence.is-hot { --heat: var(--accent); }
.result-confidence-line {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 3px !important;
  overflow: visible !important;
  color: var(--text-2) !important;
  font: 8.5px var(--font-mono) !important;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.result-confidence-line b { color: var(--heat); font-weight: 700; }
.result-confidence-line em { color: var(--text-2); font-style: normal; }
.result-confidence.is-best .result-confidence-line b::before {
  content: "◆ ";
  font-size: 7px;
}
.result-confidence > i {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.075);
}
.result-confidence > i > span {
  display: block;
  width: var(--confidence);
  height: 100%;
  margin: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #55728d, var(--heat));
  box-shadow: 0 0 10px color-mix(in srgb, var(--heat) 45%, transparent);
}
.result-meta .result-confidence {
  margin-top: 5px;
  flex-basis: 100%;
}

.browse-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--bg-hover); color: var(--text); }
.chip.is-on {
  background: var(--accent-soft);
  border-color: rgba(197, 240, 72, 0.4);
  color: var(--accent);
}

.browse-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.browse-group > h3 {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 10px;
  padding: 7px 0;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  background: linear-gradient(var(--bg) 72%, transparent);
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.browse-group > h3 .g-count {
  font-family: var(--font-mono);
  letter-spacing: 0;
  color: var(--text-3);
  opacity: 0.7;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 10px;
}

.song-card {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.song-card:hover { border-color: var(--line-strong); }
.song-card.is-active { border-color: var(--accent); box-shadow: var(--glow); }

.song-card-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.song-card-main:hover { background: var(--bg-hover); }
.song-card-text { min-width: 0; flex: 1; }
.song-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 570;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-card-sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-card-sub,
.library-meta,
.tree-tag,
.ver-tag {
  font-variant-numeric: tabular-nums;
}
.ver-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.song-card.is-open .ver-badge { background: var(--accent-soft); color: var(--accent); border-color: rgba(197,240,72,0.35); }

.ver-list {
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
}
.ver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}
.ver-row:last-child { border-bottom: 0; }
.ver-row.is-active { background: var(--accent-soft); }
.ver-open {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.ver-open:hover { color: var(--text); }
.ver-tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.ver-del {
  flex: none;
  background: none;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 5px;
}
.ver-del:hover { color: var(--danger); background: rgba(255,107,107,0.1); }

.browse-empty {
  color: var(--text-3);
  font-size: 13.5px;
  padding: 30px 0;
  text-align: center;
}

@media (max-width: 720px) {
  .rail.browser-mounted { width: 100vw; }
  .rail.browser-mounted .browse-tools { grid-template-columns: minmax(0, 1fr); }
  .rail.browser-mounted .browse-tools select { width: 100%; }
  .rail.browser-mounted .browse-modes .seg { flex: 1 0 auto; }
  .browse-head { align-items: flex-start; }
  .browse-tools input[type="search"] { width: 100%; max-width: none; }
  .browse-grid { grid-template-columns: 1fr; }
  .external-results { margin-inline: -3px; padding: 12px; }
  .external-results-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .external-results-head p { white-space: normal; }
  .external-results-head-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .external-grid { grid-template-columns: 1fr; }
  .external-result { align-items: flex-start; }
  .external-result-copy strong,
  .external-result-copy span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ── Browse: view-mode switch ───────────────────────────────────────── */
.browse-modes { display: flex; gap: 6px; }
.seg {
  padding: 7px 15px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.seg:hover { background: var(--bg-hover); color: var(--text); }
.seg.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.accent:hover { background: var(--accent-press); }

/* ── Album view ─────────────────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.album-card {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  color: inherit;
  text-decoration: none;
}
.album-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.album-card.is-open { border-color: var(--accent); }
.album-art {
  aspect-ratio: 1;
  width: 100%;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 34px;
  overflow: hidden;
}
.album-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-meta { padding: 10px 12px; }
.album-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 580;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.album-songs {
  grid-column: 1 / -1;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  padding: 12px 14px;
  margin-top: -4px;
}
.album-songs h4 {
  margin: 0 0 9px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Artists index ──────────────────────────────────────────────────── */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px;
}
.artist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.artist-card:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.artist-card .a-name {
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-card .a-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); flex: none; }

/* ── Import queue panel ─────────────────────────────────────────────── */
.queue-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
  flex: 1;
}
.queue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.queue-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.queue-sub { margin: 5px 0 0; color: var(--text-3); font-size: 12.5px; max-width: 62ch; }
.queue-form { display: flex; flex-direction: column; gap: 10px; }
.queue-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
}
.queue-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.queue-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.queue-status { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.queue-warning {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 184, 77, 0.45);
  border-radius: var(--radius-xs);
  background: rgba(255, 184, 77, 0.08);
  color: #ffd08a;
  font-size: 12.5px;
}

.queue-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.queue-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}
.queue-row.is-running { border-color: var(--accent); box-shadow: var(--glow); }
.queue-row.is-failed { border-color: rgba(255, 107, 107, 0.45); }
.q-retry {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 107, 107, 0.45);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.q-retry:hover { background: rgba(255, 107, 107, 0.1); }
.q-name { font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.q-bar { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; min-width: 80px; }
.q-bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.q-stat { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.q-state {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-3);
  white-space: nowrap;
}
.q-state.pending { color: var(--text-2); }
.q-state.running { background: var(--accent-soft); color: var(--accent); }
.q-state.done { color: var(--accent); }
.q-state.failed { background: rgba(255,107,107,0.14); color: var(--danger); }
.q-del { background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 14px; padding: 2px 5px; border-radius: 5px; }
.q-del:hover { color: var(--danger); background: rgba(255,107,107,0.1); }

@media (max-width: 720px) {
  .queue-row { grid-template-columns: 1fr auto; row-gap: 8px; }
  .q-bar { grid-column: 1 / -1; }
}

/* ── Folder tree ─────────────────────────────────────────────────────────
   File-explorer view of the library: Artist → Album → Song → Versions.
   Artist is always the top level, so the collection reads like a disk of
   folders rather than a flat pile of tabs.
   ─────────────────────────────────────────────────────────────────────── */

/* No margin-left:auto here — pushing these to the far right made them overflow
   the container instead of wrapping onto the next line. */
.tree-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: none;
  min-width: 0;
}
/* Without nowrap these wrapped to "⊞" / "Expand" on two lines and spilled
   outside the button box. */
.seg { white-space: nowrap; }
.seg.ghost {
  position: static;
  box-sizing: border-box;
  width: auto;
  height: 32px;
  min-width: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  padding: 5px 11px;
}
.seg.ghost:hover { background: var(--bg-2); color: var(--text); }
.browse-modes { flex-wrap: wrap; align-items: center; }

.tree { display: flex; flex-direction: column; font-size: 13.5px; }

.tree-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0 6px 0 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.tree-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.tree-row:hover { background: var(--bg-2); }
.tree-row.is-active { background: var(--accent-soft); }
.tree-row.is-active .tree-label { color: var(--accent); }

/* Indent guides make depth readable without heavy nesting boxes. */
.tree-indent { flex: none; display: flex; align-self: stretch; }
.tree-indent > span {
  width: 17px;
  border-left: 1px solid var(--line);
  margin-left: 8px;
}

.tree-caret {
  flex: none;
  width: 15px;
  text-align: center;
  color: var(--text-3);
  font-size: 10px;
  transition: transform .14s;
  user-select: none;
}
.tree-caret.open { transform: rotate(90deg); color: var(--accent); }
.tree-caret.leaf { opacity: 0; }

.tree-icon { flex: none; font-size: 13px; line-height: 1; opacity: 0.9; }

.tree-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-row.depth-0 .tree-label { font-weight: 620; font-size: 14px; letter-spacing: -0.01em; }
.tree-row.depth-1 .tree-label { font-weight: 520; }
.tree-row.depth-2 .tree-label { color: var(--text); }
.tree-row.depth-3 .tree-label { color: var(--text-2); font-size: 12.5px; }

.tree-year {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.tree-count {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
.tree-tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.tree-fav { flex: none; color: var(--accent); font-size: 12px; }
.tree-del {
  flex: none;
  background: none;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 5px;
  opacity: 0;
}
.tree-row:hover .tree-del { opacity: 1; }
.tree-del:focus-visible { opacity: 1; }
.tree-del:hover { color: var(--danger); background: rgba(255, 107, 107, 0.12); }

/* Album thumbnail inline in the tree — small enough to keep rows compact. */
.tree-thumb {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-3);
}

/* Album completeness badges — green when every song on the record has a tab,
   amber when some are still missing (hover shows which). */
.tree-count.is-complete { color: var(--accent); border-color: rgba(197, 240, 72, 0.4); background: var(--accent-soft); }
.tree-count.is-partial  { color: var(--amber);  border-color: rgba(245, 185, 69, 0.35); background: rgba(245, 185, 69, 0.10); }
.album-card.is-complete { border-color: rgba(197, 240, 72, 0.45); }
.album-card.is-complete .album-sub { color: var(--accent); }

/* Per-artist "find missing" action — appears on hover of an artist folder. */
.tree-gap {
  flex: none;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: pointer;
  opacity: 0;
  white-space: nowrap;
  transition: opacity .14s, color .14s, border-color .14s;
  background: transparent;
}
.tree-row:hover .tree-gap { opacity: 1; }
.tree-gap:focus-visible { opacity: 1; }
.tree-gap:hover { color: var(--accent); border-color: rgba(197, 240, 72, 0.45); background: var(--accent-soft); }
.tree-actions { flex: none; position: relative; }
.tree-actions-toggle { display: none; }
.tree-action-menu { display: flex; align-items: center; gap: 5px; }

/* An album with no tabs yet still shows, dimmed — it's a gap worth seeing. */
.tree-count.is-empty { color: var(--text-3); opacity: 0.75; }

/* "Collecting" toggle stays visible once on, so you can see at a glance which
   artists you're actively completing. */
.tree-gap.is-on { opacity: 1; color: var(--accent); border-color: rgba(197, 240, 72, 0.35); }

@media (hover: none), (pointer: coarse) {
  .tree-gap,
  .tree-del { opacity: 1; }
}

@media (max-width: 720px), (pointer: coarse) {
  .tree-row.depth-0 { min-height: 46px; }
  .tree-row.depth-0 .tree-row-main {
    min-height: 46px;
    min-width: 140px;
    padding-left: 5px;
  }
  .tree-row.depth-0 .tree-label {
    font-size: 15px;
  }
  .tree-actions.is-managed .tree-actions-toggle {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-3);
    color: var(--text-2);
    font: 11px var(--font-mono);
    cursor: pointer;
  }
  .tree-actions.is-managed.is-open .tree-actions-toggle {
    color: var(--accent);
    border-color: rgba(197, 240, 72, 0.4);
    background: var(--accent-soft);
  }
  .tree-actions.is-managed .tree-action-menu {
    display: none;
    position: absolute;
    z-index: 15;
    top: calc(100% + 6px);
    right: 0;
    width: min(250px, calc(100vw - 34px));
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    box-shadow: var(--shadow);
  }
  .tree-actions.is-managed.is-open .tree-action-menu { display: flex; }
  .tree-actions.is-managed .tree-gap {
    width: 100%;
    min-height: 40px;
    opacity: 1;
    text-align: left;
    border-radius: var(--radius-xs);
    padding-inline: 12px;
  }
}

@media (max-width: 440px) {
  .browse-modes .tree-tools {
    flex: 1 0 100%;
    width: 100%;
  }
  .browse-modes .tree-tools .seg {
    flex: 0 0 auto;
    width: auto;
    height: 34px;
  }
}

@media (max-width: 360px) {
  .tree-actions.is-managed .tree-actions-toggle {
    width: 38px;
    padding-inline: 0;
    font-size: 0;
  }
  .tree-actions.is-managed .tree-actions-toggle::after {
    content: "•••";
    font: 13px var(--font-mono);
    letter-spacing: 1px;
  }
  .tree-row.depth-0 > .tree-gap {
    width: 38px;
    min-height: 38px;
    padding-inline: 0;
    font-size: 0;
  }
  .tree-row.depth-0 > .tree-gap::after {
    content: "+";
    font: 18px var(--font-ui);
  }
}

/* ── Focused studio shell ─────────────────────────────────────────────
   The score is the product. Everything else lives in two edge drawers:
   Library on the left, Studio on the right. These late rules intentionally
   replace the older card-heavy practice-room layout without disturbing the
   library browser. */

body.rail-open,
body.practice-dock-open { overflow: hidden; }

.workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px clamp(12px, 1.15vw, 22px) 22px;
  gap: 10px;
}

.masthead {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
  gap: 16px;
  padding: 2px 4px 10px;
  border-bottom-color: rgba(255,255,255,.055);
}
.masthead-actions:empty { display: none; }
.masthead .library-launch { display: none; }
.kicker { margin-bottom: 2px; font-size: 9px; opacity: .8; }
.title { font-size: clamp(23px, 2.4vw, 34px); line-height: 1.06; }
.byline { margin-top: 2px; font-size: 12px; }

.transport {
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 6px 12px;
  min-height: 58px;
  padding: 7px 10px;
  border-radius: 13px;
  background: rgba(18,18,22,.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px -26px rgba(0,0,0,.9);
}
.transport-left { gap: 10px; }
.transport-seek { grid-column: 2; }
.transport-knobs { grid-column: 1 / -1; }
.play { width: 42px; height: 42px; font-size: 14px; box-shadow: none; }
.ghost { width: 36px; height: 36px; border-radius: 9px; }
.cursor-follow {
  width: auto;
  min-width: 96px;
  padding-inline: 9px;
  color: var(--accent);
  font: 600 9px var(--font-mono);
  white-space: nowrap;
}
.cursor-follow.is-paused {
  border-color: rgba(197, 240, 72, .42);
  background: var(--accent-soft);
  color: var(--text);
}
.time-readout { font-size: 12px; }
.audio-source { padding: 4px 7px; font-size: 9px; }
.sync-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid rgba(197,240,72,.34);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 10px var(--font-mono);
  cursor: pointer;
}
.sync-pill[aria-pressed="false"] {
  border-color: var(--line);
  background: transparent;
  color: var(--text-3);
}
.sync-pill[aria-pressed="false"] .toggle-dot { background: var(--text-3); box-shadow: none; }

.score-shell {
  height: calc(100dvh - 152px);
  min-height: 520px;
  border-radius: 13px;
  box-shadow: 0 20px 55px -34px rgba(0,0,0,.9);
}
.alpha-tab { padding-block: 18px; }

/* The always-visible desktop workbench. It uses otherwise idle horizontal
   space and leaves setup/maintenance actions in the edge drawer. */
.desktop-studio-bar {
  display: grid;
  grid-template-columns: minmax(510px, 1.9fr) minmax(260px, .9fr) 196px;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  padding: 0;
}
.desktop-studio-bar[hidden] { display: none; }
.desktop-studio-group {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(18,18,22,.78);
}
.desktop-studio-label {
  min-height: 17px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--text-3);
  font: 600 8px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.desktop-studio-label small {
  overflow: hidden;
  color: rgba(154,154,166,.72);
  font: 8px var(--font-ui);
  letter-spacing: 0;
  text-transform: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desktop-studio-label button {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 8px var(--font-mono);
  cursor: pointer;
}
.desktop-studio-label button:hover { color: var(--accent); border-color: rgba(197,240,72,.35); }
.desktop-studio-slot { min-width: 0; }
.desktop-track-bar {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(18,18,22,.88);
}
.desktop-track-bar[hidden] { display: none; }
.desktop-track-bar .desktop-studio-label { margin-bottom: 4px; }
.desktop-track-bar .track-quick {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.desktop-track-bar .track-chip {
  min-height: 27px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 9.5px;
}
.arrangement-map[hidden] { display: none; }
.arrangement-map {
  --arrangement-label-width: clamp(150px, 15vw, 260px);
  --arrangement-controls-width: 202px;
  min-width: 0;
  font-family: var(--font-mono);
}
.arrangement-guide {
  position: relative;
  height: 18px;
  margin: 0 2px 2px calc(var(--arrangement-label-width) + var(--arrangement-controls-width) + 6px);
  overflow: hidden;
  color: rgba(205,205,216,.82);
  font-size: 9px;
}
.arrangement-guide span {
  position: absolute;
  transform: translateX(2px);
}
.arrangement-lanes {
  position: relative;
  display: grid;
  gap: 3px;
  max-height: calc(100dvh - 360px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.arrangement-track {
  display: grid;
  grid-template-columns: var(--arrangement-label-width) var(--arrangement-controls-width) minmax(160px, 1fr);
  align-items: center;
  gap: 3px;
  min-height: 23px;
  opacity: 1;
}
.arrangement-track-name,
.arrangement-mix {
  height: 23px;
  padding: 0 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #c9c9d2;
  font: 10px var(--font-mono);
  cursor: pointer;
}
.arrangement-track-name {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arrangement-track.is-selected .arrangement-track-name {
  background: rgba(197,240,72,.12);
  color: var(--accent);
}
.arrangement-track-mix {
  display: flex;
  align-items: center;
  gap: 2px;
}
.arrangement-mix {
  width: 30px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  text-align: center;
  color: #c9c9d2;
}
.arrangement-mix:hover {
  border-color: rgba(197,240,72,.36);
  color: var(--accent);
}
.arrangement-mix.active.mute { background: #aa4054; color: white; }
.arrangement-mix.active.solo { background: var(--accent); color: #151708; }
.arrangement-volume,
.arrangement-pan {
  width: 65px;
  height: 18px;
  margin-left: 3px;
  accent-color: var(--accent);
  cursor: ew-resize;
}
.arrangement-timeline {
  position: relative;
  height: 20px;
  overflow: hidden;
  border-radius: 2px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(6.25% - 1px),
      rgba(255,255,255,.055) calc(6.25% - 1px),
      rgba(255,255,255,.055) 6.25%
    ),
    #252631;
  cursor: crosshair;
}
.arrangement-timeline-name {
  position: absolute;
  inset: 3px auto auto 7px;
  z-index: 2;
  max-width: min(42%, 260px);
  overflow: hidden;
  color: rgba(235, 235, 241, .52);
  font: 600 9px/14px var(--font-mono);
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #111219, 0 0 6px #111219;
  white-space: nowrap;
  pointer-events: none;
}
.arrangement-track.is-selected .arrangement-timeline-name {
  color: rgba(221, 255, 124, .78);
}
.arrangement-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 2px;
  border-radius: 1px;
  background: hsl(calc(76 + var(--track-index) * 31) 86% 54%);
  opacity: .88;
  pointer-events: none;
}
.arrangement-playhead {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ff5468;
  box-shadow: 0 0 0 1px rgba(255,84,104,.18);
  pointer-events: none;
  will-change: transform;
}
.desktop-score-actions .desktop-studio-slot {
  display: flex;
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
}
.global-pitch-control[hidden] { display: none; }
.global-pitch-control {
  display: inline-grid;
  grid-template-columns: auto 28px minmax(43px, auto) 28px;
  align-items: center;
  gap: 2px;
  min-height: 29px;
  padding: 2px 3px 2px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--text-2);
  font: 8px var(--font-mono);
  white-space: nowrap;
}
.global-pitch-control > span {
  margin-right: 2px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.global-pitch-control button {
  min-width: 28px;
  min-height: 23px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  font: 600 9px var(--font-mono);
  cursor: pointer;
}
.global-pitch-control button:hover:not(:disabled) {
  border-color: rgba(197,240,72,.45);
  color: var(--accent);
}
.global-pitch-control button:disabled { opacity: .35; cursor: default; }
.global-pitch-control #globalPitchReset.is-shifted {
  border-color: rgba(197,240,72,.42);
  background: var(--accent-soft);
  color: var(--accent);
}
.desktop-score-actions .track-picker {
  width: min(100%, 215px);
  margin: 0;
}
.desktop-score-actions .track-picker > span:first-child { display: none; }
.desktop-score-actions .sound-row,
.desktop-score-actions .track-picker select { width: 100%; }
.desktop-score-actions > .desktop-studio-slot > .btn,
.desktop-score-actions .export-tools > .btn {
  min-height: 29px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 9px;
}
.desktop-score-actions .export-tools { margin: 0; }
.desktop-studio-tools .transport-knobs {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(120px, .7fr) minmax(250px, 1.6fr);
  gap: 9px;
}
.desktop-studio-tools .knob { gap: 3px; }
.desktop-studio-tools .knob > span { font-size: 8px; }
.desktop-studio-tools .knob-row { grid-template-columns: 1fr 43px; gap: 6px; }
.desktop-studio-tools .knob-row output { font-size: 9px; }
.desktop-studio-tools .toggles {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 4px;
}
.desktop-studio-tools .toggle {
  min-height: 27px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 9px;
}
.desktop-studio-tools .loop-ab { display: inline-flex; gap: 3px; }
.desktop-studio-tools .loop-ab .toggle { min-width: 26px; padding-inline: 5px; }
.desktop-studio-tools .loop-range-readout { display: none; }
.desktop-video-rack {
  padding: 5px;
  background: #09090a;
}
.desktop-video-rack .desktop-studio-label {
  padding-inline: 3px;
  margin-bottom: 3px;
}
.desktop-video-slot .yt-player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
}
.desktop-video-slot .yt-player-empty {
  padding: 8px;
  font-size: 9px;
}

.numeric-percussion-active > .at-surface { display: none !important; }
.percussion-number-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 28px 0;
  padding: 4px 10px 28px;
  color: #171719;
  font-family: var(--font-mono);
}
.percussion-number-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 4px 2px;
}
.percussion-number-head strong { font: 700 16px var(--font-ui); }
.percussion-number-head span {
  color: #65656d;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.percussion-measure {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 17px 0 8px;
  border: 0;
  border-left: 1px solid #29292b;
  border-radius: 0;
  background:
    linear-gradient(to bottom,
      transparent 31px, #57575a 32px, transparent 33px,
      transparent 43px, #57575a 44px, transparent 45px,
      transparent 55px, #57575a 56px, transparent 57px,
      transparent 67px, #57575a 68px, transparent 69px,
      transparent 79px, #57575a 80px, transparent 81px),
    #f7f5ee;
}
.percussion-measure:last-child { border-right: 1px solid #29292b; }
.percussion-measure-number {
  position: absolute;
  top: 4px;
  left: 8px;
  color: #bc2b25;
  font-size: 9px;
}
.percussion-beats {
  display: flex;
  align-items: stretch;
  min-height: 86px;
}
.percussion-beat {
  position: relative;
  min-width: 30px;
  min-height: 86px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111114;
  cursor: pointer;
}
.percussion-note-layer { position: absolute; inset: 0; pointer-events: none; }
.percussion-note-number {
  position: absolute;
  z-index: 2;
  top: calc(9px + var(--staff-step) * 6px);
  left: 50%;
  min-width: 18px;
  padding: 0 1px;
  transform: translate(-50%, -50%);
  background: #f7f5ee;
  color: #111114;
  font: 700 10px/11px var(--font-mono);
  text-align: center;
}
.percussion-stem {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: calc(50% + 8px);
  width: 1px;
  height: calc(2px + var(--stem-bottom) * 6px);
  background: #111114;
}
.percussion-beams {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: calc(50% + 8px);
  width: calc(50% + 1px);
}
.percussion-beams i {
  display: block;
  width: 100%;
  height: 3px;
  margin-bottom: 2px;
  background: #111114;
  transform: skewY(2deg);
}
.percussion-beams.flagged { width: 10px; }
.percussion-beams.connects-next { width: calc(100% + 1px); }
.percussion-beams.flagged i { transform: skewY(22deg); transform-origin: left; }
.percussion-dots {
  position: absolute;
  z-index: 3;
  top: calc(7px + var(--staff-step) * 6px);
  left: calc(50% + 10px);
  font: 700 11px var(--font-mono);
}
.percussion-tuplet {
  position: absolute;
  z-index: 4;
  top: -3px;
  left: 50%;
  padding: 0 2px;
  background: #f7f5ee;
  font: 700 8px var(--font-mono);
}
.percussion-rest {
  position: absolute;
  top: 35px;
  left: 50%;
  transform: translateX(-50%);
  color: #111114;
  font: 25px/1 Bravura, "Noto Music", serif;
}
.percussion-beat:hover,
.percussion-beat:focus-visible {
  background: rgba(197,240,72,.22);
  outline: 2px solid rgba(103,130,27,.55);
  outline-offset: -2px;
}
.percussion-beat.is-rest { color: #9a9992; font-weight: 400; }

@media (min-width: 1180px) {
  .practice-dock-body > .dock-group:first-child { display: none; }
  .score-shell {
    height: calc(100dvh - 314px);
    min-height: 440px;
  }
}
@media (min-width: 1180px) and (max-width: 1430px) {
  .desktop-studio-bar {
    grid-template-columns: minmax(470px, 1.7fr) minmax(225px, .8fr);
  }
  .desktop-studio-label small { display: none; }
  .desktop-studio-tools .transport-knobs {
    grid-template-columns: minmax(108px, .55fr) minmax(108px, .55fr) minmax(270px, 1.5fr);
  }
}

/* Matching full-height edge launchers */
.library-dock-edge,
.practice-dock-edge {
  display: block;
  position: fixed;
  inset-block: 0;
  z-index: 62;
  width: 18px;
  height: 100dvh;
  pointer-events: none;
}
.library-dock-edge { left: 0; }
.practice-dock-edge { right: 0; top: 0; }
.library-dock-tab,
.practice-dock-tab {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 30px;
  min-height: 112px;
  padding: 11px 5px;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  border: 1px solid rgba(197,240,72,.28);
  background: rgba(17,17,20,.94);
  color: var(--accent);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(14px);
}
.library-dock-tab {
  left: 0;
  rotate: 180deg;
  border-left: 0;
  border-radius: 0 9px 9px 0;
  box-shadow: 8px 0 24px rgba(0,0,0,.28);
}
.practice-dock-tab {
  right: 0;
  left: auto;
  rotate: 180deg;
  border-right: 0;
  border-radius: 9px 0 0 9px;
  box-shadow: -8px 0 24px rgba(0,0,0,.28);
}

.rail {
  width: min(410px, calc(100vw - 18px));
  height: 100dvh;
  padding: 18px 16px 14px;
  gap: 14px;
  border-radius: 0;
  background: rgba(12,12,15,.985);
  backdrop-filter: blur(24px);
}
.rail-footer {
  gap: 8px;
  align-items: stretch;
}
.rail-footer .activity-launch {
  width: 100%;
  justify-content: center;
}

.practice-dock-backdrop {
  position: fixed;
  inset: 0;
  z-index: 84;
  padding: 0;
  border: 0;
  background: rgba(2,2,4,.56);
  backdrop-filter: blur(2px);
}
.practice-dock-edge.is-open {
  z-index: 90;
  width: min(430px, calc(100vw - 18px));
}
.practice-dock-edge:not(.is-open),
.practice-dock-edge:not(.is-open):hover,
.practice-dock-edge:not(.is-open):focus-within { width: 18px; }
.practice-dock {
  pointer-events: auto;
  position: absolute;
  inset: 0 0 0 auto;
  width: min(430px, calc(100vw - 18px));
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(12,12,15,.99);
  box-shadow: -24px 0 70px rgba(0,0,0,.55);
  transform: translateX(calc(100% + 18px));
  opacity: 0;
  visibility: hidden;
  transition: transform .2s ease, opacity .2s ease, visibility .2s;
}
.practice-dock-edge.is-open .practice-dock,
.practice-dock-edge:focus-within .practice-dock {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}
.practice-dock-edge:not(.is-open) .practice-dock,
.practice-dock-edge:not(.is-open):hover .practice-dock {
  pointer-events: none;
  transform: translateX(calc(100% + 18px));
  opacity: 0;
  visibility: hidden;
}
.practice-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.018);
}
.practice-dock-head span {
  display: block;
  color: var(--text-3);
  font: 8px/1.3 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.practice-dock-head strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  letter-spacing: -.02em;
}
.practice-dock-head button {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
}
.practice-dock-edge.is-open > .practice-dock-tab {
  opacity: 0;
  pointer-events: none;
}
.practice-dock-body {
  height: calc(100dvh - 68px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}
.dock-group {
  flex: none;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.022);
}
.dock-group > h3,
.dock-disclosure > summary {
  color: var(--text-3);
  font: 600 9px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.dock-group > h3 { margin-bottom: 9px; }
.dock-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  cursor: pointer;
  list-style: none;
}
.dock-disclosure > summary::-webkit-details-marker { display: none; }
.dock-disclosure > summary::after { content: "+"; font-size: 16px; color: var(--text-2); }
.dock-disclosure[open] > summary::after { content: "−"; }
.dock-disclosure[open] > .dock-slot { margin-top: 12px; }
.dock-slot { min-width: 0; }

.dock-slot > .track-quick {
  width: 100%;
  display: grid;
  gap: 4px;
  max-height: min(34dvh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.dock-slot .track-chip {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: left;
}
.dock-slot .track-chip.is-on { box-shadow: inset 3px 0 var(--accent); }
.dock-slot .track-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  width: 100%;
}
.dock-slot .track-control-all { grid-template-columns: 1fr; }
.dock-slot .track-mix-toggle {
  width: 44px;
  min-height: 44px;
  font-size: 11px;
}
.track-sheet-sliders {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 2px 10px 9px;
}
.track-sheet-sliders label {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font: 8px var(--font-mono);
  text-transform: uppercase;
}
.track-sheet-sliders input { width: 100%; accent-color: var(--accent); }

.dock-slot > .transport-knobs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}
.dock-slot .transport-knobs .toggles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dock-slot .toggle {
  min-height: 36px;
  justify-content: flex-start;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 11px;
}
.dock-slot .loop-ab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dock-slot .loop-range-readout { grid-column: 1 / -1; max-width: none; }
.dock-slot > .track-picker,
.dock-slot > .btn,
.dock-slot > .export-tools {
  width: 100%;
  margin-top: 7px;
}
.dock-slot .sound-row,
.dock-slot .track-picker select { width: 100%; }
.dock-slot > .export-tools > .btn { width: 100%; }
.dock-slot .export-menu { left: 0; right: 0; width: 100%; }
.dock-slot > .mixer {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.16);
}
.dock-slot .mixer-head {
  align-items: flex-start;
  margin-bottom: 9px;
}
.dock-slot .mixer-head h3 { font-size: 12px; }
.dock-slot .mixer-hint { display: block; margin-top: 2px; font-size: 9px; }
.dock-slot .mixer-actions { flex-wrap: wrap; justify-content: flex-end; }
.dock-slot .mixer-actions .btn { min-height: 30px; padding: 6px 8px; font-size: 9px; }
.dock-slot .mixer-tracks { grid-template-columns: 1fr; gap: 5px; }
.dock-slot .mixer-track {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.045);
}
.dock-slot .mixer-track:first-child { border-top: 0; }
.dock-slot .mixer-name { min-width: 0; font-size: 12px; }
.dock-slot .mixer-base {
  grid-column: 1 / -1;
  white-space: normal;
  overflow-wrap: anywhere;
}
.dock-slot .mixer-vol,
.dock-slot .mixer-pan { width: 100%; }
.dock-slot .mixer-vol,
.dock-slot .mixer-pan { grid-column: 1 / -1; }
.dock-slot .mixer-pitch { grid-column: 1 / -1; }

.dock-video { padding: 0; border: 0; background: transparent; }
.dock-video .yt-sync {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  box-shadow: none;
}
.dock-video .yt-sync-body { grid-template-columns: 1fr; }
.dock-video .yt-sync-head { display: block; }
.dock-video .yt-sync-head h3 { margin-bottom: 10px; }
.dock-video .yt-form {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.dock-video .yt-form input { grid-column: 1 / -1; }
.dock-video .yt-sync-controls { gap: 6px; }
.dock-video .yt-sync-controls > * { flex: 1 1 auto; }

.dock-slot > .practice-live {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
}
.dock-slot > .practice-bar {
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}
.dock-slot .practice-cell {
  padding: 10px;
  border-radius: 10px;
}
.dock-slot .practice-cell.notes { grid-column: 1 / -1; }
.dock-slot .practice-cell.saved-sections { grid-column: 1 / -1; }
.dock-slot .practice-cell textarea { min-height: 54px; }
.diagnostics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-3);
  font: 9px/1.4 var(--font-mono);
}
.diagnostics-head button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 9px;
  cursor: pointer;
}
.diagnostics-panel { display: grid; gap: 5px; }
.midi-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  margin-bottom: 8px;
}
.midi-controls select,
.midi-controls button {
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 9px;
}
.midi-controls button { padding-inline: 8px; cursor: pointer; }
.midi-controls span {
  grid-column: 1 / -1;
  color: var(--text-3);
  font: 8.5px/1.35 var(--font-mono);
}
.diagnostic-track {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3);
}
.diagnostic-track.has-correction { border-color: rgba(255,190,80,.45); }
.diagnostic-track strong { font-size: 10.5px; }
.diagnostic-track span {
  color: var(--text-3);
  font: 8.5px/1.45 var(--font-mono);
  overflow-wrap: anywhere;
}

/* Full-workspace source editor. It deliberately creates a new score revision:
   the imported Guitar Pro binary remains the dependable undo point. */
.tab-editor {
  width: min(1180px, calc(100vw - 36px));
  height: min(880px, calc(100dvh - 36px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #101014;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0,0,0,.72);
}
.tab-editor::backdrop {
  background: rgba(2,2,4,.76);
  backdrop-filter: blur(5px);
}
.tab-editor-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0;
}
.tab-editor-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.tab-editor-head p {
  margin: 0 0 2px;
  color: var(--accent);
  font: 600 9px var(--font-mono);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.tab-editor-head h2 { margin: 0; font-size: 21px; }
.tab-editor-close {
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
}
.tab-editor-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 0;
}
.tab-editor-meta label { min-width: 0; }
.tab-editor-meta span,
.tab-editor-copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-3);
  font: 600 9px var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tab-editor-meta input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: 13px var(--font-ui);
}
.tab-editor-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px 8px;
  color: var(--text-3);
  font-size: 11px;
}
.tab-editor-copy strong { flex: none; margin: 0; color: var(--accent); }
.tab-editor-text {
  width: calc(100% - 32px);
  height: 100%;
  min-height: 0;
  margin: 0 16px;
  padding: 14px;
  resize: none;
  tab-size: 2;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #09090b;
  color: #e7e8df;
  font: 12px/1.55 var(--font-mono);
  white-space: pre;
  overflow: auto;
}
.tab-editor-text:focus {
  border-color: rgba(197,240,72,.56);
  box-shadow: 0 0 0 3px rgba(197,240,72,.08);
}
.tab-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 66px;
  padding: 12px 16px;
}
.tab-editor-status {
  min-width: 0;
  margin-right: auto;
  color: var(--text-3);
  font: 10px/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}
.tab-editor-status.is-valid { color: var(--accent); }
.tab-editor-status.is-error { color: var(--danger); }

@media (max-width: 720px) {
  .workspace { padding: 10px 9px 14px; gap: 8px; }
  .masthead { min-height: 50px; padding-inline: 6px; }
  .kicker { display: none; }
  .title { font-size: clamp(21px, 7vw, 28px); }
  .byline { max-width: 75vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .masthead { align-items: start; }
  .masthead-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
  }
  .masthead .title,
  .masthead .byline { grid-column: 1; max-width: none; }
  .masthead .folder-nav {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .folder-nav span { display: none; }
  .folder-nav button {
    min-width: 36px;
    min-height: 36px;
    padding: 4px 7px;
    font-size: 0;
  }
  #prevTabBtn::after { content: "‹"; font-size: 20px; }
  #nextTabBtn::after { content: "›"; font-size: 20px; }
  #offlineFolderBtn { min-width: 30px; font-size: 17px; }
  .transport {
    position: static;
    grid-template-columns: 1fr;
    min-height: 54px;
    padding: 6px 8px;
  }
  .transport-left { flex-wrap: wrap; }
  .transport-seek { grid-column: 1; min-height: 22px; }
  .play { width: 44px; height: 44px; }
  .audio-source { display: none; }
  .sync-pill { padding-inline: 8px; }
  .sync-pill-label { font-size: 0; }
  .sync-pill-label::after { content: "Sync"; font-size: 10px; }
  .cursor-follow {
    min-width: 38px;
    padding-inline: 8px;
    font-size: 0;
  }
  .cursor-follow::after {
    content: "◎";
    font: 600 15px var(--font-mono);
  }
  .cursor-follow.is-paused::after { content: "↧"; }
  .score-shell { height: calc(100dvh - 132px); min-height: 420px; }
  .library-dock-tab { min-height: 92px; width: 27px; }
  .practice-dock-edge,
  .practice-dock-edge:not(.is-open),
  .practice-dock-edge:not(.is-open):hover,
  .practice-dock-edge:not(.is-open):focus-within {
    inset: auto 0 0;
    width: 100vw;
    height: 58px;
  }
  .practice-dock-edge.is-open,
  .practice-dock-edge.is-open .practice-dock {
    width: 100vw;
  }
  .practice-dock-edge.is-open { height: min(82dvh, 760px); }
  .practice-dock-tab {
    inset: auto 9px max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 18px);
    min-height: 48px;
    height: 48px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 6px 13px;
    transform: none;
    rotate: none;
    writing-mode: horizontal-tb;
    border: 1px solid rgba(197,240,72,.34);
    border-radius: 14px;
    box-shadow: 0 -8px 30px rgba(0,0,0,.42);
    text-align: left;
  }
  .practice-dock-tab-title {
    color: var(--accent);
    font: 700 9px var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .practice-dock-tab strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font: 600 12px/1.25 var(--font-ui);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .practice-dock-tab-arrow { color: var(--accent); font-size: 18px; }
  .practice-dock {
    inset: auto 0 0;
    width: 100vw;
    height: min(82dvh, 760px);
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    transform: translate3d(0, calc(100% + 18px), 0);
    transition: transform .24s cubic-bezier(.2,.75,.25,1), opacity .18s ease, visibility .24s;
  }
  .practice-dock-edge.is-open .practice-dock,
  .practice-dock-edge:focus-within .practice-dock {
    transform: translate3d(0, 0, 0);
  }
  .practice-dock-edge:not(.is-open) .practice-dock,
  .practice-dock-edge:not(.is-open):hover .practice-dock,
  .practice-dock-edge:not(.is-open):focus-within .practice-dock {
    transform: translate3d(0, calc(100% + 18px), 0);
    opacity: 0;
    visibility: hidden;
  }
  .practice-dock.is-dragging { transition: none; }
  .practice-dock-head {
    position: relative;
    min-height: 60px;
    padding: 19px 14px 9px;
    touch-action: pan-y;
    cursor: grab;
  }
  .practice-dock-head::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 44px;
    height: 5px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: var(--line-strong);
  }
  .practice-dock-body {
    height: calc(min(82dvh, 760px) - 60px);
    padding: 10px max(10px, env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }
  .dock-slot .track-chip {
    min-height: 44px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .dock-slot > .track-quick { max-height: min(48dvh, 390px); }
  .dock-slot .export-menu { left: 10px; right: 10px; width: auto; }
  .rail { width: 100vw; padding: 14px 12px; }
  .tab-editor {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .tab-editor-head { min-height: 60px; padding: 10px 12px; }
  .tab-editor-meta { grid-template-columns: 1fr; padding: 10px 10px 0; }
  .tab-editor-copy {
    display: block;
    padding: 10px;
    line-height: 1.4;
  }
  .tab-editor-copy strong { margin-bottom: 4px; }
  .tab-editor-text { width: calc(100% - 20px); margin-inline: 10px; padding: 11px; }
  .tab-editor-actions {
    min-height: 62px;
    flex-wrap: wrap;
    padding: 9px 10px;
  }
  .tab-editor-status { flex: 1 0 100%; }
  .tab-editor-actions .btn { flex: 1; }

  /* Mobile titles are content, not decoration. Never sacrifice the end of a
     song/album name to keep a row artificially one line tall. */
  .result-title,
  .library-title,
  .result-artist,
  .library-artist,
  .song-card-title,
  .song-card-sub,
  .album-name,
  .artist-card .a-name,
  .ver-open,
  .tree-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }
  .result-item,
  .library-item { gap: 4px; }
  .song-card-main { align-items: flex-start; padding-block: 12px; }
  .tree-row { align-items: flex-start; }
  .tree-row-main {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-block: 9px;
  }
  .tree-row .tree-count,
  .tree-row .tree-del { margin-top: 8px; }
  .tree-tag {
    flex: 1 0 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }
  .tree-row.depth-1 .tree-tag { padding-left: 57px; }
  .tree-row.depth-2 .tree-tag { padding-left: 74px; }
  .tree-row.depth-3 .tree-tag { padding-left: 91px; }
}

/* Dense desktop chrome: keep the score dominant and the instrument strip
   permanently reachable, matching the useful parts of Guitar Pro's layout. */
@media (min-width: 1180px) {
  .workspace {
    padding: 8px 12px 72px;
    gap: 6px;
  }
  .masthead {
    min-height: 38px;
    padding: 0 4px 5px;
    gap: 8px;
  }
  .masthead-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    overflow: hidden;
  }
  .masthead .kicker { display: none; }
  .masthead .title {
    flex: none;
    max-width: min(42vw, 680px);
    overflow: hidden;
    font-size: 22px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .masthead .byline {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .masthead .folder-nav { flex: none; }
  .transport {
    grid-template-columns: auto minmax(160px, 1fr);
    min-height: 44px;
    padding: 4px 8px;
    border-radius: 10px;
  }
  .transport-seek { grid-column: 2; }
  .transport-knobs { grid-column: 1 / -1; }
  .transport-left { gap: 7px; }
  .play { width: 34px; height: 34px; font-size: 12px; }
  .ghost { width: 30px; height: 30px; border-radius: 7px; font-size: 10px; }
  .time-readout { font-size: 10px; gap: 4px; }
  .audio-source { padding: 3px 6px; font-size: 8px; }

  .desktop-studio-bar {
    position: relative;
    grid-template-columns: minmax(510px, 1.9fr) minmax(260px, .75fr);
    gap: 5px;
    min-height: 64px;
    padding-left: 0;
  }
  .desktop-studio-group {
    min-height: 60px;
    padding: 5px 7px;
    border-radius: 9px;
  }
  .desktop-studio-label {
    min-height: 11px;
    margin-bottom: 2px;
    font-size: 7px;
  }
  .desktop-studio-label small { font-size: 7px; }
  .desktop-studio-label button { padding: 1px 4px; font-size: 7px; }
  .desktop-studio-tools .transport-knobs {
    grid-template-columns: minmax(105px, .55fr) minmax(105px, .55fr) minmax(310px, 1.6fr);
    gap: 7px;
  }
  .desktop-studio-tools .knob { gap: 1px; }
  .desktop-studio-tools .knob > span { display: none; }
  .desktop-studio-tools .knob-row { grid-template-columns: 1fr 38px; gap: 4px; }
  .desktop-studio-tools .knob-row output { font-size: 8px; }
  .desktop-studio-tools input[type="range"] { height: 3px; }
  .desktop-studio-tools input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    border-width: 2px;
  }
  .desktop-studio-tools .toggle {
    min-height: 23px;
    padding: 3px 6px;
    font-size: 8px;
  }
  .desktop-studio-tools .toggle-dot { width: 6px; height: 6px; }
  .desktop-studio-tools .loop-ab .toggle { min-width: 22px; }
  .desktop-studio-tools .global-pitch-control {
    grid-template-columns: 24px 38px 24px;
    min-height: 23px;
    padding: 0 2px;
  }
  .desktop-studio-tools .global-pitch-control > span { display: none; }
  .desktop-studio-tools .global-pitch-control button {
    min-width: 24px;
    min-height: 19px;
    padding: 1px 3px;
    font-size: 8px;
  }
  .desktop-score-actions .desktop-studio-slot { gap: 3px; }
  .desktop-score-actions .track-picker { width: 150px; }
  .desktop-score-actions .track-picker select {
    min-height: 26px;
    padding-block: 4px;
    font-size: 9px;
  }
  .desktop-score-actions > .desktop-studio-slot > .btn,
  .desktop-score-actions .export-tools > .btn {
    min-height: 25px;
    padding: 4px 6px;
    font-size: 8px;
  }
  .desktop-video-rack {
    position: fixed;
    z-index: 57;
    right: 18px;
    bottom: 128px;
    left: auto;
    width: min(320px, calc(100vw - 36px));
    min-height: 0;
    padding: 5px;
    border-color: rgba(255,255,255,.16);
    background: rgba(9,9,10,.95);
    box-shadow: 0 18px 50px rgba(0,0,0,.48);
    backdrop-filter: blur(16px);
  }
  .desktop-video-rack .desktop-studio-label {
    min-height: 10px;
    margin-bottom: 1px;
  }
  .desktop-video-slot .yt-player-wrap {
    width: 100%;
    min-height: 169px;
    border-radius: 5px;
    pointer-events: auto;
  }
  .desktop-video-slot .yt-player-empty { padding: 4px; font-size: 7px; }

  .desktop-video-rack.is-minimized {
    width: auto;
    min-width: 118px;
    padding: 5px 7px;
  }
  .desktop-video-rack.is-minimized .desktop-studio-label {
    margin: 0;
  }
  .desktop-video-rack.is-minimized .desktop-video-slot { display: none; }
  .score-wrap { margin-left: 0; }
  body.reader-mode .desktop-studio-tools,
  body.reader-mode .desktop-score-actions { display: none; }
  body.reader-mode .desktop-studio-bar {
    display: block;
    padding-left: 0;
  }
  body.reader-mode .text-reader { margin-left: 0; }
  body.practice-dock-open .desktop-studio-bar { padding-left: 0; }
  body.practice-dock-open .score-wrap { margin-left: 0; }
  body.practice-dock-open.reader-mode .text-reader { margin-left: 0; }

  .score-shell {
    height: calc(100dvh - 234px - var(--desktop-trackbar-height, 114px));
    min-height: 280px;
  }

  .desktop-track-bar {
    position: fixed;
    z-index: 58;
    right: 12px;
    bottom: 7px;
    left: 12px;
    max-height: calc(100dvh - 300px);
    padding: 8px 10px;
    overflow-y: auto;
    border-color: var(--line-strong);
    border-radius: 10px;
    background: rgba(12,12,15,.97);
    box-shadow: 0 -12px 36px rgba(0,0,0,.38);
    backdrop-filter: blur(18px);
  }
  .desktop-track-bar .desktop-studio-label {
    min-height: 18px;
    margin-bottom: 4px;
    font-size: 10px;
  }
  .desktop-track-bar .desktop-studio-label small { font-size: 9px; }
  .desktop-track-bar .desktop-studio-label button {
    min-height: 24px;
    padding: 3px 9px;
    font-size: 9px;
  }
  .desktop-track-bar .desktop-studio-label button.is-on {
    border-color: rgba(197,240,72,.5);
    background: var(--accent-soft);
    color: var(--accent);
  }
  .desktop-track-bar.has-arrangement .desktop-studio-slot { display: none; }
  .desktop-track-bar .track-quick { gap: 3px; }
  .desktop-track-bar .track-quick {
    flex-wrap: nowrap;
    overflow: visible;
  }
  .desktop-track-bar .track-control {
    flex: 1 1 92px;
  }
  .desktop-track-bar .track-control-all {
    flex: 0 0 auto;
  }
  .desktop-track-bar .track-chip {
    flex: 1 1 auto;
    min-height: 24px;
    padding: 3px 7px;
    font-size: 8.5px;
  }
  .desktop-track-bar .track-mix-toggle {
    flex: 0 0 18px;
    width: 18px;
    min-height: 24px;
    font-size: 7.5px;
  }
}
