/* MajesticTab design 1: the app recedes, the score leads. Loaded after style.css and overrides it.
   Target: MajesticTab-local/design-1/majestictab-reimagined.html (tokens, shapes and structure follow that page). */

/* ==========================================================================
   DESIGN 1 — FLAT FINISHES, QUIET CHROME (the app recedes, the score leads)
   One tone step between surfaces, flat hues, no gradients, glass, glow or
   resting shadows (they are the costliest on low-end Android GPUs).
   Tokens first, then the few places that bypass tokens.
   ========================================================================== */
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-display: swap; src: url('fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root, [data-theme] {
  /* Four-step ground ladder: body, elevated, card, hover (existing tokens). Cards become opaque. */
  --bg-card: var(--bg-card-solid);
  --bg-ambient-1: transparent;
  --bg-ambient-2: transparent;
  /* Flat action color (the original primary). A same-color gradient keeps `background-image` uses valid. */
  --accent-gradient: linear-gradient(var(--accent-primary), var(--accent-primary));
  --accent-gradient-hover: linear-gradient(var(--accent-secondary), var(--accent-secondary));
  --accent-glow: transparent;
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  /* Motion tokens (exits faster than entries) */
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 350ms;
  --dur-slower: 400ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --r-control: 8px;
  --r-card: 12px;
}

/* Platform corner radius: tighter on desktop, rounder on iOS */
.tauri-ios, .tauri-macos { --r-control: 10px; --r-card: 14px; }
.tauri-windows, .tauri-linux { --r-control: 4px; --r-card: 8px; }

body {
  background-image: none;
  background-attachment: scroll;
}

/* No glass anywhere; scrims keep their dimming but lose the blur */
*, *::before, *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

#topBar {
  background: var(--bg-elevated) !important;
  box-shadow: none;
  border-bottom: 1px solid var(--border-subtle);
}
#topBar.hud-hidden.hud-transient { box-shadow: none; }

/* Buttons: flat fill, tone-step hover, no glow or lift */
.btn-theme-primary {
  background: var(--accent-primary) !important;
  border: 1px solid transparent !important;
  box-shadow: none;
  transform: none;
}
@media (hover: hover) { .btn-theme-primary:hover:not(:disabled) {
  background: var(--accent-primary) !important;
  border: 1px solid transparent !important;
  box-shadow: none;
  transform: none;
} }
@media (hover: hover) { .btn-theme-primary:hover:not(:disabled) { filter: brightness(1.12); } }
@media (hover: hover) { .btn-theme-outline:hover:not(:disabled) { box-shadow: none; } }
.btn-theme-primary,
.btn-theme-outline,
.btn-theme-danger,
.btn-theme-success,
.theme-control-btn,
.btn-theme-icon {
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn-theme-primary:active:not(:disabled),
.btn-theme-outline:active:not(:disabled),
.theme-control-btn:active:not(:disabled),
.btn-theme-icon:active:not(:disabled) { transform: scale(0.97); }

/* Display face: song titles and big numerals only, like pedal and amp labels */
.brand-title,
.breadcrumb-song-title,
.theme-modal-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.breadcrumb-song-title { font-size: 1.3em; font-weight: 600; letter-spacing: 0.02em; }

/* Modals and panels: opaque cards, scale-in, faster out */
.theme-modal-card { box-shadow: none !important; border: 0 !important; border-radius: var(--r-card) !important; }
/* Dialog chrome: tone steps instead of hairlines, ink tokens instead of white, system-font title, no glow on the header buttons */
.theme-modal-header { border-bottom: 0; }
.theme-modal-footer { border-top: 0; border-bottom-left-radius: var(--r-card); border-bottom-right-radius: var(--r-card); }
.theme-modal-title,
.theme-modal-titles :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; font-weight: 600; letter-spacing: 0; color: var(--ink) !important; }
.theme-modal-back-btn:hover:not(:disabled) { border-color: transparent; box-shadow: none; color: var(--ink); }
.theme-modal-close-btn, .theme-modal-back-btn { transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
@media (pointer: coarse) { .theme-modal-close-btn, .theme-modal-back-btn { min-width: 44px; min-height: 44px; } }

/* --- Motion (phase 2): transform and opacity only, exits faster than entries --- */
@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.theme-modal-card { animation: modalScaleUp var(--dur-base) var(--ease-out); }
.theme-modal-backdrop { animation: scrimIn var(--dur-base) var(--ease-out); }
.theme-modal-backdrop.is-closing { animation: scrimOut var(--dur-fast) ease-in forwards; }
.theme-modal-backdrop.is-closing .theme-modal-card { animation: modalScaleDown var(--dur-fast) ease-in forwards; }
/* Desktop shells: the scrim dims the whole window, title bar included. The card stays clear of the traffic lights / caption buttons through padding, and the Windows buttons float above the scrim. */
.tauri-macos .theme-modal-backdrop, .tauri-windows .theme-modal-backdrop { top: 0; height: 100vh; padding: calc(50px + 0.75rem) 1rem 1rem; }
.tauri-windows #winControls { z-index: 2001; }
/* Tool modals opened from the reader's Tools menu share one place on phones: top-aligned, always below the top safe-area inset (Dynamic Island), one width and one height limit. */
body.phone-reader :is(#referenceModal, #tunerModal, #metronomeModal, #latencyModal, #jamModal):not(.tool-embedded) { align-items: flex-start; padding: calc(env(safe-area-inset-top, 0px) + 8px) max(env(safe-area-inset-right, 0px), 12px) max(env(safe-area-inset-bottom, 0px), 12px) max(env(safe-area-inset-left, 0px), 12px); }
body.phone-reader :is(#referenceModal, #tunerModal, #metronomeModal, #latencyModal, #jamModal):not(.tool-embedded) .theme-modal-card { width: 100%; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px); }
body.phone-reader #referenceModal:not(.tool-embedded) .reference-modal-card { height: auto; }
@keyframes scrimOut { to { opacity: 0; } }
@keyframes modalScaleDown { to { opacity: 0; transform: scale(0.97); } }

/* Spring switch: the thumb overshoots slightly, the track recolors quickly */
.form-switch .form-check-input {
  transition: background-position var(--dur-base) cubic-bezier(0.34, 1.36, 0.64, 1),
              background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  box-shadow: none !important;
}
.form-switch .form-check-input:focus-visible { box-shadow: 0 0 0 0.2rem var(--accent-primary-alpha) !important; }
.synth-panel .theme-switch:checked, .form-check-input:checked { box-shadow: none; }

/* Panels grow from where they were opened */
.dropdown-menu, .tools-menu, .popover-pop {
  transform-origin: top right;
  animation: popIn var(--dur-base) var(--ease-out);
}
/* `scale`, not `transform`: Popper positions menus with an inline transform, and animating transform would override it and make the menu jump */
@keyframes popIn { from { opacity: 0; scale: 0.97; } to { opacity: 1; scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .theme-modal-card, .theme-modal-backdrop, .dropdown-menu, .tools-menu, .popover-pop { animation: none !important; }
  .form-switch .form-check-input { transition: none !important; }
  .btn-theme-primary:active:not(:disabled),
  .btn-theme-outline:active:not(:disabled),
  .theme-control-btn:active:not(:disabled),
  .btn-theme-icon:active:not(:disabled) { transform: none; }
}

/* --- Shell (phase 5): one nav, two shapes. Bottom tab bar on phones, left rail on wide windows. --- */
:root { --rail-w: 76px; --topbar-h: 57px; }
@media (min-width: 577px) {
  body.library-view-active .library-bottom-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    width: var(--rail-w);
    z-index: 1040;
    padding: 0.75rem 0.5rem;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-subtle);
    box-shadow: none;
  }
  body.library-view-active .library-bottom-nav .library-nav-settings { margin-top: auto; }
  body.library-view-active #libraryPage { padding-left: var(--rail-w); }
  .library-bottom-nav .library-nav-tab { border-radius: var(--r-control); min-height: 56px; }
  @media (hover: hover) { .library-bottom-nav .library-nav-tab:hover { background: var(--bg-card-hover); color: var(--text-primary); } }
}
/* Active item: a flat dot in the second hue, no glow */
.library-bottom-nav .library-nav-tab { position: relative; }
.library-bottom-nav .library-nav-tab.active::before {
  content: ''; position: absolute; top: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent-secondary);
}
@media (max-width: 576px) {
  body.library-view-active .library-bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--bg-elevated);
    box-shadow: none;
  }
}
.library-nav-tab { transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.library-nav-tab:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) { .library-nav-tab:active { transform: none; } }
/* The rail replaces the in-page view switcher */
@media (min-width: 577px) { body.library-view-active .lib-view-switch-row { display: none; } }
/* View is a reader menu */
body.library-view-active #viewPill { display: none; }

/* --- Toast: flat tone step, status dot, rises from below, or drops from the top on phones (slower in than out), optional action such as Undo --- */
:root { --ok: #34d399; --warn: #fbbf24; --danger: #f87171; }
[data-theme="Snow White"] { --ok: #047857; --warn: #92400e; --danger: #b91c1c; }

.theme-toast-container {
  position: fixed; z-index: 10000; right: 16px; bottom: calc(var(--dock-h, 0px) + var(--fretboard-effective-h, 0px) + 16px);
  display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px));
  pointer-events: none;
}
.theme-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; min-height: 48px;
  background: var(--s3); color: var(--ink); border: 0; border-radius: var(--r-card);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28); backdrop-filter: none; -webkit-backdrop-filter: none;
  font-size: 0.9rem;
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.theme-toast-visible { opacity: 1; transform: none; }
.theme-toast-hiding { opacity: 0; transform: translateY(12px); transition-duration: var(--dur-fast); }
@media (max-width: 576px) {
  .theme-toast-container { left: 16px; right: 16px; width: auto; bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 12px); }
  .theme-toast { transform: translateY(-12px); }
  .theme-toast-visible { transform: none; }
  .theme-toast-hiding { transform: translateY(-12px); }
  /* The native (liquid glass) search field is drawn by the system above the web view, so a toast cannot cover it: start below it */
  body.native-search:not(.native-search-pane) .theme-toast-container { top: calc(var(--native-search-top, 0px) + 8px); }
}
/* Wider screens keep toasts at the bottom; the native tab bar is drawn over the web view there too, so sit above it */
@media (min-width: 577px) {
  html:not(.native-vertical) body.native-tabbar .theme-toast-container { bottom: calc(var(--native-tabbar-h, 83px) + var(--dock-h, 0px) + var(--fretboard-effective-h, 0px) + 16px); }
}
.theme-toast-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ink2); }
.theme-toast-success .theme-toast-dot { background: var(--ok); }
.theme-toast-warning .theme-toast-dot { background: var(--warn); }
.theme-toast-error .theme-toast-dot { background: var(--danger); }
.theme-toast-message { flex: 1 1 auto; min-width: 0; line-height: 1.4; word-break: break-word; }
.theme-toast-action, .theme-toast-close {
  flex-shrink: 0; background: transparent; border: 0; cursor: pointer; border-radius: var(--r-control);
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.theme-toast-action { padding: 0 12px; color: var(--accent-text); font-weight: 700; font-size: 0.85rem; }
.theme-toast-close { min-width: 32px; padding: 0; color: var(--ink2); font-size: 1.25rem; line-height: 1; }
@media (hover: hover) { .theme-toast-action:hover,
.theme-toast-close:hover { background: var(--s2); } }
@media (hover: hover) { .theme-toast-close:hover { color: var(--ink); } }
.theme-toast-action:active, .theme-toast-close:active { transform: scale(0.96); }
.theme-toast-action:focus-visible, .theme-toast-close:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@media (pointer: coarse) {
  .theme-toast-action, .theme-toast-close { min-height: 44px; }
  .theme-toast-close { min-width: 44px; }
}

/* --- Screens slide in sideways: forward from the right, so the library to reader move reads as depth --- */
@keyframes screenInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes screenInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
#libraryPage { animation: screenInLeft var(--dur-base) var(--ease-out); }
#barRuler:not([hidden]) { animation: screenInRight var(--dur-base) var(--ease-out); }

/* Modal close: anything that adds .is-closing before hiding gets the faster exit */
@media (prefers-reduced-motion: reduce) {
  .theme-toast, .theme-toast-hiding, .theme-toast-action, .theme-toast-close { transition: none; }
  #libraryPage, #barRuler { animation: none !important; }
  .ruler-tip { transition: none; }
}

/* ==========================================================================
   Phase 9: rebuild toward the mockup. Tokens first (the mockup's names, mapped onto the finish tokens),
   then shared controls, then the reader chrome.
   ========================================================================== */
:root, [data-theme] {
  --ground: var(--bg-body);
  --s1: var(--bg-elevated);
  --s2: var(--bg-card-solid);
  --s3: var(--bg-card-hover);
  --ink: var(--text-primary);
  --ink2: var(--text-muted);
  --action: var(--accent-primary);
  --hue: var(--accent-secondary);
  --line: var(--border-subtle);
  --r: var(--r-control);
  --r-sm: 6px;
  --r-lg: var(--r-card);
  --rail-ground: color-mix(in srgb, var(--s1) 45%, #000);
  --setnav-ground: color-mix(in srgb, var(--s1) 80%, var(--s2));
  /* Section families on the bar ruler: six hues, the same in every theme and every file, so a chorus looks like a
     chorus. A block keeps its surface's own lightness (text contrast is unchanged) and takes the hue at low chroma. */
  --sec-verse: 200;
  --sec-chorus: 350;
  --sec-bridge: 125;
  --sec-solo: 60;
  --sec-bookend: 285;
  --sec-instrumental: 245;
}
[data-theme="Dark Side"] {
  --rail-ground: #000000;
  --setnav-ground: var(--s1);
}
[data-theme="Slate Blue"] {
  --rail-ground: color-mix(in srgb, var(--s1) 45%, #000);
  --setnav-ground: var(--ground);
}
[data-theme="Snow White"] {
  --rail-ground: var(--s3);
  --setnav-ground: var(--ground);
}
.tauri-macos, .tauri-ios { --r-control: 10px; --r-card: 12px; }
.tauri-windows { --r-control: 6px; --r-card: 8px; }
.tauri-linux { --r-control: 8px; --r-card: 12px; }
.tauri-ios { --r-control: 12px; }
html, body { background: var(--ground) !important; }
body { font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }

/* Buttons: tone steps, not borders. Primary is the action color, secondary is one step up, ghost is bare. */
.btn-theme-primary {
  background: var(--action) !important; color: var(--on-action, #fff) !important; border: 0 !important;
  border-radius: var(--r) !important; font-weight: 600;
}
@media (hover: hover) { .btn-theme-primary:hover:not(:disabled) {
  background: var(--action) !important; color: var(--on-action, #fff) !important; border: 0 !important;
  border-radius: var(--r) !important; font-weight: 600;
} }
.btn-theme-outline, .theme-control-btn {
  background: var(--s3) !important; color: var(--ink) !important; border: 0 !important;
  border-radius: var(--r) !important; font-weight: 600;
}
@media (hover: hover) { .btn-theme-outline:hover:not(:disabled),
.theme-control-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--s3) 80%, var(--ink)) !important; color: var(--ink) !important;
} }
.btn-theme-icon, .brand-btn { border: 0 !important; background: transparent !important; color: var(--ink2) !important; border-radius: var(--r) !important; box-shadow: none !important; }
@media (hover: hover) { .btn-theme-icon:hover:not(:disabled),
.brand-btn:hover { background: var(--s2) !important; color: var(--ink) !important; } }
.btn-theme-danger { background: color-mix(in srgb, var(--danger, #f87171) 18%, var(--s2)) !important; color: var(--danger, #f87171) !important; border: 0 !important; border-radius: var(--r) !important; }
.btn-theme-success { background: color-mix(in srgb, var(--hue) 22%, var(--s2)) !important; color: var(--ink) !important; border: 0 !important; border-radius: var(--r) !important; }

/* Segmented control: a recessed track and one raised sliding pill (the mockup's .seg) */
.hud-pill-group {
  position: relative;
  background: var(--s2) !important; border: 0 !important; border-radius: var(--r) !important; padding: 3px !important; gap: 0 !important; box-shadow: none !important;
}
.hud-pill-group .btn, .hud-pill-group .btn-check + .btn, #topBar .hud-pill-group .btn {
  position: relative; z-index: 1;
  background: transparent !important; border: 0 !important; color: var(--ink2) !important; border-radius: calc(var(--r) - 3px) !important;
  min-height: 30px; padding: 6px 12px; font-size: 13px; font-weight: 500; box-shadow: none !important;
  transition: color var(--dur-fast) ease-in-out;
}
.hud-pill-group .btn[hidden] { display: none !important; }
/* On touch the segments keep a 44px target, so the track grows to them instead of staying at its fixed height (the selected segment
   was taller than the track). The reader's bottom words and nav keep their own sizing. */
@media (pointer: coarse) { .hud-pill-group:not(#navButtons, #topFlexZone *) { height: auto !important; } }
.hud-pill-group .btn.active, .hud-pill-group .btn-check:checked + .btn, #topBar .hud-pill-group .btn.active,
#topBar .hud-pill-group .btn-check:checked + .btn {
  background: var(--s3) !important; color: var(--ink) !important; box-shadow: none !important;
}
.hud-pill-group.has-sliding-pill .btn.active,
.hud-pill-group.has-sliding-pill .btn-check:checked + .btn,
.hud-pill-group.has-sliding-pill #topBar .hud-pill-group .btn.active,
.hud-pill-group.has-sliding-pill #topBar .hud-pill-group .btn-check:checked + .btn {
  background: transparent !important;
}
.hud-pill-group .hud-sliding-pill {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: calc(var(--r) - 3px);
  background: var(--s3);
  transition: transform var(--dur-base, 250ms) var(--ease-out, cubic-bezier(.16,1,.3,1)),
              width var(--dur-base, 250ms) var(--ease-out, cubic-bezier(.16,1,.3,1)),
              opacity var(--dur-fast, 150ms) ease-out;
  will-change: transform, width;
  pointer-events: none;
}
.hud-pill-group.no-pill-anim .hud-sliding-pill {
  transition: none !important;
}
@media (hover: hover) { .hud-pill-group .btn:hover:not(.active) { color: var(--ink) !important; background: transparent !important; } }
@media (prefers-reduced-motion: reduce) { .hud-pill-group .hud-sliding-pill { transition: none !important; } }

/* ---------- Reader top bar: back, title, Page/Scroll, then bare icons ---------- */
#topBar {
  background: var(--ground) !important; border: 0 !important; min-height: 52px; padding-top: 6px; padding-bottom: 6px;
}
body:not(.library-view-active) #brand-text { display: none !important; }
body:not(.library-view-active) #songBreadcrumb { gap: 2px; }
body:not(.library-view-active) .breadcrumb-divider { display: none; }
.breadcrumb-back-btn { width: 36px; height: 36px; padding: 0 !important; border-radius: var(--r) !important; }
.breadcrumb-back-btn span { display: none; }
.breadcrumb-back-btn i { margin: 0 !important; font-size: 1.15rem; }
.top-bar-song-btn {
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: var(--r) !important; height: 40px; padding: 0 10px;
}
 .top-bar-song-btn.active { background: var(--s2) !important; }
@media (hover: hover) { .top-bar-song-btn:hover { background: var(--s2) !important; } }
.top-bar-song-btn .song-title-glyph { display: none !important; }
.top-bar-song-btn .breadcrumb-song-title {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.005em; line-height: 1.1;
}
.tools-btn-label { font-weight: 500; }
/* Right cluster: no pill containers, just ghost buttons */
#topFlexZone .hud-pill-group, #topFlexZone .rbar-item, #fullscreenPill, #navButtons { background: transparent !important; padding: 0 !important; }
#topFlexZone .btn, #fullscreenPill .btn, #navButtons .btn, #globalAudioControls .btn {
  background: transparent !important; border: 0 !important; color: var(--ink2) !important; border-radius: var(--r) !important; min-height: 36px;
}
/* Hover only where a pointer really hovers: on touch, :hover sticks after a tap and the button stays lit */
@media (hover: hover) { #topFlexZone .btn:hover, #fullscreenPill .btn:hover, #navButtons .btn:hover { background: var(--s2) !important; color: var(--ink) !important; } }
#topFlexZone .btn:active, #fullscreenPill .btn:active, #navButtons .btn:active { background: var(--s2) !important; color: var(--ink) !important; }
@media (hover: none) { #navButtons .btn:hover:not(:active) { background: transparent !important; color: var(--ink2) !important; } }
#navButtons { display: inline-flex; gap: 0; }
#pageIndicator { color: var(--ink2); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: center; }

/* ---------- The paper: a light card floating on the ground, bright and quiet ---------- */
/* Side insets: the cutout side (left in landscape) keeps the full inset for content; the far side only keeps
   part of it, since nothing sits behind the rounded corner but ground. Bars and paper run to the edge. */
:root { --inset-far: calc(env(safe-area-inset-right, 0px) * 0.4); }
#mainContent { background: var(--ground); padding-left: 0 !important; padding-right: 0 !important; }
#output {
  background: var(--ground);
  scrollbar-gutter: stable; /* a panel that shortens the view must not add a scrollbar that narrows the paper */
  padding-top: 12px !important;
  padding-bottom: 16px !important;
  padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(16px, var(--inset-far)) !important;
}
#output .alphaTabContainer {
  margin: 0 auto; border-radius: 3px; overflow: hidden;
}
#output.continuous-mode.gp-horizontal-mode {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
#output.continuous-mode.gp-horizontal-mode::after {
  content: "";
  flex: 0 0 50%;
}
#output.continuous-mode.gp-horizontal-mode > .alphaTabContainer {
  margin: 0;
}
/* The pages are at rest, so they are flat: the paper tone against the ground separates them, with no shadow or outline. */
.pageWrapper, .gp-page-wrapper, .alphaTabContainer, .text-content,
body.theme-sheet-active .pageWrapper, body.theme-sheet-active .gp-page-wrapper,
body.theme-sheet-active .alphaTabContainer, body.theme-sheet-active .text-content,
body.sheet-mode-dark:not(.theme-sheet-active) .pageWrapper, body.sheet-mode-dark:not(.theme-sheet-active) .gp-page-wrapper,
body.sheet-mode-dark:not(.theme-sheet-active) .alphaTabContainer, body.sheet-mode-dark:not(.theme-sheet-active) .text-content {
  box-shadow: none; border: 0;
}

/* ==========================================================================
   Bottom transport (the mockup's dock): pick play button, bar ruler, bar and time, tempo, sound, loop, metronome
   ========================================================================== */
.mobile-playback-dock { display: none !important; }
body:not(.library-view-active):not(.dock-off) .mobile-playback-dock.has-audio-sources,
body:not(.library-view-active) .mobile-playback-dock.has-audio-sources {
  display: block !important;
  position: relative; left: auto; right: auto; bottom: auto; transform: none;
  flex: none; width: 100%; z-index: 1045;
  background: var(--s1);
}
/* must out-rank the display:block rule above, which carries two :not() and .has-audio-sources */
body:not(.library-view-active):not(.dock-off) .mobile-playback-dock.has-audio-sources.hud-hidden:not(.hud-transient) { display: none !important; }
.mobile-playback-dock.hud-hidden:not(.hud-transient) { display: none !important; }
.fretboard-dock {
  bottom: var(--dock-h, 0px) !important;
  box-shadow: none !important;
  border-top: 0 !important;
  background: var(--s1) !important;
}
.fretboard-dock-header { border-bottom: 0 !important; }
body.fretboard-open .mobile-playback-dock { bottom: auto !important; }
.mobile-playback-dock-inner {
  display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto auto; gap: 8px 16px; align-items: center;
  padding: 10px max(14px, var(--inset-far)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: transparent; border: 0; border-radius: 0; box-shadow: none; width: 100%;
}
.dock-tr { display: flex; align-items: center; gap: 6px; }
.dock-ruler { min-width: 0; }
.dock-time { font: 500 13px system-ui, sans-serif; color: var(--ink2); white-space: nowrap; min-width: 0; text-align: right; }
/* The readout reserves room for the song's widest bar number (--bar-digits is set when the song loads), so the ruler beside it keeps one length */
.dock-time { min-width: calc(30px + var(--bar-digits, 2) * 13px); }
.dock-time b { font: 700 22px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.dock-bpm { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 0 8px; font-size: 12px; color: var(--ink2); }
.dock-bpm b { font: 700 26px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.dock-tools { display: flex; align-items: center; gap: 4px; }
.dock-src { display: inline-flex; align-items: center; background: var(--s2); border-radius: var(--r); padding: 3px; }
.dock-src .mobile-dock-divider { display: none !important; }
.mobile-dock-btn, .dock-icon-btn {
  width: 36px; height: 36px; min-width: 36px; padding: 0; border: 0 !important; background: transparent !important; color: var(--ink2) !important;
  border-radius: var(--r) !important; box-shadow: none !important; display: inline-flex; align-items: center; justify-content: center;
}
/* Tone step on hover only where a pointer really hovers (on touch :hover sticks after a tap), and while pressed */
@media (hover: hover) { .mobile-dock-btn:hover { background: var(--s2) !important; color: var(--ink) !important; } }
.mobile-dock-btn:active { background: var(--s2) !important; color: var(--ink) !important; }
.mobile-dock-btn.active-audio-mode { background: transparent !important; color: var(--hue) !important; }
/* On is shown by the playhead color on the glyph, not a fill, so it never reads as a stuck hover */
#fretboardDockBtn.active, #fretboardDockBtn[aria-pressed="true"], #readingDockBtn[aria-pressed="true"] { background: transparent !important; color: var(--hue) !important; }
.dock-src .mobile-dock-btn { width: auto; padding: 0 10px; border-radius: calc(var(--r) - 3px) !important; gap: 6px; height: 32px; font-size: 13px; font-weight: 500; }
@media (hover: hover) { .dock-src .mobile-dock-btn:hover { background: transparent !important; color: var(--ink) !important; } }
.dock-src .mobile-dock-btn.active-audio-mode, #mobileSynthToggleBtn.active-audio-mode, #mobileYtToggleBtn.active-audio-mode {
  background: var(--s3) !important; color: var(--ink) !important;
}
/* The play button is the brand's pick */
.mobile-dock-play-btn {
  position: relative; width: 52px; height: 56px; min-width: 52px; padding: 0 !important; border: 0 !important; background: transparent !important;
  display: grid; place-items: center; transition: transform var(--dur-fast) cubic-bezier(.34,1.36,.64,1); box-shadow: none !important;
}
.mobile-dock-play-btn:active { transform: scale(.92); }
.mobile-dock-play-btn svg.pk { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--action); }
.mobile-dock-play-btn i { position: relative; margin-top: -4px; font-size: 1.5rem; color: var(--on-action, #fff); line-height: 1; }
.mobile-dock-play-btn:disabled { opacity: .5; }
.dock-marks { position: absolute; left: 14px; bottom: calc(100% + 6px); max-width: min(420px, calc(100% - 28px)); max-height: 40vh; overflow: auto; background: var(--s2); border-radius: var(--r-lg); padding: 10px 14px; z-index: 5; }
.dock-marks[hidden] { display: none; }
.dock-marks .mhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dock-marks-close { flex-shrink: 0; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink2); cursor: pointer; }
@media (hover: hover) { .dock-marks-close:hover { background: var(--s3); color: var(--ink); } }
.dock-marks-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (pointer: coarse) { .dock-marks-close { width: 44px; height: 44px; } }

/* ---------- ruler ---------- */
.ruler { position: relative; height: 44px; touch-action: none; cursor: pointer; border-radius: var(--r-sm); background: var(--s2); overflow: visible; }
/* The playhead sits on top of the ruler and may overhang its ends; everything else is clipped to the rounded shape */
.ruler-clip { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-sm); }
.ruler:not(.mini) .head { z-index: 2; }
.ruler:not(.mini) .head::after { top: -5px; }
.ruler[hidden] { display: none; }
.ruler:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
/* A slider focused by a press (utils/pointerFocus.js) shows no ring: Space and the arrows must not draw it */
[role="slider"][data-pointer-focus]:focus-visible { outline: none !important; }
/* The ruler is a row of section blocks with a 2px gap (real transparency); each block carries its own played fill */
#barRuler { background: transparent; }
.ruler-segs { position: absolute; inset: 0; }
.ruler-segs .seg { position: absolute; top: 0; bottom: 0; }
.ruler-segs .seg-body { position: absolute; top: 0; bottom: 0; left: 1px; right: 1px; background: var(--s2); overflow: hidden; }
.ruler-segs .seg:first-child .seg-body { left: 0; }
.ruler-segs .seg:last-child .seg-body { right: 0; }
.ruler-segs .seg.tight .seg-body { left: 0; right: 0; }
/* A block that is a known kind of section takes its family's hue on its ground and on its played fill */
.ruler-segs .seg[data-family="verse"] { --h: var(--sec-verse); }
.ruler-segs .seg[data-family="chorus"] { --h: var(--sec-chorus); }
.ruler-segs .seg[data-family="bridge"] { --h: var(--sec-bridge); }
.ruler-segs .seg[data-family="solo"] { --h: var(--sec-solo); }
.ruler-segs .seg[data-family="bookend"] { --h: var(--sec-bookend); }
.ruler-segs .seg[data-family="instrumental"] { --h: var(--sec-instrumental); }
.ruler-segs .seg[data-family] .seg-body { background: color-mix(in oklab, oklch(0.62 0.12 var(--h)) 18%, var(--s2)); }
.ruler-segs .seg[data-family] .seg-fill { background: color-mix(in oklab, oklch(0.62 0.12 var(--h)) 26%, var(--s3)); }
@supports (color: oklch(from red l c h)) {
  .ruler-segs .seg[data-family] .seg-body { background: oklch(from var(--s2) l 0.055 var(--h)); }
  .ruler-segs .seg[data-family] .seg-fill { background: oklch(from var(--s3) l 0.065 var(--h)); }
}
.ruler-segs .seg-fill { position: absolute; inset: 0; background: var(--s3); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
.ruler-segs .seg-label { position: absolute; left: 5px; right: 3px; top: 2px; font: 600 11px/14px system-ui, sans-serif; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruler-segs .seg-label.is-current .seg-main { color: var(--ink); }
.ruler-segs .seg-sub { font-weight: 500; }
/* Where the playhead is, in words, while it is being moved: it floats, so it may carry a shadow */
.ruler-tip { position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 3; padding: 6px 10px; background: var(--s1); color: var(--ink); border-radius: var(--r-control); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28); font: 600 13px/1.2 system-ui, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; will-change: opacity; transition: opacity var(--dur-fast) var(--ease-out); }
.ruler-tip.is-on { opacity: 1; }
.ruler .loop { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--hue) 22%, transparent); border-inline: 2px solid var(--hue); display: none; }
.ruler[data-loop="1"] .loop { display: block; }
.ruler svg { position: absolute; left: 0; top: 0; width: 100%; height: 44px; }
.ruler svg path { stroke: var(--ink2); stroke-opacity: .6; stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.ruler-labels { position: absolute; inset: 0 0 auto 0; height: 44px; pointer-events: none; }
.ruler-labels em { position: absolute; top: 18px; transform: translateX(4px); font: 500 10px system-ui, sans-serif; color: var(--ink2); font-style: normal; font-variant-numeric: tabular-nums; }
.ruler .head { position: absolute; top: 0; bottom: 0; left: 0; width: 0; will-change: transform; pointer-events: none; }
.ruler .head::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 3px; background: var(--hue); }
.ruler .head::after { content: ''; position: absolute; left: -7px; top: -1px; width: 15px; height: 14px; background: var(--hue); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* ---------- More menu and popovers share the mockup's popover look ---------- */
.tools-menu, .view-menu, .guitar-menu, .more-menu, .score-options-panel, .synth-panel, .yt-panel, .pdf-bookmarks-panel {
  background: var(--s2) !important; border: 0 !important; border-radius: var(--r-lg) !important; box-shadow: none !important;
}
.more-menu { width: 280px; padding: 6px; }
.more-menu-list { display: flex; flex-direction: column; gap: 2px; }
.more-menu .btn, .more-menu-settings {
  display: flex !important; align-items: center; justify-content: flex-start !important; gap: 12px; width: 100%; min-height: 48px;
  padding: 8px 12px !important; background: transparent !important; text-align: left; font-weight: 500 !important; font-size: 15px;
}
@media (hover: hover) { .more-menu .btn:hover { background: var(--s3) !important; } }
.more-menu .btn i { font-size: 1.1rem; width: 1.4rem; text-align: center; color: var(--ink2) !important; }

/* Medium width (tablet / narrow desktop): tighten dock spacing so the bar number and bpm never collide */
@media (max-width: 899px) {
  .dock-bpm { padding: 0 4px; }
}
@media (min-width: 641px) and (max-width: 899px) {
  .mobile-playback-dock-inner {
    gap: 8px 12px;
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, var(--inset-far));
    grid-template-columns: auto minmax(80px, 1fr) auto auto auto;
  }
}

/* Phone: the transport stacks with the ruler on top */
@media (max-width: 640px) {
  .mobile-playback-dock-inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "r r r" "a b c"; gap: 8px; }
  .dock-ruler { grid-area: r; }
  .dock-tr { grid-area: a; }
  .dock-time { grid-area: b; display: none !important; }
  .dock-bpm { display: none; }
  .dock-tools { grid-area: c; }
  .dock-src .audio-src-label { display: none; }
  .dock-src .mobile-dock-btn { padding: 0 11px; }
  #dockMetroBtn { display: none; }
}
/* Narrow phones: "Synth" and "Original" keep the row inside the screen; the buttons keep their full names for screen readers */
@media (max-width: 440px) { .dock-src .audio-sfx { display: none; } }
@media (prefers-reduced-motion: reduce) { .mobile-dock-play-btn { transition: none; } }

/* page navigation keeps its buttons but loses the pill outline */
#navButtons, #navButtons.hud-pill-group, #fullscreenPill, .rbar-item {
  border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important;
}
#topBar .btn svg.i-aa { display: block; }

/* ---------- View menu (mockup): label over a full-width segmented control, big size value ---------- */
#viewMenu { width: min(360px, calc(100vw - 24px)); padding: 12px 14px 8px !important; }
#viewMenu::before { content: 'View'; display: block; font: 600 17px system-ui, sans-serif; padding: 4px 2px 10px; color: var(--ink); }
#readerViewOptions { gap: 16px !important; }
#viewMenu .form-label { font-size: 13px; color: var(--ink2) !important; margin-bottom: 8px !important; }
#viewMenu .hud-pill-group { width: 100%; display: flex; }
#viewMenu .hud-pill-group .btn { flex: 1; text-align: center; justify-content: center; padding-inline: 4px; }
#viewMenu .hud-pill-group i { display: none; }
#viewMenu .view-size-label { display: flex; justify-content: space-between; align-items: baseline; }
#viewMenu #gpSheetScaleValue { font: 600 22px/1 system-ui, sans-serif; color: var(--ink) !important; }
#viewMenu .view-more-settings { width: 100%; margin-top: 4px; color: var(--ink2); background: transparent; border: 0; min-height: 44px; font-weight: 500; }
@media (hover: hover) { #viewMenu .view-more-settings:hover { color: var(--ink); background: var(--s3); } }
#viewMenu input[type=range], .form-range { accent-color: var(--hue); }
#gpSheetScaleMinus, #gpSheetScalePlus { width: 36px; height: 36px; padding: 0 !important; }
#viewMenu .view-size-label { display: flex !important; }
.form-range::-webkit-slider-runnable-track { background: var(--s3); height: 6px; border-radius: 3px; }
.form-range::-moz-range-track { background: var(--s3); height: 6px; border-radius: 3px; }
.form-range::-webkit-slider-thumb { background: var(--hue); border: 0; width: 18px; height: 18px; margin-top: -6px; box-shadow: none; }
.form-range::-moz-range-thumb { background: var(--hue); border: 0; width: 18px; height: 18px; box-shadow: none; }
.form-range:focus { box-shadow: none; }

/* ---------- Switches: the mockup's 46x28 toggle with a spring thumb ---------- */
.form-switch .form-check-input, .form-check-input.theme-switch {
  width: 46px !important; height: 28px !important; margin: 0 !important; padding: 0; border: 0 !important; border-radius: 14px !important;
  background-color: var(--s3) !important;
  background-image: radial-gradient(circle at center, var(--ink) 0 10.5px, transparent 11px) !important;
  background-size: 28px 28px !important; background-repeat: no-repeat !important; background-position: left center !important;
  transition: background-position var(--dur-slow) cubic-bezier(.34,1.36,.64,1), background-color var(--dur-base) ease-in-out !important;
  box-shadow: none !important; flex: none;
}
.form-switch .form-check-input:checked, .form-check-input.theme-switch:checked {
  background-color: var(--action) !important; background-position: right center !important;
  background-image: radial-gradient(circle at center, var(--on-action, #fff) 0 10.5px, transparent 11px) !important;
}
.form-switch { padding-left: 0 !important; min-height: 0; }

/* Checkboxes and radios outside a switch: tone fill, no outline, the action color when on (replaces the stock blue) */
.form-check-input:not(.theme-switch)[type="checkbox"], .form-check-input:not(.theme-switch)[type="radio"] {
  width: 18px; height: 18px; margin-top: 0; border: 0 !important; background-color: var(--s3);
  cursor: pointer; flex: none; box-shadow: none;
}
.form-check-input:not(.theme-switch)[type="checkbox"] { border-radius: 4px; }
/* A plain checkbox or radio with its label: a flex row with a real gap (the stock float and 1.5em padding leave the 18px box touching the text) */
.form-check:not(.form-switch):has(> .form-check-input:not(.theme-switch)) { display: flex; align-items: center; gap: 10px; padding-left: 0; min-height: 0; }
.form-check:not(.form-switch):has(> .form-check-input:not(.theme-switch)) > .form-check-input { float: none; margin: 0; }
.form-check:not(.form-switch):has(> .form-check-input:not(.theme-switch)) > .form-check-label { margin: 0; cursor: pointer; }
.form-check-input:not(.theme-switch)[type="checkbox"]:checked, .form-check-input:not(.theme-switch)[type="checkbox"]:indeterminate,
.form-check-input:not(.theme-switch)[type="radio"]:checked { background-color: var(--action); }
.form-check-input:not(.theme-switch)[type="checkbox"]:focus-visible, .form-check-input:not(.theme-switch)[type="radio"]:focus-visible {
  box-shadow: 0 0 0 0.2rem var(--accent-primary-alpha); outline: 0;
}
/* Delete confirmation: the second press */
.btn-theme-danger.is-confirming { background: var(--danger) !important; color: var(--on-action, #fff) !important; }
.form-switch .form-check-label { cursor: pointer; }

/* ---------- This song: popover from the title; tracks as color bar, name and tuning, Only, toggle ---------- */
.score-options-panel { width: min(360px, calc(100vw - 24px)); padding-bottom: 8px; }
.score-options-panel .synth-panel-header { background: transparent !important; border: 0 !important; padding: 14px 16px 6px; }
.score-options-panel .synth-panel-title { font: 600 17px system-ui, sans-serif; color: var(--ink); }
.score-options-panel .synth-panel-body { padding: 4px 16px 12px; }
.score-options-panel .form-label { font-size: 13px; color: var(--ink2) !important; font-weight: 400 !important; }
.score-options-panel .hud-pill-group { width: 100%; display: flex; }
.score-options-panel .hud-pill-group .btn { flex: 1; justify-content: center; }
.score-options-panel .hud-pill-group i { display: none; }
.gp-track-row {
  display: grid !important; grid-template-columns: 10px minmax(0, 1fr) auto auto;
  grid-template-areas: "dot label only sw" "dot sub only sw"; column-gap: 12px; align-items: center; min-height: 52px;
}
.gp-track-row .form-check,
#synthTrackVisibilitySection .gp-track-row .form-check.form-switch { display: contents !important; }
.gp-track-row .gp-track-dot { grid-area: dot; width: 10px !important; height: 36px !important; border-radius: 3px !important; background: var(--track-color) !important; border: 0 !important; }
.gp-track-row .form-check-label { grid-area: label; max-width: none !important; font-size: 14px !important; font-weight: 600; color: var(--ink); align-self: end; }
.gp-track-row .gp-track-tuning { grid-area: sub; justify-self: start; background: transparent !important; color: var(--ink2) !important; padding: 0 !important; font-size: 12px; font-weight: 400; align-self: start; }
.gp-track-row .gp-track-only-btn { grid-area: only; background: transparent !important; color: var(--ink2) !important; font-weight: 500; }
.gp-track-row .gp-track-checkbox { grid-area: sw; }
.gp-track-row:has(.gp-track-checkbox:not(:checked)) .gp-track-dot, .gp-track-row:has(.gp-track-checkbox:not(:checked)) .form-check-label { opacity: .35; }

/* ---------- Tools and other menus: roomy rows, tone-step hover ---------- */
.tools-menu { width: min(320px, calc(100vw - 24px)); padding: 6px !important; }
.tools-row { padding: 0 !important; }
.tools-item, .tools-row > .btn {
  display: flex !important; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px !important;
  border-radius: var(--r) !important; background: transparent !important; border: 0 !important; color: var(--ink) !important; text-align: left;
}
@media (hover: hover) { .tools-item:hover, .tools-row > .btn:hover { background: var(--s3) !important; } }
.tools-item-text span { font-weight: 500; font-size: 15px; color: var(--ink); }
.tools-item-text small { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.tools-item kbd { margin-left: auto; font: 600 12px system-ui, sans-serif; color: var(--ink2); background: var(--s3); border: 0 !important; border-radius: 4px; padding: 2px 7px; }
.tools-menu-divider { background: transparent !important; height: 6px !important; }
.tools-menu-hint { color: var(--ink2); }
.gp-track-row { border: 0 !important; background: transparent !important; padding: 0 !important; }
.score-options-panel .synth-panel-header i, .score-options-panel .synth-panel-header .bi-layers-fill { display: none; }
#synthTrackVisibilitySection .form-check.form-switch { display: flex !important; flex-direction: row-reverse; justify-content: space-between; align-items: center; width: 100%; padding: 0 !important; min-height: 44px; }
#synthTrackVisibilitySection .form-check.form-switch .form-check-label { font-size: 15px !important; color: var(--ink) !important; }
#scoreOptionsAdaptSection .form-check.form-switch { flex-direction: row-reverse; }

/* ==========================================================================
   Sound panels (Synth audio, Original audio): menus like the others
   ========================================================================== */
/* Placed by placePanel (readerPanels.js) like the other menus: under the Sound word, over the page, so the score never reflows.
   Width and height come from the shared menu rule below; phones turn it into a sheet (body.phone-reader rules). */
#synthDropdownPanel, #ytDropdownPanel {
  z-index: 1085; overflow-y: auto; overflow-x: hidden; background: var(--s2) !important; border-radius: var(--r-lg) !important;
}
#synthDropdownPanel .synth-panel-header, #ytDropdownPanel .yt-panel-header {
  background: var(--s2) !important; border: 0 !important; padding: 14px 16px 6px; position: sticky; top: 0; z-index: 2;
}
#synthDropdownPanel .synth-panel-header > div:first-child > i, #ytDropdownPanel .yt-header-badge { display: none !important; }
#synthPanelTitle, #realAudioPanelTitle { font-size: 0 !important; }
#realAudioPanelTitle::before { content: 'Original audio'; font: 600 17px system-ui, sans-serif; color: var(--ink); }
#synthPanelTitle::before { content: 'Synth audio'; font: 600 17px system-ui, sans-serif; color: var(--ink); }
#synthDropdownPanel .synth-panel-body, #ytDropdownPanel .yt-panel-body { padding: 4px 16px 18px; }
.practice-seg { width: 100%; display: flex; margin-bottom: 16px; }
.practice-seg .btn { flex: 1; justify-content: center; }
#synthDropdownPanel .form-label, #ytDropdownPanel .form-label { color: var(--ink2) !important; font-weight: 400 !important; font-size: 13px; }
.theme-value-badge { background: transparent !important; border: 0 !important; color: var(--ink) !important; font: 600 15px system-ui, sans-serif; padding: 0 4px !important; }
/* Speed buttons read as one segmented control */
.btn-group[role="group"] { background: var(--s1); border-radius: var(--r); padding: 3px; gap: 0; }
.btn-group[role="group"] > .btn { background: transparent !important; color: var(--ink2) !important; border: 0 !important; border-radius: calc(var(--r) - 3px) !important; flex: 1; font-weight: 500; min-height: 32px; }
.btn-group[role="group"] > .btn.active { background: var(--s3) !important; color: var(--ink) !important; }
#synthDropdownPanel input[type=range], #ytDropdownPanel input[type=range] { accent-color: var(--hue); width: 100%; }
#synthLatencySection input[type=range], #ytLatencySection input[type=range] { flex: 1 1 auto; min-width: 0; }
#synthLatencyCalBtn, #ytLatencyCalBtn { font-size: 13px; white-space: nowrap; }
#synthDropdownPanel .form-control, #ytDropdownPanel .form-control, #synthDropdownPanel .form-select, #ytDropdownPanel .form-select {
  background: var(--s3) !important; border: 0 !important; border-radius: var(--r) !important; color: var(--ink) !important; min-height: 36px;
}
#ytDropdownPanel .yt-mode-selector { background: transparent; }
#ytDropdownPanel .yt-mode-btn, .yt-mode-btn {
  background: var(--s1) !important; border: 0 !important; border-radius: var(--r) !important; color: var(--ink) !important; min-height: 52px;
}
.btn-check:checked + .yt-mode-btn { background: var(--s3) !important; }
#synthDropdownPanel .btn-group > .btn.active, #ytDropdownPanel .btn-group > .btn.active, #realAudioRates .btn.active { background: var(--s3) !important; color: var(--ink) !important; }

/* Practice panel recording slots & sync follow card */
.rec-slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.slot {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: var(--r);
  background: var(--s1); width: 100%; text-align: left; border: 0; transition: background-color var(--dur-fast) var(--ease-out);
  position: relative; cursor: pointer; color: var(--ink);
}
@media (hover: hover) { .slot:hover { background: var(--s3); } }
.slot[aria-checked="true"] { background: var(--s3); }
.slot .rd { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink2); display: grid; place-items: center; flex: none; }
.slot[aria-checked="true"] .rd { border-color: var(--hue); }
.slot[aria-checked="true"] .rd::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); }
.slot .t { min-width: 0; flex: 1; }
.slot .t b { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.slot .t span { display: block; font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--s2); color: var(--ink2); font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.chip.ok { background: color-mix(in srgb, var(--hue) 22%, var(--s2)); color: var(--ink); }
.chip.warn { background: color-mix(in srgb, var(--warn) 24%, var(--s2)); color: var(--warn); }
.chip.hot { background: color-mix(in srgb, var(--warn) 22%, var(--s2)); color: var(--warn); }

/* Setlists & flat library rows */
.setrow .num {
  width: 28px;
  text-align: center;
  font: 600 15px system-ui, sans-serif;
  color: var(--ink2);
  flex: none;
}
@media (hover: hover) { .setrow.clickable:hover { background: var(--s2); } }
.rowwrap {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
}
.rowwrap:last-child {
  border-bottom: none;
}
.rowwrap .row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  transition: background-color var(--dur-fast, 150ms) var(--ease-out, ease);
}
.rowwrap .row .t {
  min-width: 0;
  flex: 1;
}
.rowwrap .row .t b {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rowwrap .row .t span {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
}
.rowwrap .row .end {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--ink2);
  font-size: 13px;
  flex: none;
}
.rowwrap .row .mono {
  width: 40px;
  height: 40px;
  border-radius: var(--r, 8px);
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--s2);
  color: var(--ink);
  flex: none;
}

/* ==========================================================================
   Library: a branded rail, flat rows on a 56px pitch, no card grid, no borders
   ========================================================================== */
@media (min-width: 577px) {
  /* No top bar over the library on the web: the rail carries the brand, Tools and Settings. Desktop apps keep a quiet drag strip. */
  html:not(.tauri-macos):not(.tauri-windows):not(.tauri-linux) body.library-view-active #topBar { display: none; }
  html:not(.tauri-macos):not(.tauri-windows):not(.tauri-linux) body.library-view-active .library-bottom-nav { top: 0; }
  body.library-view-active .library-bottom-nav {
    width: calc(76px + env(safe-area-inset-left, 0px));
    padding-left: calc(8px + env(safe-area-inset-left, 0px));
    padding-right: 8px;
    padding-top: max(env(safe-area-inset-top, 0px), 14px);
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 14px);
    gap: 2px; background: var(--rail-ground) !important; border: 0 !important;
  }
  body.library-view-active #libraryPage {
    padding-left: calc(76px + env(safe-area-inset-left, 0px));
    padding-right: max(env(safe-area-inset-right, 0px), 0px);
  }
  .library-bottom-nav .library-nav-tab { min-height: 48px; border-radius: var(--r) !important; font-size: 11px; font-weight: 500; }
  .library-bottom-nav .library-nav-tab.active { background: var(--s2); color: var(--ink); }
  .library-bottom-nav .library-nav-tab.active i { color: var(--ink); }
  .library-bottom-nav .library-nav-tab.active::before { content: ''; top: 50%; left: 3px; margin: -3px 0 0; width: 6px; height: 6px; background: var(--hue); animation: inlay var(--dur-base) cubic-bezier(.34,1.36,.64,1); }
  .library-bottom-nav .library-nav-settings { margin-top: auto !important; }
}
@keyframes inlay { from { transform: scale(0); } to { transform: scale(1); } }
@media (min-width: 1000px) {
  body.library-view-active .library-bottom-nav { width: 212px; padding: 16px 12px; }
  body.library-view-active #libraryPage { padding-left: 212px; }
  .library-bottom-nav .library-nav-tab { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14px; padding: 0 12px; }
  .library-bottom-nav .library-nav-tab.active::before { left: -2px; }
}

/* Content */
.library-page-view { background: var(--s1) !important; }
@media (min-width: 577px) { .library-page-view { border-radius: var(--r-lg) 0 0 0; margin-left: 0; } }
.library-page-container { max-width: none; }
.library-search-box .library-search-bar, .library-search-bar {
  background: var(--s2) !important; border: 0 !important; border-radius: var(--r-control, var(--r)) !important; height: 40px; box-shadow: none !important;
  gap: 10px; padding: 0 12px !important; color: var(--ink2);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.library-search-bar .search-icon { margin: 0; font-size: 15px; color: var(--ink2); }
.library-search-bar:focus-within { background: var(--s3) !important; outline: 2px solid var(--hue); outline-offset: 0; }
.library-search-bar .search-input { background: transparent !important; color: var(--ink) !important; border: 0 !important; font-size: 15px; }
.library-search-bar .search-input::placeholder { color: var(--ink2); opacity: 1; }
.library-search-bar .search-clear-btn { color: var(--ink2); min-width: 24px; min-height: 24px; }
@media (hover: hover) and (pointer: fine) { .library-search-bar .search-clear-btn:hover { color: var(--ink); background: var(--s3); } }
.library-search-bar .search-key-hint { font: 12px system-ui, sans-serif; color: var(--ink2); background: var(--s3); border: 0; border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }
.library-search-bar:focus-within .search-key-hint, .library-search-bar:has(.search-clear-btn:not([style*="none"])) .search-key-hint { display: none; }
@media (hover: none) { .library-search-bar .search-key-hint { display: none; } }
/* Cancel exists only for the phone search layout (styled in the 576px block below); elsewhere it would be a bare native button */
.library-search-bar .search-close-btn { display: none; }
.library-list-toolbar { padding: 0 4px; font-size: 13px; color: var(--ink2); }
.library-artists-grid, .library-albums-grid, .library-songs-list { display: flex !important; flex-direction: column; gap: 0 !important; }
.library-card, .library-row-card, .library-song-row, .library-track-row {
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  min-height: 56px; padding: 6px 20px !important; transition: background-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .library-card:hover, .library-row-card:hover, .library-song-row:hover, .library-track-row:hover { background: var(--s2) !important; transform: none !important; } }
.library-card .artist-thumbnail, .library-card img[class*="thumbnail"], .library-row-card img {
  width: 40px !important; height: 40px !important; border-radius: var(--r) !important; border: 0 !important; object-fit: cover;
}
.library-card h6, .library-row-card h6 { font-size: 15px; font-weight: 600; }
.library-card .small, .library-row-card .small { font-size: 13px; color: var(--ink2) !important; }

/* Two-pane library */
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); position: relative; width: 100%; }
.pane { min-height: 0; display: flex; flex-direction: column; }
.pane .pane-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; -webkit-overflow-scrolling: touch; }
.pane h3.pane-head { margin: 0; padding: 12px 20px 6px; font: 500 13px system-ui, sans-serif; color: var(--ink2); display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.pane-head-title, .artist-head-title { padding: 4px 20px 8px; }
.pane-head-title h2, .artist-head-title h2 { margin: 0; font: 700 24px/1.2 var(--font-display, inherit); color: var(--ink); letter-spacing: -0.01em; }
@media (max-width: 576px) {
  .pane-head-title, .artist-head-title { padding: 2px 20px 6px; }
  .pane-head-title h2, .artist-head-title h2 { font-size: 20px; }
}
@media (min-width: 1000px) {
  .library-page-body:has(#libBrowseContent:not([style*="display: none"]) .panes),
  .library-page-body:has(.setlists-body .panes) {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .library-page-body:has(#libBrowseContent:not([style*="display: none"]) .panes) > .library-page-container,
  .library-page-body:has(.setlists-body .panes) > .library-page-container {
    flex: 1 1 0;
    min-height: 0;
    grid-template-rows: max-content max-content minmax(0, 1fr);
    align-items: stretch;
  }
  .library-page-container > #libBrowseContent,
  .library-page-container > .setlists-body {
    grid-row: 3;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .collection-root-view {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .collection-root-view > .resume-card { flex: none; }
  .panes { grid-template-columns: 320px minmax(0, 1fr) !important; margin-top: 16px; align-items: stretch; }
  .pane.list { border-right: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)); padding-right: 12px; }
  .pane.songs { padding-left: 20px; }
  .pane.list, .pane.songs { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; -webkit-overflow-scrolling: touch; }
  .pane .pane-scroll { overflow: visible; flex: none; }
  .panes .in-view-back-btn, .panes #libBrowseBackBtn { display: none !important; }
}
@media (max-width: 999px) {
  .panes { margin-top: 8px; }
  .panes[data-pane="list"] .pane.songs { display: none !important; }
  /* One pane at a time: the list is only a menu here, so no row carries the current mark (it is the stale default or the last one opened) */
  .pane.list [aria-current="true"] { background: transparent !important; }
  .pane.list [aria-current="true"]::before { content: none !important; }
  .panes[data-pane="songs"] .pane.list { display: none !important; }
  .collection-root-view:has(.panes[data-pane="songs"]) .resume-card { display: none !important; }
  /* Second level: the first level's count row ("5 artists") and its filter stay out, so the list is not held down by them */
  .library-page-container:has(.panes[data-pane="songs"]) > .library-list-toolbar > div:first-child { display: none !important; }
  /* and the body's own top margins are dropped, so the back row sits right under the search bar */
  .library-page-container:has(.panes[data-pane="songs"]) > #libBrowseContent { margin-top: 0; }
  .panes[data-pane="songs"] { margin-top: 0; }
}
.library-card[aria-current="true"], .artist-card[aria-current="true"] { background: var(--s2) !important; position: relative; }
.library-card[aria-current="true"]::before, .artist-card[aria-current="true"]::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue);
}

/* Resume card */
.resume-card { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: center; background: var(--s2); border-radius: var(--r-lg); padding: 16px; margin: 4px 20px 12px; }
.resume-cover { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r); grid-row: span 1; }
.resume-meta { min-width: 0; }
.resume-kicker { font-size: 13px; color: var(--ink2); }
.resume-title { font: 700 36px/1.02 var(--font-display); margin: 2px 0 4px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.resume-sub { font-size: 13px; color: var(--ink2); }
.resume-btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
.resume-card .ruler { grid-column: 1 / -1; margin-top: 14px; }
.ruler.mini { height: 28px; overflow: visible; }
.ruler.mini .fill { position: absolute; inset: 0; background: var(--s3); transform-origin: 0 50%; transform: scaleX(0); }
.ruler.mini .fill-clip { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-sm); }
.ruler.mini .head { z-index: 2; }
.ruler.mini svg { height: 28px; }
.ruler line { stroke: var(--ink2); stroke-opacity: .6; stroke-width: 1; vector-effect: non-scaling-stroke; }
@media (max-width: 640px) { .resume-card { grid-template-columns: auto 1fr; margin: 4px 16px 12px; } .resume-btn { grid-column: 1 / -1; } .resume-title { font-size: 30px; } }

/* Library header: search bar goes all the way to the right across the row */
.library-page-container { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 0; align-items: center; padding: 16px max(env(safe-area-inset-right, 0px), 20px) 0 max(env(safe-area-inset-left, 0px), 20px); }
.library-page-container > .lib-view-switch-row { display: none; }
.library-page-container > .library-search-box { grid-column: 1 / -1; grid-row: 1; margin: 0 !important; max-width: none; }
.library-page-container > .library-list-toolbar { display: contents; }
.library-list-toolbar > div:last-child { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-start; min-width: 0; }
.library-list-toolbar > div:last-child:empty { display: none !important; }
.library-list-toolbar > div:first-child { grid-column: 1 / -1; grid-row: 2; }
.library-list-toolbar > div:first-child > span.small { display: none; }
/* Ghost text action beside the one primary action */
.lib-ghost-action { min-height: 36px; padding: 0 12px; border: 0 !important; background: transparent !important; color: var(--ink2) !important; border-radius: var(--r-control) !important; font-weight: 500; box-shadow: none !important; white-space: nowrap; }
@media (hover: hover) { .lib-ghost-action:hover:not(:disabled) { background: var(--s2) !important; color: var(--ink) !important; } }
.lib-ghost-action:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .lib-ghost-action { min-height: 44px; } }

/* If a header action is present (e.g. Setlists empty state or Recents edit), allocate the action slot */
.library-page-container:has(> .library-list-toolbar > div:last-child:not(:empty)) {
  grid-template-columns: minmax(0, 1fr) minmax(148px, auto);
  column-gap: 10px;
}
.library-page-container:has(> .library-list-toolbar > div:last-child:not(:empty)) > .library-search-box {
  grid-column: 1;
}
.library-list-toolbar .library-toolbar-actions { justify-content: flex-start; }
.library-list-toolbar .btn { min-height: 36px; }
.library-list-toolbar .btn.btn-theme-primary { padding: 0 14px; border-radius: var(--r-control) !important; }
@media (hover: hover) { .library-list-toolbar .btn.btn-theme-primary:hover:not(:disabled) { padding: 0 14px; border-radius: var(--r-control) !important; } }
@media (pointer: coarse) { .library-list-toolbar .btn { min-height: 44px; } }

/* Group by (Artists | Tunings): a real switch at the top of the list pane, directly above the rows it regroups.
   style.css fixes .hud-pill-group at 35px, shorter than a touch-size button, so the box grows with its buttons. */
.lib-groupby-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 20px 12px; }
.lib-groupby { height: auto; }
.lib-groupby-row .lib-ghost-action { margin-left: auto; }
.lib-groupby .btn { height: auto; min-height: 36px; }
@media (pointer: coarse) { .lib-groupby .btn { min-height: 44px; } }

/* Filters in the toolbar and the Group by row (collection, artist) are text actions with a chevron, not pills */
:is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group {
  position: relative; display: flex; flex: 1 1 auto; min-width: 0; max-width: 100%;
  background: transparent; border: 0; box-shadow: none; border-radius: var(--r-control); overflow: visible;
  transition: background-color var(--dur-fast) var(--ease-out);
}
:is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 11px; height: 11px; margin-top: -5px; pointer-events: none;
  background: var(--ink2);
  -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 6 4 4 4-4'/%3e%3c/svg%3e") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 6 4 4 4-4'/%3e%3c/svg%3e") center / contain no-repeat;
}
:is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group .collection-select-input,:is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group .collection-select-input:focus {
  background-image: none !important; color: var(--ink2) !important; font: 500 14px/1.2 system-ui, sans-serif !important;
  min-height: 36px; min-width: 0 !important; max-width: none !important; width: 100%; padding: 0 30px 0 12px !important;
  text-overflow: ellipsis; border-radius: var(--r-control) !important;
}
@media (hover: hover) { :is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group .collection-select-input:hover {
  background-image: none !important; color: var(--ink2) !important; font: 500 14px/1.2 system-ui, sans-serif !important;
  min-height: 36px; min-width: 0 !important; max-width: none !important; width: 100%; padding: 0 30px 0 12px !important;
  text-overflow: ellipsis; border-radius: var(--r-control) !important;
} }
:is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group:focus-within { box-shadow: none; outline: 2px solid var(--ink); outline-offset: 2px; }
:is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group:focus-within .collection-select-input { color: var(--ink) !important; }
@media (hover: hover) and (pointer: fine) {
  :is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group:hover { background: var(--s2); box-shadow: none; }
  :is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group:hover .collection-select-input { color: var(--ink) !important; }
  :is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group:hover::after { background: var(--ink); }
}
@media (pointer: coarse) { :is(.library-list-toolbar, .lib-groupby-row) .collection-pill-group .collection-select-input { min-height: 44px; } }
/* In the Group by row the artist filter keeps its own width */
.lib-groupby-row .collection-pill-group { flex: 0 1 auto; min-width: 160px; }

/* Phones: search takes the whole first row on every page; the second row holds the count and filter on the left and the one action on the right */
@media (max-width: 576px) {
  .library-page-container { grid-template-columns: minmax(0, 1fr) auto; }
  .library-list-toolbar > div:first-child { grid-column: 1; grid-row: 2; min-width: 0; margin-top: 8px; }
  .library-list-toolbar > div:last-child { grid-column: 2; grid-row: 2; margin-top: 8px; max-width: 60vw; justify-content: flex-end; }
  .library-list-toolbar .library-toolbar-actions { justify-content: flex-end; }
  .library-page-container > .library-search-box { grid-column: 1 / -1; }
  /* The list heading carries the count ("Artists (33)"), so the toolbar does not repeat it */
  .library-list-toolbar > div:first-child > span.small { display: none; }
}
.library-page-container > .library-sticky-breadcrumbs,
.library-page-container > .lib-groupby-row,
.library-page-container > #libBrowseContent,
.library-page-container > #libFilteredSearchResults { grid-column: 1 / -1; }
.library-page-container > #libBrowseContent { margin: 12px -20px 0; }
.resume-card { margin-top: 0; }
@media (max-width: 576px) {
  .library-page-container { padding: max(env(safe-area-inset-top, 0px), 12px) max(env(safe-area-inset-right, 0px), 16px) 0 max(env(safe-area-inset-left, 0px), 16px) !important; }
  .library-page-container > #libBrowseContent { margin-inline: -16px; }
}

/* ==========================================================================
   Settings: a page. Big title, section list, grouped rows (title, help, control).
   ========================================================================== */
/* Settings and Tools are library views: the page is drawn in the library's content area (src/utils/settingsPage.js, toolsPage.js).
   #fileMenu only parks Settings' built page while another view shows. */
.page-body { flex: 1; min-height: 0; padding: 0; display: block; overflow: hidden; }
.setshell { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.sethead { padding: 22px 28px 6px; flex: none; user-select: none; -webkit-user-select: none; }
.sethead h1, .sethead .sethead-title { font: 700 44px/1.02 var(--font-display); letter-spacing: -.01em; margin: 0; color: var(--ink); }
.sethead p { margin: 6px 0 0; color: var(--ink2); font-size: 14px; }
.sethead .sethead-section { display: none; margin: 0; font: 700 20px/1.2 var(--font-display); color: var(--ink); letter-spacing: -.01em; }
.sethead .sethead-extra { display: none; }
.sethead .setback { display: none; }
/* Page title: the one visible h1 on Tools and Settings (the rail names the destination, but the page should too) */
.setshell > h1.set-title {
  position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal;
  flex: none; padding: 22px 28px 10px; font: 700 32px/1.1 var(--font-display); letter-spacing: -.01em; color: var(--ink);
  user-select: none; -webkit-user-select: none;
}
@media (max-width: 899px) {
  .setshell > h1.set-title { padding: max(calc(env(safe-area-inset-top, 0px) + 12px), 20px) max(env(safe-area-inset-right, 0px), 16px) 0 max(env(safe-area-inset-left, 0px), 16px); }
  .setshell[data-pane="page"] > h1.set-title,
  .setshell:has(.setwrap[data-pane="page"]) > h1.set-title { display: none; }
}
.setwrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .setwrap { grid-template-columns: 260px minmax(0, 1fr); }
  .sethead { display: none !important; }
}
@media (max-width: 899px) {
  .sethead { display: none; padding-inline: max(env(safe-area-inset-left, 0px), 16px) max(env(safe-area-inset-right, 0px), 16px); }
  .setwrap[data-pane="list"] .setpage { display: none; }
  .setwrap[data-pane="page"] .setnav { display: none; }
  .setpage {
    padding-left: max(env(safe-area-inset-left, 0px), 16px);
    padding-right: max(env(safe-area-inset-right, 0px), 16px);
  }
  .setnav {
    padding-top: 8px !important; /* the page title above carries the safe-area inset */
    padding-left: max(env(safe-area-inset-left, 0px), 16px) !important;
    padding-right: max(env(safe-area-inset-right, 0px), 16px) !important;
  }

  /* Mobile detail pane: single adaptive top bar with back action and current section title */
  .setshell[data-pane="page"] .sethead,
  .setshell:has(.setwrap[data-pane="page"]) .sethead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: max(env(safe-area-inset-left, 0px), 16px);
    padding-right: max(env(safe-area-inset-right, 0px), 16px);
    padding-top: max(calc(env(safe-area-inset-top, 0px) + 6px), 12px) !important;
    padding-bottom: 6px;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
  }
  .setshell[data-pane="page"] .sethead .sethead-title,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .sethead-title,
  .setshell[data-pane="page"] .sethead p,
  .setshell:has(.setwrap[data-pane="page"]) .sethead p {
    display: none;
  }
  .setshell[data-pane="page"] .sethead .sethead-section,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .sethead-section {
    display: block;
    font: 700 20px/1.2 var(--font-display);
    color: var(--ink);
    letter-spacing: -.01em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }
  .setshell[data-pane="page"] .sethead .sethead-extra,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .sethead-extra {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--ink2);
  }
  .setshell[data-pane="page"] .sethead .sethead-extra:empty,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .sethead-extra:empty {
    display: none;
  }
  .setshell[data-pane="page"] .sethead .setback,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .setback {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink2);
    background: transparent;
    border: 0;
    font: 500 15px system-ui, sans-serif;
    min-height: 44px;
    min-width: 44px;
    padding: 0 14px 0 12px;
    margin: 0 0 0 -12px;
    border-radius: var(--r-control);
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--dur-fast), background-color var(--dur-fast);
  }
  .setshell[data-pane="page"] .sethead .setback > *,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .setback > * {
    pointer-events: none;
  }
  @media (hover: hover) { .setshell[data-pane="page"] .sethead .setback:hover,
.setshell:has(.setwrap[data-pane="page"]) .sethead .setback:hover {
    color: var(--ink);
  } }
  .setshell[data-pane="page"] .sethead .setback:active,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .setback:active {
    background: var(--s2);
  }
  .setshell[data-pane="page"] .sethead .setback:focus-visible,
  .setshell:has(.setwrap[data-pane="page"]) .sethead .setback:focus-visible {
    outline: 2px solid var(--hue);
    outline-offset: 2px;
  }
  .setshell[data-pane="page"] .setpage,
  .setshell:has(.setwrap[data-pane="page"]) .setpage {
    padding-top: 12px;
  }
}
.setnav { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; overflow: auto; }
.setnav button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: var(--r); color: var(--ink2); font-weight: 500; width: 100%; text-align: left; position: relative; background: transparent; border: 0; transition: background-color var(--dur-fast), color var(--dur-fast); }
.setnav button[hidden] { display: none; }
.setnav button i:first-child { font-size: 1.15rem; width: 1.5rem; text-align: center; }
.setnav button span { flex: 1; }
.setnav button .chev { opacity: .6; font-size: .9rem; }
@media (hover: hover) { .setnav button:hover { color: var(--ink); } }
.setnav button[aria-current="true"] { color: var(--ink); background: var(--s2); }
@media (min-width: 900px) { .setnav button .chev { display: none; } .setnav button[aria-current="true"]::before { content: ''; position: absolute; left: -2px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); } }
/* Flat rows on the 56px pitch (they were filled tonal cards); a press takes one tone step */
@media (max-width: 899px) { .setnav button { background: transparent; min-height: 56px; color: var(--ink); } .setnav button:active, .setnav button[aria-current="true"]:active { background: var(--s2); } .setnav button[aria-current="true"] { background: transparent; } }
.setpage { overflow: auto; padding: 4px 28px 40px; min-width: 0; }
.setsec[hidden] { display: none; }
.setpage .sgroup:first-child h3 { margin-top: 0; }
.setsec > .classtab-host .sgroup h3 { margin-top: 22px; }
.tools-shell .tool-pane-host { margin-top: 0; }
.tool-pane-host .openfile-tool-embedded { height: 100%; }
.tool-pane-host .openfile-tool-embedded .open-file-back,
.tool-pane-host .openfile-tool-embedded .lib-view-switch-row { display: none !important; }
.tool-pane-host .openfile-tool-embedded .open-file-view { max-width: 680px; margin: 0 auto; padding: 12px 0 40px; }
.sgroup h3 { margin: 22px 0 8px; font: 600 13px system-ui, sans-serif; color: var(--ink2); }
.sgroup.danger h3 { color: var(--danger, #f87171); }
.srows { display: flex; flex-direction: column; gap: 2px; border-radius: var(--r); overflow: hidden; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 10px 14px; background: var(--s2); position: relative; }
.srow .st { min-width: 0; }
.srow .st b { display: block; font-weight: 500; font-size: 15px; color: var(--ink); }
.srow .st span { display: block; font-size: 13px; color: var(--ink2); max-width: 48ch; }
.srow .sc { flex: none; display: flex; gap: 8px; align-items: center; }
.srow .srow-ghost { background: transparent; border: 0; box-shadow: none; color: var(--ink2); font-weight: 500; }
@media (hover: hover) { .srow .srow-ghost:hover:not(:disabled) { background: var(--s3); color: var(--ink); } }
.srow #updateCheckBtn[hidden] { display: none; }
.fin-ctl { display: inline-flex; align-items: center; gap: 8px; }
.fin-ctl #drawerThemeName { font-weight: 600; }
.snote { margin: 8px 2px 0; font-size: 13px; color: var(--ink2); max-width: 52ch; }
.sgroup .settings-advanced-details { background: var(--s2); border-radius: var(--r); padding: 6px 14px; margin-top: 10px; }
.sgroup .settings-advanced-details summary { color: var(--ink2) !important; min-height: 40px; display: flex; align-items: center; }
@media (max-width: 899px) { .srow { flex-wrap: wrap; } .srow .sc { width: 100%; } }

/* SoundFonts in Settings and reader modal */
#soundFontSection .soundfont-toolbar {
  min-height: 32px;
}
#soundFontSection .soundfont-toolbar .srow-ghost {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink2);
  font-weight: 500;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--r-control, 8px);
}
#soundFontSection .soundfont-toolbar .srow-ghost.active {
  background: var(--s3);
  color: var(--ink);
}
#soundFontSection .soundfont-list,
.soundfont-list.srows {
  gap: 2px;
  max-height: none;
  overflow-y: visible;
}
#soundFontSection .soundfont-row,
.soundfont-row.srow {
  background: var(--s2) !important;
  border: 0 !important;
  border-radius: 0 !important;
  min-height: 60px;
  padding: 10px 14px;
  cursor: pointer;
}
@media (hover: hover) {
  #soundFontSection .soundfont-row:hover,
  .soundfont-row.srow:hover,
  #soundFontStrictRow:hover {
    background: var(--s3) !important;
  }
}
#soundFontSection .soundfont-move-up-btn,
#soundFontSection .soundfont-move-down-btn,
#soundFontSection .soundfont-delete-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-control, 8px);
}
#soundFontSection .soundfont-delete-btn.active {
  background: color-mix(in srgb, var(--danger, #f87171) 22%, var(--s3)) !important;
  color: var(--danger, #f87171) !important;
}
#soundFontSection .form-select {
  background-color: var(--s3) !important;
  border: 0 !important;
  color: var(--ink) !important;
  border-radius: var(--r-control, 8px) !important;
  font-size: 13px;
  min-height: 34px;
}
#soundFontSection .form-select:focus {
  outline: 2px solid var(--hue) !important;
  outline-offset: -1px;
}
#soundFontSection .form-select option {
  background-color: var(--s1) !important;
  color: var(--ink) !important;
}
#soundFontModal .soundfont-sgroup h3 {
  display: none;
}

.about-credits-box {
  background: var(--s2);
  border-radius: var(--r);
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink2);
}
.about-credits-box .about-third-party {
  margin-top: 14px;
}
.about-credits-box .about-third-party .fw-semibold {
  color: var(--ink);
}
.about-credits-box a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.about-credits-box ul {
  padding-left: 1.25rem;
  margin-top: 6px;
}
.about-credits-box li {
  margin-bottom: 4px;
}
.license-expander {
  margin-top: 4px;
}
.license-expander summary {
  cursor: pointer;
  font-size: 12px;
}
@media (pointer: coarse) {
  .license-expander summary { display: flex; align-items: center; min-height: 44px; }
}
.license-expander-text {
  max-height: 240px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 10px;
  background: var(--s1);
  border-radius: var(--r);
  color: var(--ink2);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* Phone: five tabs, no brand or Tools (Tools stays in the top bar) */
@media (max-width: 576px) {
  body.library-view-active .library-bottom-nav { background: var(--s1) !important; }
  .library-bottom-nav .library-nav-tab { font-size: 11px; font-weight: 500; }
  .library-bottom-nav .library-nav-tab.active { background: transparent; color: var(--ink); }
  .library-bottom-nav .library-nav-tab.active::before { top: 3px; left: 50%; margin-left: -3px; margin-top: 0; }
  body.library-view-active #libraryPage { padding-left: 0; }
}

/* Finishes modal */
.fin, .theme-modal-grid.fin {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 4px;
}
@media (max-width: 639px) {
  .fin, .theme-modal-grid.fin {
    grid-template-columns: repeat(2, 1fr);
  }
}
.fin-tile {
  border-radius: var(--r-control, 8px);
  background: var(--f0, var(--bg-card-solid));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  position: relative;
  min-height: 84px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 0;
  cursor: pointer;
  transition: transform var(--dur-fast, 150ms) var(--ease-out);
}
.fin-tile:active {
  transform: scale(0.97);
}
.fin-tile .bands {
  display: flex;
  height: 40px;
  width: 100%;
}
.fin-tile .bands i {
  flex: 1;
  height: 100%;
}
.fin-tile .nm {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--f-ink, var(--text-main));
  display: flex;
  align-items: center;
  gap: 6px;
}
.fin-tile[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--f-ink, var(--text-main));
}

/* Window controls in top row & title bar clearings */
:root {
  --wc-l: 0px;
  --wc-r: 0px;
  --bar-h: 52px;
}
.tauri-macos #topBar, .tauri-windows #topBar { min-height: var(--bar-h); }
.tauri-macos, body.tauri-macos {
  --wc-l: 78px;
  --topbar-h: var(--bar-h);
}
.tauri-windows, body.tauri-windows {
  --wc-r: 138px;
  --topbar-h: var(--bar-h);
}
.tauri-linux, body.tauri-linux {
  --wc-r: 56px;
}

html.window-fullscreen, body.window-fullscreen {
  --wc-l: 0px !important;
  --wc-r: 0px !important;
}
html.window-fullscreen #winControls {
  display: none !important;
}
html.window-fullscreen #readingDragStrip {
  display: none !important;
}

#topBar {
  padding-left: max(calc(12px + var(--wc-l, 0px)), calc(env(safe-area-inset-left, 0px) + 6px)) !important;
  padding-right: max(calc(12px + var(--wc-r, 0px)), calc(var(--inset-far) + 6px)) !important;
}

.tauri-windows #winControls {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  height: var(--bar-h);
  z-index: 2001;
}
.win-ctrl-btn {
  width: 46px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .win-ctrl-btn:hover {
  background: var(--s3);
} }
@media (hover: hover) { .win-ctrl-close:hover {
  background: #c42b1c !important;
  color: #fff !important;
} }

/* Section chips in Practice panel */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r, 8px);
  background: var(--s3);
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .chipbtn:hover { background: var(--bg-card-hover, #333); } }
.chipbtn.on { background: var(--hue); color: #000; font-weight: 600; }

/* Tunings flat rows */
.library-tunings-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
}
.tuning.tuning-card {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--s1);
  border-radius: var(--r);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
  text-align: left;
}
@media (hover: hover) { .tuning.tuning-card:hover {
  background: var(--s2);
} }
.tuning .strings {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tuning .strings span {
  flex: none;
  width: 50px;
  height: 42px;
  border-radius: var(--r-control, 6px);
  background: var(--s2);
  display: grid;
  place-items: center;
  font: 600 16px system-ui, sans-serif;
  position: relative;
  color: var(--ink);
}
@media (hover: hover) { .tuning.tuning-card:hover .strings span {
  background: var(--s3);
} }
.tuning .strings span small {
  position: absolute;
  top: 3px;
  left: 5px;
  font: 500 9px system-ui, sans-serif;
  color: var(--ink2);
}
.tuning h4 {
  margin: 0;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink);
}
.tuning h4 em {
  font: normal 13px system-ui, sans-serif;
  color: var(--ink2);
  font-style: normal;
}

/* Reader stacking: clean vertical offsets for playback dock, mobile nav, and the virtual fretboard */
:root {
  --reader-bottom-nav-h: 0px;
  --fretboard-effective-h: 0px;
}
body.fretboard-open {
  --fretboard-effective-h: var(--fretboard-dock-height, 213px);
}
@media (max-width: 640px) {
  body.fretboard-open {
    --fretboard-effective-h: var(--fretboard-dock-height, 111px);
  }
}

.sync-mode-bar {
  position: fixed !important;
  bottom: calc(var(--dock-h, 0px) + var(--reader-bottom-nav-h, 0px) + var(--fretboard-effective-h, 0px)) !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  z-index: 1050 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 12px 16px !important;
  background: var(--s2) !important;
  border-top: 1px solid var(--border-subtle) !important;
  border-radius: var(--r-card) var(--r-card) 0 0 !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4) !important;
  transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
@media (prefers-reduced-motion: reduce) {
  .sync-mode-bar {
    transition: none !important;
  }
}
.sync-mode-bar .sync-mode-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Adjust points modal: waveform hero & point controls */
.sync-editor-card {
  max-width: min(780px, calc(100vw - 24px)) !important;
}
#syncEditorInfo {
  display: flex;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 2px;
  flex-wrap: wrap;
}
#syncEditorInfo > span + span:not([hidden])::before { content: "\00b7"; margin-right: 8px; }
#syncEditorInfo .sync-info-check { color: var(--ink); font-weight: 500; }
/* A sentence, not a count: it takes its own line */
#syncEditorInfo .sync-info-note { flex-basis: 100%; }
#syncEditorInfo .sync-info-note::before { content: none !important; }
#syncFromSelect { width: auto; max-width: min(260px, 100%); }
#syncEditorTimeline {
  margin-top: 8px;
  margin-bottom: 12px;
}

/* Synced videos manager & copy dialog rows */
.synced-video-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 56px;
  border-radius: var(--r-control);
  background: var(--s1);
  transition: background var(--dur-fast) var(--ease-out);
  cursor: pointer;
  user-select: none;
}
@media (hover: hover) { .synced-video-row:hover { background: var(--s2); } }
.synced-video-row.is-selected {
  background: var(--s3);
}
.synced-video-row .form-check-input,
#manageSyncedSelectAll {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  border: 0 !important;
  background-color: var(--s3) !important;
  cursor: pointer;
  flex: none;
}
.synced-video-row .form-check-input[type="checkbox"],
#manageSyncedSelectAll {
  border-radius: 4px !important;
}
.synced-video-row .form-check-input[type="radio"] {
  border-radius: 50% !important;
}
.synced-video-row .form-check-input:checked,
#manageSyncedSelectAll:checked,
#manageSyncedSelectAll:indeterminate {
  background-color: var(--action) !important;
}

/* ==========================================================================
   Discography Shelf & Album Blocks (Precision Gear-Stack Style)
   ========================================================================== */

.discography-shelf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--s3) transparent;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
}
.discography-shelf::-webkit-scrollbar {
  height: 4px;
}
.discography-shelf::-webkit-scrollbar-thumb {
  background: var(--s3);
  border-radius: 2px;
}

.shelf-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r, 8px);
  background: var(--s2);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  color: var(--ink);
  cursor: pointer;
  flex: none;
  max-width: 260px;
  text-align: left;
  user-select: none;
  transition: background-color var(--dur-fast, 120ms) var(--ease-out, ease),
              border-color var(--dur-fast, 120ms) var(--ease-out, ease),
              transform var(--dur-fast, 120ms) var(--ease-out, ease);
}
@media (hover: hover) { .shelf-item:hover {
  background: var(--s3);
  border-color: rgba(255, 255, 255, 0.16);
} }
.shelf-item:active {
  transform: translateY(1px);
}
.shelf-item.active {
  background: color-mix(in srgb, var(--hue) 15%, var(--s2));
  border-color: var(--hue);
  box-shadow: 0 0 12px color-mix(in srgb, var(--hue) 22%, transparent);
}

.shelf-cover {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm, 6px);
  object-fit: cover;
  flex: none;
  background: var(--s3);
}
.shelf-cover-all {
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--hue);
  background: color-mix(in srgb, var(--hue) 12%, var(--s3));
}
.shelf-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.shelf-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.shelf-sub {
  font-size: 11px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.2;
}

/* Album Block & Header */
.album-block {
  margin-bottom: 24px;
}
.album-header {
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  background: transparent;
}
@media (max-width: 575.98px) {
  .album-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .album-header > :first-child {
    flex: 1 1 100%;
    min-width: 0;
  }
  .album-header-actions {
    margin-left: auto;
  }
}
@media (pointer: coarse) {
  .album-header-actions .btn-theme-icon {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
.album-header-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--r, 8px);
  object-fit: cover;
  flex: none;
  background: var(--s2);
}
.album-header-cover-icon {
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--ink2);
  background: var(--s2);
}
.album-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}
.album-header-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink2);
  margin-top: 3px;
  flex-wrap: wrap;
}
.album-header-sub .sep {
  opacity: 0.5;
}

/* Redesigned Precision Song Rows */
.library-song-rowwrap {
  position: relative;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
  transition: background-color var(--dur-fast, 120ms) var(--ease-out, ease);
  width: 100%;
}
.library-song-rowwrap:last-child {
  border-bottom: none;
}
@media (hover: hover) { .library-song-rowwrap:hover { background: var(--s2) !important; } }
.library-song-rowwrap.library-song-row-pinned {
  border-left: 2px solid var(--warn);
}

.library-song-rowwrap .song-row-container {
  display: flex;
  align-items: center;
  width: 100%;
}

.library-song-rowwrap .song-row.library-song-row {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 12px 6px 20px !important;
  margin: 0 !important;
  width: 100%;
  text-align: left;
  background: transparent !important;
  border: 0 !important;
  color: inherit;
  cursor: pointer;
  user-select: none;
  outline: none;
  box-shadow: none !important;
  flex-wrap: nowrap !important;
}
.library-song-rowwrap .song-row.library-song-row:focus-visible {
  outline: 2px solid var(--hue);
  outline-offset: -2px;
}

.library-song-row .num {
  font: normal 13px system-ui, sans-serif;
  color: var(--ink2);
  min-width: 24px;
  width: auto !important;
  max-width: none !important;
  text-align: right;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.library-song-row .t {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.library-song-row .t b {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.library-song-row .t .sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.2;
}

.library-song-row .end {
  font: normal 13px system-ui, sans-serif;
  color: var(--ink2);
  min-width: 44px;
  width: auto !important;
  max-width: none !important;
  text-align: right;
  flex: none !important;
  margin-left: auto;
  padding: 0 !important;
}

.library-song-rowwrap .song-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding-right: 16px;
}

.library-song-row .sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hue);
  display: inline-block;
  flex: none;
}

.chip.sec {
  background: var(--s3);
  color: var(--ink2);
}

/* Phone: library song rows give the song title the full width over duration and pin icon,
   with tuning, audio type and metadata on the second line */
@media (max-width: 576px) {
  .library-song-rowwrap {
    padding: 8px 16px;
  }
  .library-song-rowwrap .song-row-container {
    display: grid !important;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 3px;
    align-items: center;
    width: 100%;
  }
  .library-song-rowwrap .song-row-container:not(:has(.num, .song-cover)) {
    grid-template-columns: 1fr auto auto;
  }
  .library-song-rowwrap .song-row.library-song-row {
    display: contents !important;
  }
  .library-song-row .num,
  .library-song-row .song-cover {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0 !important;
    min-width: 24px;
    text-align: right;
  }
  .library-song-row .t {
    display: contents !important;
  }
  .library-song-row .t b {
    grid-column: 2 / -1;
    grid-row: 1;
    font-size: 14.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .library-song-rowwrap .song-row-container:not(:has(.num, .song-cover)) .library-song-row .t b {
    grid-column: 1 / -1;
  }
  .library-song-row .t .sub {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink2);
    line-height: 1.2;
    margin: 0 !important;
  }
  .library-song-rowwrap .song-row-container:not(:has(.num, .song-cover)) .library-song-row .t .sub {
    grid-column: 1;
  }
  .library-song-row .end {
    display: inline-flex !important;
    align-items: center;
    grid-column: 3;
    grid-row: 2;
    font-size: 13px;
    color: var(--ink2);
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: end;
  }
  .library-song-rowwrap .song-row-container:not(:has(.num, .song-cover)) .library-song-row .end {
    grid-column: 2;
  }
  .library-song-rowwrap .song-actions .song-tabs-spacer {
    display: none !important;
  }
  .library-song-rowwrap .song-actions {
    grid-column: 4;
    grid-row: 2;
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding-right: 0 !important;
    justify-self: end;
  }
  .library-song-rowwrap .song-row-container:not(:has(.num, .song-cover)) .song-actions {
    grid-column: 3;
  }
  .library-song-rowwrap .song-actions .song-tabs-btn {
    width: auto !important;
    min-height: 32px;
    padding: 0 4px;
    font-size: 13px;
  }
  .library-song-rowwrap .song-actions .btn-theme-icon {
    min-width: 32px;
    padding: 0;
  }
  .library-song-rowwrap:has(.library-song-row:focus-visible) {
    outline: 2px solid var(--hue);
    outline-offset: -2px;
  }
}

/* ---------- Phone: the library has no reader controls ----------
   Over the library the bar keeps the brand and Tools. View, More, fullscreen and the hamburger belong to an open
   score (Settings is in the tab bar), and the Settings page needs the whole screen. */
@media (max-width: 576px) {
  body.library-view-active #topBar { display: none !important; }
  .setpage {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* Classical tab scrolls its own list, so the list runs down to the tab bar. The pane already reaches 8px under the
     bar, and the bar covers the safe area, so the pane's bottom padding is exactly those 8px (no safe-area inset) */
  .tools-shell .setpage:has(.classtab-tool-embedded) {
    padding-bottom: 24px !important;
  }
  .library-search-bar { height: 44px !important; }
  .library-search-bar .search-input { font-size: 16px !important; /* 16px stops iOS zooming the page on focus */ }
}

/* Pane back control (single-pane layout, under 1000px): flat text action, platform radius, ink on tone steps, no pill, no accent border or white hover */
.pane-head .in-view-back-btn { border-radius: var(--r-control) !important; border: 0 !important; background: transparent !important; box-shadow: none; color: var(--ink) !important; min-height: 32px; transition: background-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .pane-head .in-view-back-btn:hover { transform: none; background: var(--s2) !important; color: var(--ink) !important; } }
.pane-head .in-view-back-btn:active { background: var(--s3) !important; }
.pane-head .in-view-back-btn:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
@media (pointer: coarse) { .pane-head .in-view-back-btn { min-height: 44px; min-width: 44px; } }

/* Second level (pinned, an artist, an album): the back control starts at the rows' left edge, not 8px in from it */
@media (max-width: 576px) {
  .pane-head .in-view-back-btn { padding-left: 0 !important; }
}

/* Recents: one flat row, the row opens the tab */
.recent-row { min-height: 64px; }
.recent-row .small { color: var(--ink2) !important; }
.recent-row-actions .btn { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
@media (pointer: coarse), (max-width: 576px) { .recent-row-actions .btn { min-width: 44px; min-height: 44px; } }
.library-page-container > #recentsList { grid-column: 1 / -1; margin: 8px -20px 0; }
@media (max-width: 576px) { .library-page-container > #recentsList { margin-inline: -16px; } }

/* ---------- Phone reader: the song title is the first thing in the bar ----------
   The Page/Scroll switch is in View, so its slot goes to the title (which opens This song). */
@media (max-width: 576px) {
  body:not(.library-view-active) .top-bar-song-btn .breadcrumb-song-title { display: block !important; max-width: none; font-size: 20px; }
  body:not(.library-view-active) .top-bar-song-btn { min-width: 0; max-width: 100%; }
  body:not(.library-view-active) #centerSection { display: none !important; }
  body:not(.library-view-active) #topBar { grid-template-columns: minmax(0, 1fr) auto !important; }
  body:not(.library-view-active) #pageIndicator { display: none; }
}

/* ---------- Meta text, not pills ----------
   Counts, tunings, years and statuses read as plain grey text beside what they describe. Only real controls
   (filters, switches) and key caps keep a shape. */
.badge-theme-primary, .badge-theme-secondary, .badge-theme-success, .badge-theme-info, .badge-theme-warning,
.badge-theme-year, .badge-tuning, .badge-no-tab, .badge-has-tabs {
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 0 !important; font-family: inherit !important; font-size: 13px !important; font-weight: 400 !important;
  letter-spacing: 0 !important; text-transform: none !important; color: var(--ink2) !important;
}
.badge-theme-warning, .badge-no-tab { color: var(--warn) !important; }
.album-year-badge { display: none !important; }
/* Safety net: a .badge or the Experimental tag never draws a pill; it reads as grey text */
.badge, .settings-beta-badge {
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 0 !important; font-size: 12px !important; font-weight: 400 !important; letter-spacing: 0; text-transform: none; color: var(--ink2) !important;
}
.settings-beta-badge::before { content: "\00b7"; margin-right: 6px; }

/* Library rows carry their meta as plain text */
.library-song-row .sub .chip, .library-song-row .sub .chip.hot, .library-song-row .sub .chip.sec {
  background: transparent; padding: 0; height: auto; border-radius: 0; font-size: 13px; font-weight: 400; color: var(--ink2);
}
.library-song-row .sub .chip.hot { color: var(--ink); }
.library-song-row .sub .chip.no-tab { color: var(--ink2) !important; font-weight: 400; }
.library-song-rowwrap.no-tab .library-song-row .t b { color: var(--ink2); }
.library-song-row .sub .chip i { display: none; }
.library-song-row .sub .chip + .chip::before, .library-song-row .sub .album-label + .chip::before { content: "\00b7"; margin-right: 8px; }
.library-song-row .sub .chip.text-muted { opacity: 1 !important; }
/* On a narrow row the artist and album keep a readable share and the tuning gives way first. Before, the label shrank
   to nothing and left only the separators ("· 7-String Standard · ·"). */
.library-song-row .sub .album-label { flex: 0 1 auto; min-width: min(12ch, 45%); overflow: hidden; text-overflow: ellipsis; }
.library-song-row .sub .chip { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.2; }
/* A narrow row cannot hold everything. The short format chip (GP, PDF pages) never shrinks; the artist/album and the tuning
   give way first, then the audio and Mapped chips, and every cut ends in an ellipsis. Before, the chips were cut
   mid-word ("YouT") by the row's edge with no ellipsis. */
.library-song-row .sub .album-label, .library-song-row .sub .chip:not(.sec):not(.no-tab) { flex-shrink: 4; }
.library-song-row .sub .chip.song-format, .library-song-row .sub .chip.sec:not(.song-audio):not(.song-mapped), .library-song-row .sub .chip.no-tab { flex: 0 0 auto; }
.library-song-row .sub .chip.song-audio, .library-song-row .sub .chip.song-mapped { flex: 0 1 auto; min-width: 3ch; }
/* On a phone the meta line is only about 155px wide beside the duration and the tab count, so it wraps instead of cutting
   facts off: each fact keeps its whole text on one line of its own (the separators give way to a gap), and the row
   grows by one line when it needs it. */
@media (max-width: 576px) {
  .library-song-rowwrap .library-song-row .t .sub { flex-wrap: wrap !important; white-space: normal !important; overflow: visible; gap: 1px 12px; }
  .library-song-row .sub .chip + .chip::before, .library-song-row .sub .album-label + .chip::before { content: none; margin: 0; }
  .library-song-row .sub .album-label { flex: 0 1 auto; min-width: 0; max-width: 100%; }
  .library-song-row .sub .chip, .library-song-row .sub .album-label { font-size: 12px; }
  .library-song-row .sub .chip, .library-song-row .sub .chip.song-audio, .library-song-row .sub .chip.song-mapped { flex: 0 1 auto; min-width: 0; max-width: 100%; }
}
.library-song-rowwrap.library-song-row-pinned { border-left: 0; }

/* Pinned songs: ordinary rows under a heading, no outline or accent bar */
.library-pinned-card {
  background: transparent !important; border: 0 !important; border-left: 0 !important; border-radius: 0 !important;
  box-shadow: none !important; height: auto; min-height: 56px;
}
@media (hover: hover) and (pointer: fine) { .library-pinned-card:hover { background: var(--s2) !important; transform: none !important; } }
.library-pinned-grid { gap: 0; grid-template-columns: 1fr; }

/* Album shelf: names in a row; the open album takes a tone step and the inlay dot */
.discography-shelf { border-bottom: 0; }
.shelf-item { background: transparent; border: 0; padding: 6px 12px 6px 6px; position: relative; }
@media (hover: hover) { .shelf-item:hover { background: var(--s2); border-color: transparent; } }
.shelf-item.active { background: var(--s2); border-color: transparent; box-shadow: none; }
.shelf-item.active::before { content: ""; position: absolute; left: 2px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); }

/* Row and album actions are words, not boxed buttons */
.library-song-rowwrap .song-actions { flex-direction: row; flex-wrap: nowrap; }
.library-song-rowwrap .song-actions .dropdown { display: inline-flex; }
.song-actions .dropdown > .btn-theme-outline, .album-header-actions .btn-theme-outline {
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--ink2) !important;
  font-weight: 500; font-size: 14px;
}
@media (hover: hover) { .song-actions .dropdown > .btn-theme-outline:hover, .album-header-actions .btn-theme-outline:hover { background: var(--s3) !important; color: var(--ink) !important; } }
.library-song-rowwrap .song-row-container .song-actions { display: flex !important; align-items: center; }

/* Tunings: rows on the page, no cards */
.library-tunings-grid { gap: 0; }
.tuning.tuning-card { background: transparent; border: 0; border-radius: 0; padding: 14px 20px; }
.tuning.tuning-card .edit-tuning-btn { background: transparent !important; border: 0 !important; color: var(--ink2) !important; font-weight: 500; font-size: 14px; min-height: 36px; }
@media (hover: hover) { .tuning.tuning-card .edit-tuning-btn:hover { background: var(--s3) !important; color: var(--ink) !important; } }
@media (max-width: 576px) { .tuning.tuning-card { padding-inline: 16px; } }

/* Album shelf: artwork only. The title, year and track count are in the album header below. */
.shelf-meta { display: none; }
.shelf-item { padding: 6px; max-width: none; }
.shelf-item .shelf-cover { width: 56px; height: 56px; }
.discography-shelf { gap: 6px; }
.shelf-item.active::before { left: 50%; top: auto; bottom: 0; margin: 0 0 0 -3px; }

/* ---------- Data management: one task at a time, tone steps instead of outlines ----------
   Settings, Data management opens the right task directly, there is no popup or tab strip. */
.backup-stat-card, .restore-mode-card, .backup-provider-option, .drive-backup-item, .backup-dropzone, #restoreInspectionCard {
  background: var(--s2) !important; border: 0 !important; box-shadow: none !important;
}
@media (hover: hover) { .backup-stat-card:hover,
.restore-mode-card:hover,
.backup-provider-option:hover,
.drive-backup-item:hover { background: var(--s3) !important; box-shadow: none !important; } }
.restore-mode-card:has(input:checked) { background: var(--s3) !important; box-shadow: none !important; }
.backup-dropzone.drag-over { background: var(--s3) !important; box-shadow: none !important; }
.provider-mini-icon { background: var(--s3); border: 0; }
#restoreInspectionCard .restore-mode-card { background: var(--s1) !important; }
#restoreInspectionCard .restore-mode-card:has(input:checked) { background: var(--s3) !important; }
#viewMenu { padding-bottom: 12px; }

/* Setlists: the page content spans the grid, rows are names and counts */
.setlists-view .setrow .mono { display: none; }
.setlists-view #toggleSetlistsEditBtn.btn-theme-outline { background: transparent !important; border: 0 !important; color: var(--ink2) !important; font-weight: 500; }
@media (hover: hover) { .setlists-view #toggleSetlistsEditBtn.btn-theme-outline:hover { background: var(--s3) !important; color: var(--ink) !important; } }
.setlists-view #toggleSetlistsEditBtn i { display: none; }
.setlists-view .rowwrap .row { flex-wrap: nowrap; margin: 0; --bs-gutter-x: 0; padding-inline: 20px; }
.setlists-view .rowwrap .row > * { width: auto; max-width: none; padding: 0; margin-top: 0; }
.setlists-view .rowwrap .row > .t { flex: 1; min-width: 0; }
.setlists-view .rowwrap { border-bottom: 0; }

/* Pinned songs: a group of its own above the artist list */
.pinned-group-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: inherit;
  background: transparent !important; border: 0 !important; border-radius: 0 !important; min-height: 56px; padding: 6px 20px !important; position: relative;
}
.pinned-group-card[aria-current="true"] { background: var(--s2) !important; }
.pinned-group-card[aria-current="true"]::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); }
@media (hover: hover) { .pinned-group-card:hover { background: var(--s2) !important; } }
.pinned-group-glyph { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--s3); color: var(--ink); flex: none; }
/* Pinned songs list: ordinary rows, no accent bar, no bullet where there is no track number */
.library-song-rowwrap.library-song-row-pinned { border-left: 0 !important; box-shadow: none !important; }
.library-song-rowwrap, #libSongsList { min-width: 0; max-width: 100%; }

/* ---------- Custom Music: no boxed bars, books are words ---------- */
.library-sticky-breadcrumbs { background: transparent !important; border: 0 !important; box-shadow: none !important; padding-inline: 20px !important; }
.library-book-pdf-bar { background: transparent !important; border: 0 !important; padding: 4px 20px !important; margin-bottom: 4px; }
.book-row-label { color: var(--ink2); font-size: 13px; }
.library-book-pdf-bar .book-item { min-height: 36px; max-width: 100%; }
.library-book-pdf-bar .album-book-link { font-size: 14px; max-width: 220px; min-height: 36px; }
.library-book-pdf-bar .btn-theme-outline {
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--ink2) !important; font-weight: 500; font-size: 14px;
}
@media (hover: hover) { .library-book-pdf-bar .btn-theme-outline:hover { background: var(--s3) !important; color: var(--ink) !important; } }
.pane-head .in-view-back-btn { color: var(--ink) !important; }
.library-sticky-breadcrumbs .btn-theme-outline { background: transparent !important; border: 0 !important; color: var(--ink2) !important; }
.theme-breadcrumb-btn { background: transparent !important; border: 0 !important; box-shadow: none !important; }
@media (max-width: 576px) { .library-sticky-breadcrumbs, .library-book-pdf-bar { padding-inline: 16px !important; } }
.library-book-pdf-bar { row-gap: 0 !important; column-gap: 14px !important; }
.library-book-pdf-bar .btn { padding-inline: 0 !important; min-height: 40px; }
@media (hover: hover) { .library-book-pdf-bar .btn:hover { background: transparent !important; text-decoration: underline; text-underline-offset: 3px; } }

/* Setlist detail: a text way back, quiet actions, no notes in the rows */
.setlists-view .theme-control-btn, .setlists-view #toggleSetlistEditBtn { background: transparent !important; border: 0 !important; color: var(--ink2) !important; font-weight: 500; }
@media (hover: hover) { .setlists-view .theme-control-btn:hover,
.setlists-view #toggleSetlistEditBtn:hover { background: var(--s3) !important; color: var(--ink) !important; } }
.setlists-view .setlist-add-songs { border: 0 !important; }

/* Page titles and empty states are left aligned words, not centred glyphs */
.library-page-title, .library-page-title-text, .library-page-title-sub { text-align: left !important; justify-content: flex-start !important; }
.library-empty { text-align: left; padding-inline: 16px; }
@media (min-width: 577px) { .library-empty { padding-inline: 20px; } }
@media (pointer: coarse) { .library-empty .btn { min-height: 44px; } }
.library-empty h6 { font-size: 17px; }

/* Empty collection welcome launchpad */
.empty-welcome-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  padding: 32px 16px 48px;
  margin: 0;
  text-align: left;
}

@media (min-width: 577px) {
  .empty-welcome-container {
    padding: 36px 20px 56px;
  }
}

.empty-welcome-hero {
  margin-bottom: 32px;
}

.empty-welcome-title {
  font-family: var(--font-display, inherit);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 8px 0;
  line-height: 1.15;
}

@media (min-width: 577px) {
  .empty-welcome-title {
    font-size: 32px;
  }
}

.empty-welcome-sub {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink2);
  margin: 0 0 20px 0;
  max-width: 560px;
}

.empty-welcome-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-control);
}

.empty-welcome-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.empty-section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 12px;
}

/* Flat Rows on 56px Pitch with Tone Steps */
.empty-action-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.empty-action-row {
  display: flex;
  color: inherit;
  text-decoration: none;
  align-items: center;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: var(--r-control);
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) {
  .empty-action-row:hover {
    background-color: var(--s1);
  }
}

.empty-action-row:active {
  background-color: var(--s2);
}

.empty-action-row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.empty-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 14px;
  color: var(--ink2);
  font-size: 18px;
  transition: color var(--dur-fast) var(--ease-out);
}

.empty-action-row:hover .empty-action-icon,
.empty-action-row:focus-visible .empty-action-icon {
  color: var(--ink);
}

.empty-action-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.empty-action-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.empty-action-desc {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 576px) {
  .empty-action-desc {
    white-space: normal;
  }
}

.empty-action-chevron {
  font-size: 14px;
  color: var(--ink2);
  opacity: 0.5;
  margin-left: 8px;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

@media (hover: hover) {
  .empty-action-row:hover .empty-action-chevron {
    opacity: 0.9;
    transform: translateX(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-action-row,
  .empty-action-icon,
  .empty-action-chevron {
    transition: none !important;
    transform: none !important;
  }
}

/* Explainer rows: same pitch and left edge as action rows, but not controls */
.empty-info-row { display: flex; align-items: center; min-height: 56px; padding: 10px 14px; }
.empty-info-row .empty-action-desc { white-space: normal; }

/* Setlist rows carry the album art */
.setrow .setrow-cover { width: 44px; height: 44px; border-radius: var(--r); object-fit: cover; flex: none; background: var(--s3); }

/* ---------- Reference library, Fretboard dock, Tuner: tools in the same flat language ---------- */
/* Reference library: one frame for all three tabs, flat rows and tone steps, no outlines */
/* Tone steps for this tool, made from ink over the ground so they climb in every finish (in Snow White --s2 is the ground itself) */
.ref-page-container, .ref-section-box, .ref-circle-container { --ref-rest: color-mix(in srgb, var(--ink) 6%, var(--ground)); --ref-on: color-mix(in srgb, var(--ink) 13%, var(--ground)); }
.ref-page-container { display: block !important; padding: 0 0 32px !important; max-width: 1180px; }
.ref-chip:focus-visible, .ref-chord-link:focus-visible, .ref-switch input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .ref-chip { min-height: 44px; } }

.ref-section-box, .ref-circle-container, .ref-circle-right, .ref-scale-banner, .ref-stat-card {
  background: transparent !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; padding: 0 !important; border-radius: 0 !important;
}
.ref-filter-group-label, .ref-select-label, .ref-card-subhead, .ref-kv dt {
  text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; font-weight: 400 !important; color: var(--ink2) !important; margin: 0 !important;
}
.ref-chip-row { display: flex; flex-wrap: wrap; gap: 2px; }
.ref-chip {
  min-height: 36px; min-width: 36px; padding: 0 12px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink2);
  font: 500 14px/1 inherit; font-family: inherit; font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ref-chip[aria-pressed="true"] { background: var(--ref-on); color: var(--ink); font-weight: 600; }
@media (hover: hover) { .ref-chip:hover { background: var(--ref-rest); color: var(--ink); } .ref-chip[aria-pressed="true"]:hover { background: var(--ref-on); } }
/* Root keys are real key caps */
.ref-root-row { gap: 4px; margin-bottom: 16px; }
.ref-key { min-width: 44px; background: var(--ref-rest); color: var(--ink); }
.ref-key[aria-pressed="true"] { background: var(--ref-on); }
.ref-root-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ref-root-row::-webkit-scrollbar { display: none; }
.ref-root-row .ref-key { flex: none; }
.ref-filter-row { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: flex-end; margin-bottom: 20px; }
.ref-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ref-page-container .ref-select.form-select {
  min-height: 44px; padding: 0 36px 0 12px !important; border: 0 !important; border-radius: var(--r-control) !important; background-color: var(--ref-rest) !important; color: var(--ink) !important; font-size: 14px; box-shadow: none !important;
}
.ref-result-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ref-count { font-size: 13px; color: var(--ink2); }
.ref-switch { display: inline-flex; align-items: center; gap: 12px; min-height: 36px; font-size: 14px; color: var(--ink); cursor: pointer; }
.ref-switch input { margin: 0; }
.ref-empty { padding: 48px 0; color: var(--ink2); font-size: 14px; }

/* Chord cards: a tone step, no outline; ink dots on the diagram */
.ref-chord-card { background: var(--ref-rest) !important; border: 0 !important; box-shadow: none !important; transform: none !important; border-radius: var(--r-card) !important; padding: 16px 8px 12px !important; }
@media (hover: hover) { .ref-chord-card:hover { background: var(--ref-on) !important; box-shadow: none !important; transform: none !important; } }
.ref-chord-name { font-size: 16px !important; }
.ref-chord-cat { font-size: 13px !important; color: var(--ink2) !important; }
.ref-chord-diagram-svg { max-width: 176px !important; }
.ref-chord-diagram-svg.ref-chord-diagram-vertical { max-width: 130px !important; }
.ref-mode-row, .ref-orient-row { gap: 4px; }
.ref-chord-frets { font-family: inherit !important; font-size: 13px !important; color: var(--ink2) !important; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.ref-chord-card [class*="fingering"], .ref-chord-card code { font-family: inherit !important; }
.ref-chord-capo-bar { fill: var(--ink) !important; fill-opacity: 0.85 !important; }
.ref-chord-capo-text { fill: var(--ink2) !important; font-family: inherit !important; }

/* Key-value rows */
.ref-kv { margin: 0 0 20px; }
.ref-kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-control); background: var(--ref-rest); margin-bottom: 2px; }
.ref-kv dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.ref-scale-facts .ref-scale-formula, .ref-scale-facts .ref-scale-notes { font-family: inherit !important; color: var(--ink) !important; font-weight: 600; }
.ref-scale-note-btn {
    background: transparent;
    border: 0;
    padding: 2px 4px;
    margin: 0;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--r-control, 4px);
    transition: background var(--dur-fast, 150ms) var(--ease-out, ease-out), color var(--dur-fast, 150ms) var(--ease-out, ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .ref-scale-note-btn:hover {
        background: var(--ref-on, rgba(255, 255, 255, 0.08));
    }
}
.ref-scale-note-btn:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}
.ref-scale-note-btn.playing {
    background: var(--ref-on, rgba(255, 255, 255, 0.14));
}
.ref-scale-note-sep {
    color: var(--ink2);
    user-select: none;
}
.ref-fretboard-scroll-container { background: transparent !important; padding: 8px 0 0 !important; }
.ref-fretboard-svg .ref-fret-note {
    filter: none;
    cursor: pointer;
    user-select: none;
}
.ref-fretboard-svg .ref-fret-note circle.ref-note-marker {
    transition: opacity var(--dur-fast, 150ms) var(--ease-out, ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .ref-fretboard-svg .ref-fret-note:hover circle.ref-note-marker {
        opacity: 0.82;
    }
}
.ref-fretboard-svg .ref-fret-note:focus-visible {
    outline: none;
}
.ref-fretboard-svg .ref-fret-note:focus-visible circle.ref-note-marker,
.ref-fretboard-svg .ref-fret-note.playing circle.ref-note-marker {
    stroke: var(--ink);
    stroke-width: 2.5;
}

/* Circle of fifths: flat wedges, the chosen key one tone step up with the inlay dot */
.ref-circle-container { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 48px !important; align-items: center !important; }
.ref-circle-svg-wrapper { max-width: 460px !important; }
.ref-circle-svg { filter: none !important; border-radius: 0 !important; }
.ref-circle-slice { fill: var(--ref-rest); stroke: var(--ground); stroke-width: 2; transition: fill var(--dur-fast) var(--ease-out); filter: none !important; opacity: 1 !important; }
.ref-circle-slice.active { fill: var(--ref-on); }
@media (hover: hover) and (pointer: fine) { .ref-circle-slice:hover { fill: var(--ref-on); opacity: 1; } }
.ref-circle-slice:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ref-key-headline { font: 700 44px/1.02 var(--font-display) !important; letter-spacing: -.01em !important; margin: 0 0 16px !important; color: var(--ink) !important; }
.ref-subhead-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 24px 0 8px; }
.ref-deg-grid { gap: 4px !important; }
.ref-chord-deg-card {
    position: relative;
    background: var(--ref-rest) !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: var(--r-control) !important;
    min-height: 58px;
    padding: 0 !important;
    display: flex;
    overflow: hidden;
    transition: background var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .ref-chord-deg-card:hover { background: var(--ref-on) !important; } }
.ref-chord-deg-card.playing { background: var(--ref-on) !important; }
.ref-deg-chord-btn {
    flex: 1 1 auto;
    width: 100%;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 8px 18px 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    color: inherit;
    font: inherit;
    border-radius: var(--r-control) !important;
    transition: background var(--dur-fast) var(--ease-out);
}
.ref-deg-chord-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ref-deg-link-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--ink2);
    cursor: pointer;
    border-radius: var(--r-control, 4px);
    transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
    .ref-deg-link-btn:hover {
        color: var(--ink);
        background: color-mix(in srgb, var(--ink) 12%, transparent);
    }
}
.ref-deg-link-btn:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    color: var(--ink);
}
.ref-deg-label { font-size: 12px !important; color: var(--ink2) !important; line-height: 1.2; pointer-events: none; }
.ref-deg-chord { font-size: 15px !important; font-weight: 600; color: var(--ink) !important; line-height: 1.25; margin-top: 2px; pointer-events: none; }
@media (max-width: 899px) { .ref-circle-container { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; } .ref-key-headline { font-size: 36px !important; } }
@media (max-width: 576px) { .ref-filter-row .ref-chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; } .ref-filter-row .ref-chip-row::-webkit-scrollbar { display: none; } .ref-filter-row .ref-chip { flex: none; } .ref-filter-row { gap: 8px; } .ref-deg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } .ref-filter-row { gap: 12px 20px; } }
@media (prefers-reduced-motion: reduce) { .ref-chip, .ref-circle-slice { transition: none; } }

/* Fretboard dock */
.fretboard-tuning-badge, .fretboard-track-badge { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--ink2) !important; border-radius: 0 !important; }
#fretboardDock .btn i, .fretboard-panel .btn i, [id^="fretboard"] .btn-theme-outline i { display: none; }
.fretboard-playhead, [class*="fretboard"] [class*="playhead"], [class*="fretboard"] [class*="cursor-glow"] { box-shadow: none !important; filter: none !important; }

/* Tuner: the reference tools' flat language. Tone steps, no outlines or glow, the one hue on the needle (the playhead), words for status */
.tuner-modal-body { --ref-rest: color-mix(in srgb, var(--ink) 6%, var(--ground)); --ref-on: color-mix(in srgb, var(--ink) 13%, var(--ground)); }
.tuner-modal-card { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.tuner-modal-body, .tuner-display-card, .tuner-instrument-banner, .tuner-string-btn { box-shadow: none !important; }
.tuner-instrument-grid, .tuner-selector-row .ref-chip-row { gap: 2px; }
.tuner-inst-icon-wrap, #tunerModal .btn i { display: none !important; }
.tuner-selector-row { align-items: center; gap: 8px 24px; }
.tuner-selector-label, .tuner-calib-group label { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; font-weight: 400 !important; color: var(--ink2) !important; }
.tuner-modal-body select.tuner-other-select.form-select, .tuner-calib-select {
  min-height: 44px; padding: 0 36px 0 12px !important; border: 0 !important; border-radius: var(--r-control) !important; background-color: var(--ref-rest) !important; color: var(--ink) !important; font-size: 14px !important; box-shadow: none !important;
}
.tuner-modal-body select.tuner-other-select.active { background-color: var(--ref-on) !important; background-image: none !important; color: var(--ink) !important; font-weight: 600; }
.tuner-calib-select { padding-right: 12px !important; }
@media (hover: hover) { .tuner-modal-body select.tuner-other-select.form-select:hover { background-color: var(--ref-on) !important; border-color: transparent !important; color: var(--ink) !important; } }
.tuner-calib-group { display: inline-flex; align-items: center; gap: 8px; border: 0 !important; background: transparent !important; padding: 0 !important; color: var(--ink2) !important; }
.tuner-instrument-banner { background: transparent !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; }
.tuner-banner-title { font-size: 18px; flex-wrap: wrap; }
.tuner-banner-subtitle, .tuner-active-note, .tuner-chromatic-note { font-size: 13px; color: var(--ink2); margin-bottom: 12px; }
.tuner-active-note { margin: 0; font-weight: 400; }
.tuner-string-btn { background: var(--ref-rest) !important; border: 0 !important; border-radius: var(--r-control) !important; min-height: 56px; }
.tuner-string-btn.active { background: var(--ref-on) !important; }
@media (hover: hover) { .tuner-string-btn:hover { background: var(--ref-on) !important; } }
.tuner-string-note { font-size: 16px; font-weight: 700; color: var(--ink); }
.tuner-string-hz { font-size: 12px; color: var(--ink2); font-family: inherit !important; font-variant-numeric: tabular-nums; }
.tuner-string-btn:focus-visible, .tuner-mic-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.tuner-display-card { background: var(--ref-rest) !important; border: 0 !important; border-radius: var(--r-card) !important; padding: 24px 16px !important; }
.tuner-cents-meter { background: var(--ref-on); border: 0; height: 12px; border-radius: 6px; }
.tuner-green-zone { background: color-mix(in srgb, var(--ink) 28%, var(--ref-on)); }
.tuner-center-target { background: var(--ink); box-shadow: none; }
/* The needle spans the meter and slides with transform (1% of its width = 1 cent); its visible bar is the ::after */
.tuner-cents-meter .tuner-needle { left: 0; width: 100%; background: none !important; box-shadow: none !important; border-radius: 0; transform: translateX(var(--needle, 0%)); transition: transform var(--dur-fast) var(--ease-out); will-change: transform; }
.tuner-cents-meter .tuner-needle::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--hue); }
.tuner-tick { background: color-mix(in srgb, var(--ink) 25%, transparent); }
.tuner-tick.is-major { background: color-mix(in srgb, var(--ink) 40%, transparent); }
.tuner-big-note { font-family: var(--font-display) !important; font-weight: 700; font-size: 5rem; letter-spacing: -.01em; text-shadow: none; transition: color var(--dur-fast) var(--ease-out); }
.tuner-big-note.is-in-tune { color: var(--ink); }
.tuner-big-note.is-idle { color: var(--ink2); opacity: .5; }
.tuner-big-octave { font-family: var(--font-display) !important; font-weight: 700; font-size: 2rem; color: var(--ink2); }
.tuner-freq-readout, .tuner-cents-readout { font-family: inherit !important; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink2); }
.tuner-status-readout { text-transform: none !important; letter-spacing: 0 !important; font-size: 15px !important; font-weight: 600; }
.tuner-status-in-tune { color: var(--ink) !important; font-weight: 700; text-shadow: none !important; }
.tuner-status-almost, .tuner-status-off { color: var(--ink2) !important; text-shadow: none !important; }
.tuner-vol-bar { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.tuner-vol-bar.is-active { background: var(--ink); box-shadow: none; }
.tuner-mic-btn { min-height: 44px; padding: 0 28px; border-radius: var(--r-control) !important; letter-spacing: 0 !important; font-size: 15px; font-weight: 600; box-shadow: none !important; }
.tuner-mic-btn.is-listening { background: var(--ref-on) !important; background-image: none !important; color: var(--ink) !important; border-color: transparent !important; box-shadow: none !important; }
@media (max-width: 576px) { .tuner-big-note, .metro-bpm { font-size: 4.5rem; } .tuner-big-octave { font-size: 1.6rem; } }
@media (prefers-reduced-motion: reduce) { .tuner-needle, .tuner-big-note { transition: none; } }
.fretboard-close-btn i, #tunerModal .theme-modal-close-btn i, #referenceModal .theme-modal-close-btn i { display: inline-block !important; }
.fretboard-panel .btn:not(.fretboard-close-btn), #fretboardDock .btn:not(.fretboard-close-btn) { background: transparent !important; border: 0 !important; color: var(--ink2) !important; }

/* ---------- Fretboard track strip: names with a color bar; it also shows and hides each track ---------- */
.fretboard-tracks-legend { min-width: 0; max-width: 100%; }
.fretboard-track-strip { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.fretboard-track-strip::-webkit-scrollbar { display: none; }
.fb-track {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 36px; padding: 0 10px; border-radius: var(--r-control, 8px);
  color: var(--ink); font-size: 14px; font-weight: 500; background: transparent; border: 0; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.fb-track::before { content: ""; width: 3px; height: 16px; border-radius: 1px; background: var(--track-color); flex: none; transition: opacity var(--dur-fast) var(--ease-out); }
.fb-track[aria-pressed="false"] { color: var(--ink2); }
.fb-track[aria-pressed="false"]::before { opacity: .3; }
@media (hover: hover) { .fb-track:hover { background: var(--s2); } }
@media (pointer: coarse) { .fb-track { min-height: 44px; } }
.fretboard-track-colors-btn { display: none; }
.fretboard-tracks-legend { flex: 1 1 auto; }
/* With a track strip the names take the room; the tuning is in This song and in each track's tooltip */
.fretboard-tracks-legend:has(.fretboard-track-strip) ~ .fretboard-tuning-badge { display: none; }

/* Fretboard dock: tracks on the left take all the room, Notes/Frets and close sit together on the right */
.fretboard-tracks-legend { max-width: none !important; }
.fretboard-dock-header { gap: 12px; }
.fretboard-dock-left { flex: 1 1 0 !important; min-width: 0; }
.fretboard-dock-center { order: 2; flex: none !important; }
.fretboard-dock-center { gap: 16px; }
.fretboard-dock-right { order: 3; flex: none !important; }
.library-song-row .song-cover { width: 44px; height: 44px; border-radius: var(--r); object-fit: cover; flex: none; background: var(--s3); }
.setsec .defaults-pills { flex: 0 1 auto; max-width: none; }
.setsec .defaults-pills .btn { flex: 0 0 auto; padding-inline: 14px; }

/* ---------- Per-track mix, under each track in Song: Mix opens mute, solo, level and pan ---------- */
.gp-track-item { display: block; }
.gp-track-row { grid-template-columns: 10px minmax(0, 1fr) auto auto auto !important; grid-template-areas: "dot label only mix sw" "dot sub only mix sw" !important; }
.gp-track-row.no-switch { grid-template-columns: 10px minmax(0, 1fr) auto auto !important; grid-template-areas: "dot label only mix" "dot sub only mix" !important; }
.gp-track-item.is-muted .gp-track-row .form-check-label { opacity: .5; }
.mixer-toggle { width: auto; min-width: 64px; height: 36px; padding: 0 14px; border: 0 !important; background: var(--s3) !important; color: var(--ink2) !important; box-shadow: none !important; }
.mixer-toggle.active { background: var(--ink) !important; color: var(--ground) !important; }
.mixer-slider .theme-value-badge { background: transparent !important; border: 0 !important; color: var(--ink2) !important; min-width: 40px; font-variant-numeric: tabular-nums; }
.mixer-slider input[type="range"] { accent-color: var(--hue, currentColor); }

/* Library lists scroll with the page: a pane that is not height-limited must not trap the wheel */
.pane .pane-scroll, .pane-scroll { overscroll-behavior: auto; }

/* ---------- Song loading card: a tone-step panel, flat progress, platform radius ---------- */
.loading-card { transition: opacity var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast); }
.loading-card.is-visible { transition: opacity var(--dur-base) var(--ease-out); }
.loading-card-panel {
  background: var(--s2) !important; border: 0 !important; box-shadow: none !important; border-radius: var(--r-card) !important;
  width: min(380px, 100%); padding: 16px 18px; gap: 14px;
  transform: translate3d(0, 8px, 0); transition: transform var(--dur-base) var(--ease-out);
}
.loading-card.is-visible .loading-card-panel { transform: none; }
.loading-card-cover { border: 0 !important; border-radius: var(--r-control) !important; background: var(--s3); }
.loading-card-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -0.005em; }
.loading-card-subtitle, .loading-card-stage { color: var(--ink2) !important; font-size: 13px; }
.loading-card-track { height: 4px; border: 0 !important; border-radius: 2px; background: var(--s3) !important; box-sizing: border-box; }
.loading-card-fill { background: var(--hue) !important; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { .loading-card-panel, .loading-card, .loading-card-fill { transition: none !important; } }

.backup-summary-box { background: var(--s2) !important; border: 0 !important; box-shadow: none !important; }
.backup-summary-box i { display: none; }

/* ---------- Data tasks live on the Settings page (Cloud sync and Data management) ---------- */
.data-task-back { display: inline-flex; background: transparent !important; border: 0 !important; color: var(--ink2) !important; padding-left: 0 !important; margin: 4px 0 8px; }
.data-task-back::before { content: "\2039"; margin-right: 6px; font-size: 18px; line-height: 1; }
#backupModal.is-embedded,
.data-task-slot .theme-modal-backdrop,
.data-task-slot #backupModal {
  position: static !important;
  display: block;
  background: transparent !important;
  padding: 0 !important;
  inset: auto !important;
  height: auto !important;
  min-height: 0 !important;
}
#backupModal.is-embedded .theme-modal-card { width: 100%; max-width: 100%; max-height: none; height: auto; background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0; transform: none !important; opacity: 1 !important; }
#backupModal.is-embedded .theme-modal-body { padding-inline: 0 !important; overflow: visible; max-height: none; }

/* Data tasks open in place under their row: same surface as the expanded row */
.data-task-slot { background: var(--s3); padding: 0 14px 12px; }

/* ---------- Data task content: rows and words, no boxes inside boxes ---------- */
.data-task-slot .backup-summary-box, .data-task-slot .backup-stat-card, .data-task-slot .restore-mode-card, .data-task-slot .backup-provider-option,
.data-task-slot #restoreInspectionCard, .data-task-slot [class*="alert"], .data-task-slot .rounded-3 {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.data-task-slot .backup-provider-option, .data-task-slot .restore-mode-card {
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--r-control, 8px) !important;
  transition: background var(--dur-fast, 150ms) var(--ease-out);
}
@media (hover: hover) { .data-task-slot .backup-provider-option:hover,
.data-task-slot .restore-mode-card:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent) !important;
} }
/* The inspection card's own rule is more specific: keep its options flat like the other rows */
.data-task-slot #restoreInspectionCard .restore-mode-card,
.data-task-slot #restoreInspectionCard .restore-mode-card:has(input:checked) { background: transparent !important; }
@media (hover: hover) { .data-task-slot #restoreInspectionCard .restore-mode-card:hover { background: color-mix(in srgb, var(--ink) 5%, transparent) !important; } }
.data-task-slot .backup-dropzone {
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--r-control, 8px) !important;
  padding: 8px 0 16px !important;
}
@media (hover: hover) { .data-task-slot .backup-dropzone:hover {
  background: transparent !important;
} }
.data-task-slot .backup-dropzone.drag-over {
  background: color-mix(in srgb, var(--ink) 8%, var(--s3)) !important;
}
.data-task-slot .backup-summary-box { padding: 12px 0 !important; }
.data-task-slot .backup-stat-card { background: transparent !important; padding-left: 0 !important; }
.data-task-slot .provider-mini-icon, .data-task-slot .backup-provider-option .badge, .data-task-slot .backup-provider-option > :last-child:not(label):not(div:has(input)) { }
.data-task-slot .provider-mini-icon { display: none !important; }
.data-task-slot .backup-provider-option > span.small:last-child, .data-task-slot .backup-provider-option .text-muted.small:last-child { display: none; }
.data-task-slot i[class^="bi"], .data-task-slot i[class*=" bi-"], .data-task-slot i.icon-gdrive, .data-task-slot svg.bi { display: none !important; }
.data-task-slot .btn i { display: none !important; }
.data-task-slot .small.fw-semibold, .data-task-slot .form-label, .data-task-slot h6, .data-task-slot .fw-bold.text-white.small { text-transform: none !important; letter-spacing: 0 !important; }
.data-task-slot .text-white-50, .data-task-slot .text-muted { color: var(--ink2) !important; }
.data-task-slot .text-danger, .data-task-slot .text-danger-emphasis { color: var(--ink) !important; }
.data-task-slot .text-danger.is-danger-notice { color: var(--danger, #f87171) !important; }
/* "I understand" confirmation: a tone row, a box that reads against it, ink label (no red fill) */
.confirm-check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--s2); border-radius: var(--r-control, 8px); }
.confirm-check[style*="display: none"] { display: none !important; }
.confirm-check .form-check-input:not(.theme-switch)[type="checkbox"] { float: none; margin: 1px 0 0; width: 20px; height: 20px; background-color: color-mix(in srgb, var(--ink) 24%, var(--s2)); }
.confirm-check .form-check-input:not(.theme-switch)[type="checkbox"]:checked { background-color: var(--action); }
.confirm-check label { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--ink); cursor: pointer; }
.data-task-slot .text-success { color: var(--ink2) !important; }
.data-task-slot .bg-danger, .data-task-slot [class*="bg-danger"] { background: transparent !important; }
.data-task-slot .border, .data-task-slot [class*="border-"] { border: 0 !important; }
.data-task-slot hr, .data-task-slot .border-top, .data-task-slot .border-bottom { display: none; }
/* The row's Close does this job */
.data-task-slot #restoreCancelBtn, .data-task-slot #backupCancelBtn, .data-task-slot [id$="CancelBtn"], .data-task-slot #orphansCloseBtn, .data-task-slot #reloadCancelBtn { display: none !important; }
.data-task-slot .theme-modal-footer { background: transparent !important; border: 0 !important; padding-inline: 0 !important; }
.data-task-slot .btn-theme-outline, .data-task-slot .theme-control-btn {
  background: color-mix(in srgb, var(--ink) 10%, var(--s3)) !important;
  color: var(--ink) !important;
  border: 0 !important;
  border-radius: var(--r-control, var(--r)) !important;
  font-weight: 500;
}
@media (hover: hover) { .data-task-slot .btn-theme-outline:hover:not(:disabled),
.data-task-slot .theme-control-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 18%, var(--s3)) !important;
  color: var(--ink) !important;
} }
.data-task-slot .form-control {
  background-color: color-mix(in srgb, var(--ink) 6%, var(--s3)) !important;
  border: 0 !important;
  color: var(--ink) !important;
  border-radius: var(--r-control, var(--r)) !important;
}
.data-task-slot .form-control:focus {
  background-color: color-mix(in srgb, var(--ink) 9%, var(--s3)) !important;
  outline: 2px solid var(--hue) !important;
  outline-offset: -1px;
  color: var(--ink) !important;
}
/* The one destructive action in a task keeps the danger color */
.data-task-slot #deleteAllExecuteBtn, .data-task-slot [id*="Delete"][id$="Btn"].btn-theme-danger, .data-task-slot .btn-theme-danger { background: color-mix(in srgb, var(--danger, #f87171) 24%, var(--s3)) !important; color: var(--ink) !important; border: 0 !important; }
.data-task-slot .text-center { text-align: left !important; }
.data-task-slot .justify-content-center { justify-content: flex-start !important; }
.data-task-slot #restoreChangeLocationBtn, .data-task-slot #restoreDrivePickBtn, .data-task-slot .select-drive-backup-btn { min-height: 32px; }

/* ---------- Reader vocabulary: View, Song, Guitar, Tools. Four labelled buttons, then Full screen and the page buttons ---------- */
/* Page / Scroll lives in View; the centre switch is gone. The radios stay in the DOM for the code that drives them. */
#modeButtons, #centerSection { display: none !important; }
#topBar { grid-template-columns: minmax(0, 1fr) auto !important; }
#topFlexZone { gap: 2px; }
.bar-btn-label { font-size: 14px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
#topFlexZone .btn, #toolsToggleBtn { padding-inline: 12px !important; }
#topFlexZone .btn.active, #topFlexZone .btn[aria-expanded="true"] { background: var(--s2) !important; color: var(--ink) !important; }
/* The word's selected tone follows its sheet: it enters with the sheet's entry (--dur-base) and leaves with its exit (--dur-fast), on the same curve */
#topFlexZone .btn { transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
#topFlexZone .btn.active, #topFlexZone .btn[aria-expanded="true"] { transition-duration: var(--dur-base); }
@media (prefers-reduced-motion: reduce) { #topFlexZone .btn { transition: none; } }
#soundToggleBtn:disabled, #guitarToggleBtn:disabled { opacity: 0.4; }
/* The title is a plain label. Its old button role stays for code that clicks it. */
.top-bar-song-btn { cursor: pointer; }
.top-bar-song-btn.is-static, .top-bar-song-btn.disabled { pointer-events: none; cursor: default; }
.top-bar-song-btn .song-title-chevron { display: inline-block; font-size: 12px; margin-left: 6px; color: var(--ink2); }
.top-bar-song-btn.is-static .song-title-chevron, .top-bar-song-btn.disabled .song-title-chevron { display: none !important; }
.top-bar-song-btn:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
/* Page buttons: the far right, always in the same spot, large targets for use while performing */
#navButtons { margin-left: 6px; }
#navButtons .btn { min-width: 44px; min-height: 44px; font-size: 1.1rem; }
#pageIndicator { min-width: 4.5ch; font: 500 14px system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--ink2); }
/* Guitar button shows the state when an override is on */
#guitarToggleBtn.is-adapted .bar-btn-label::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--hue); vertical-align: middle; }

/* ---------- Guitar panel ---------- */
.guitar-menu { width: 360px; max-width: calc(100vw - 16px); padding: 14px 16px 12px; position: fixed; z-index: 1085; display: flex; flex-direction: column; gap: 14px; }
.guitar-menu-title { font: 600 17px system-ui, sans-serif; color: var(--ink); }
.guitar-menu-sub { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.guitar-menu-written { display: flex; flex-direction: column; gap: 2px; }
.guitar-menu-label { color: var(--ink2); font-size: 13px; }
.guitar-menu-written b { font-size: 15px; font-weight: 600; }
.guitar-menu > div { margin: 0 !important; }
.guitar-menu .form-label { color: var(--ink2) !important; font-size: 13px; font-weight: 500 !important; }
.guitar-menu-foot { display: flex; gap: 6px; justify-content: space-between; }
.guitar-menu-action { background: transparent !important; border: 0 !important; color: var(--ink2) !important; padding: 8px 10px !important; border-radius: var(--r) !important; min-height: 40px; font-weight: 600; }
@media (hover: hover) { .guitar-menu-action:hover:not(:disabled) { background: var(--s3) !important; color: var(--ink) !important; } }
.guitar-menu-action:disabled { opacity: 0.4; }
.guitar-menu .hud-pill-group { width: 100%; display: flex; }
.guitar-menu .hud-pill-group .btn { flex: 1; text-align: center; justify-content: center; padding-inline: 4px; }
.guitar-menu .hud-pill-group i { display: none; }
.guitar-menu .form-select { background-color: var(--s3); border: 0; color: var(--ink); }
.guitar-menu .form-check-input.theme-switch { flex: none; }

/* The song title takes all the room the bar has, and only truncates when it must */
body:not(.library-view-active) #brandSection { min-width: 0; width: 100%; }
body:not(.library-view-active) #songBreadcrumb { flex: 1 1 auto; min-width: 0; }
body:not(.library-view-active) .top-bar-song-btn { max-width: none !important; min-width: 0; flex: 0 1 auto; }
body:not(.library-view-active) .top-bar-song-btn .breadcrumb-song-title { max-width: none !important; }
.usual-guitar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.usual-guitar .form-select { width: auto; min-width: 150px; background-color: var(--s3); border: 0; color: var(--ink); }

/* ---------- Practice panel (top bar) and the dock's volume ---------- */
/* The Synth panel shows the synth's sound options (Hear, SoundFonts, the mixer). Its speed block lives in the Practice
   menu; it stays in the DOM for the code that reads it. */
#synthDropdownPanel .synth-panel-body > :has(#synthSpeedButtons) { display: none !important; }
#barRulerInfoBtn { display: none !important; }
.dock-more { width: 32px !important; min-width: 32px !important; padding: 0 !important; }
#practiceToggleBtn.has-state .bar-btn-label::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--hue); vertical-align: middle; }
.practice-menu { width: 360px; max-width: calc(100vw - 16px); max-height: calc(100vh - 90px); overflow-y: auto; padding: 14px 16px 14px; position: fixed; z-index: 1085; display: flex; flex-direction: column; gap: 16px; }
.practice-menu > div { margin: 0 !important; flex-shrink: 0; }
.practice-menu [data-cap-hidden] { display: none !important; }
.practice-presets.practice-tempo-row { grid-template-columns: repeat(4, 1fr); }
.practice-presets:empty { display: none; }
.practice-menu .form-check.form-switch { display: flex; align-items: center; gap: 12px; flex-direction: row-reverse; justify-content: space-between; min-height: 44px; }
.practice-menu :has(> .form-check.form-switch + .form-check.form-switch) { flex-direction: column; align-items: stretch !important; }
.practice-menu .form-check.form-switch:has(#synthLoopSwitch) { width: auto; }
.practice-menu .form-check.form-switch:has(#synthLoopSwitch) .form-check-label { display: none; }
.practice-menu .form-check.form-switch .form-check-label { font-size: 15px !important; color: var(--ink) !important; }
.practice-title { font: 600 17px system-ui, sans-serif; color: var(--ink); }
.practice-sub { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.practice-menu .form-label, .practice-label { color: var(--ink2) !important; font-size: 13px; font-weight: 500 !important; }
.practice-speed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.practice-speed-value { font: 700 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.practice-step { width: 44px; height: 44px; padding: 0 !important; background: var(--s3) !important; border: 0 !important; color: var(--ink) !important; border-radius: var(--r) !important; font-size: 20px; }
.practice-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.practice-preset { background: var(--s3) !important; border: 0 !important; color: var(--ink2) !important; min-height: 44px; font-weight: 600; border-radius: var(--r) !important; }
.practice-preset.active { background: var(--s1) !important; color: var(--ink) !important; }
.dock-pop { position: fixed; z-index: 1086; width: 300px; max-width: calc(100vw - 16px); background: var(--s2); border-radius: var(--r-lg); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(6px) scale(0.98); transform-origin: bottom center; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.dock-pop[hidden] { display: none; }
.dock-pop.is-open { opacity: 1; transform: none; }
.dock-pop > div { margin: 0 !important; }
/* Volume popover: a narrow vertical fader with the level above it */
.dock-pop.dock-pop-volume { width: 64px; padding: 12px 0; align-items: center; gap: 8px; }
.dock-pop-volume > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dock-pop-volume #synthVolumeBadge { font: 600 13px system-ui, sans-serif; color: var(--ink2); background: none; padding: 0; }
.dock-pop-volume #synthVolumeSlider { writing-mode: vertical-lr; direction: rtl; width: 6px; height: 160px; margin: 0; accent-color: var(--hue); }
@media (max-width: 640px) { .dock-pop.dock-pop-volume { right: auto; width: 64px; } }
.dock-pop-title { font: 600 17px system-ui, sans-serif; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .dock-pop { transition: none; transform: none; } }

/* ---------- View, Practice, Song, Guitar, Tools: one set, one look ---------- */
/* Same width, inner padding, title and section gap; the open one's button takes a tone step */
#viewMenu, #practiceMenu, #guitarMenu, #scoreOptionsDropdownPanel { width: min(360px, calc(100vw - 24px)); }
#viewMenu, #practiceMenu, #guitarMenu { padding: 14px 16px 12px !important; }
#viewMenu::before { padding: 0 0 10px; }
#viewMenu .form-label, #scoreOptionsDropdownPanel .form-label, #practiceMenu .form-label, #guitarMenu .form-label,
.practice-label, .guitar-menu-label, .score-options-group-title { color: var(--ink2) !important; font-size: 13px; font-weight: 500 !important; }
#topFlexZone .btn[aria-expanded="true"], #topFlexZone .btn.active { background: var(--s3) !important; color: var(--ink) !important; }
@media (max-width: 640px) { #topFlexZone .btn[aria-expanded="true"], #topFlexZone .btn.active { background: var(--s2) !important; } }

#practiceMenu input[type=number], #practiceMenu .form-control { background: var(--s3) !important; color: var(--ink) !important; border: 0 !important; border-radius: var(--r) !important; }
#practiceMenu .btn:not(.practice-step):not(.practice-preset) { background: var(--s3) !important; color: var(--ink) !important; border: 0 !important; }

/* ---------- Song panel ---------- */
.score-options-panel .synth-panel-body { display: flex; flex-direction: column; gap: 18px; }
.score-options-panel .synth-panel-body > div { margin: 0 !important; }
#scoreOptionsDropdownPanel .form-select { background-color: var(--s3) !important; border: 0 !important; border-radius: var(--r-control) !important; color: var(--ink) !important; min-height: 36px; }
#scoreOptionsDropdownPanel .form-select:focus { outline: 2px solid var(--hue); outline-offset: -1px; box-shadow: none; }
#scoreOptionsDropdownPanel .form-select option { background-color: var(--s1); color: var(--ink); }
@media (pointer: coarse) { #scoreOptionsDropdownPanel .form-select { min-height: 44px; } }
.score-options-group-title { color: var(--ink2); font-size: 13px; font-weight: 500; }
.song-row-btn { display: flex !important; width: 100%; text-align: left; justify-content: flex-start !important; padding: 10px 12px !important; background: transparent !important; border: 0 !important; color: var(--ink) !important; border-radius: var(--r-control) !important; min-height: 56px; }
@media (hover: hover) { .song-row-btn:hover { background: var(--s3) !important; } }
.song-row-btn span { display: flex; flex-direction: column; gap: 2px; }
.song-row-btn small { color: var(--ink2); font-size: 12px; font-weight: 400; }
.score-options-group .song-row-btn + * { margin-top: 10px; }
/* Flat text rows on the 56px pitch (not stacked filled buttons); one tone step on hover */
#scoreOptionsSaveGroup .btn { background: transparent !important; border: 0 !important; color: var(--ink) !important; justify-content: flex-start !important; padding-inline: 12px !important; border-radius: var(--r-control) !important; min-height: 56px; }
/* Not the d-flex utility (it is !important and beat the inline display:none that hides actions that do not apply) */
#scoreOptionsSaveGroup .btn { display: flex; align-items: center; }
@media (hover: hover) { #scoreOptionsSaveGroup .btn:hover { background: var(--s3) !important; } }
#scoreOptionsSaveGroup .btn i { display: none; }
/* Export and Share: one row each, the label on the left and the formats as text actions on the right */
#scoreOptionsSaveGroup [hidden] { display: none !important; }
.song-format-row { display: flex; align-items: center; gap: 8px; min-height: 56px; padding-inline: 12px; }
.song-format-label { color: var(--ink); flex: 0 0 auto; }
.song-format-options { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; margin-inline-start: auto; }
#scoreOptionsSaveGroup .song-format-options .btn { min-height: 40px; padding-inline: 10px !important; color: var(--ink2) !important; justify-content: center !important; width: auto; }
@media (hover: hover) { #scoreOptionsSaveGroup .song-format-options .btn:hover { color: var(--ink) !important; background: var(--s3) !important; } }
@media (pointer: coarse) { #scoreOptionsSaveGroup .song-format-options .btn { min-height: 44px; } }
.top-bar-song-btn.active { background: transparent !important; }

/* ---------- Song menu: Tuning ---------- */
/* A flat row on the 56px pitch (value in grey beside its label); the list below it is rows with a switch, one tone step on hover */
#scoreOptionsTuningGroup[hidden] { display: none; }
#scoreOptionsTuningGroup { display: flex; flex-direction: column; gap: 4px; }
.tuning-row { display: flex; align-items: center; width: 100%; min-height: 56px; padding: 0 12px; border: 0; background: transparent; color: var(--ink); text-align: left; border-radius: var(--r-control); transition: background var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .tuning-row:hover { background: var(--s2); } }
.tuning-row[aria-expanded="true"] { background: var(--s2); }
.tuning-row:focus-visible, .tuning-item:focus-within, .tuning-text-action:focus-visible { outline: 2px solid var(--ink2); outline-offset: -2px; }
.tuning-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tuning-row-text small { color: var(--ink2); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuning-detail { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 4px; }
.tuning-detail[hidden] { display: none; }
.tuning-change, .tuning-custom { display: flex; flex-direction: column; gap: 6px; padding: 0 12px; }
.tuning-custom[hidden] { display: none; }
.tuning-detail .form-select, .tuning-detail .form-control { background-color: var(--s3) !important; color: var(--ink) !important; border: 0 !important; border-radius: var(--r-control); min-height: 44px; }
.tuning-custom-error { color: var(--ink2); font-size: 12px; }
.tuning-custom-error[hidden] { display: none; }
.tuning-list-title { padding: 0 12px; color: var(--ink2); font-size: 13px; font-weight: 500; }
.tuning-list { display: flex; flex-direction: column; }
.tuning-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 12px; border-radius: var(--r-control); cursor: pointer; color: var(--ink); transition: background var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .tuning-item:hover { background: var(--s2); } }
.tuning-item.is-hidden .tuning-item-name { color: var(--ink2); }
.tuning-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuning-item .form-check { flex: none; display: flex; align-items: center; }
.tuning-note { padding: 0 12px; color: var(--ink2); font-size: 12px; }
.tuning-text-action { align-self: flex-start; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--ink2); border-radius: var(--r-control); }
@media (hover: hover) { .tuning-text-action:hover { background: var(--s2); color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .tuning-row, .tuning-item { transition: none; } }

/* ---------- Page strip (PDF and text tabs) ---------- */
.page-strip { flex: none; width: 100%; background: var(--s1); padding: 12px 14px 8px; position: relative; z-index: 1045; }
.page-strip[hidden] { display: none; }
.page-strip-track { position: relative; height: 40px; display: grid; grid-template-columns: repeat(var(--pages, 1), minmax(0, 1fr)); gap: var(--seg-gap, 2px); overflow: hidden; touch-action: none; cursor: pointer; border-radius: var(--r-sm); }
.page-strip-seg { display: block; background: var(--s3); border-radius: 2px; min-width: 0; }
.page-strip-seg.is-current { background: var(--hue); }
.page-strip-track:has(.page-strip-fill) { display: block; background: var(--s2); overflow: hidden; }
.page-strip-fill { position: absolute; inset: 0; background: var(--s3); transform-origin: 0 50%; transform: scaleX(0); display: block; }
.page-strip-head { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--hue); display: block; pointer-events: none; }
/* With a strip there are no bars: the dock keeps play, the sound switch and volume */
body.page-strip-on .dock-time, body.page-strip-on .dock-bpm, body.page-strip-on #barRuler,
/* A one-page PDF or text tab has no strip, but it has no bars either: Bar and bpm would show a Guitar Pro song's last values */
body.doc-tab .dock-time, body.doc-tab .dock-bpm, body.doc-tab #barRuler { display: none !important; }
body:is(.page-strip-on, .doc-tab) .dock-ruler:not(:has(.page-strip.in-dock)) { display: none !important; }
/* Desktop: the strip sits in the dock row, between the transport and the sound switch */
.page-strip.in-dock { padding: 0; background: transparent; z-index: auto; }
.page-strip.in-dock .page-strip-track { height: 36px; }
body:is(.page-strip-on, .doc-tab) .mobile-playback-dock-inner { grid-template-columns: auto 1fr auto; }
.page-strip-track:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
.page-strip-marks { position: relative; height: 26px; margin-top: 4px; }
.page-strip-mark { position: absolute; top: 0; transform: translateX(-2px); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; border: 0; padding: 4px 6px; color: var(--ink2); font: 500 12px system-ui, sans-serif; min-height: 24px; border-radius: var(--r-sm); }
@media (hover: hover) { .page-strip-mark:hover { background: var(--s2); color: var(--ink); } }
.page-strip-marks:empty { display: none; }

/* ---------- Phone reader chrome ----------
   Top: two slim rows over the score (back and song name; View, Practice, Tracks, Guitar, Tools).
   Bottom: one strip (progress on top; restart, play, position, sound, fretboard, Reading mode).
   Nothing resizes the sheet on its own: the top slides away only on a hand scroll down in Scroll mode (an overlay, so no
   refit), and Reading mode is the explicit, remembered way to reclaim the top. body.phone-reader is set by readerViewMenu.js
   from PHONE_READER_QUERY (narrow screens, and short landscape phones, where the top becomes a side rail). */
body.phone-reader:not(.library-view-active) { --reader-rail-w: 0px; padding-bottom: 0 !important; }
body.phone-reader:not(.library-view-active) #topBar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1056; display: flex !important; flex-wrap: wrap; align-items: center; gap: 0;
  overflow: visible; min-height: 0; grid-template-columns: none !important;
  padding: env(safe-area-inset-top, 0px) max(env(safe-area-inset-right, 0px), 6px) 0 max(env(safe-area-inset-left, 0px), 6px) !important;
  background: var(--ground) !important;
  transition: transform var(--dur-base) var(--ease-out), visibility 0s;
}
body.phone-reader:not(.library-view-active) #rightSection { display: contents; }
body.phone-reader:not(.library-view-active) #centerSection, body.phone-reader:not(.library-view-active) #globalAudioControls, body.phone-reader:not(.library-view-active) #audioSourcePill, body.phone-reader:not(.library-view-active) #fullscreenPill, body.phone-reader:not(.library-view-active) #jamLivePill { display: none !important; }
body.phone-reader:not(.library-view-active) #brandSection { order: 1; flex: 1 1 0; min-width: 0; min-height: 44px; display: flex; align-items: center; }
body.phone-reader:not(.library-view-active) #navButtons { order: 2; flex: none; }
body.phone-reader:not(.library-view-active) #navButtons .btn { min-width: 44px; min-height: 44px; }
body.phone-reader:not(.library-view-active) #topFlexZone { order: 3; flex: 0 0 100%; display: flex; align-items: stretch; justify-content: space-around; gap: 0; }
/* Portrait phone: View, Practice, Tracks, Guitar and Tools are the bottom row, for the thumb. setPhoneTabs() in readerViewMenu.js
   moves them out of the top bar (a transformed bar would carry a fixed child with it). The strip sits above them. */
@media (max-width: 640px) {
  body.phone-reader:not(.library-view-active) { --tabs-h: calc(48px + env(safe-area-inset-bottom, 0px)); --reader-bottom-nav-h: var(--tabs-h); padding-bottom: var(--tabs-h) !important; }
  body.phone-reader.reading-mode:not(.library-view-active) { --tabs-h: 0px; }
  body.phone-reader:not(.library-view-active) > #topFlexZone {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1055; min-height: var(--tabs-h); padding: 0 4px; background: var(--s1);
  }
  /* the home-indicator inset is the bar's own padding, outside the words, so a pressed or selected word's tone is a normal 48px key (tabletop keeps its own) */
  :where(html:not(.duo-tabletop)) body.phone-reader:not(.library-view-active) > #topFlexZone { padding-bottom: env(safe-area-inset-bottom, 0px); }
  :where(html:not(.duo-tabletop)) body.phone-reader:not(.library-view-active) > #topFlexZone .btn { min-height: 48px; padding-bottom: 0 !important; box-sizing: border-box; align-items: center; }
  body.phone-reader.reading-mode:not(.library-view-active) > #topFlexZone { display: none; }
  /* The five words below the strip clear the home indicator; without them (Reading mode) the strip does */
  body.phone-reader:not(.library-view-active) { --strip-inset: 0px; }
  body.phone-reader.reading-mode:not(.library-view-active) { --strip-inset: env(safe-area-inset-bottom, 0px); }
  body.phone-reader:not(.library-view-active) .fretboard-dock { bottom: calc(var(--dock-h, 0px) + var(--tabs-h)) !important; }
  /* Compact fretboard header on a phone: one short row. The controls look smaller but keep a 44px touch target (an invisible extension). */
  body.phone-reader:not(.library-view-active) .fretboard-dock-header { padding: 2px 8px; flex-wrap: nowrap; gap: 8px; }
  body.phone-reader:not(.library-view-active) .fb-track { min-height: 28px; padding: 0 8px; gap: 6px; font-size: 13px; position: relative; }
  body.phone-reader:not(.library-view-active) .fb-track::before { height: 12px; }
  body.phone-reader:not(.library-view-active) .fb-track::after,
  body.phone-reader:not(.library-view-active) .fretboard-mode-pills .btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  body.phone-reader:not(.library-view-active) .fretboard-mode-pills { height: 26px !important; }
  body.phone-reader:not(.library-view-active) .fretboard-mode-pills .btn { position: relative; font-size: 12px !important; }
  body.phone-reader:not(.library-view-active) .fretboard-neck-wrapper { padding: 0 0 2px; }
  /* it sits above the strip, which clears the home indicator, so it needs no inset of its own */
  body.phone-reader:not(.library-view-active) .fretboard-dock { padding-bottom: 6px; }
}
body.phone-reader:not(.library-view-active) #topFlexZone .hud-pill-group, body.phone-reader:not(.library-view-active) #topFlexZone .rbar-item { flex: 1 1 0; display: flex; min-width: 0; }
body.phone-reader:not(.library-view-active) #topFlexZone .btn { flex: 1; min-height: 44px; padding-inline: 2px !important; justify-content: center; border-radius: var(--r-control) !important; }
/* the word whose sheet is open has square top corners, so it joins the sheet right above it (tabletop has its own rule) */
:where(html:not(.duo-tabletop)) body.phone-reader:not(.library-view-active) > #topFlexZone .btn:is([aria-expanded="true"], .active) { border-radius: 0 0 var(--r-control) var(--r-control) !important; }
body.phone-reader:not(.library-view-active) .bar-btn-label { font-size: 14px; }
/* The top leaves upward in Reading mode only. It overlays the score, so nothing is resized. */
body.phone-reader:not(.library-view-active) #topBar.hud-hidden:not(.hud-transient) {
  transform: translateY(-100%); margin-top: 0; opacity: 1; visibility: hidden; pointer-events: none;
  transition: transform var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
}
body.phone-reader:not(.library-view-active) #topBar.hud-hidden.hud-transient { margin-top: 0; }
/* The score starts below the top; in Scroll mode it scrolls under it instead */
body.phone-reader:not(.library-view-active) #mainContent { padding-top: var(--topbar-h, 96px) !important; }
body.phone-reader:not(.library-view-active):has(#output.continuous-mode) #mainContent { padding-top: 0 !important; }
body.phone-reader:not(.library-view-active) #output.continuous-mode { padding-top: calc(var(--topbar-h, 96px) + 4px) !important; }
body.phone-reader:not(.library-view-active) #output:not(.continuous-mode) { padding-top: 4px !important; }
body.phone-reader.reading-mode:not(.library-view-active) #mainContent { padding-top: env(safe-area-inset-top, 0px) !important; }
body.phone-reader.reading-mode:not(.library-view-active) #output.continuous-mode { padding-top: calc(env(safe-area-inset-top, 0px) + 12px) !important; }

/* The strip: progress on top, one row of controls under it. It clears the home indicator itself. */
body.phone-reader:not(.library-view-active) .mobile-playback-dock-inner {
  grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "r r r" "a b c"; gap: 8px 4px;
  padding: 4px max(8px, var(--inset-far)) calc(4px + var(--strip-inset, env(safe-area-inset-bottom, 0px))) max(8px, env(safe-area-inset-left, 0px));
}
body.phone-reader:not(.library-view-active) .dock-ruler { grid-area: r; }
body.phone-reader:not(.library-view-active) .dock-tr { grid-area: a; gap: 0; }
/* No bar number on a phone: the playhead on the track shows where you are, and the controls get the room */
body.phone-reader:not(.library-view-active) .dock-time { display: none !important; }
body.phone-reader:not(.library-view-active) .dock-bpm, body.phone-reader:not(.library-view-active) #dockMetroBtn, body.phone-reader:not(.library-view-active) #dockVolumeBtn { display: none !important; }
/* The sound switch sits midway between the play button and the fretboard button; the two icon buttons stay together at the right */
body.phone-reader:not(.library-view-active) .dock-tools { grid-column: 2 / 4; grid-row: 2; gap: 2px; min-width: 0; }
/* auto margins centre the boxes; the fretboard glyph sits about 10px inside its box, so nudge 5px to even the visible gaps */
body.phone-reader:not(.library-view-active) .dock-src { margin-inline: auto; transform: translateX(5px); }
body.phone-reader:not(.library-view-active) .dock-src { min-width: 0; }
body.phone-reader:not(.library-view-active) .dock-src .audio-src-label { display: inline !important; }
body.phone-reader:not(.library-view-active) .dock-src .mobile-dock-btn { padding: 0 8px; font-size: 13px; }
/* The sound switch is 34px tall on every phone; the touch target stays 44px through an invisible extension */
body.phone-reader:not(.library-view-active) .dock-src { padding: 2px; }
body.phone-reader:not(.library-view-active) .dock-src .rbtn { min-height: 34px; height: 34px; position: relative; }
body.phone-reader:not(.library-view-active) .dock-src .rbtn::after { content: ''; position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; }
body.phone-reader:not(.library-view-active) #mobileRewindBtn, body.phone-reader:not(.library-view-active) #mobilePlayPauseBtn { width: 44px; min-width: 44px; height: 44px; }
body.phone-reader:not(.library-view-active) #fretboardDockBtn, body.phone-reader:not(.library-view-active) #readingDockBtn { display: inline-flex; width: 44px !important; min-width: 44px !important; height: 44px; align-items: center; justify-content: center; }
body.phone-reader:not(.library-view-active) #fretboardDockBtn[style*="display: none"] { display: none !important; }
body.phone-reader:not(.library-view-active) .ruler { height: 28px; }
body.phone-reader:not(.library-view-active) body.phone-reader:not(.library-view-active) .ruler svg, body.phone-reader:not(.library-view-active) .ruler-labels { height: 28px; }
body.phone-reader:not(.library-view-active) .ruler-labels em { display: none; }
body.phone-reader:not(.library-view-active) .page-strip-track { height: 28px; }
body.phone-reader:not(.library-view-active) .page-strip-marks { display: none; }
body.phone-reader:not(.library-view-active) .rec-strip { min-height: 28px; }
body.phone-reader:not(.library-view-active) #scoreRecStrip { margin-bottom: 0; }

/* Reading mode (every platform): the bottom bar narrows to play, the progress track and the Reading mode button, in one row */
body.phone-reader.reading-mode:not(.library-view-active) .mobile-playback-dock-inner { grid-template-areas: "a r c"; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 0; }
/* Reading mode: the toggle takes its place in the single row (the portrait/landscape placements of .dock-tools must not apply) */
body.phone-reader.reading-mode:not(.library-view-active) .dock-tools { grid-area: c; }

/* Desktop Reading mode: the bar is one slim row (the phone bar already is) */
body.reading-mode:not(.library-view-active):not(.phone-reader) .mobile-playback-dock-inner { padding-top: 4px; padding-bottom: 4px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: none; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .dock-tools { grid-column: 3; grid-row: 1; justify-self: end; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .ruler { height: 28px; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .ruler svg, body.reading-mode:not(.library-view-active):not(.phone-reader) .ruler-labels { height: 28px; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .ruler-labels em { display: none; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .page-strip.in-dock .page-strip-track { height: 28px; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .page-strip-marks { display: none; }
body.reading-mode:not(.library-view-active):not(.phone-reader) .rec-strip { min-height: 28px; }
body.reading-mode:not(.library-view-active):not(.phone-reader) #mobilePlayPauseBtn { width: 40px; min-width: 40px; height: 40px; }
/* Optical spacing: the playhead overhangs the ruler's left end by about 7px and the toggle's glyph sits about 14px inside its 44px box, so the left gap is wider and the right gap is zero: both read as about 13px */
body.phone-reader.reading-mode:not(.library-view-active) .dock-ruler { margin-left: 20px; }
body.reading-mode:not(.library-view-active) #mobileRewindBtn,
body.reading-mode:not(.library-view-active) .dock-time,
body.reading-mode:not(.library-view-active) .dock-bpm,
body.reading-mode:not(.library-view-active) .dock-tools > :not(#readingDockBtn):not(.dock-pace),
body.reading-mode:not(.library-view-active) .rec-status,
body.reading-mode:not(.library-view-active) .rec-actions { display: none !important; }
/* An open fretboard stays open in Reading mode, without its header (track list, Notes | Frets); the dock's height follows */
body.reading-mode:not(.library-view-active) .fretboard-dock-header { display: none !important; }
/* The fretboard and the sync bar sit above the strip and shrink the sheet (the score area) instead of covering it: its
   height is what is left between the top and them, in Page and Scroll mode alike. --sync-bar-h is set by syncMode.js. */
body.phone-reader:not(.library-view-active) #output {
  height: calc(100% - var(--fretboard-effective-h, 0px) - var(--sync-bar-h, 0px)) !important;
  max-height: calc(100% - var(--fretboard-effective-h, 0px) - var(--sync-bar-h, 0px)) !important;
  flex: none; padding-bottom: 16px !important;
}
body.phone-reader:not(.library-view-active) #output.continuous-mode { padding-bottom: 24px !important; }
/* A text sheet is a fixed page, not a scroll tail: no extra 24px under it, so it sits as close to the strip as it does to the top row */
body.phone-reader:not(.library-view-active) #output.continuous-mode:has(.pageWrapper .text-line) { padding-bottom: 0 !important; }
/* View does not repeat the toggle; the strip has it */
#readingCell { display: none !important; }

/* Sheets (View, Practice, Sound, Guitar, Tools, Song, Synth, Original) rise from the bottom, above the strip, and are as tall as the space
   under the top row allows, so they rarely need scrolling. The fretboard stays behind them: a sheet covers it rather than stopping above it. */
body.phone-reader #viewMenu, body.phone-reader #practiceMenu, body.phone-reader #guitarMenu, body.phone-reader #toolsMenu,
body.phone-reader #scoreOptionsDropdownPanel, body.phone-reader #synthDropdownPanel, body.phone-reader #ytDropdownPanel {
  position: fixed !important; left: var(--reader-rail-w) !important; right: 0 !important; top: auto !important; width: auto !important; max-width: none !important;
  bottom: calc(var(--dock-h, 0px) + var(--reader-bottom-nav-h, 0px)) !important; transform: none !important;
  max-height: min(88vh, calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - var(--reader-bottom-nav-h, 0px) - 12px)) !important;
  overflow-y: auto; border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
  transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
/* The Song menu opens from the song's name in the top row, so on a portrait phone it drops in from there (not up from the
   bottom like the sheets that belong to the five words). As tall as the space allows, so it rarely needs scrolling. */
@media (max-width: 640px) {
  html:not(.duo-tabletop) body.phone-reader #scoreOptionsDropdownPanel {
    top: var(--topbar-h, 52px) !important; bottom: auto !important; left: 0 !important; right: 0 !important;
    max-height: calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - var(--reader-bottom-nav-h, 0px) - 12px) !important;
    border-radius: 0 0 var(--r-lg) var(--r-lg) !important; --rp-from: 0 -40px;
  }
}
body.phone-reader .dock-pop { left: 8px !important; right: 8px; width: auto; }
body.phone-reader #topFlexZone .btn[aria-expanded="true"], body.phone-reader #topFlexZone .btn.active { background: var(--s2) !important; }

/* Volume lives in the sound panel on a phone */
.panel-volume { display: flex; align-items: center; gap: 12px; }
.panel-volume::before { content: 'Volume'; color: var(--ink2); font-size: 13px; font-weight: 500; }
.panel-volume #synthVolumeSlider { writing-mode: horizontal-tb; direction: ltr; flex: 1; width: auto; height: auto; min-height: 44px; margin: 0; accent-color: var(--hue); }
/* Mixer level and pan sliders: the same plain track and thumb */
.track-mix input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; border: 0; padding: 0; margin: 0; flex: 1; min-width: 0; }
.track-mix input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--s3); }
.track-mix input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--s3); }
.track-mix input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 0; border-radius: 50%; background: var(--hue); }
.track-mix input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--hue); }
/* A plain track with a thumb: the native control draws a tall outlined pill when it is given a 44px row */
.panel-volume #synthVolumeSlider { -webkit-appearance: none; appearance: none; background: transparent; border: 0; padding: 0; }
.panel-volume #synthVolumeSlider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--s3); }
.panel-volume #synthVolumeSlider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--s3); }
.panel-volume #synthVolumeSlider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 0; border-radius: 50%; background: var(--hue); }
.panel-volume #synthVolumeSlider::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--hue); }
.panel-volume #synthVolumeSlider:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.panel-volume #synthVolumeBadge { order: 3; font: 600 13px system-ui, sans-serif; color: var(--ink2); background: none; padding: 0; min-width: 3ch; text-align: right; }

/* Short landscape phone: the top becomes a side rail (back, song name, the five words); Reading mode removes it and
   leaves the slim strip */
@media (min-width: 641px) {
  :where(html:not(.duo-tabletop)) {
  body.phone-reader:not(.library-view-active) { --reader-rail-w: calc(92px + env(safe-area-inset-left, 0px)); --strip-inset: 0px; }
  body.phone-reader.reading-mode:not(.library-view-active) { --reader-rail-w: env(safe-area-inset-left, 0px); --strip-inset: 0px; }
  body.phone-reader:not(.library-view-active) #topBar { right: auto; bottom: 0; width: var(--reader-rail-w); flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 4px 4px 4px max(env(safe-area-inset-left, 0px), 4px) !important; }
  /* The rail and the strip are one L of chrome in the same tone, so the corner where they meet has no seam; the strip drops the home inset (the score ends above it) */
  body.phone-reader:not(.library-view-active) #topBar { background: var(--s1) !important; }
  body.phone-reader:not(.library-view-active) .dock-src .audio-sfx { display: none !important; }
  body.phone-reader:not(.library-view-active) .dock-src { padding: 2px; }
  /* A shorter switch (34px); the touch target stays 44px through an invisible extension */
  body.phone-reader:not(.library-view-active) .dock-src .rbtn { min-height: 34px; height: 34px; position: relative; }
  body.phone-reader:not(.library-view-active) .dock-src .rbtn::after { content: ''; position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; }
  body.phone-reader:not(.library-view-active) .dock-src .mobile-dock-btn { padding: 0 12px; }
  /* Recording bar (Original): one row, time, track, then the sync state and Add points to the right of the track, so the strip stays short */
  body.phone-reader:not(.library-view-active) .rec-strip { display: flex; flex-wrap: nowrap; align-items: center; gap: 0 10px; min-height: 28px; padding: 0; }
  body.phone-reader:not(.library-view-active) .rec-time { min-width: 0; }
  body.phone-reader:not(.library-view-active) .rec-track { flex: 1 1 0; min-width: 60px; }
  body.phone-reader:not(.library-view-active) .rec-status { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body.phone-reader:not(.library-view-active) .rec-actions .ct-text { min-height: 28px; padding: 0 8px; font-size: 13px; white-space: nowrap; position: relative; }
  body.phone-reader:not(.library-view-active) .rec-actions .ct-text::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  body.phone-reader:not(.library-view-active) #scoreRecStrip { margin-bottom: 2px; }
  /* Page arrows and the percent share the 88px the rail has: they were 129px and spilled out of it */
  body.phone-reader:not(.library-view-active) #navButtons { width: 100%; gap: 0; margin: 0; padding: 0; }
  body.phone-reader:not(.library-view-active) #navButtons #prevPage, body.phone-reader:not(.library-view-active) #navButtons #nextPage { flex: 0 0 32px; width: 32px; min-width: 32px; padding-inline: 0 !important; }
  body.phone-reader:not(.library-view-active) #navButtons #pageIndicator { flex: 1 1 0; min-width: 0; width: auto; padding: 0; text-align: center; font-size: 13px; }
  /* A range such as "1-2 of 8" is wider than the 24px left between the arrows: it takes its own line above them */
  /* The row is as tall as its 44px arrows, so the View button below never sits under them */
  body.phone-reader:not(.library-view-active) #navButtons { flex-wrap: wrap; justify-content: space-between; min-height: 44px; height: auto; flex: none; }
  body.phone-reader:not(.library-view-active) #navButtons .btn { height: 44px; }
  body.phone-reader:not(.library-view-active) #navButtons #pageIndicator { order: -1; flex: 1 0 100%; text-align: left; padding-left: 8px; }
  /* Right side: keep the score, the strip and the fretboard clear of a camera cutout or the Dynamic Island (the left is the rail's) */
  body.phone-reader:not(.library-view-active) #mainContent { padding-right: env(safe-area-inset-right, 0px) !important; }
  body.phone-reader:not(.library-view-active) .mobile-playback-dock-inner { padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  /* The fretboard runs to the screen's right edge, like the strip below it; its content stays clear of the cutout */
  body.phone-reader:not(.library-view-active) .fretboard-dock { right: 0 !important; padding-right: env(safe-area-inset-right, 0px); }
  body.phone-reader:not(.library-view-active) #brandSection { flex: none; min-height: 0; flex-direction: column; align-items: stretch; }
  body.phone-reader:not(.library-view-active) #songBreadcrumb { flex-direction: column; align-items: stretch !important; gap: 0; }
  body.phone-reader:not(.library-view-active) .top-bar-song-btn { height: auto; min-height: 44px; text-align: left; padding: 0 8px; }
  body.phone-reader:not(.library-view-active) .top-bar-song-btn .breadcrumb-song-title { font-size: 15px; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
  body.phone-reader:not(.library-view-active) .top-bar-song-btn .song-title-chevron { display: none; }
  body.phone-reader:not(.library-view-active) #navButtons { order: 3; display: flex; justify-content: center; }
  body.phone-reader:not(.library-view-active) #topFlexZone { order: 4; flex: 1 1 auto; flex-direction: column; justify-content: flex-start; padding: 0; min-height: 0; }
  body.phone-reader:not(.library-view-active) #topFlexZone .hud-pill-group, body.phone-reader:not(.library-view-active) #topFlexZone .rbar-item { flex: none; }
  body.phone-reader:not(.library-view-active) #topFlexZone .btn { flex: none; width: 100%; min-height: 44px; justify-content: flex-start; padding-inline: 10px !important; }
  body.phone-reader:not(.library-view-active) #topBar.hud-hidden:not(.hud-transient) { transform: translateX(-100%); }
  body.phone-reader:not(.library-view-active) #mainContent { padding-top: env(safe-area-inset-top, 0px) !important; padding-left: var(--reader-rail-w) !important; }
  body.phone-reader:not(.library-view-active):has(#output.continuous-mode) #mainContent { padding-top: 0 !important; }
  body.phone-reader:not(.library-view-active) #output.continuous-mode { padding-top: calc(env(safe-area-inset-top, 0px) + 12px) !important; }
  /* The strip's background runs to the screen's left edge, under the rail; its content starts after the rail */
  body.phone-reader:not(.library-view-active) .mobile-playback-dock { margin-left: 0; width: 100% !important; }
  body.phone-reader:not(.library-view-active) .mobile-playback-dock-inner { padding-left: calc(var(--reader-rail-w) + 8px); }
  body.phone-reader:not(.library-view-active) .fretboard-dock { left: var(--reader-rail-w) !important; width: auto !important; }
  }
}
/* Short landscape phone, continued: the strip is one row (the screen is short), the fretboard header is compact, and
   sheets are side panels (a bottom sheet would sit under the fretboard and leave no score) */
@media (min-width: 641px) {
  :where(html:not(.duo-tabletop)) {
  body.phone-reader:not(.library-view-active) .mobile-playback-dock-inner { grid-template-areas: "a r c"; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
  body.phone-reader:not(.library-view-active) .dock-tools { grid-area: c; grid-column: auto; grid-row: auto; }
  body.phone-reader:not(.library-view-active) .dock-src { margin-inline: 0; transform: none; }
  body.phone-reader:not(.library-view-active) .fretboard-dock-header { padding: 2px 8px; flex-wrap: nowrap; gap: 8px; }
  body.phone-reader:not(.library-view-active) .fb-track { min-height: 28px; padding: 0 8px; gap: 6px; font-size: 13px; position: relative; }
  body.phone-reader:not(.library-view-active) .fb-track::before { height: 12px; }
  body.phone-reader:not(.library-view-active) .fb-track::after, body.phone-reader:not(.library-view-active) .fretboard-mode-pills .btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  body.phone-reader:not(.library-view-active) .fretboard-mode-pills { height: 26px !important; }
  body.phone-reader:not(.library-view-active) .fretboard-mode-pills .btn { position: relative; font-size: 12px !important; }
  body.phone-reader:not(.library-view-active) .fretboard-neck-wrapper { padding: 0 0 2px; }
  body.phone-reader:not(.library-view-active) .fretboard-dock { padding-bottom: 4px; }
  body.phone-reader .rpanel { --rp-from: -24px 0; }
  /* The sound panels belong to the strip's Synth | Original switch, which sits on the right: they open on the right */
  body.phone-reader #synthDropdownPanel, body.phone-reader #ytDropdownPanel { --rp-from: 24px 0; }
  body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) { width: min(320px, 50vw) !important; }
  body.phone-reader #viewMenu, body.phone-reader #practiceMenu, body.phone-reader #guitarMenu, body.phone-reader #toolsMenu,
  body.phone-reader #scoreOptionsDropdownPanel {
    left: var(--reader-rail-w, 0px) !important; right: auto !important; top: 0 !important; bottom: var(--dock-h, 0px) !important; width: min(380px, 55vw) !important;
    max-height: none !important; z-index: 1060 !important; border-radius: 0 var(--r-lg) var(--r-lg) 0 !important;
  }
  body.phone-reader #synthDropdownPanel, body.phone-reader #ytDropdownPanel {
    left: auto !important; right: env(safe-area-inset-right, 0px) !important; top: 0 !important; bottom: var(--dock-h, 0px) !important; width: min(320px, 50vw) !important;
    max-height: none !important; z-index: 1060 !important; border-radius: var(--r-lg) 0 0 var(--r-lg) !important;
  }
  }
}
/* Sound panels: the header stays, only the body scrolls (the panel itself scrolling as well made two nested scrollers) */
body.phone-reader #synthDropdownPanel:not([style*="display: none"]):not([style*="display:none"]),
body.phone-reader #ytDropdownPanel:not([style*="display: none"]):not([style*="display:none"]) { display: flex !important; flex-direction: column; overflow: hidden !important; }
body.phone-reader #synthDropdownPanel .synth-panel-header, body.phone-reader #ytDropdownPanel .yt-panel-header { flex: none; }
body.phone-reader #synthDropdownPanel .synth-panel-body, body.phone-reader #ytDropdownPanel .yt-panel-body {
  flex: 1 1 auto !important; min-height: 0; overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
/* Phone panels are denser (portrait sheets and landscape side panels): the screen is small, so type, rows and controls are about 20% smaller */
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) { font-size: 13px; padding: 10px 12px !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(h1, h2, h3, .rpanel-title, #synthPanelTitle::before) { font-size: 15px !important; padding-block: 0 6px; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.btn, button, .rbtn, .form-select, .form-control, select, input:not([type=range]):not([type=checkbox])) { min-height: 34px !important; font-size: 13px !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.btn, button, .rbtn):not(.form-check-input) { padding-block: 4px !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(label, p, small, .text-muted, span, div) { line-height: 1.25; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.form-check-input, .theme-switch) { transform: scale(.8); }
/* Switches in these panels (YouTube | Local audio, the View pairs) hold buttons that are 34px tall here; the base group has a fixed 30 to 35px height, which left the selected button taller than its track */
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) .hud-pill-group { height: auto !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.mixer-toggle, .track-mix-toggles .mixer-toggle) { min-width: 34px !important; width: 34px !important; height: 34px !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) [class*="gap-"], body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) .view-screen-pair { gap: 6px !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.mb-3, .my-3, .py-3) { margin-bottom: 8px !important; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) .practice-step { width: 34px; height: 34px; font-size: 18px; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) .practice-speed-value { font-size: 22px; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) .practice-presets { grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) .practice-presets .btn { padding-inline: 0 !important; }
body.phone-reader:not(.library-view-active) #practiceMenu .practice-presets.practice-tempo-row { grid-template-columns: repeat(4, 1fr); gap: 6px; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.form-check.form-switch, .practice-menu .form-check.form-switch) { min-height: 34px !important; gap: 8px; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.d-flex.align-items-center.justify-content-between, #synthLoopSteppers) { min-height: 0; }
body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(.mixer-toggle) { height: 34px !important; }
@media (max-width: 640px) {
  /* Recording bar (Original): one row, time, track, then the sync state and Add points to the right of the track, so the strip stays short */
  body.phone-reader:not(.library-view-active) .rec-strip { display: flex; flex-wrap: nowrap; align-items: center; gap: 0 10px; min-height: 28px; padding: 0; }
  body.phone-reader:not(.library-view-active) .rec-time { min-width: 0; }
  body.phone-reader:not(.library-view-active) .rec-track { flex: 1 1 0; min-width: 60px; }
  body.phone-reader:not(.library-view-active) .rec-status { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body.phone-reader:not(.library-view-active) .rec-actions .ct-text { min-height: 28px; padding: 0 8px; font-size: 13px; white-space: nowrap; position: relative; }
  body.phone-reader:not(.library-view-active) .rec-actions .ct-text::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  body.phone-reader:not(.library-view-active) #scoreRecStrip { margin-bottom: 2px; }
  body.phone-reader:not(.library-view-active) .rec-time { font-size: 11px; }
  body.phone-reader:not(.library-view-active) .rec-status { font-size: 11px; }
  /* The track needs the room: the bar and repeat counts show only in the tooltip and the Points list */
  body.phone-reader:not(.library-view-active) .rec-strip:not(.is-tapping) .rec-detail { display: none; }
}
/* While tapping points the strip carries a status line and up to four actions, more than one row holds on a phone: time and
   track on the first row, the status on the second, the actions (Points, Undo, Clear, Done) on the third, right-aligned. */
body.phone-reader:not(.library-view-active) .rec-strip.is-tapping { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; }
body.phone-reader:not(.library-view-active) .rec-strip.is-tapping .rec-time { grid-column: 1; grid-row: 1; }
body.phone-reader:not(.library-view-active) .rec-strip.is-tapping .rec-track { grid-column: 2; grid-row: 1; min-width: 0; }
body.phone-reader:not(.library-view-active) .rec-strip.is-tapping .rec-status { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
body.phone-reader:not(.library-view-active) .rec-strip.is-tapping .rec-actions { grid-column: 1 / -1; grid-row: 3; justify-self: end; }
body.phone-reader:not(.library-view-active) .rec-strip.is-tapping .rec-points { grid-column: 1 / -1; grid-row: 4; }
@media (prefers-reduced-motion: reduce) { body.phone-reader:not(.library-view-active) #topBar, body.phone-reader .panel-volume { transition: none !important; } }

/* Song, Tracks: visible keyboard focus and 44px targets on touch */
.gp-track-only-btn:focus-visible, .mixer-toggle:focus-visible, #synthMixResetBtn:focus-visible, #synthShowAllTracksBtn:focus-visible,
.track-mix input[type="range"]:focus-visible { outline: 2px solid var(--ink) !important; outline-offset: 2px; }
@media (pointer: coarse) {
  .gp-track-only-btn, .mixer-toggle { min-height: 44px; }
  #synthMixResetBtn, #synthShowAllTracksBtn { min-height: 44px; padding: 0 4px !important; }
  .track-mix input[type="range"] { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .lib-browse-by-btn { transition: none; } }
/* Reduced motion: the side panel and sheets, and the rail's inlay dot, appear without moving */
@media (prefers-reduced-motion: reduce) {
  #synthDropdownPanel, #ytDropdownPanel, .library-bottom-nav .library-nav-tab.active::before { animation: none !important; }
  #synthDropdownPanel, #ytDropdownPanel, #viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel { transition: none !important; }
}

/* Phones: the library has no reader controls (the reader's five words and page buttons belong to a song) */
@media (max-width: 640px) { body.library-view-active #topFlexZone { display: none !important; } }
/* View, Practice, Tracks, Guitar and Tools belong to an open song, at every width. The library reaches Tools from the rail. */
body.library-view-active #viewPill, body.library-view-active #practicePill, body.library-view-active #soundPill, body.library-view-active #guitarPill, body.library-view-active #toolsPill { display: none !important; }

/* Tools page: flat rows on a 56px pitch, the same left edge as Setlists and Library */
.tools-view .tools-page-list { display: flex; flex-direction: column; }
.tools-page-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink); text-align: left; transition: background-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) { html:not(.pointer-out) .tools-page-row:hover:not(:disabled) { background: var(--s1); } }
.tools-page-row:active:not(:disabled) { background: var(--s2); }
.tools-page-row:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tools-page-row:disabled { opacity: .55; cursor: default; }
.tools-page-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tools-page-text b { font-size: 16px; font-weight: 600; }
.tools-page-text small { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.tools-page-row kbd { font: 600 12px system-ui, sans-serif; color: var(--ink2); background: var(--s3); border: 0; border-radius: 4px; padding: 2px 7px; }
@media (hover: none) { .tools-page-row kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .tools-page-row { transition: none; } }
.tools-view > * { grid-column: 1 / -1; }

/* ---------- Brand mark in the top bar ---------- */
/* Same pick as the rail, so the logo does not change with width. The rail carries it from 577px;
   below that the library has a top bar instead, so the bar carries it. Flat: no gradient text. */
.brand-pick { display: none; width: 28px; height: 30px; flex: none; }
.brand-title { color: var(--ink) !important; }
.brand-title .brand-title-accent { background: none; -webkit-text-fill-color: currentColor; color: var(--accent-text); }
@media (max-width: 576px) {
  body.library-view-active #brandSection .brand-pick { display: block; margin-right: 8px; }
}

/* Book PDFs are plain text links: in the album header and the Custom Music books row */
.album-book-link { background: transparent; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; min-height: 24px; }
@media (hover: hover) { .album-book-link:hover { text-decoration: underline; text-underline-offset: 3px; } }
.album-book-link:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; }
@media (pointer: coarse) { .album-book-link { min-height: 44px; } }

/* ==========================================================================
   Tools and Setlists share the Settings page's title and subtitle type.
   Tools render in place beside their list; their own screens lose the dialog chrome.
   ========================================================================== */
.setlists-view > .title-row h2 { font: 700 44px/1.02 var(--font-display); letter-spacing: -.01em; margin: 0; color: var(--ink); }
.setlists-view > .title-row p { margin: 6px 0 0; color: var(--ink2); font-size: 14px; }
@media (max-width: 899px) { .setlists-view > .title-row h2 { font-size: 36px; } }
/* The page body pads its bottom by max(inset + 1.25rem, 2rem); the shell cancels all of it, so a landscape phone's home inset leaves no gap */
.setshell { --body-pb: max(calc(env(safe-area-inset-bottom, 0px) + 1.25rem), 2rem); height: calc(100% + 20px + var(--body-pb)); margin: -20px -20px calc(-1 * var(--body-pb)); }
/* The phone page body is padded 12px / 8px, so this lands Tools exactly where Settings sits (title and rows 16px in) */
@media (max-width: 576px) { .setshell { height: calc(100% + 44px); margin: 0 -8px -32px; } }

/* Tools is an instrument rack, not a settings list: rows grouped by purpose (a gap, no heading), a plain readout of real
   state on the right, no icons; the open tool fills the stage beside the list. */
.tools-shell .setnav { gap: 0; padding-top: 8px; padding-bottom: 24px; }
.tools-shell .setgroup { display: flex; flex-direction: column; gap: 2px; }
.tools-shell .setgroup + .setgroup { margin-top: 20px; }
.tools-shell .setnav button { min-height: 56px; padding: 8px 12px 8px 20px; color: var(--ink); }
.tools-shell .setnav button .tool-name { flex: 0 0 auto; max-width: 100%; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools-shell .setnav button .tool-read { flex: 1 1 auto; min-width: 0; color: var(--ink2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; margin-left: auto; }
/* An empty readout still takes the spare width, so every row's chevron sits at the right edge */
.tools-shell .setnav button .tool-read:empty { display: block; }
.tools-shell .tool-stage-header { display: none; }
.tools-shell .tool-stage-title { display: none; }
@media (min-width: 900px) {
  .tools-shell .setnav button[aria-current="true"]::before { left: 8px; }
  .tools-shell .setpage { padding: 28px 44px 44px; }
  .tools-shell .tool-stage-header { display: flex; align-items: baseline; gap: 16px; margin: 0 0 22px; }
  .tools-shell .tool-stage-title { display: block; margin: 0; font: 700 40px/1 var(--font-display); color: var(--ink); }
  .tools-shell .tool-stage-extra { font-size: 14px; color: var(--ink2); font-weight: 400; }
  .tools-shell .tool-stage-extra:empty { display: none; }
  .tools-shell .tool-pane-host > .tool-embedded { align-items: flex-start; justify-content: flex-start; animation: tools-stage-in var(--dur-base) var(--ease-out) both; }
}
/* One surface pattern for the Tools and Settings pages: the list is a column on the ground, the detail beside it is the
   page (--s1), and a selected or hovered row takes one tone step. */
@media (min-width: 900px) {
  .setshell { --set-col: 260px; }
  .tools-shell { --set-col: 300px; }
  /* The page title belongs to the list column only: the shell is a two-column grid, so the detail pane starts at the top */
  .setshell { display: grid; grid-template-columns: var(--set-col) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .setshell > .setwrap { display: contents; }
  .setshell > h1.set-title { grid-column: 1; grid-row: 1; background: var(--setnav-ground); }
  .setshell .setnav { grid-column: 1; grid-row: 2; min-height: 0; }
  .setshell .setpage { grid-column: 2; grid-row: 1 / span 2; min-height: 0; }
  .setshell .setnav { background: var(--setnav-ground); }
  @media (hover: hover) { html:not(.pointer-out) .setshell .setnav button:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 5%, var(--setnav-ground)); } }
  .setshell .setnav button[aria-current="true"] { background: color-mix(in srgb, var(--ink) 9%, var(--setnav-ground)); }
  .setshell .setpage { background: var(--s1); }
}
@keyframes tools-stage-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tools-shell .tool-pane-host > .tool-embedded { animation: none; } }
.tool-pane-host:empty::before { content: 'Choose a tool.'; color: var(--ink2); font-size: 14px; }
.theme-modal-backdrop.tool-embedded { position: static; inset: auto; z-index: auto; background: transparent; padding: 0; height: auto; display: block; }
.theme-modal-backdrop.tool-embedded[style*="display: none"] { display: none; }
.theme-modal-backdrop.tool-embedded .theme-modal-card { max-width: none; max-height: none; height: auto; background: transparent !important; border: 0 !important; border-radius: 0; box-shadow: none; animation: none; overflow: visible; }
.theme-modal-backdrop.tool-embedded .theme-modal-header { display: none !important; }
.theme-modal-backdrop.tool-embedded .theme-modal-body { padding: 0; }
.theme-modal-backdrop.tool-embedded .library-page-container { padding-top: 0; }
.tool-pane { padding-top: 0; }
.theme-modal-backdrop.tool-embedded .reference-modal-card,
.theme-modal-backdrop.tool-embedded .tuner-modal-card { height: auto; max-height: none; overflow: visible; width: 100%; }
.theme-modal-backdrop.tool-embedded .reference-modal-body,
.theme-modal-backdrop.tool-embedded .tuner-modal-body { overflow: visible; overscroll-behavior: auto; height: auto; max-height: none; flex: none; padding: 0; }

/* Setlists & Tunings: the library's two-pane page */
.library-page-container > .setlists-body { grid-column: 1 / -1; margin: 12px -20px 0; }
@media (max-width: 576px) { .library-page-container > .setlists-body { margin-inline: -16px; } }
.setlists-view .setlist-actions,
.tunings-view .tuning-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 20px 12px; }
.setlists-view .setlist-add-songs { margin-inline: 20px; }
.setlists-view .setlist-danger { padding: 24px 20px 12px; }
.setlist-title-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: 700 24px/1.2 var(--font-display, inherit);
  letter-spacing: -0.01em;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: var(--r-control, 6px);
  outline: none;
  box-sizing: border-box;
  transition: background var(--dur-fast, 150ms) ease, border-color var(--dur-fast, 150ms) ease;
}
.setlist-title-input:hover {
  background: var(--s1);
}
.setlist-title-input:focus {
  background: var(--s1);
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.12));
}
.setlist-title-input::placeholder {
  color: var(--ink2);
  opacity: 0.6;
}
@media (max-width: 576px) {
  .setlist-title-input { font-size: 20px; }
}
.setlist-card[aria-current="true"],
.tuning-card[aria-current="true"] { background: var(--s2) !important; position: relative; }
.setlist-card[aria-current="true"]::before,
.tuning-card[aria-current="true"]::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); }
.setlists-view .setlist-actions .theme-control-btn, .setlists-view .pane-head .in-view-back-btn,
.tunings-view .tuning-actions .theme-control-btn, .tunings-view .pane-head .in-view-back-btn { color: var(--ink2) !important; }

/* Sunken rail across all finishes: the rail sits a step darker than the library ground */
@media (min-width: 577px) {
  body.library-view-active .library-bottom-nav { background: var(--rail-ground) !important; }
}

/* Mockup: a row that runs edge to edge (Library, Setlists, Tunings and Recents) is a rectangle; anything inset from the edge (rail, settings nav, Tools rows) is rounded */
.library-card, .library-row-card, .library-song-row, .library-track-row, .library-pinned-card,
.pinned-group-card, .tuning.tuning-card, .setlist-card, .recent-row {
  border-radius: 0 !important;
}
.setnav button, .library-bottom-nav .library-nav-tab, .tools-page-row, .shelf-item { border-radius: var(--r-control) !important; }
/* From 1000px the panes run edge to edge like the mockup: no inset, so the square rows meet the rail and the page edge */
/* Single pane (below 1000px): the rows run the full width of the available area, past the page body's side padding (20px, 8px on phones) */
@media (max-width: 999px) {
  .panes { margin-left: -20px; width: calc(100% + 40px); max-width: none; }
}
@media (max-width: 576px) {
  .panes { margin-left: -8px; width: calc(100% + 16px); }
}
@media (min-width: 1000px) {
  .panes { margin-left: -20px; width: calc(100% + 40px); max-width: none; }
  .pane.list { padding-right: 0; }
  .pane.songs { padding-left: 0; }
}

/* Rows and cards a library search filtered out */
.lib-filter-hidden { display: none !important; }

/* Finishes live inside Settings: flat rows on tone steps, no outlines */
.setsec .fin-tile { border: 0; }

/* Dropdown indicator: every select shows a down chevron on the right. Set as background-image only,
   so rules that set background-color or the background shorthand do not hide it. */
:root, [data-theme] { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%23c8c8d0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-theme="Snow White"] { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%23444450' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select.form-select, select.theme-select, select.ref-select, select.tuner-calib-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: var(--select-chevron) !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  padding-right: 32px !important;
}
select.form-select[multiple], select.form-select[size]:not([size="1"]) { background-image: none !important; padding-right: 12px !important; }

/* Settings dropdowns: a tone step on the row, no outline, the platform's control radius, no accent on hover or focus.
   The older library-page rules in style.css are !important, so these match them in specificity and load later. */
.library-page-view .settings-page select.form-select, .settings-page select.form-select {
  background-color: var(--s3) !important; border: 0 !important; border-radius: var(--r-control) !important;
  color: var(--ink) !important; box-shadow: none !important; font-size: 14px !important; font-weight: 400;
  min-height: 36px; transition: background-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .library-page-view .settings-page select.form-select:hover, .settings-page select.form-select:hover { background-color: color-mix(in srgb, var(--s3), var(--ink) 8%) !important; color: var(--ink) !important; } }
.library-page-view .settings-page select.form-select:focus, .settings-page select.form-select:focus {
  background-color: var(--s3) !important; color: var(--ink) !important; box-shadow: none !important; outline: 2px solid var(--hue) !important; outline-offset: -1px;
}
.settings-page select.form-select option { background-color: var(--s1) !important; color: var(--ink) !important; }
@media (pointer: coarse) { .settings-page select.form-select { min-height: 44px; } }

/* ==========================================================================
   Reader buttons and panels: one look and one behaviour
   View, Practice, Song, Guitar, Tools (top bar rows or side rail on phones) and the dock's Synth | Recording switch are all .rbtn.
   Every panel they open is .rpanel (class set by utils/readerPanels.js), with entry and exit driven by showPanel/hidePanel.
   ========================================================================== */
.rbtn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding-inline: 12px !important; border: 0 !important;
  border-radius: var(--r-control, var(--r)) !important; background: transparent !important; color: var(--ink2) !important; box-shadow: none !important;
  font: 600 14px system-ui, sans-serif; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .rbtn:hover:not(:disabled) { background: var(--s1) !important; color: var(--ink) !important; } }
.rbtn[aria-expanded="true"], .rbtn.active { background: var(--s2) !important; color: var(--ink) !important; }
.rbtn:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
.rbtn:disabled { opacity: 0.4; }
.rbtn .bar-btn-label, .rbtn .audio-src-label { font: inherit; margin: 0; }
@media (pointer: coarse) { .rbtn { min-height: 44px; } }

/* The Synth | Recording switch: a tray with the selected sound one step up */
.dock-src .rbtn { min-height: 32px; height: 32px; padding-inline: 10px !important; border-radius: calc(var(--r) - 3px) !important; font-size: 13px; }
@media (hover: hover) { .dock-src .rbtn:hover:not(:disabled) { background: var(--s3) !important; } }
.dock-src .rbtn.active-audio-mode, .dock-src .rbtn.active { background: var(--s3) !important; color: var(--ink) !important; }
@media (pointer: coarse) { .dock-src .rbtn { min-height: 44px; height: 44px; } }

/* One status dot: a setting is on that you cannot see (the active-item inlay dot, the only color on these buttons) */
#guitarToggleBtn.is-adapted .bar-btn-label::after, #practiceToggleBtn.has-state .bar-btn-label::after,
#toolsToggleBtn.has-pad .bar-btn-label::after, #toolsToggleBtn.has-jam .bar-btn-label::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--hue); vertical-align: middle;
}
.tools-status-dot { display: none !important; }

/* Panels: the same entry and a shorter exit. translate and scale are their own properties, so the panels that
   position themselves with transform keep working. */
.rpanel { animation: none !important; }
.rpanel.rp-in { animation: rpIn var(--dur-base) var(--ease-out) both !important; }
.rpanel.rp-out { animation: rpOut var(--dur-fast) var(--ease-out) both !important; pointer-events: none; }
#synthDropdownPanel, #ytDropdownPanel { --rp-from: 24px 0; }
@media (max-width: 900px) { #synthDropdownPanel, #ytDropdownPanel { --rp-from: 0 40px; } }
@media (max-width: 640px) { .rpanel { --rp-from: 0 40px; } }
@keyframes rpIn { from { opacity: 0; translate: var(--rp-from, 0 -6px); } to { opacity: 1; translate: 0 0; } }
@keyframes rpOut { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: var(--rp-from, 0 -6px); } }
@media (prefers-reduced-motion: reduce) { .rpanel.rp-in, .rpanel.rp-out { animation: none !important; } .rbtn { transition: none; } }

/* The five top-bar menus are the same width and never taller than the space between the bar and the dock.
   Placement is one function (placePanel in readerPanels.js): under the button, right edges aligned, clamped to the window. */
@media (min-width: 641px) {
  #viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel {
    width: min(360px, calc(100vw - 16px)) !important; max-width: none;
    max-height: calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - 24px); overflow-y: auto; overflow-x: hidden;
  }
}

/* Only: a text button */
.gp-track-row .gp-track-only-btn {
  font: 500 13px system-ui, sans-serif !important; letter-spacing: 0; line-height: 1.3; padding: 6px 12px !important; min-height: 32px;
  border: 0 !important; border-radius: var(--r) !important; background: transparent !important; color: var(--ink2) !important;
}
@media (hover: hover) { .gp-track-row .gp-track-only-btn:hover { background: var(--s3) !important; color: var(--ink) !important; } }
@media (pointer: coarse) { .gp-track-row .gp-track-only-btn { min-height: 44px; } }

/* Synth panel mixer: each track is a two-line strip, always visible.
   Line 1: color bar, name, Mute and Solo. Line 2: level and pan. */
#synthMixerList, #afStemList { gap: 14px !important; }
.track-mix { display: flex; flex-direction: column; gap: 8px; }
.track-mix-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.track-mix .gp-track-dot { flex: none; width: 10px; height: 24px; border-radius: 3px; background: var(--track-color); border: 0; }
.track-mix-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-mix-toggles { display: flex; gap: 6px; flex: none; }
.track-mix-toggles .mixer-toggle { min-width: 36px; width: 36px; height: 32px; padding: 0; font: 600 13px system-ui, sans-serif; border-radius: var(--r) !important; }
.track-mix-sliders { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; padding-left: 22px; }
.track-mix-sliders .mixer-slider { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Label and value take fixed columns, so the Level and Pan tracks start and end at the same x */
.track-mix-sliders .mixer-slider-label { flex: 0 0 40px; width: 40px; font-size: 12px; }
.track-mix-sliders .theme-value-badge { min-width: 0; font-size: 12px; text-align: right; }
.track-mix-sliders .mixer-volume-badge, .track-mix-sliders .mixer-pan-badge { flex: 0 0 40px; width: 40px; }
.track-mix.is-muted .track-mix-name, .track-mix.is-muted .track-mix-sliders, .gp-track-item.is-muted .track-mix-name, .gp-track-item.is-muted .track-mix-sliders { opacity: .5; }
@media (pointer: coarse) { .track-mix-toggles .mixer-toggle { min-width: 44px; width: 44px; height: 44px; } }
@media (max-width: 640px) { .track-mix-sliders { grid-template-columns: 1fr; gap: 8px; } }
.track-chip-dot, .track-mix .gp-track-dot { box-shadow: none !important; }

/* Desktop shells: the library has no top bar of its own. The rail carries the brand and Settings, so the bar
   shows nothing there but the way back to an open song. It stays as the drag strip and window-control clearance. */
.tauri-macos body.library-view-active #brandSection .brand-pick,
.tauri-macos body.library-view-active #brand-text,
.tauri-windows body.library-view-active #brandSection .brand-pick,
.tauri-windows body.library-view-active #brand-text,
.tauri-linux body.library-view-active #brandSection .brand-pick,
.tauri-linux body.library-view-active #brand-text { display: none !important; }

/* ==========================================================================
   Recording panel: flat rows, plain-text status, one filled action (Tap to sync)
   ========================================================================== */
#ytDropdownPanel .rec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#ytDropdownPanel .rec-label { font-size: 13px; color: var(--ink2); }
#ytDropdownPanel .rec-text-btn {
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--ink2) !important;
  font: 500 13px system-ui, sans-serif; padding: 6px 12px; min-height: 32px; border-radius: var(--r) !important; white-space: nowrap;
}
@media (hover: hover) { #ytDropdownPanel .rec-text-btn:hover { background: var(--s3) !important; color: var(--ink) !important; } }
#ytDropdownPanel .rec-text-btn:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
/* The sync controls stay in the DOM (the sync card drives them); the card is the only place they show */
#ytDropdownPanel .rec-sync-proxy { display: none !important; }
/* Status is plain grey text, not a pill */
#ytDropdownPanel .slot .chip, #ytDropdownPanel .slot .chip.ok, #ytDropdownPanel .slot .chip.warn {
  height: auto; padding: 0; border-radius: 0; background: transparent; color: var(--ink2); font-size: 12px; font-weight: 400;
}
#ytDropdownPanel .slot .chip.ok { color: var(--ink); }
/* Text follows the finish instead of forced white */
#ytDropdownPanel .text-white-50, #ytDropdownPanel .text-muted { color: var(--ink2) !important; }
#ytDropdownPanel .text-white { color: var(--ink) !important; }
#ytDropdownPanel .spinner-border { color: var(--ink2); }
/* Joined inputs become a row of separate tone-step controls */
#ytDropdownPanel .input-group { display: flex; flex-wrap: nowrap; gap: 6px; align-items: stretch; }
#ytDropdownPanel .input-group > .form-control { flex: 1; min-width: 0; }
#ytDropdownPanel .input-group > .btn { border: 0 !important; margin: 0 !important; border-radius: var(--r) !important; display: inline-flex; align-items: center; }
/* No outlines on the video, its states, the waveform or the file rows */
#ytDropdownPanel .af-wave { border: 0 !important; background: var(--s1) !important; border-radius: var(--r); }
#ytDropdownPanel .af-file-row { border: 0 !important; background: var(--s1) !important; }
#ytDropdownPanel .af-file-row.is-selected { background: var(--s3) !important; }
@media (pointer: coarse) { #ytDropdownPanel .btn { min-height: 44px; } }
@media (min-width: 577px) {
  .tauri-macos body.library-view-active #topBar, .tauri-windows body.library-view-active #topBar, .tauri-linux body.library-view-active #topBar { background: transparent !important; z-index: 1050; }
  .tauri-macos body.library-view-active, .tauri-windows body.library-view-active, .tauri-linux body.library-view-active { background: var(--s1) !important; }
  .tauri-macos body.library-view-active .library-bottom-nav, .tauri-windows body.library-view-active .library-bottom-nav, .tauri-linux body.library-view-active .library-bottom-nav { top: 0; }
  .tauri-macos body.library-view-active .library-bottom-nav { padding-top: 48px; }
}
#ytDropdownPanel [hidden] { display: none !important; }

/* Desktop shells, library: the bar takes no room. It is a thin drag strip over the top edge. On macOS it fills the 36px space down to the search bar. */
@media (min-width: 577px) {
  .tauri-macos body.library-view-active #topBar, .tauri-windows body.library-view-active #topBar, .tauri-linux body.library-view-active #topBar {
    position: fixed; top: 0; left: 0; right: 0; height: 20px; min-height: 0; padding-top: 0 !important; padding-bottom: 0 !important; overflow: visible;
  }
  .tauri-macos body.library-view-active #topBar { height: 36px; }
  .tauri-windows .setpage { padding-right: max(28px, calc(var(--wc-r, 0px) + 16px)); }
  /* Windows: the caption buttons are --bar-h tall and float over the page. The page content stays where it is; only the scrollbar track starts below the buttons, so they never cover the scrollbar's top. Library, Settings and Tools. Fullscreen hides the buttons, so the inset goes too. */
  .tauri-windows:not(.window-fullscreen) .library-page-body,
  .tauri-windows:not(.window-fullscreen) .setpage { scrollbar-width: auto; scrollbar-color: auto; }
  /* scrollbar-width and scrollbar-color inherit, so the `auto` above reached the Settings and Tools list column (a sibling of .setpage inside the library body) and gave it the system scrollbar. Put the themed values back on it. */
  .tauri-windows:not(.window-fullscreen) .setshell .setnav { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent-primary) 55%, transparent) transparent; }
  .tauri-windows:not(.window-fullscreen) .library-page-body::-webkit-scrollbar,
  .tauri-windows:not(.window-fullscreen) .setpage::-webkit-scrollbar { width: 10px; }
  .tauri-windows:not(.window-fullscreen) .library-page-body::-webkit-scrollbar-track,
  .tauri-windows:not(.window-fullscreen) .setpage::-webkit-scrollbar-track { background: transparent; }
  /* Chromium ignores margin on a scrollbar track, so the library starts its scroll container below the buttons instead. Settings and Tools sit inside that same body but cancel its padding, so their scroller already starts at the same top and gets no margin; both scrollbars then begin --bar-h below the top of the page. */
  /* Settings and Tools keep their layout; a transparent start button on the scrollbar pushes the track and thumb down below the caption buttons. */
  .tauri-windows:not(.window-fullscreen) .setpage::-webkit-scrollbar-button:vertical:start:decrement { display: block; height: var(--bar-h); background: transparent; }
  .tauri-windows:not(.window-fullscreen) body.library-view-active .library-page-body:not(:has(.setshell)) { margin-top: var(--bar-h); padding-top: 0; }
  .tauri-windows:not(.window-fullscreen) .library-page-body::-webkit-scrollbar-thumb,
  .tauri-windows:not(.window-fullscreen) .setpage::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent-primary) 55%, transparent); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
}

/* About: the one place the pick appears */
.about-brand { display: flex; align-items: center; gap: 14px; padding: 12px 0 0; margin-bottom: 20px; }
.about-mark { width: 64px; height: 64px; box-sizing: border-box; padding: 9px 8px; flex: none; background: #fff; border-radius: var(--r-card); }
.about-wordmark { font: 700 28px/1 var(--font-display); letter-spacing: -.01em; color: var(--ink); }
.about-wordmark b { font-weight: 700; color: var(--ink2); }

/* View menu: Screen row (Fullscreen, Reading mode): two flat tone-step buttons, like Layout and Notation */
#viewMenu .view-screen-pair { display: flex; gap: 8px; }
#viewMenu .view-screen-pair > span { flex: 1 1 0; min-width: 0; display: block; }
#viewMenu .view-window-btn {
  width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--s1) !important; color: var(--ink) !important; border: 0 !important; box-shadow: none; border-radius: var(--r-control); padding: 4px 8px;
}
@media (hover: hover) { #viewMenu .view-window-btn:hover { background: var(--s2) !important; } }
#viewMenu .view-window-btn.is-on { background: var(--s3) !important; }
#viewMenu .view-window-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#viewMenu .view-window-hint { color: var(--ink2); font-size: 11px; line-height: 1; }
@media (hover: none) { #viewMenu .view-window-hint { display: none; } }

/* Reading mode (desktop): leaving is quicker than arriving. The dock fades (hud-leaving) at the same moment and for the same time as the top bar, then hud-hidden takes it out of the layout; WebViews without display transitions would otherwise drop it at once */
#topBar { transition: transform var(--dur-base) var(--ease-out), margin-top var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out); }
#topBar.hud-hidden:not(.hud-transient) { transition-duration: var(--dur-fast); }
body:not(.library-view-active):not(.dock-off) .mobile-playback-dock.has-audio-sources {
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), display var(--dur-base) allow-discrete;
}
body:not(.library-view-active):not(.dock-off) .mobile-playback-dock.has-audio-sources.hud-leaving:not(.hud-transient),
body:not(.library-view-active):not(.dock-off) .mobile-playback-dock.has-audio-sources.hud-hidden:not(.hud-transient) {
  opacity: 0; transform: translateY(16px); transition-duration: var(--dur-fast);
}
@starting-style { body:not(.library-view-active):not(.dock-off) .mobile-playback-dock.has-audio-sources { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { #topBar, .mobile-playback-dock { transition: none !important; } }

/* Master volume slider while iOS-controlled audio (YouTube, audio file) is active */
#synthVolumeSlider:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==========================================================================
   Metronome tool. Flat rows on the ground ladder; color only on the primary action and on the
   beat that is sounding (the playhead). Based on The Minimal Metronome by Zane Helton (MIT).
   ========================================================================== */
.metronome-modal-card { max-width: 480px; width: 95%; max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.metronome-body { display: flex; flex-direction: column; gap: 20px; padding: 20px; overflow-y: auto; overscroll-behavior: contain; --ref-rest: color-mix(in srgb, var(--ink) 6%, var(--ground)); --ref-on: color-mix(in srgb, var(--ink) 13%, var(--ground)); }
.metro-main, .metro-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.metro-main > *, .metro-side > * { flex-shrink: 0; }
/* Like the tuner, two columns when the tool has the width (the stage on the Tools page): the pulse on the left, the pattern and options on the right */
.metronome-modal-card { container: tool / inline-size; }
@container tool (min-width: 640px) { .metronome-body { flex-direction: row; align-items: flex-start; gap: 40px; } .metro-main, .metro-side { flex: 1 1 0; } }
.metro-stage { position: relative; height: 140px; border-radius: var(--r-card); background: var(--ref-rest); overflow: hidden; }
.metro-arm { position: absolute; left: calc(50% - 2px); top: 28px; bottom: 0; width: 4px; border-radius: 2px; background: var(--ink2); transform-origin: 50% 100%; transform: rotate(0); will-change: transform; }
.metro-mark { position: absolute; left: calc(50% - 6px); top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--hue); opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.metro-mark.is-lit { opacity: 1; transition: none; }
.metro-readout { display: flex; align-items: center; justify-content: center; gap: 24px; }
.metro-tempo { display: flex; align-items: baseline; gap: 8px; min-width: 150px; justify-content: center; }
.metro-bpm { font-family: var(--font-display); font-weight: 700; font-size: 5rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.metro-unit { font-size: 14px; color: var(--ink2); }
.metro-step { width: 44px; height: 44px; border: 0; border-radius: var(--r-control); background: var(--ref-rest); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; transition: transform var(--dur-fast) var(--ease-out); }
.metro-step:active { transform: translateY(1px); }
.tauri-ios .metro-step:active { transform: scale(.96); }
@media (hover: hover) { .metro-step:hover, .metro-ghost:hover { background: var(--ref-on) !important; } }
.metro-range { width: 100%; accent-color: var(--ink2); min-height: 24px; }
.metro-beats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 14px; }
.metro-beat { width: 12px; height: 12px; border-radius: 50%; background: var(--ref-on); transition: background-color var(--dur-fast) var(--ease-out); }
.metro-beat.is-downbeat { background: color-mix(in srgb, var(--ink) 28%, var(--ground)); }
.metro-beat.is-current { background: var(--hue); }
.metro-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.metro-play { min-height: 44px; min-width: 120px; padding: 0 28px; border-radius: var(--r-control) !important; font-size: 15px; font-weight: 600; }
.metro-ghost { min-height: 44px; padding: 0 16px; border: 0 !important; border-radius: var(--r-control) !important; background: transparent !important; color: var(--ink2) !important; font-size: 14px; box-shadow: none !important; }
.metro-sig-slash, .metro-times { color: var(--ink2); font-size: 18px; }
.metro-parts { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.metro-parts-head { font-size: 13px; color: var(--ink2); padding: 0 12px; }
.metro-pattern { display: flex; flex-direction: column; gap: 2px; }
.metro-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 56px; padding: 6px 12px; border-radius: var(--r-control); }
.metro-row.is-current::before { content: ""; position: absolute; left: 3px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); }
.metro-row [data-remove] { margin-left: auto; }
.metro-part-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.metro-ghost:disabled { opacity: .4; cursor: default; }
.metro-field.form-select, .library-page-view select.form-select.metro-field { width: 76px; min-height: 44px; padding: 0 26px 0 12px !important; border: 0 !important; border-radius: var(--r-control) !important; background-color: var(--ref-rest) !important; background-position: right 8px center !important; color: var(--ink) !important; font-size: 15px; font-variant-numeric: tabular-nums; text-align: left; text-align-last: left; box-shadow: none !important; }
@media (hover: hover) { .metro-field:hover, .library-page-view select.form-select.metro-field:hover { background-color: var(--ref-on) !important; } }
.metro-field:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.metro-options { display: flex; flex-direction: column; gap: 2px; }
.metro-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px 12px; border-radius: var(--r-control); cursor: pointer; color: var(--ink); font-size: 15px; }
.metro-option small { display: block; font-size: 12px; color: var(--ink2); }
@media (hover: hover) { .metro-option:hover { background: var(--ref-rest); } }
.metro-help { font-size: 12px; color: var(--ink2); }
.metro-play:focus-visible, .metro-ghost:focus-visible, .metro-step:focus-visible, .metro-range:focus-visible, .metro-option:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
#metronomeModal .theme-modal-close-btn i { display: inline-block !important; }
.theme-modal-backdrop.tool-embedded .metronome-modal-card { max-width: none; width: 100%; }
.theme-modal-backdrop.tool-embedded .metronome-body { padding: 0; }
#latencyModal.tool-embedded .theme-modal-card { max-width: 520px; }
@media (pointer: coarse) { [data-latency-step], #synthLatencyCalBtn, #ytLatencyCalBtn, #latencyModal #latencyStartBtn, #latencyModal #latencyApplyBtn { min-height: 44px; min-width: 44px; } }
#latencyModal.tool-embedded .border-top { border-top: 0 !important; margin-top: 8px !important; }
@media (prefers-reduced-motion: reduce) { .metro-mark, .metro-beat, .metro-step { transition: none; } }

/* Library and Setlists glyphs from the Reimagined mockup (stroked, drawn as masks so they take currentColor and the icon font size) */
.mt-ico { display: inline-block; width: 1em; height: 1em; background-color: currentColor; vertical-align: -0.125em; -webkit-mask: var(--mt-ico) center / contain no-repeat; mask: var(--mt-ico) center / contain no-repeat; }
.mt-ico-library { --mt-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 5v14M9 5v14M14.5 6.5l3.2-1 2.8 12.5-3.2 1z%22/%3E%3C/svg%3E"); }
.mt-ico-setlists { --mt-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 6h11M9 12h11M9 18h7M4.5 6h.01M4.5 12h.01M4.5 18h.01%22/%3E%3C/svg%3E"); }

/* --- Jam mode modal: flat rows on tone steps, plain-text status, ghost secondary actions --- */
.jam-modal-card { border: 0; }
.jam-modal-body .form-control, .jam-modal-body .form-select { background-color: var(--s3); border: 0; border-radius: var(--r-control); color: var(--ink); min-height: 36px; }
.jam-modal-body .form-control:focus, .jam-modal-body .form-select:focus { background-color: var(--s3); box-shadow: 0 0 0 2px var(--ink2); }
.jam-modal-body .form-control::placeholder { color: var(--ink2); }
.jam-label, .jam-help { color: var(--ink2); }
.jam-card, .jam-list-row { background: var(--s2); border: 0; border-radius: var(--r-card); }
.jam-list-row { min-height: 56px; }
.jam-qr { border-radius: var(--r-control); }
.jam-status { margin: 0; font-weight: 400; color: var(--ink2); }
.jam-matrix-badge { font-size: 0.75rem; font-weight: 400; color: var(--warn); }
.jam-matrix-sum { border-bottom: 0; }
.jam-danger { margin-top: 1.25rem; padding-top: 0.5rem; }
.jam-danger .jam-label { color: var(--danger); }

/* Only Join and Start hosting stay filled; the rest are ghost text actions */
.jam-modal-body .btn-theme-outline:not(.jam-matrix-cell):not([aria-pressed="true"]), .jam-modal-body .theme-control-btn {
  background: transparent !important; color: var(--ink2) !important; font-weight: 500;
}
@media (hover: hover) {
  .jam-modal-body .btn-theme-outline:not(.jam-matrix-cell):hover:not(:disabled), .jam-modal-body .theme-control-btn:hover:not(:disabled) { background: var(--s3) !important; color: var(--ink) !important; }
}
.jam-modal-body [data-jam-rename-save], .jam-modal-body [data-jam-qr][aria-pressed="true"] { background: var(--s3) !important; color: var(--ink) !important; }

/* Matrix cells: a tone step shows the choice, not a colored button */
.jam-matrix-cell.btn-theme-outline { background: var(--s3) !important; color: var(--ink) !important; border-radius: var(--r-control); }
.jam-matrix-cell.btn-theme-primary { background: var(--ink) !important; color: var(--ground) !important; border-radius: var(--r-control) !important; }
@media (hover: hover) { .jam-matrix-cell.btn-theme-primary:hover:not(:disabled) { background: var(--ink) !important; color: var(--ground) !important; border-radius: var(--r-control) !important; } }

/* The control-request card floats: shadow only, no border or glow */
.jam-request-card { border: 0; box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.5); border-radius: var(--r-card); animation: popIn var(--dur-base) var(--ease-out); }

@media (pointer: coarse) {
  .jam-modal-body .btn, .jam-request-card .btn { min-height: 44px; min-width: 44px; }
  .jam-matrix { grid-template-columns: minmax(5rem, 12rem) repeat(var(--jam-cols), 44px); gap: 0.35rem 0.5rem; }
  .jam-matrix-cell { width: 44px; height: 44px; }
}
.jam-modal-body .form-switch .form-check-label { padding-left: 0.5rem; }
.jam-modal-body .form-switch { min-height: 44px; display: flex; align-items: center; }
.jam-matrix-cell.btn-theme-outline { background: color-mix(in srgb, var(--ink) 14%, var(--s2)) !important; }

/* Controls reference inside Settings: flat tone steps, no outlines or hairlines */
#controllerHelpModal .controller-ref-card { background: var(--s1); border: 0; border-radius: var(--r-card); }
#controllerHelpModal .controller-ref-title { border-bottom: 0; }
#controllerHelpModal .controller-ref-item { border-bottom: 0 !important; }
#controllerHelpModal .controls-tab-bar { border-bottom: 0; justify-content: flex-start !important; }

/* ---------- Task status and progress (backup, restore, reload, cleanup) ----------
   One flat component for "this is happening" and "this happened", in the place the task reports on itself.
   Tone step behind it, one hue for the fill, transform-only motion, no spinners, no outlines. */
.task-status { margin: 8px 0 4px; padding: 12px 14px; background: var(--s2); border-radius: var(--r-card); color: var(--ink); font-size: 14px; line-height: 1.4; }
.task-status:empty { display: none !important; }
.task-status strong { display: block; font-weight: 600; }
.task-status-detail { display: block; margin-top: 2px; color: var(--ink2); }
.task-status-error { color: var(--danger); }
.task-status-error .task-status-detail { color: var(--ink2); }
.task-status-info { color: var(--ink2); }
.task-progress { display: grid; gap: 10px; }
.task-progress-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.task-progress-label { flex: 0 1 auto; max-width: 100%; color: var(--ink); font-weight: 600; }
.task-progress-detail { flex: 1 1 12ch; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.task-progress-detail:not(:empty)::before { content: "\00B7"; margin-right: 8px; }
.task-progress-track { position: relative; height: 4px; overflow: hidden; border-radius: 2px; background: var(--s3); }
.task-progress-fill { position: absolute; inset: 0; border-radius: 2px; background: var(--hue); transform: scaleX(0); transform-origin: left center; transition: transform var(--dur-base) var(--ease-out); }
.task-progress-track.is-indeterminate .task-progress-fill { right: auto; width: 30%; transform: translateX(-100%); transition: none; animation: task-progress-slide 1.4s linear infinite; }
@keyframes task-progress-slide { to { transform: translateX(333%); } }
@media (prefers-reduced-motion: reduce) {
  .task-progress-fill { transition: none; }
  .task-progress-track.is-indeterminate .task-progress-fill { animation: none; transform: none; width: 30%; }
}
/* Counts and states inside the data screens are ink, not signal colours */
.data-task-slot .text-info, .data-task-slot .text-primary, .data-task-slot .text-warning { color: var(--ink) !important; }
.data-task-slot #restoreDriveLoading { text-align: left !important; }

/* Data rows in Settings: a verb on the right, the whole row is the target, one tone step while open */
.srow-task, .srow:has(.srow-hit) { position: relative; }
@media (hover: hover) { .srow-task:hover { background: var(--s3); } }
.srow-task:has(button[aria-expanded="true"]) { background: var(--s3); }
.srow-task:has(button:focus-visible) { outline: 2px solid var(--hue); outline-offset: -2px; }
.srow .srow-hit { position: static; min-width: 64px; text-align: right; }
.srow .srow-hit::after { content: ""; position: absolute; inset: 0; }
.srow .srow-hit:focus-visible { outline: none; }
.srow .srow-hit.is-danger { color: var(--danger) !important; }
@media (hover: hover) { .srow .srow-hit:hover:not(:disabled) { background: transparent; } }
@media (max-width: 899px) { .srow.srow-task { flex-wrap: nowrap; } .srow.srow-task .sc { width: auto; } .srow.srow-task .srow-hit { min-height: 44px; min-width: 56px; } }

/* A data task opens as the rest of its row: same surface, same left edge, no page of its own */
.srow-task:has(button[aria-expanded="true"]) { padding-bottom: 6px; }
.data-task-slot { background: var(--s3); padding: 0 14px 6px; }
.data-task-slot #deleteTabContent, .data-task-slot #deleteTabContent .form-check { margin-bottom: 0 !important; }
.data-task-slot .theme-modal-body, #backupModal.is-embedded .theme-modal-body { padding: 0 !important; }
.data-task-slot .theme-modal-card > :first-child, .data-task-slot .theme-modal-body > :first-child > :first-child { margin-top: 0 !important; }
.data-task-slot .backup-summary-box { padding: 4px 0 8px !important; margin-bottom: 4px !important; }
.data-task-slot .backup-summary-box:last-child, .data-task-slot .theme-modal-body > div > :last-child { margin-bottom: 0 !important; }
.data-task-slot .d-flex.justify-content-end.pt-1 { padding-top: 8px !important; }
.data-task-slot .task-status, .data-task-slot .task-status:not(:empty) { background: color-mix(in srgb, var(--ink) 6%, var(--s3)); border-radius: var(--r-control, 8px) !important; }
.data-task-slot .p-3 { padding: 0 !important; }
.data-task-slot .mb-3 { margin-bottom: 12px !important; }
.srow-task:has(button[aria-expanded="true"]) + .data-task-slot:not([hidden]) { margin-top: -2px; }

/* ==========================================================================
   Open file page: one drop surface, one primary action, provider rows on a 56px pitch
   ========================================================================== */
.open-file-body { max-width: 760px; margin: 0 auto; padding: 0 0 24px; }
.open-file-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 32px 20px; background: var(--s2); border: 0; border-radius: var(--r-card); box-shadow: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
 .open-file-dropzone.is-dragover { background: var(--s3); }
@media (hover: hover) { .open-file-dropzone:hover { background: var(--s3); } }
.open-file-dropzone:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.open-file-dropzone-title { font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.open-file-dropzone-sub { font-size: 13px; color: var(--ink2); }
.open-file-dropzone .btn { margin-top: 14px; min-height: 36px; padding: 0 20px; }
.open-file-web-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: none; margin: 16px 0 0 !important; }
.open-file-web-search .library-search-bar { flex: 1 1 auto; min-width: 0; }
.open-file-web-search .btn { min-height: 36px; padding: 0 16px; }
.open-file-section-label { margin: 28px 0 4px; padding: 0 12px; font: 600 14px system-ui, sans-serif; color: var(--ink2); letter-spacing: 0; text-transform: none; }
.open-file-provider-list { display: flex; flex-direction: column; }
.open-file-provider-item {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; min-width: 0;
  background: transparent; border: 0; border-radius: var(--r-control); box-shadow: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.open-file-provider-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
@media (hover: hover) { .open-file-provider-item:hover { background: var(--s2); } }
.open-file-provider-item:active { background: var(--s3); }
.open-file-provider-item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.open-file-provider-text { display: flex; flex-direction: column; min-width: 0; }
.open-file-provider-name { font-size: 15px; font-weight: 500; color: var(--ink); }
.open-file-provider-meta, .open-file-provider-desc { font-size: 12px; font-weight: 400; color: var(--ink2); line-height: 1.35; }
@media (pointer: coarse) { .open-file-provider-item { min-height: 56px; } .open-file-dropzone .btn, .open-file-web-search .btn { min-height: 44px; } }
@media (max-width: 576px) { .open-file-dropzone { padding: 24px 16px; } }
@media (prefers-reduced-motion: reduce) { .open-file-dropzone, .open-file-provider-item { transition: none; } }

.open-file-back { grid-column: 1 / -1; justify-self: start; min-height: 36px; margin: 0 0 4px -8px; padding: 0 10px 0 6px; border: 0 !important; background: transparent !important; color: var(--ink2) !important; border-radius: var(--r-control) !important; font-weight: 500; box-shadow: none !important; }
@media (hover: hover) { .open-file-back:hover { background: var(--s2) !important; color: var(--ink) !important; } }
.open-file-back:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .open-file-back { min-height: 44px; } }

/* Open file page is a single column. The library header grid (search + action) does not apply here, which
   is what squeezed the title and body into two narrow tracks on small widths. */
.library-page-container.open-file-view { display: block; max-width: 760px; margin-inline: auto; }
.open-file-view .library-page-title { margin: 0 0 16px; padding: 0 4px; text-align: left; }
.open-file-view .library-page-title-text { font-size: 22px; font-weight: 600; margin: 0; color: var(--ink); }
.open-file-view .library-page-title-sub { font-size: 14px; color: var(--ink2); margin: 4px 0 0; }
.open-file-view .open-file-body { max-width: none; margin: 0; }
.open-file-view .open-file-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; }
@media (max-width: 576px) {
  .open-file-web-search { flex-wrap: wrap; }
  .open-file-web-search .library-search-bar { flex: 1 1 100%; }
  .open-file-web-search .btn { flex: 1 1 100%; }
}

.srow-editor-slot {
  background: var(--s2);
  padding: 14px 16px;
  border-radius: var(--r-control);
  margin-top: -2px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.srow-editor-slot[hidden] { display: none !important; }
.srow-editor-slot .form-control,
.srow-editor-slot .form-select {
  background-color: var(--s3) !important;
  border: 0 !important;
  border-radius: var(--r-control, var(--r)) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}
.srow-editor-slot .form-control:focus,
.srow-editor-slot .form-select:focus {
  background-color: var(--s3) !important;
  outline: 2px solid var(--hue) !important;
  outline-offset: -1px;
  color: var(--ink) !important;
}
.srow-editor-slot .form-select option {
  background-color: var(--s1) !important;
  color: var(--ink) !important;
}

/* The hint is a dismissible notice: one tone step above the bar, no divider */

/* Keyboard hints are noise at phone width */
@media (max-width: 576px) {
  .search-key-hint, .tools-item kbd, .tools-page-row kbd, #smTapBtn kbd { display: none !important; }
  #output { padding: 8px 0 16px !important; }
  .gp-page-container { padding-left: 0 !important; padding-right: 0 !important; }
  #output .alphaTabContainer,
  .gp-page-wrapper {
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* A TV has a remote, not a keyboard: no key hints anywhere */
.tv-mode kbd { display: none !important; }
.tv-mode .ref-root-row { flex-wrap: wrap; overflow-x: visible; }

/* The key and gamepad reference is parked on <body> until Settings moves it into its page; do not paint it there (it covered the first frames) */
body > #controllerHelpModal { display: none; }

/* Fretboard markers and picks: flat, no glow, no highlight, no outline. A part's colour is the only colour on
   the neck (it identifies the track), and the label on it is dark ink because every part colour is a light tone
   (white on them is 1.4 to 2.6:1). The brand pick keeps its shape. Pop feedback moves and fades only. */
.fretboard-neck-bg { fill: var(--s1); stroke: none; }
.fretboard-capo-bar { stroke: none; filter: none; }
.fretboard-capo-label { fill: var(--on-action, var(--ink)); }
.fretboard-note-marker .marker-glow { display: none; }
.fretboard-note-marker .marker-circle { stroke: var(--ground); stroke-width: 1; box-shadow: none; }
/* A two-part dot is told apart by hue alone: no seam, so the note letter never sits on a dark line. The outline ring stays. */
.fretboard-note-marker .marker-split-left,
.fretboard-note-marker .marker-split-right { stroke: none; box-shadow: none; }
.fretboard-note-marker .marker-split-divider { display: none !important; }
.fretboard-note-marker .marker-outline { fill: none; stroke: var(--ground); stroke-width: 1; }
.fretboard-note-marker .marker-text { fill: black; font-weight: 700; }
.fretboard-note-marker .marker-dead { stroke: black; }
.pick-strike-shape { stroke: none; }
@keyframes fb-pop { from { transform: scale(1.18); } to { transform: scale(1); } }
.fretboard-note-marker.is-struck .marker-circle, .fretboard-note-marker.is-struck .marker-split-left, .fretboard-note-marker.is-struck .marker-split-right,
.fretboard-note-marker.is-struck-alt .marker-circle, .fretboard-note-marker.is-struck-alt .marker-split-left, .fretboard-note-marker.is-struck-alt .marker-split-right { animation: fb-pop var(--dur-fast) var(--ease-out); }
.fretboard-note-marker.is-struck-alt .marker-circle { animation-name: fb-pop-alt; }
@keyframes fb-pop-alt { from { transform: scale(1.18); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .fretboard-note-marker .marker-circle, .fretboard-note-marker .marker-split-left, .fretboard-note-marker .marker-split-right, .pick-marker-inner { animation: none !important; }
}
.setnav button svg:first-child { width: 1.5rem; height: 1.15rem; flex-shrink: 0; }

/* ---------- Sync dialog ----------
   Flat: tone steps and ink, no icon squares, tiles, outlines, badges or striped bars. The destructive option
   sits in its own Danger zone and takes a second press on a separate screen. */
#syncModal .sync-card { max-width: 620px; }
#syncModal .theme-modal-header { border: 0; }
#syncModal .theme-modal-footer, #syncModal .sync-footer { border: 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 8px 16px 16px; }
#syncModal .sync-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
#syncModal .sync-subtitle { color: var(--ink2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#syncModal .sync-body { padding: 4px 16px 12px; color: var(--ink); font-size: 14px; }
#syncModal .text-white, #syncModal .text-white-50, #syncModal .text-muted { color: var(--ink2) !important; }
#syncModal .form-label { color: var(--ink2) !important; }
#syncModal .sync-lead { color: var(--ink2); margin: 0 0 12px; }
#syncModal .sync-hint { color: var(--ink2); font-size: 13px; margin: 6px 0 0; }
#syncModal .sync-list { display: flex; flex-direction: column; gap: 2px; }
#syncModal .sync-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 56px; padding: 10px 14px; text-align: left; background: var(--s2); border: 0; border-radius: var(--r-control); color: var(--ink); }
@media (hover: hover) { #syncModal .sync-option:hover { background: var(--s3); } }
#syncModal .sync-option:focus-visible, #syncModal .sync-text-action:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
#syncModal .sync-option-title { font-weight: 600; }
#syncModal .sync-option-text { color: var(--ink2); font-size: 13px; }
#syncModal .sync-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#syncModal .sync-head > .min-w-0, #syncModal .sync-danger-row > .min-w-0 { min-width: 0; }
#syncModal .sync-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex-shrink: 0; }
#syncModal .sync-status { font-weight: 600; }
#syncModal .sync-location { color: var(--ink2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#syncModal .sync-text-action { min-height: 32px; padding: 4px 10px; background: transparent; border: 0; border-radius: var(--r-control); color: var(--ink2); font-size: 13px; }
@media (hover: hover) { #syncModal .sync-text-action:hover { background: var(--s2); color: var(--ink); } }
@media (pointer: coarse) { #syncModal .sync-text-action, #syncModal .btn { min-height: 44px; } }
#syncModal .sync-counts { margin: 0 0 12px; color: var(--ink2); font-size: 14px; }
#syncModal .sync-counts strong { color: var(--ink); font-weight: 600; }
#syncModal .sync-counts .is-zero strong { color: var(--ink2); font-weight: 400; }
#syncModal .sync-section { margin: 0 0 8px; }
#syncModal .sync-section summary { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; cursor: pointer; user-select: none; }
#syncModal .sync-meta { margin-left: auto; color: var(--ink2); font-weight: 400; font-size: 13px; }
#syncModal .sync-rows { list-style: none; margin: 4px 0 0; padding: 0; max-height: 28vh; overflow-y: auto; background: var(--s2); border-radius: var(--r-control); }
#syncModal .sync-rows li { display: flex; flex-direction: column; padding: 8px 12px; min-width: 0; }
#syncModal .sync-rows li + li { background: transparent; }
#syncModal .sync-row-name { color: var(--ink); overflow-wrap: anywhere; }
#syncModal .sync-rows .sync-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#syncModal .sync-row-note { color: var(--ink2); font-size: 13px; }
#syncModal .sync-danger { margin-top: 20px; }
#syncModal .sync-danger h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--danger, #f87171); }
#syncModal .sync-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 12px; background: var(--s2); border-radius: var(--r-control); }
#syncModal .sync-danger-row .btn { flex-shrink: 0; }

#syncModal .task-status { margin-top: 0; margin-bottom: 12px; }
#syncModal pre { border: 0 !important; }

/* Embedded in Settings under its row: the row names the task, so no header, card or second title */
#syncModal.tool-embedded .sync-card { max-width: none; }
#syncModal.tool-embedded .sync-body { padding: 0; }
#syncModal.tool-embedded .sync-footer { padding: 8px 0 0; }
#syncModal.tool-embedded .sync-subtitle { display: none; }
#syncModal.tool-embedded .sync-option { background: transparent; border-radius: var(--r-control, 8px); transition: background var(--dur-fast, 150ms) var(--ease-out); }
@media (hover: hover) { #syncModal.tool-embedded .sync-option:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); } }
#syncModal.tool-embedded .sync-rows, #syncModal.tool-embedded .sync-danger-row { background: color-mix(in srgb, var(--ink) 5%, var(--s3)); border-radius: var(--r-control, 8px); }

/* ==========================================================================
   Master Search & Live Search Stream (Reimagined Flat Ground Ladder)
   ========================================================================== */

#libFilteredSearchResults {
    background: var(--s1);
    border-radius: var(--r-card);
    overflow: hidden;
    margin-top: 4px;
}

.search-stream-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink2);
    padding: 12px 16px 4px;
}

.search-stream-count {
    font-weight: 400;
    color: var(--ink2);
    margin-left: 4px;
}

.search-stream-list {
    display: flex;
    flex-direction: column;
}

.search-stream-row {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 8px 16px;
    gap: 12px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
    transition: background var(--dur-fast, 150ms) ease;
}

@media (hover: hover) { .search-stream-row:hover { background: var(--s2); } }
.search-stream-row.is-selected {
    background: var(--s2);
}

.search-stream-row:focus-visible {
    outline: 2px solid var(--hue);
    outline-offset: -2px;
}

.search-track-num {
    width: 24px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--ink2);
    text-align: right;
    flex-shrink: 0;
}

.search-row-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.search-row-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.search-row-sub {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.3;
}

.search-catalog-status-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    font-size: 13px;
    color: var(--ink2);
}

.search-catalog-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hue);
    animation: search-pulse-dot 1.2s infinite ease-in-out;
    flex-shrink: 0;
}

@keyframes search-pulse-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

.search-subview-head {
    min-height: 36px;
    gap: 8px;
}

.search-subview-title {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    flex: 1 1 0;
    text-align: right;
}

.search-subview-name {
    color: var(--ink);
    font-weight: 600;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.search-subview-sub {
    color: var(--ink2);
    font-size: 0.875em;
}

.search-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    border-radius: var(--r-control);
    color: var(--ink2);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 6px 10px 6px 6px;
    min-height: 32px;
    cursor: pointer;
    box-shadow: none;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.search-back-btn i {
    font-size: 15px;
    line-height: 1;
}

@media (hover: hover) { .search-back-btn:hover {
    background: var(--s2);
    color: var(--ink);
} }

.search-back-btn:active {
    background: var(--s3);
    color: var(--ink);
}

.search-back-btn:focus-visible {
    outline: 2px solid var(--hue);
    outline-offset: 2px;
}

@media (pointer: coarse) {
    .search-back-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px 12px 8px 8px;
    }
}

@media (pointer: coarse) {
    .search-stream-row {
        min-height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) { body:not(.library-view-active) #topBar, body:not(.library-view-active) .mobile-playback-dock, body:not(.library-view-active) .page-strip { transition: none !important; } }

/* Settings and Tools pages: breathing room above the first row (nav list and page body) */
@media (min-width: 900px) {
  .setnav { padding-top: 24px; }
  .setpage { padding-top: 24px; }
}
@media (max-width: 899px) {
  /* The list sits under the page title, which already carries the safe-area inset */
  .setnav { padding-top: 8px !important; }
  .setshell[data-pane="page"] .setpage,
  .setshell:has(.setwrap[data-pane="page"]) .setpage { padding-top: 16px; }
}

/* ---------- Song row tab actions and the tab picker ----------
   One row height for 0, 1 and several tabs. "Add tab" and "n tabs" are text actions in a fixed slot; the choice itself
   happens in a floating panel (a sheet above the tab bar on phones), so the list never grows. */
.song-tabs-btn {
  flex: none; width: 80px; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--ink2); font: 500 14px system-ui, sans-serif; text-align: right; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.song-tabs-btn .song-tabs-chev { margin-left: 2px; }
@media (hover: hover) { .song-tabs-btn:hover { background: var(--s3); color: var(--ink); } }
.song-tabs-btn:active { background: var(--s3); }
.song-tabs-btn[aria-expanded="true"] { background: var(--s3); color: var(--ink); }
.song-tabs-btn:focus-visible, .tabpick button:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
.song-tabs-spacer { flex: none; width: 80px; }
.song-actions-spacer { flex: none; }
@media (pointer: coarse) { .song-tabs-btn { min-height: 44px; } .song-actions-spacer { width: 44px; } }
/* Phone: a narrower slot, but still fixed, so the time column lines up on every row */
@media (max-width: 576px) { .song-tabs-spacer, .song-tabs-btn { width: 66px; padding: 0 6px; } }

.tabpick {
  position: fixed; z-index: 1090; width: 640px; max-width: calc(100vw - 16px); max-height: min(80vh, 600px); overflow-y: auto;
  padding: 6px; background: var(--s2); color: var(--ink); border-radius: var(--r-card); box-shadow: 0 8px 28px rgb(0 0 0 / 0.32);
  animation: popIn var(--dur-base) var(--ease-out); transform-origin: top right;
}
.tabpick.is-closing { animation: tabpickOut var(--dur-fast) ease-in forwards; pointer-events: none; }
@keyframes tabpickOut { to { opacity: 0; } }
.tabpick-scrim { position: fixed; inset: 0; z-index: 1089; background: rgb(0 0 0 / 0.45); animation: scrimIn var(--dur-base) var(--ease-out); }
.tabpick-scrim.is-closing { animation: scrimOut var(--dur-fast) ease-in forwards; }
.tabpick-list { list-style: none; margin: 0; padding: 0; }
.tabpick-title { margin: 0; padding: 10px 12px 6px; font: 600 16px system-ui, sans-serif; }
.tabpick-sub { color: var(--ink2); font-weight: 400; }
.tabpick-label, .tabpick-note { margin: 0; padding: 10px 12px 4px; color: var(--ink2); font-size: 13px; }
.tabpick-note { padding-top: 6px; padding-bottom: 8px; }
.tabpick-bar { padding: 2px 0; }
.tabpick-item { position: relative; display: flex; align-items: center; gap: 4px; border-radius: var(--r-control); }
.tabpick-item.is-default::before { content: ""; position: absolute; left: 3px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); }
.tabpick-row, .tabpick-act, .tabpick-back {
  border: 0; background: transparent; color: var(--ink); font: 14px system-ui, sans-serif; text-align: left; cursor: pointer;
  border-radius: var(--r-control); min-height: 40px; padding: 0 12px; transition: background-color var(--dur-fast) var(--ease-out);
}
.tabpick-row { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.tabpick-item .tabpick-row { flex: 1 1 auto; padding-left: 16px; }
.tabpick-name { min-width: 0; overflow-wrap: anywhere; white-space: normal; font-weight: 500; }
.tabpick-meta { flex: none; color: var(--ink2); font-size: 13px; white-space: nowrap; }
.tabpick .sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hue); display: inline-block; flex: none; }
.tabpick-act, .tabpick-back { flex: none; color: var(--ink2); font-size: 13px; padding: 0 10px; white-space: nowrap; }
.tabpick-state { flex: none; padding: 0 10px; color: var(--ink2); font-size: 13px; white-space: nowrap; }
.tabpick-danger { color: var(--danger); }
.tabpick-foot { margin-top: 4px; padding-top: 4px; }
.tabpick-search { display: block; width: calc(100% - 16px); margin: 2px 8px 6px; height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-control); background: var(--s3); color: var(--ink); font: 15px system-ui, sans-serif; }
.tabpick-search::placeholder { color: var(--ink2); }
.tabpick-search:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
.tabpick-song .tabpick-name { flex: 1 1 auto; }
.tabpick-song .tabpick-meta { overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.tabpick-foot .tabpick-row { padding-left: 16px; }
@media (hover: hover) { .tabpick-row:hover, .tabpick-act:hover, .tabpick-back:hover { background: var(--s3); } .tabpick-item:hover { background: var(--s3); } .tabpick-item .tabpick-row:hover { background: transparent; } }
.tabpick-row:active, .tabpick-act:active, .tabpick-back:active { background: var(--s3); }
/* "Make default" is a set-once action: on desktop it shows on hover or focus, on touch it is always there */
@media (hover: hover) and (pointer: fine) {
  .tabpick-makedef { opacity: 0; }
  .tabpick-item:hover .tabpick-makedef, .tabpick-makedef:focus-visible { opacity: 1; }
}
@media (pointer: coarse) { .tabpick-row, .tabpick-act, .tabpick-back { min-height: 44px; } }

@media (max-width: 576px) {
  .tabpick {
    left: 0 !important; right: 0; top: auto !important; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none;
    max-height: 80vh; border-radius: var(--r-card) var(--r-card) 0 0; padding: 4px 8px 12px; transform-origin: bottom center;
    animation: tabpickSheetIn var(--dur-base) var(--ease-out);
  }
  .tabpick.is-closing { animation: tabpickSheetOut var(--dur-fast) ease-in forwards; }
  /* A tab row is two lines: the name and its details on top, the actions in a line below, so a long file name never shares the line with them */
  .tabpick-item { flex-wrap: wrap; row-gap: 0; padding-bottom: 4px; }
  .tabpick-item .tabpick-row { flex: 1 1 100%; flex-wrap: wrap; row-gap: 0; padding-top: 6px; padding-bottom: 2px; }
  .tabpick-item .tabpick-meta { flex: 1 1 100%; white-space: normal; }
  .tabpick-item .tabpick-act, .tabpick-item .tabpick-state { margin-left: 6px; padding: 0 8px; }
  .tabpick-item .tabpick-act:last-child { margin-left: auto; }
  .tabpick-item .tabpick-state { display: inline-flex; align-items: center; min-height: 44px; }
}
@keyframes tabpickSheetIn { from { transform: translate3d(0, 24px, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tabpickSheetOut { to { transform: translate3d(0, 24px, 0); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tabpick, .tabpick-scrim { animation: none !important; } }
/* The row menu is a plain ⋯: no caret, and the placeholder on rows without a menu is exactly as wide */
.song-actions .dropdown > .dropdown-toggle.btn-theme-icon::after,
.album-header-actions .dropdown > .dropdown-toggle.btn-theme-icon::after { display: none; }
.song-actions .dropdown > .dropdown-toggle.btn-theme-icon,
.album-header-actions .dropdown > .dropdown-toggle.btn-theme-icon { min-width: 36px; display: inline-flex; align-items: center; justify-content: center; }
.song-actions-spacer { width: 36px; }
@media (pointer: coarse) { .song-actions .dropdown > .dropdown-toggle.btn-theme-icon, .song-actions-spacer { min-width: 44px; width: 44px; } }

/* Album list rows on phones: title and year get the full width, the actions sit under them */
@media (max-width: 576px) {
    .search-album-row { flex-wrap: wrap; row-gap: 8px; }
    .search-album-row .search-row-title,
    .search-album-row .search-row-sub { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
    .search-album-row .search-album-actions { flex: 1 0 100%; margin-left: 56px !important; }
}

/* Search and tracklist rows: titles wrap instead of truncating, so the row
   action stays a short ghost text action. */
.search-stream-row .search-row-title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

.tool-attribution { display: inline-flex; align-items: baseline; gap: 3px; color: var(--ink2); font-size: inherit; line-height: 1.2; }
.tool-attribution a { color: var(--ink2); text-decoration: underline; text-underline-offset: 2px; transition: color var(--dur-fast); }
@media (hover: hover) {
  .tool-attribution a:hover { color: var(--ink); }
}
.tool-attribution a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (max-width: 420px) {
  .sethead .tool-attribution-prefix { display: none; }
}
@media (pointer: coarse) {
  .sethead .tool-attribution a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
}

/* Classical tab (Tools): composers left, pieces right; flat rows on the ground ladder, no outlines or pills */
.classtab-tool-embedded { height: 100%; }
.ct-root { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; max-width: 1040px; }
.ct-head { display: flex; flex-direction: column; gap: 4px; }
.ct-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ct-credit, .ct-sub, .ct-note, .ct-error, .ct-empty { margin: 0; font-size: 13px; color: var(--ink2); }
.ct-credit a, .ct-sub a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.ct-error { color: var(--danger, #f87171); }
.ct-empty { padding: 14px; }
.ct-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.ct-status { display: flex; align-items: center; gap: 16px; min-height: 44px; color: var(--ink); font-size: 14px; }
.ct-text { background: transparent; border: 0; color: var(--ink2); font-size: 14px; padding: 6px 10px; min-height: 32px; border-radius: var(--r-control); cursor: pointer; transition: background-color var(--dur-fast), color var(--dur-fast); }
@media (hover: hover) { .ct-text:hover { background: var(--s2); color: var(--ink); } }
.ct-text:focus-visible, .ct-filter:focus-visible, .ct-comp:focus-visible, .ct-open:focus-visible, .ct-more:focus-visible, .ct-menu button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ct-search { width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-control); background: var(--s2); color: var(--ink); font-size: 15px; }
.ct-search::placeholder { color: var(--ink2); }
.ct-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-filter { min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-control); background: var(--s1); color: var(--ink2); font-size: 13px; cursor: pointer; transition: background-color var(--dur-fast), color var(--dur-fast); }
@media (hover: hover) { .ct-filter:hover { background: var(--s2); color: var(--ink); } }
.ct-filter[aria-pressed="true"] { background: var(--s3); color: var(--ink); }
.ct-morewrap { position: relative; display: inline-block; }
.ct-moremenu { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 160px; background: var(--s3); border-radius: var(--r-control); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.ct-eramenu { min-width: 112px; }
.ct-moremenu .ct-filter { text-align: left; background: transparent; }
.ct-moremenu .ct-filter[aria-pressed="true"] { background: var(--s2); }
.ct-cols { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 16px; min-height: 0; flex: 1; }
.ct-composers, .ct-pieces { min-height: 0; overflow: auto; }
.ct-comp { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink2); text-align: left; font-size: 14px; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 44px; }
@media (hover: hover) { .ct-comp:hover { background: var(--s1); color: var(--ink); } }
.ct-comp[aria-current="true"] { background: var(--s2); color: var(--ink); }
.ct-count { color: var(--ink2); font-size: 13px; flex-shrink: 0; }
.ct-pieces-title { margin: 4px 0 4px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ink); }
.ct-list { display: flex; flex-direction: column; margin-top: 8px; }
.ct-row { position: relative; display: flex; align-items: center; min-height: 56px; content-visibility: auto; contain-intrinsic-size: auto 56px; border-radius: var(--r-control); }
@media (hover: hover) { .ct-row:hover { background: var(--s1); } }
.ct-open { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px; border: 0; background: transparent; text-align: left; color: var(--ink); cursor: pointer; border-radius: var(--r-control); }
.ct-row-title { font-size: 15px; overflow-wrap: anywhere; }
.ct-row-meta { font-size: 13px; color: var(--ink2); }
.ct-more { flex-shrink: 0; width: 44px; min-height: 44px; margin-right: 4px; border: 0; background: transparent; color: var(--ink2); font-size: 18px; cursor: pointer; border-radius: var(--r-control); }
@media (hover: hover) { .ct-more:hover { background: var(--s2); color: var(--ink); } }
.ct-menu { position: absolute; z-index: 5; right: 8px; top: calc(100% - 8px); display: flex; flex-direction: column; min-width: 200px; padding: 6px; background: var(--s3); border-radius: var(--r-control); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.ct-menu button { min-height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--ink); text-align: left; font-size: 14px; cursor: pointer; border-radius: var(--r-control); }
@media (hover: hover) { .ct-menu button:hover { background: var(--s2); } }
@media (max-width: 899px) {
  .ct-cols { grid-template-columns: minmax(0, 1fr); }
  .ct-cols[data-pane="composers"] .ct-pieces { display: none; }
  .ct-cols[data-pane="pieces"] .ct-composers { display: none; }
  /* One pane: the whole page scrolls, so the search and filters move away with the list like in the library */
  .ct-root { overflow-y: auto; overscroll-behavior: contain; }
  .ct-root > * { flex-shrink: 0; }
  .ct-cols { flex: none; display: block; }
  .ct-composers, .ct-pieces { overflow: visible; }
  /* The search stays pinned at the top of the pane while the list scrolls (the native field follows it) */
  .ct-search { position: sticky; top: 0; z-index: 3; }
}
@media (pointer: coarse) { .ct-filter { min-height: 44px; } .ct-text { min-height: 44px; } }
/* Browse header: one row (what it is, then Update archive) so the list starts high on a phone. The screen's title is
   the top bar's; the full credit and the update date show where there is room. */
.ct-facts { flex: 1; min-width: 0; align-self: center; }
.ct-facts a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 576px) {
  .ct-credit-long { display: none; }
  .ct-filters { gap: 4px; }
  .ct-filter { padding: 0 10px; }
  /* The More menu opens leftward from the button so it stays inside the screen (no sideways scroll) */
  .ct-moremenu { left: auto; right: 0; }
}
@media (prefers-reduced-motion: reduce) { .ct-text, .ct-filter { transition: none; } }

/* Classical tab matches the library: two-line rows (bold title, grey line), a column heading with its count,
   a chevron and the ink dot on the chosen composer, and adding a piece in the row menu. No artwork. */
.ct-colhead { display: flex; justify-content: space-between; padding: 8px 12px; font-size: 13px; color: var(--ink2); }
.ct-comp { position: relative; min-height: 56px; padding: 6px 8px 6px 20px; gap: 12px; }
.ct-comp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ct-comp-name { font-weight: 400; font-size: 14.5px; color: var(--ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-comp-name b, .ct-row-title .ct-comp-name b { font-weight: 700; }
.ct-row-title .ct-comp-name { font-size: inherit; overflow: visible; white-space: normal; }
.ct-pin { flex-shrink: 0; width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink2); cursor: pointer; border-radius: var(--r-control); }
@media (hover: hover) { .ct-pin:hover { background: var(--s2); color: var(--ink); } }
.ct-pin[aria-pressed="true"] { color: var(--ink); }
.ct-pin:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ct-comprow { position: relative; }
.ct-comprow .ct-comp { padding-right: 56px; }
.ct-comprow .ct-pin { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.ct-comp-text small { font-size: 12px; color: var(--ink2); line-height: 1.2; }
.ct-comp .chev { color: var(--ink2); opacity: .6; font-size: .9rem; }
.ct-comp[aria-current="true"]::before { content: ''; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--hue); }
.ct-row { min-height: 56px; border-radius: 0; }
/* Rows use content-visibility: auto, which clips what sticks out of the row: the row whose menu is open must not be clipped, and stacks above its neighbours */
.ct-row-open { content-visibility: visible; z-index: 6; }
@media (hover: hover) { .ct-row:hover { background: var(--s2); } }
.ct-open { padding: 6px 12px 6px 20px; border-radius: 0; gap: 2px; }
.ct-row-title { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.ct-row-meta { font-size: 12px; line-height: 1.2; }

/* Tools fill the height of the page. The pane is a column and the host grows into it; a tool that has its own
   scrolling lists (Classical tab) is held to the pane's height instead of growing past it. */
.tools-shell .tool-pane { display: flex; flex-direction: column; }
.tools-shell .tool-pane-host { flex: 1 0 auto; display: flex; flex-direction: column; }
.tools-shell .tool-pane-host > .tool-embedded { flex: 1 0 auto; }
.tools-shell .tool-pane:has(.classtab-tool-embedded) { overflow: hidden; padding-bottom: 12px; }
.tools-shell .tool-pane:has(.classtab-tool-embedded) .tool-pane-host { flex: 1 1 0; min-height: 0; }
.tools-shell .tool-pane-host > .classtab-tool-embedded { flex: 1 1 0; min-height: 0; height: auto; }
/* The tool scrolls its own list, so the library page behind it must not scroll: the shell is a few px taller than the page
   (and much taller under the native bar), and a scroll chained out of the list on iOS would slide the whole header up */
.library-page-body:has(.classtab-tool-embedded) { overflow: hidden; overflow: clip; overscroll-behavior: none; }

/* The line between composers and pieces, as between artists and songs in the library */
@media (min-width: 900px) {
  .ct-composers { border-right: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)); padding-right: 12px; }
}

/* Recording strip: the linked recording's progress, above the page strip on text and PDF tabs. It reads as unlinked
   until sync points exist: grey fill, "Not synced", and the tab does not follow it. Synced, the fill takes the playhead
   color and ticks show where the tab is pinned. */
.rec-strip { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; min-height: 36px; padding: 2px 0; }
.rec-strip[hidden] { display: none; }
.page-strip:not(.in-dock) ~ .rec-strip, .rec-strip:not(.in-dock) { padding-left: 14px; padding-right: 14px; }
.rec-time { flex: none; min-width: 5.5em; font: 500 12px system-ui, sans-serif; color: var(--ink2); font-variant-numeric: tabular-nums; }
.rec-track { position: relative; flex: 1 1 160px; min-width: 120px; height: 8px; border-radius: var(--r-control); background: var(--s2); cursor: pointer; touch-action: none; overflow: hidden; }
.rec-track::before { content: ''; position: absolute; inset: -14px 0; } /* a taller hit area */
.rec-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--ink2); opacity: .55; display: block; }
.rec-strip.is-synced .rec-fill { background: var(--hue); opacity: 1; }
.rec-marks { position: absolute; inset: 0; pointer-events: none; }
.rec-marks i { position: absolute; bottom: 0; height: 3px; width: 1px; background: var(--ink); opacity: .5; } /* ticks sit on the track's lower edge so the position stays readable */
.rec-fill { z-index: 1; }
.rec-head { position: absolute; z-index: 2; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--ink); }
.rec-status { flex: none; font: 500 13px system-ui, sans-serif; color: var(--ink2); }
.rec-strip.is-synced .rec-status, .rec-strip.is-tapping .rec-status { color: var(--ink); }
.rec-actions { display: inline-flex; gap: 2px; flex: none; }
.rec-actions .ct-text[disabled] { opacity: .4; pointer-events: none; }
.rec-actions .rec-done { color: var(--ink); }
/* A point that jumps back to an earlier page or line (a repeat): a wider, full-ink tick on the track */
.rec-marks i.is-back { width: 2px; height: 8px; opacity: 1; }
/* Edit list: one flat row per point, time and place on the left, Remove on the right */
.rec-points { flex: 0 0 100%; max-height: 132px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 2px; }
.rec-points[hidden] { display: none; }
.rec-point { display: flex; align-items: center; gap: 8px; min-height: 32px; border-radius: var(--r-control); }
@media (hover: hover) { .rec-point:hover { background: var(--s1); } }
.rec-point-go { flex: none; font-variant-numeric: tabular-nums; }
.rec-point-note { flex: 1 1 auto; min-width: 0; font: 500 13px system-ui, sans-serif; color: var(--ink2); }
@media (max-width: 576px) { .rec-points { grid-column: 1 / -1; grid-row: 3; } }
@media (pointer: coarse) { .rec-point { min-height: 44px; } }
.rec-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Phone width: the strip is two deliberate rows, not a wrap. Row one is the time and the track; row two is the status on
   the left and the actions on the right, so the links never drop under the track with empty space beside them. */
@media (max-width: 576px) {
  .rec-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0 12px; }
  .rec-time { grid-column: 1; grid-row: 1; min-width: 0; }
  .rec-track { grid-column: 2 / 4; grid-row: 1; min-width: 0; }
  .rec-status { grid-column: 1 / 3; grid-row: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rec-actions { grid-column: 3; grid-row: 2; justify-self: end; }
  .rec-actions:empty { display: none; }
}
.page-strip.in-dock ~ .rec-strip { order: -1; }
/* The recording bar and the page strip both stay on text and PDF tabs, as the recording bar and the bar ruler do on Guitar Pro files */
/* On Guitar Pro tabs the recording bar sits in the dock's ruler slot, directly above the bar ruler */
#scoreRecStrip { margin-bottom: 4px; }
body.rec-strip-on .dock-ruler:not(:has(.page-strip.in-dock)):has(.rec-strip) { display: block !important; }
/* The status and actions share one wrapper; it is invisible to the layouts above and only the wide dock below uses it */
.rec-end { display: contents; }
/* A long state ("Check bar 12 · 148 points from the host") shortens with an ellipsis; it never pushes Add points off the bar */
.rec-end > .rec-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Wide dock (tablet, desktop, a foldable's inner display and the short landscape phone), with a recording attached: two rows beside
   the play buttons. The recording bar (time, track, sync state, Add points) is one row that stretches from the play buttons to
   the right edge; under it sit the bar ruler, the Bar and tempo readouts and the sound switch and toggles. */
@media (min-width: 641px) {
  /* tabletop (a foldable's inner display is this wide, but the folded pose uses the phone dock) keeps the recording bar above the ruler */
  :where(html:not(.duo-tabletop)) {
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .mobile-playback-dock-inner:has(#scoreRecStrip:not([hidden])) {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-areas: none; align-items: center;
  }
  /* The ruler's wrapper steps aside so the recording bar and the ruler are grid items of their own */
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .dock-ruler:has(#scoreRecStrip:not([hidden])) { display: contents !important; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .dock-tr:has(~ .dock-ruler #scoreRecStrip:not([hidden])) { grid-column: 1; grid-row: 1 / span 2; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) #scoreRecStrip:not(.is-tapping) { grid-column: 2 / -1; grid-row: 1; min-width: 0; margin-bottom: 0; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) #scoreRecStrip .rec-track { min-width: 0; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) #scoreRecStrip .rec-end { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 0 1 auto; min-width: 0; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) #scoreRecStrip .rec-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) #barRuler { grid-column: 2; grid-row: 2; min-width: 0; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .dock-time { grid-column: 3; grid-row: 2; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .dock-bpm { grid-column: 4; grid-row: 2; }
  body.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .dock-tools { grid-column: 5; grid-row: 2; }
  /* The short landscape phone hides the Bar and tempo readouts: the cluster takes their columns */
  body.phone-reader.score-rec-strip-on:not(.reading-mode):not(.library-view-active) .dock-tools { grid-column: 3 / -1; justify-self: end; }
  }
}
/* Tablet and narrow desktop: "Synth audio | Original audio" shortens to "Synth | Original" so the progress bars keep their width */
@media (min-width: 641px) and (max-width: 899px) {
  body:not(.phone-reader) .dock-src .audio-sfx { display: none; }
}
/* Text and PDF tabs, tablet width: the bar stays on one row (the old wrap dropped Add points under the status and made the dock taller).
   While tapping or editing points it wraps as before. */
@media (min-width: 641px) {
  body:not(.phone-reader) #recordingStrip:not(.is-tapping):not(:has(.rec-points:not([hidden]))) { flex-wrap: nowrap; }
  body:not(.phone-reader) #recordingStrip:not(.is-tapping) .rec-track { flex: 1 1 0; min-width: 60px; }
  body:not(.phone-reader) #recordingStrip:not(.is-tapping) .rec-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Tab text: where the recording is, and what is pinned while tapping */
/* The block you just tapped while syncing. When following, the reading line shows the position instead. */
/* The tab text sits on paper (--sheet-bg), not on the app ground, so a ground tone (--s2) painted an opaque dark bar over
   the text. A tint of the playhead color or of the paper's own ink stays readable on any paper. */
.ts-tapping .ts-current { background: color-mix(in srgb, var(--hue) 16%, transparent); box-shadow: inset 3px 0 0 var(--hue); }
.ts-tapping [data-block] { cursor: pointer; }
@media (hover: hover) { .ts-tapping [data-block]:hover { background: color-mix(in srgb, var(--sheet-text, currentColor) 8%, transparent); } }
.ts-pinned { box-shadow: inset 3px 0 0 var(--ink2); }
.ts-pinned.ts-current { box-shadow: inset 3px 0 0 var(--hue); }
/* Reading marker: a solid playhead-colored triangle at the left edge of the tab, level with where the recording puts the
   reader. It glides down at the pace the sync points imply, so how near it is to the bottom says how soon the page
   scrolls or turns. Flat, no glow. */
.reading-line { position: absolute; left: 0; top: 0; z-index: 6; width: 0; height: 0; pointer-events: none; will-change: transform; opacity: 1; transition: opacity var(--dur-base) var(--ease-out); }
/* The marker's origin is the left edge of the text, so the arrow is drawn in the gutter to its left (the paper pads the text by 20px) */
.reading-line::before { content: ''; position: absolute; left: -16px; top: -8px; border: 8px solid transparent; border-left: 12px solid var(--hue); border-right: 0; }
body.gp-horizontal-mode .loose-line::before { left: -8px; top: -12px; border: 8px solid transparent; border-top: 12px solid var(--hue); border-bottom: 0; }
.reading-line[hidden] { display: none; }
/* While a tab loads, #output is faded out and the loading card is up; the marker lives beside #output, so it would hang over the card */
body.reader-loading .reading-line { visibility: hidden; }
/* Countdown under the arrow while the cursor is in the last staff of the page: seconds left before the page turns, then a next icon */
.reading-line-turn { position: absolute; left: -26px; top: 12px; width: 32px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--hue); line-height: 1; }
.reading-line-turn[hidden] { display: none; }
.reading-line-turn-n { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.reading-line-turn.is-up { top: auto; bottom: 12px; flex-direction: column-reverse; }
.reading-line-turn.is-up svg { transform: rotate(180deg); }
.reading-line-turn svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Playhead inside a PDF page: the Guitar Pro reader's cursor (a vertical pill with a pointed bottom, in the playhead colour,
   flat, multiplied onto a light sheet), one row of music tall, centred on the place the recording is at. */
.pdf-cursor { position: absolute; left: 0; top: 0; z-index: 6; width: 20px; margin-left: -10px; box-sizing: border-box; pointer-events: none; will-change: transform; opacity: 1; transition: opacity var(--dur-base) var(--ease-out); }
.pdf-cursor[hidden] { display: none; }
.pdf-cursor.is-off { opacity: 0; transition-duration: var(--dur-fast); }
.pdf-cursor svg { display: block; overflow: visible; }
.pdf-cursor path { fill: none; stroke: var(--hue); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
body:not(.sheet-mode-dark) .pdf-cursor svg { mix-blend-mode: multiply; }
@media (prefers-reduced-motion: reduce) { .pdf-cursor { transition: none; } }
/* Auto-scroll before Play: no marker is drawn beside the page until the clock starts */
body.auto-follow .reading-line { display: none; }
.reading-line.is-off { opacity: 0; transition-duration: var(--dur-fast); }
@media (prefers-reduced-motion: reduce) { .reading-line { transition: none; } }
@media (prefers-reduced-motion: no-preference) { .rec-fill { transition: transform 120ms linear; } }

/* Link-style action inside the tap-to-sync toolbar */
.sync-mode-bar .sm-link { background: transparent; border: 0; color: var(--ink2); font-size: 14px; padding: 6px 10px; min-height: 32px; border-radius: var(--r-control); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: background-color var(--dur-fast), color var(--dur-fast); }
@media (hover: hover) { .sync-mode-bar .sm-link:hover { background: var(--s3); color: var(--ink); } }
.sync-mode-bar .sm-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (pointer: coarse) { .sync-mode-bar .sm-link { min-height: 44px; } }

/* A Guitar Pro tab whose Original recording has no sync points: the cursor can't follow it, so it is not shown */
body.score-cursor-hidden .gp-reader-cursor,
body.score-cursor-hidden .gp-page-cursor-beat {
  display: none !important;
}

/* Sound off: a text or PDF tab has no recording to place, so the pin cursors over it are never drawn (Guitar Pro keeps its cursor: it plays at tempo) */
body.sound-off .pdf-cursor,
body.sound-off .ts-bar-cursor,
body.sound-off .txt-ribbon-playhead {
  display: none !important;
}

/* Cursor over notes set to Hide (View, Settings > Defaults): every cursor and reading marker, in every layout */
body.cursor-off .gp-reader-cursor,
body.cursor-off .gp-page-cursor-beat,
body.cursor-off .at-cursor-bar,
body.cursor-off .at-cursor-beat,
body.cursor-off .reading-line,
body.cursor-off .pdf-cursor,
body.cursor-off .ts-bar-cursor,
body.cursor-off .txt-ribbon-playhead {
  display: none !important;
}

/* A MIDI file as the sound source has no bars to loop (its player holds a one-bar placeholder) */
/* A text or PDF tab with no MIDI linked: the Synth panel offers only the link action */
body.midi-synth-none #synthDropdownPanel .synth-panel-body > :not(#synthMidiSection) { display: none !important; }
body.midi-synth-none #synthMidiRemoveBtn { display: none !important; }
body.midi-synth-source #barRuler,
body.midi-synth-source .dock-time { display: none !important; }
body.midi-synth-source:not(.txt-has-bars) #dockLoopBtn,
body.midi-synth-source:not(.txt-has-bars) .mb-3:has(#synthLoopSwitch) { display: none !important; }
body.txt-horizontal-mode #pageStrip,
body.rec-strip-on.txt-has-bars:has(#output.continuous-mode) #pageStrip { display: none !important; }
body.rec-strip-on:not(.page-strip-on):not(.doc-tab) .mobile-playback-dock-inner { grid-template-columns: auto 1fr auto auto; }

/* PDF pages: the page box is exactly the page. It was 100% of its share of the row, so a page narrower than its
   share (two portrait pages side by side on a landscape phone) sat in a wide box with extra margin each side. */
.pageContainer > .pageWrapper:has(> canvas) { width: auto !important; max-width: none !important; flex: 0 0 auto; }

/* The page number is a div inside .pageWrapper, so ".pageWrapper > div" (20px padding, full width, flex: 1) gave it a
   full-width box and a large label over the page. It is a small label in the corner. */
.pageWrapper > .pageNumber { width: auto; flex: none; padding: 2px 6px; font: 11px/1.3 system-ui, sans-serif; left: auto; top: auto; }

/* Guitar Pro on a phone: the bar ruler already shows where you are, so the scroll percentage beside the page arrows
   says the same thing twice. PDF and text tabs keep their page range, which the page strip does not spell out. */
body.phone-reader:not(.library-view-active):not(.page-strip-on) #navButtons #pageIndicator { display: none; }

/* The beat cursor is an outline drawn over the score. Where it crosses a bar number or a P.M. mark (the first beat of a
   bar) it hid them. Multiplying it into the paper keeps dark notation fully dark under the outline; it is still the
   playhead color on the paper. Not on a dark sheet, where multiplying would make it vanish. */
body:not(.sheet-mode-dark) .gp-reader-cursor svg { mix-blend-mode: multiply; }

/* Portrait phone: a panel is tall enough to show its contents without scrolling (it was 40%, which made every sheet scroll),
   up to 72% of the screen, and never under the top row. The tab stays in view above it. Landscape panels are side panels and
   keep their own limits. */
@media (orientation: portrait) {
  body.phone-reader #viewMenu, body.phone-reader #practiceMenu, body.phone-reader #guitarMenu, body.phone-reader #toolsMenu,
  body.phone-reader #scoreOptionsDropdownPanel, body.phone-reader #synthDropdownPanel, body.phone-reader #ytDropdownPanel {
    max-height: min(72vh, calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - var(--reader-bottom-nav-h, 0px) - 12px)) !important;
  }
}

/* Portrait phone: the five words' sheets open from their tab, over the strip (ruler and transport), as in tabletop, instead of
   stacking above the dock. The five words stay visible (the Sound word's Synth and Original sheets too); Song keeps its own place. */
@media (orientation: portrait) {
  :where(html:not(.duo-tabletop)) body.phone-reader:not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #synthDropdownPanel, #ytDropdownPanel) {
    bottom: var(--reader-bottom-nav-h, 0px) !important;
    max-height: min(72vh, calc(100vh - var(--topbar-h, 52px) - var(--reader-bottom-nav-h, 0px) - 12px)) !important;
  }
  /* The Original sheet keeps one height whichever source is shown; it runs down to the Sound word like the others. */
  :where(html:not(.duo-tabletop)) body.phone-reader:not(.library-view-active) #ytDropdownPanel {
    height: min(60vh, calc(100vh - var(--topbar-h, 52px) - var(--reader-bottom-nav-h, 0px) - 12px)) !important;
  }
}

/* Phone: the View sheet's Screen row (Fullscreen, Reading mode) is not needed. The phone has no fullscreen toggle to
   offer, and Reading mode already has its own toggle in the bottom bar, which is its only home. */
body.phone-reader #screenRow { display: none !important; }

/* A row with a switch keeps the switch at the row's trailing edge on a phone, level with the label, instead of wrapping
   it onto its own line under the description (the 100% width rule above is for rows with several buttons). */
@media (max-width: 899px) { .srow:has(.form-switch) { flex-wrap: nowrap; } .srow .sc:has(.form-switch) { width: auto; } }

/* Library home on a phone: the Resume card is one compact row (title, where you stopped, the one action), not 40% of the
   first screen. The cover and the mini ruler are for wider screens; the title may truncate on its own line. */
@media (max-width: 640px) {
  .resume-card { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .resume-card .resume-cover, .resume-card .ruler { display: none; }
  .resume-btn { grid-column: auto; }
  .resume-title { font-size: 24px; }
}

/* Original audio panel: the Source switch reads as a switch (its own darker track), not one filled word beside bright text,
   and in portrait the sheet keeps one height whichever source is shown, so it does not jump when you switch. */
@media (orientation: portrait) { body.phone-reader #ytDropdownPanel { height: min(60vh, calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - var(--reader-bottom-nav-h, 0px) - 12px)) !important; } }
/* Text pages are scaled to the page width, so they never scroll sideways */
/* Text pages: a line wider than the page at the smallest legible size scrolls sideways instead of being cut off */
.pageContainer > .pageWrapper:has(.text-line) { overflow-x: hidden; overflow-y: hidden; }

/* ---------- iOS 26 system tab bar ----------
   On iOS 26 and later the app shows the system tab bar (Liquid Glass, drawn by the OS, see nativeTabBar.js) in place
   of the HTML one. It overlays the page, so pages reserve its height, reported by the native side. Only this system
   chrome is glass; everything the web draws stays flat. If the native bar fails or is unavailable the class is never
   set and the HTML bar stays. */
body.native-tabbar .library-bottom-nav,
body.native-rail .library-bottom-nav { display: none !important; }
/* Wider than a phone (the iPhone Duo's strip layouts): the native rail replaces the web rail, so the page keeps no room for it */
body.native-tabbar,
body.native-rail { --rail-w: 0px; }
/* On iOS (iPhone Duo), the native rail sits in the side safe area reported by the plugin */
html.tauri-ios body.native-tabbar.library-view-active #libraryPage,
html.tauri-ios body.native-rail.library-view-active #libraryPage,
body.native-tabbar:not(.native-rail).library-view-active #libraryPage {
  padding-left: max(env(safe-area-inset-left, 0px), var(--native-rail-left, 0px));
  padding-right: max(env(safe-area-inset-right, 0px), var(--native-rail-right, 0px));
}
/* On macOS, the native rail sits on the left */
html.tauri-macos body.native-rail.library-view-active #libraryPage {
  padding-left: var(--native-rail-w, 88px) !important;
}
html.tauri-macos body.native-rail.library-view-active #topBar {
  padding-left: var(--native-rail-w, 88px) !important;
}
/* The horizontal bar overlays the page at every width, so pages reserve its height; the side rail is already a safe-area inset */
html:not(.native-vertical) body.native-tabbar.library-view-active .library-page-body { padding-bottom: calc(var(--native-tabbar-h, 83px) + 1rem) !important; }
html:not(.native-vertical) body.native-tabbar .setpage { padding-bottom: calc(var(--native-tabbar-h, 83px) + 16px) !important; }
/* The Classical tab list scrolls under the native bar like the library does: the shell runs to the bottom of the screen
   and the list's own bottom padding keeps the last row clear of the bar */
html:not(.native-vertical) body.native-tabbar .tools-shell .setpage:has(.classtab-tool-embedded) { padding-bottom: 0 !important; }
html:not(.native-vertical) body.native-tabbar .classtab-tool-embedded .ct-root { padding-bottom: calc(var(--native-tabbar-h, 83px) + 16px); }
@media (max-width: 576px) {
  html:not(.native-vertical) body.native-tabbar .tools-shell:has(.classtab-tool-embedded) { height: calc(100% + 44px + var(--native-tabbar-h, 83px) - 28px); }
}

/* The native search field (see nativeTabBar.js) stands in for the page's own while it is shown; the web field stays
   in the DOM, hidden, because it holds the search logic */
body.native-search:not(.native-search-pane) .library-search-box { display: none !important; }
/* ...and it floats at the top of the window, so the page starts below it */
body.native-search:not(.native-search-pane).library-view-active .library-page-body { padding-top: 0 !important; }
body.native-search:not(.native-search-pane) .library-page-container { padding-top: calc(var(--native-search-top, 0px) - 4px) !important; }
/* Inside a Tools pane (Open file, Classical tab) it is laid over the page's own field, which keeps its space but is not drawn */
body.native-search .tool-pane-host .library-page-container { padding-top: 12px !important; }
body.native-search .tool-pane-host .library-search-box { display: flex !important; visibility: hidden; }
body.native-search .tool-pane-host .library-search-box * { visibility: hidden; }
body.native-search .tool-pane-host .library-search-box .btn { display: none; }
body.native-search .classtab-tool-embedded .ct-search { visibility: hidden; }

/* iPhone Duo and other devices whose system keeps its status in a vertical strip at the screen edge (see nativeTabBar.js):
   the reader's top bar stays clear of it, as the library's rail does */
html.native-vertical body:not(.library-view-active) { --wc-r: max(calc(var(--native-rail-right, 0px) - 12px), 0px); }

/* iPhone Duo held upright: the system's status cluster takes the top-right corner of the top band. The reader's top bar is two rows:
   back and the song title/menu in the first, left of the cluster; View through Tools and the page buttons in the second. */
html.native-status-corner body:not(.library-view-active):not(.phone-reader) #topBar {
  display: grid; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto auto; align-items: center; row-gap: 0;
  padding-top: 28px;
}
html.native-status-corner body:not(.library-view-active):not(.phone-reader) #brandSection { padding-right: var(--native-status-r, 0px); min-height: 44px; }
html.native-status-corner body:not(.library-view-active):not(.phone-reader) #rightSection { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; min-width: 0; width: 100%; }
html.native-status-corner body:not(.library-view-active):not(.phone-reader) #navButtons { margin-left: auto; }
/* Reading mode takes the whole bar out of the layout (it is taller than the 56px style.css assumes), so the page starts at the top */
html.native-status-corner body:not(.library-view-active):not(.phone-reader) #topBar.hud-hidden:not(.hud-transient) { margin-top: calc(-1 * var(--topbar-h, 114px)); }

/* Bottom dock on a device whose system bars live at the screen's side (iPhone Duo): there is no bottom bar under the dock, so it keeps
   only a part of the home-indicator inset instead of leaving the whole of it as empty space */
html.native-vertical body:not(.library-view-active):not(.phone-reader) .mobile-playback-dock-inner {
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px) * 0.4);
}

/* The fretboard sits above the bottom dock, which already clears the home indicator, so it keeps only a small pad of its own
   (its full inset showed as an empty band between the strings and the controls on tablets and foldables) */
body:not(.library-view-active):not(.dock-off) .fretboard-dock { padding-bottom: 6px; }

/* ==========================================================================
   Tabletop: an iPhone Duo folded with the crease across (src/foldState.js sets html.duo-tabletop, --fold-top and --fold-h).
   The score fills the top half, the crease stays empty, and everything you touch is in the bottom half: the strip, the
   five words, and the sheets (which open over the song row, from the strip up to the crease, so the score is never covered).
   The phone reader chrome does the rest (src/utils/narrowAlias.js restates its narrow-screen rules for this pose).
   The top bar (back, song name, page buttons) sits in the bottom half too. Nothing is open until a word is pressed.
   Reading mode does not exist here: the bottom half is the controls.
   ========================================================================== */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) {
  --dt-controls-top: calc(var(--fold-top, 50dvh) + var(--fold-h, 0px));
  --dt-target: 56px;                                  /* every press target in this pose */
  --dt-row: 48px;                                     /* the song row: shorter than the keys, so the title sits close under the hinge */
  --dt-gap: 10px;                                     /* air between the rows of the controls half */
  --tabs-h: calc(2 * (max(14px, env(safe-area-inset-bottom, 0px) * 0.47) + 9px));   /* the label sits 14px or more above the edge (clear of the home indicator) and is centered in its button, so the button is twice that to the label's center */
  --reader-bottom-nav-h: var(--tabs-h);
  padding-bottom: var(--tabs-h) !important;
}
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #mainContent {
  flex: none; height: var(--fold-top, 50dvh); min-height: 0; padding-top: 0 !important;
}
/* The page fills the score half from its top edge to the fold line (PDF and text pages) */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #output:not(.continuous-mode) { padding-top: 0 !important; padding-bottom: 0 !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #output:not(.continuous-mode) .pageContainer { padding-top: 0 !important; padding-bottom: 0 !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #output.continuous-mode { padding-top: calc(env(safe-area-inset-top, 0px) + 12px) !important; }
/* the transport sits at the bottom of the controls half, over the five words */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .mobile-playback-dock { margin-top: auto; margin-bottom: var(--dt-slack, 0px); }

/* The top bar (back, song name, page buttons) moves down into the controls half: one row at its top, under the crease.
   It stays in view; a sheet opens below it, down to the transport. */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #topBar {
  top: var(--dt-controls-top); bottom: auto; z-index: 1040;
  flex-wrap: nowrap; padding: 0 max(env(safe-area-inset-right, 0px), 8px) 0 max(env(safe-area-inset-left, 0px), 8px) !important;
  background: var(--s1) !important; min-height: var(--dt-row); height: var(--dt-row);
}
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #brandSection { min-height: var(--dt-row); gap: 4px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #topBarBackToLibraryBtn { width: var(--dt-row); min-width: var(--dt-row); height: var(--dt-row); min-height: var(--dt-row); }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .top-bar-song-btn { min-height: var(--dt-row); height: var(--dt-row); }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .top-bar-song-btn .breadcrumb-song-title { font-size: 18px; }

/* One row of large keys (tabletopRows.js moves the page buttons in): restart, play, Synth | Original, previous, next. All 64px tall. */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools .dock-src { flex: 1 1 0; min-width: 0; margin: 0; transform: none; height: 64px; padding: 2px; align-items: stretch; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools .dock-src .rbtn { flex: 1 1 0; min-height: 60px; height: 60px; padding-inline: 8px; font-size: 16px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools .dock-src .rbtn::after { top: -2px; bottom: -2px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools .dock-src .audio-sfx { display: none; }
/* the transport row: restart, play and the page buttons share it, 64px tall, the page buttons wide */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools { grid-column: 2 / 4; justify-content: flex-end; align-items: center; min-width: 0; gap: 8px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools #navButtons { display: flex !important; align-items: center; gap: 8px; margin: 0; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools #navButtons #pageIndicator { display: none; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools #navButtons .btn { width: 76px; min-width: 76px; height: 64px; min-height: 64px; font-size: 22px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(#mobileRewindBtn, #mobilePlayPauseBtn) { width: 64px; min-width: 64px; height: 64px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tr { gap: 8px; }
/* Play is the one primary: the same rounded key as its neighbours, filled with the action color, not the brand pick */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #mobilePlayPauseBtn { width: 96px; min-width: 96px; background: var(--action) !important; border-radius: var(--r-control) !important; transition: transform var(--dur-fast) var(--ease-out); }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #mobilePlayPauseBtn svg.pk { display: none; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #mobilePlayPauseBtn i { margin-top: 0; font-size: 2.25rem; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #mobilePlayPauseBtn:active { transform: translateY(1px); }
/* a real control shows its shape: restart and the page buttons take one tone step (play is the one primary) */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(#mobileRewindBtn, .dock-tools #navButtons .btn) { background: var(--s2) !important; border-radius: var(--r-control) !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(#mobileRewindBtn, .dock-tools #navButtons .btn):active { background: var(--s3) !important; }
/* The five words, the transport and the strip: large targets with room between them */
/* The five words are tabs: the open one is the sheet's own tone and joins it with square top corners (no rounding where it meets the sheet) */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) > #topFlexZone .btn { border-radius: 0 0 var(--r-control) var(--r-control) !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) > #topFlexZone .btn:is([aria-expanded="true"], .active) { background: var(--s2) !important; }
/* the labels hug the bottom edge, clear of the home indicator */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) > #topFlexZone .btn { align-items: center; padding-bottom: 4px !important; font-size: 16px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #topFlexZone .btn { min-height: var(--tabs-h); font-size: 16px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fretboard-dock { bottom: calc(var(--dock-h, 0px) + var(--tabs-h)) !important; }
/* One tone from the crease down: the song row, the strip and the five words are all --s1, so where there is no fretboard (PDF,
   text, MIDI) the empty band is the same tone and reads as rest, not as a missing block */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) { background: var(--s1) !important; }
/* The fretboard is always shown here (fretboardController.js), just above the strip. The
   score half keeps its size: the dock's height must not feed the score's own fretboard-open sizing. */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) { --fretboard-effective-h: 0px !important; }
html.duo-tabletop body.phone-reader.fretboard-open:not(.reading-mode):not(.library-view-active) #output:not(.continuous-mode) { height: 100% !important; max-height: 100% !important; padding-bottom: 4px !important; }
html.duo-tabletop body.phone-reader.fretboard-open:not(.reading-mode):not(.library-view-active) #output.continuous-mode { padding-bottom: 24px !important; }
/* The fretboard keeps its drawn proportions: the dock is as tall as its track labels plus the board, sits just above the strip,
   and the spare height of the controls half is left between the song row and the dock. */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fretboard-dock {
  top: auto; bottom: calc(var(--dock-h, 0px) + var(--tabs-h) + var(--dt-slack, 0px) * 2) !important; height: auto; padding-bottom: 0; z-index: 1030;
}
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fretboard-dock-header { padding: 0 12px; height: 48px; min-height: 0; flex-wrap: nowrap; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fretboard-neck-wrapper { padding: 0 8px 4px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #fretboardSvgContainer svg { width: 100%; height: auto; display: block; }
html.duo-tabletop #fretboardDockBtn, html.duo-tabletop #fretboardCloseBtn { display: none !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fretboard-dock :is(button, .btn, .fb-track) { min-height: 44px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fretboard-mode-pills { height: 44px !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .fb-track { font-size: 16px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .mobile-playback-dock-inner { gap: var(--dt-slack, 16px) 8px; padding-top: 2px; padding-bottom: 0; }   /* the ruler to the buttons is one of the shared gaps too */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #fretboardDockBtn { width: var(--dt-target) !important; min-width: var(--dt-target) !important; height: var(--dt-target); }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-src .rbtn { min-height: 48px; height: 48px; padding-inline: 14px; font-size: 15px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-src .rbtn::after { top: -4px; bottom: -4px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(.ruler, .ruler svg, .ruler-labels, .page-strip-track) { height: 32px; }

/* Sheets cover everything in the bottom half except the five words, which stay visible: the selected word closes its sheet.
   Same height and top edge for every one, scrolling inside. */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) {
  top: var(--dt-controls-top) !important; bottom: var(--tabs-h) !important; height: auto !important; max-height: none !important;
  padding: 12px 16px 16px !important; z-index: 1050; border-radius: 0 !important; overscroll-behavior: contain;
}
/* The sound panels (Synth, Original) and the Song panel have no close X: the Sound word, a press outside or Escape closes them. The buttons stay in the DOM
   because readerPanels.js and readerViewMenu.js close the panels by clicking them. */
#synthPanelCloseBtn, #ytPanelCloseBtn, #scoreOptionsPanelCloseBtn { display: none !important; }
/* Controls inside a sheet */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) :is(button, .btn, [role="tab"], [role="radio"], select) { min-height: var(--dt-target) !important; height: auto; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) #practiceMenu :is(#practiceSlower, #practiceFaster, #synthLoopStartMinusBtn, #synthLoopStartPlusBtn, #synthLoopEndMinusBtn, #synthLoopEndPlusBtn) { width: var(--dt-target); min-width: var(--dt-target); height: var(--dt-target) !important; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu) .form-check-input { font-size: 30px; }
html.duo-tabletop #readingToggleBtn { display: none !important; }
/* Reading mode is the open-book button at the end of the transport row, the same control as on a portrait phone */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools #readingDockBtn { display: inline-flex !important; flex: 0 0 64px; width: 64px !important; min-width: 64px !important; height: 64px !important; min-height: 64px; margin: 0; padding: 0 !important; align-items: center; justify-content: center; background: var(--s2) !important; border-radius: var(--r-control) !important; font-size: 1.6rem; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tools #readingDockBtn[aria-pressed="true"] { background: var(--s3) !important; }

/* Book (iPhone Duo folded with the crease up and down): two pages, one on each half, with the crease between them.
   foldState.js sets html.duo-book and --fold-left / --fold-w. The normal reader chrome stays (the width is a regular one). */
html.duo-book :is(.gp-page-container, .pageContainer) { gap: var(--fold-w, 10px); padding-inline: 0; }

/* Reading mode on macOS and Windows: the top bar is gone, so a thin invisible strip along the top keeps the window draggable (double-click maximizes).
   On Windows it sits under the caption buttons; on macOS the traffic lights are native and draw above it. */
#readingDragStrip { display: none; }
html:is(.tauri-macos, .tauri-windows) body.reading-mode:not(.library-view-active):not(.phone-reader) #readingDragStrip { display: block; position: fixed; top: 0; left: 0; right: 0; height: 20px; z-index: 1000; background: transparent; }

/* The transport row: every gap between its keys is the same 8px, as at the edges */
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .mobile-playback-dock-inner { column-gap: 8px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-tr { gap: 8px; }

/* Size cap: the slider thumb takes the ink tone at the limit, the readout names it */
#gpSheetScale[data-cap="max"]::-webkit-slider-thumb, #gpSheetScale[data-cap="min"]::-webkit-slider-thumb { background: var(--ink); }
#gpSheetScale[data-cap="max"]::-moz-range-thumb, #gpSheetScale[data-cap="min"]::-moz-range-thumb { background: var(--ink); }

/* Live pinch readout: mirrors the Size slider from the gesture value, not from the re-render */
#pinchScaleReadout {
  position: fixed; z-index: 10000; left: 50%; bottom: calc(var(--dock-h, 0px) + var(--fretboard-effective-h, 0px) + 16px);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 240px; max-width: calc(100% - 32px);
  background: var(--s3); color: var(--ink); border-radius: var(--r-card); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  font-size: 0.9rem; pointer-events: none;
  opacity: 0; transform: translateX(-50%) translateY(12px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
#pinchScaleReadout.is-shown { opacity: 1; transform: translateX(-50%); transition-duration: var(--dur-base); }
#pinchScaleReadout .pinch-scale-label { color: var(--ink2); }
#pinchScaleReadout .pinch-scale-track { flex: 1; height: 6px; border-radius: 3px; background: var(--s2); overflow: hidden; }
#pinchScaleReadout .pinch-scale-fill { display: block; height: 100%; background: var(--hue); transform-origin: left; }
#pinchScaleReadout[data-cap="max"] .pinch-scale-fill, #pinchScaleReadout[data-cap="min"] .pinch-scale-fill { background: var(--ink); }
#pinchScaleReadout .pinch-scale-value { font-weight: 600; min-width: 5.5em; text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { #pinchScaleReadout, #pinchScaleReadout.is-shown { transition: none; } }

/* ===== Video sheet (src/ytSheet.js) =====
   The YouTube player lives here, not in the Original panel: it must be on the screen while it plays. It opens when
   YouTube starts playing and overlaps the page (the page never reflows for it). The person can push it down to a peek:
   the whole sheet moves down by --yt-d and is clipped by the same amount at the bottom, where it would pass over the
   strip, so the top slice of the video stays on the screen. Rows: grabber, video. Nothing of ours is drawn over the video. */
.yt-sheet {
  --yt-d: 0px; --yt-h: 200px; --yt-w: 356px; --yt-grab-h: 28px;
  position: fixed; z-index: 1047; right: 16px; width: min(var(--yt-w), 100%); /* above the fretboard dock (1040), whose slide would otherwise pass over the video; below the panels (1050+) */
  bottom: calc(var(--dock-h, 0px) + var(--fretboard-effective-h, 0px));
  pointer-events: none;
  opacity: 0; visibility: hidden; translate: 0 24px;
  transform: translateY(var(--yt-d)); clip-path: inset(0 0 var(--yt-d) 0);
  transition: opacity var(--dur-fast) var(--ease-out), translate var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out),
              clip-path var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-fast);
}
.yt-sheet.is-shown {
  opacity: 1; visibility: visible; translate: 0 0; pointer-events: auto;
  transition: opacity var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
              clip-path var(--dur-base) var(--ease-out), visibility 0s;
}
.yt-sheet.is-dragging { transition: none; }
@media (pointer: coarse) { .yt-sheet { --yt-grab-h: 44px; } }
.yt-sheet-head { display: flex; align-items: center; height: var(--yt-grab-h); background: var(--s2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.yt-sheet-grab {
  flex: 1; display: flex; align-items: center; justify-content: center; height: 100%; padding: 0; border: 0; cursor: grab;
  background: transparent; touch-action: none;
}
.yt-sheet-grab:active { cursor: grabbing; }
.yt-sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--ink2); }
.yt-sheet-grab:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.yt-sheet-video { position: relative; height: var(--yt-h); background: var(--s1); }
.yt-sheet .yt-iframe-wrapper { position: absolute; inset: 0; background: var(--s1); border: 0; border-radius: 0; overflow: hidden; }
.yt-sheet .yt-iframe-wrapper > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-sheet .yt-state-card { background: var(--s1); border: 0; color: var(--ink); }
.yt-sheet .yt-state-card .text-muted { color: var(--ink2) !important; }

/* Desktop: the minimum-size player at the right, over the page. The menus (the sound panels included) open over it.
   Desktop widths (over 1024px, not the phone reader) have no grabber row: the player cannot be lowered there (see canLower() in ytSheet.js). */
@media (min-width: 1025px) {
  body:not(.phone-reader) .yt-sheet-head { display: none; }
}

/* Phone, portrait: full width above the fretboard and the five words, and every sheet that opens stays above it */
@media (max-width: 640px) {
  body.phone-reader .yt-sheet { left: 0; right: 0; margin-inline: auto; width: min(var(--yt-w), 100%); border-radius: var(--r-lg) var(--r-lg) 0 0;
    bottom: calc(var(--dock-h, 0px) + var(--reader-bottom-nav-h, 0px) + var(--fretboard-effective-h, 0px)); }
  body.phone-reader.yt-sheet-open :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #synthDropdownPanel, #ytDropdownPanel) {
    bottom: calc(var(--dock-h, 0px) + var(--reader-bottom-nav-h, 0px) + var(--fretboard-effective-h, 0px) + var(--yt-sheet-h, 0px)) !important;
    max-height: calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - var(--reader-bottom-nav-h, 0px) - var(--fretboard-effective-h, 0px) - var(--yt-sheet-h, 0px) - 12px) !important;
  }
  body.phone-reader.yt-sheet-open #scoreOptionsDropdownPanel {
    max-height: calc(100vh - var(--topbar-h, 52px) - var(--dock-h, 0px) - var(--reader-bottom-nav-h, 0px) - var(--fretboard-effective-h, 0px) - var(--yt-sheet-h, 0px) - 12px) !important;
  }
}
/* Desktop: the video is a native view on macOS and draws above the page, so no menu may reach it. Every reader menu ends above the sheet. */
@media (min-width: 641px) {
  body:not(.phone-reader).yt-sheet-open :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) {
    max-height: calc(100vh - var(--topbar-h, 52px) - 8px - var(--dock-h, 0px) - var(--fretboard-effective-h, 0px) - var(--yt-sheet-h, 0px) - 12px) !important;
    overflow-y: auto !important;
  }
}
/* Short landscape phone: a column on the right, at least 200 high for the video, with the right-hand panels beside it */
@media (orientation: landscape) and (max-height: 500px) {
  body.phone-reader .yt-sheet { left: auto; right: env(safe-area-inset-right, 0px); margin-inline: 0; width: min(var(--yt-w), 100%); bottom: var(--dock-h, 0px); }
  body.phone-reader.yt-sheet-open :is(#synthDropdownPanel, #ytDropdownPanel) { right: calc(env(safe-area-inset-right, 0px) + var(--yt-sheet-w, 356px)) !important; bottom: var(--dock-h, 0px) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .yt-sheet, .yt-sheet.is-shown { transition: none; translate: 0 0; }
}

/* Tabletop (iPhone Duo folded, crease across): the video sheet takes the fretboard's band, above the strip. With Video chosen the
   fretboard steps aside; with Fretboard chosen (the switch in the sheet's bar) the sheet is lowered to its peek and the fretboard sits
   above it. Panels end above the sheet. The switch shows only where there is a fretboard (a Guitar Pro song). */
.yt-sheet-switch { display: none; flex: none; gap: 4px; padding-right: 8px; }
.yt-sheet-switch .btn { min-height: 44px; color: var(--ink2); background: transparent; border: 0; border-radius: var(--r-control); }
.yt-sheet-switch .btn[aria-pressed="true"] { background: var(--s3); color: var(--ink); }
html.duo-tabletop body.phone-reader.fretboard-open:not(.reading-mode):not(.library-view-active) .yt-sheet-switch { display: inline-flex; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .yt-sheet {
  left: 0; right: 0; margin-inline: auto; width: min(var(--yt-w), 100%); z-index: 1032;
  bottom: calc(var(--dock-h, 0px) + var(--tabs-h) + var(--dt-slack, 0px) * 2);
}
html.duo-tabletop body.phone-reader.yt-sheet-open:not(.yt-sheet-peek):not(.reading-mode):not(.library-view-active) .fretboard-dock { display: none !important; }
html.duo-tabletop body.phone-reader.yt-sheet-peek:not(.reading-mode):not(.library-view-active) .fretboard-dock {
  bottom: calc(var(--dock-h, 0px) + var(--tabs-h) + var(--yt-sheet-h, 0px) + var(--dt-slack, 0px) * 3) !important;
}
html.duo-tabletop body.phone-reader.yt-sheet-open:not(.reading-mode):not(.library-view-active) :is(#viewMenu, #practiceMenu, #guitarMenu, #toolsMenu, #scoreOptionsDropdownPanel, #synthDropdownPanel, #ytDropdownPanel) {
  bottom: calc(var(--dock-h, 0px) + var(--tabs-h) + var(--yt-sheet-h, 0px) + var(--dt-slack, 0px) * 2) !important;
}

/* The library has no reader chrome: the video sheet is never shown there */
body.library-view-active .yt-sheet { display: none !important; }

/* Remembered videos (Original panel): rows like the Recording and Backing rows; in removal mode each carries its own Remove */
.vrow { display: flex; gap: 6px; align-items: stretch; }
.vrow .slot { flex: 1; min-width: 0; text-align: left; }
.vrow-remove { flex: none; align-self: center; color: var(--danger) !important; background: transparent !important; border: 0 !important; min-height: 44px; max-width: 45%; text-align: right; white-space: normal; }
/* Edit mode: Move and Remove go on a row of their own under the recording, so its title and details keep the whole width */
.vrow:has(.vrow-move, .vrow-remove) { flex-wrap: wrap; justify-content: flex-end; }
.vrow:has(.vrow-move, .vrow-remove) .slot { flex: 1 0 100%; }
.vrow:has(.vrow-move, .vrow-remove) :is(.vrow-move, .vrow-remove) { max-width: none; min-height: 36px; }
.vrow-move { flex: none; align-self: center; background: transparent !important; border: 0 !important; min-height: 44px; max-width: 35%; text-align: right; white-space: normal; }
.vrow-remove.is-armed { font-weight: 600; }
.vrow-copy.is-armed .t b { color: var(--danger); }
.vrow.is-missing .slot { opacity: 0.7; }
/* A stem sits under the recording it was split from */
.vrow-nested { margin-left: 20px; }
.yt-danger-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.yt-danger-row .rec-text-btn { color: var(--danger) !important; }

.vrow .slot .t b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Library rows: file type and audio sit with the meta; on a narrow row the artist/album and tuning give way, these stay whole */
.library-song-row .sub .song-format, .library-song-row .sub .song-audio, .library-song-row .sub .song-mapped { flex: none; overflow: visible; }

/* ---------- Bulk Export Tool (Tools > Bulk export) ---------- */
.tools-shell .tool-pane:has(.bulkexport-tool-embedded) { overflow-y: auto; padding-bottom: 24px; }
.bulkexport-tool-embedded, .missingtabs-tool-embedded, .bulkimport-tool-embedded { height: 100%; display: flex; flex-direction: column; }
.tools-shell .tool-pane:has(.bulkimport-tool-embedded) { overflow-y: auto; padding-bottom: 24px; }
/* Bulk import: flat rows on the ground ladder, one tone step for an open row, no outlines */
.imp-root { max-width: 860px; }
.imp-strategies { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.imp-strategies legend { float: none; width: auto; margin: 0 0 4px; padding: 0; font-size: 14px; }
.imp-strategy { min-height: 44px; }
.imp-help { margin-top: 6px; max-width: 60ch; }
.imp-top { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.imp-actions { margin-top: 0; gap: 4px 16px; }
.imp-strategy-pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.imp-strategy-pick .form-select { width: auto; }
.imp-list { display: flex; flex-direction: column; }
.imp-row { content-visibility: auto; contain-intrinsic-size: auto 56px; border-radius: var(--r-control); }
.imp-row.is-open { background: var(--s1); content-visibility: visible; }
@media (hover: hover) { .imp-row:not(.is-open):hover { background: var(--s1); } }
.imp-line { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px; }
.imp-check { flex-shrink: 0; margin: 0; width: 20px; height: 20px; }
.imp-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.imp-file { font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere; }
.imp-sugg { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.imp-sugg.is-none { color: var(--ink2); }
.imp-sub { color: var(--ink2); font-size: 12.5px; }
.imp-state { flex: 0 1 140px; font-size: 12.5px; color: var(--ink2); text-align: right; }
.imp-row.is-attention .imp-state { color: var(--ink); font-weight: 600; }
.imp-row.is-out .imp-sugg, .imp-row.is-out .imp-file { opacity: .6; }
.imp-change { flex-shrink: 0; }
.imp-search { padding: 4px 10px 12px 42px; display: flex; flex-direction: column; gap: 8px; }
.imp-search-bar { display: flex; align-items: center; gap: 8px; }
.imp-results { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.imp-result { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0; background: transparent; color: var(--ink); padding: 8px 10px; min-height: 44px; border-radius: var(--r-control); cursor: pointer; }
@media (hover: hover) { .imp-result:hover { background: var(--s2); } }
.imp-result.is-picked { background: var(--s3); }
.imp-kind { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.imp-kind-btn[aria-pressed="true"] { background: var(--s3); color: var(--ink); }
.imp-mode-bar { margin-bottom: 16px; }
/* Bulk import's fields: a tone step on the ground, no outline, the platform's control radius. The older library-page rules in
   style.css are !important, so these match them. */
.imp-root :is(.form-control, .form-select), .library-page-view .imp-root :is(.form-control, .form-select), .library-page-view .imp-root select.form-select {
  background-color: var(--s3) !important; border: 0 !important; border-radius: var(--r-control) !important; color: var(--ink) !important;
  min-height: 36px; box-shadow: none !important; font-size: 14px !important;
}
.library-page-view .imp-root select.form-select {
  padding: 0.25rem 2rem 0.25rem 0.75rem !important;
  background-image: var(--select-chevron) !important; background-repeat: no-repeat !important; background-position: right 10px center !important; background-size: 14px 14px !important;
}
@media (hover: hover) and (pointer: fine) { .library-page-view .imp-root select.form-select:hover { background-color: var(--s3) !important; color: var(--ink) !important; } }
.library-page-view .imp-root :is(.form-control, .form-select):focus, .library-page-view .imp-root select.form-select:focus {
  background-color: var(--s3) !important; color: var(--ink) !important; box-shadow: 0 0 0 2px var(--ink2) !important; outline: 0 !important;
}
.library-page-view .imp-root .form-control::placeholder { color: var(--ink2) !important; opacity: 1; }
@media (pointer: coarse) { .imp-root :is(.form-control, .form-select), .library-page-view .imp-root :is(.form-control, .form-select) { min-height: 44px; } }
.imp-row.is-have .imp-sugg, .imp-row.is-have .imp-file { opacity: .6; }
.imp-custom { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 4px; }
.imp-custom-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
@media (max-width: 576px) { .imp-custom-fields { grid-template-columns: minmax(0, 1fr); } }
.imp-fallback { min-height: 44px; align-items: flex-start; padding-top: 6px; }
.imp-result:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.imp-result-main { font-size: 14px; }
@media (max-width: 576px) {
  .imp-line { flex-wrap: wrap; }
  .imp-state { order: 3; flex-basis: auto; text-align: left; }
  .imp-search { padding-left: 10px; }
}
.tools-shell .tool-pane:has(.missingtabs-tool-embedded) { overflow-y: auto; padding-bottom: 24px; }
.missingtabs-list { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 4px; }
.missingtabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: var(--r-control); transition: background-color var(--dur-fast); content-visibility: auto; contain-intrinsic-size: auto 48px; }
@media (hover: hover) { .missingtabs-row:hover { background: var(--s1); } }
.missingtabs-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.missingtabs-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.missingtabs-sub { font-size: 12.5px; color: var(--ink2); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.missingtabs-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Fill in missing tabs: the run's progress and the browser walkthrough. Flat, tone steps, ink only. */
.fill-progress { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.fill-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.fill-progress-head span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fill-error { color: var(--ink); }
.fill-guide { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--s1); }
.fill-guide-title { font-size: 28px; line-height: 1.1; white-space: normal; overflow: visible; }
.fill-guide-wait { margin: 0; }
.fill-guide-nav { margin-top: 4px; }
.fill-guide-link { display: flex; gap: 8px; }
.fill-guide-link .form-control { flex: 1; min-width: 0; }
/* A button with a menu of the search providers beside it: two halves, one tone, the menu floats with the plain shadow */
.fill-split { position: relative; display: inline-flex; gap: 1px; }
.fill-split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fill-split-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 8px; padding-right: 8px; }
.fill-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 220px; display: flex; flex-direction: column; padding: 4px; border-radius: var(--r-card); background: var(--s2); box-shadow: var(--shadow-float); }
.fill-menu-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; min-height: 36px; padding: 6px 12px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink); font: inherit; text-align: left; }
.fill-menu-note { color: var(--ink2); font-size: 12.5px; }
@media (hover: hover) { .fill-menu-item:hover { background: var(--s3); } }
.fill-menu-item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
@media (pointer: coarse) { .fill-menu-item { min-height: 44px; } }
.missingtabs-row:has(.fill-menu) { content-visibility: visible; }
.missingtabs-row .fill-menu { left: auto; right: 0; }
@media (pointer: coarse) { .missingtabs-row .fill-split-caret { min-width: 44px; } }
@media (pointer: coarse) {
  .missingtabs-row { min-height: 52px; padding: 8px 12px; }
  .missingtabs-row .btn { min-height: 44px; min-width: 72px; }
}
.be-field { flex-direction: column; align-items: flex-start; gap: 6px; max-width: 360px; cursor: default; }
.be-field .form-select { width: 100%; }
.be-root { display: flex; flex-direction: column; gap: 16px; max-width: 760px; padding-bottom: 24px; }

.be-modes { display: inline-flex; align-items: center; background: var(--s1); border-radius: var(--r-control); padding: 3px; gap: 2px; align-self: flex-start; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.be-mode-btn { padding: 6px 14px; min-height: 36px; border: 0; border-radius: calc(var(--r-control) - 2px); font-size: 13.5px; font-weight: 500; color: var(--ink2); background: transparent; cursor: pointer; white-space: nowrap; transition: background-color var(--dur-fast), color var(--dur-fast); }
@media (hover: hover) { .be-mode-btn:hover { color: var(--ink); } }
.be-mode-btn[aria-selected="true"] { background: var(--s3); color: var(--ink); font-weight: 600; }
.be-mode-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.be-section { display: flex; flex-direction: column; gap: 14px; }
.be-card { background: var(--s1); border-radius: var(--r-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.be-stats-row { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.be-info-sub { font-size: 12px; color: var(--ink2); line-height: 1.3; }

.be-option { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; cursor: pointer; }
.be-option .form-check-input { flex-shrink: 0; margin: 0; }
.be-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.be-option-title { font-size: 14px; color: var(--ink); }
.be-option-sub { font-size: 12px; color: var(--ink2); }

.be-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 44px; margin-top: 4px; }
.be-status { font-size: 13.5px; color: var(--ink2); }
.be-progress-track { width: 100%; height: 6px; background: var(--s2); border-radius: 3px; overflow: hidden; }
.be-progress-fill { height: 100%; background: var(--action); transition: width var(--dur-fast) var(--ease-out); }

.be-dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 20px; background: var(--s2); border: 0; border-radius: var(--r-card); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.be-dropzone.is-dragover { background: var(--s3); }
@media (hover: hover) { .be-dropzone:hover { background: var(--s3); } }
.be-dropzone:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.be-dropzone-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.be-dropzone-sub { font-size: 12.5px; color: var(--ink2); }

.be-listhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--ink2); margin-top: 4px; }
.be-listhead-actions { display: flex; align-items: center; gap: 8px; }

.be-file-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; background: var(--s1); border-radius: var(--r-card); padding: 6px; }
.be-file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 4px 10px; border-radius: var(--r-control); transition: background-color var(--dur-fast); }
@media (hover: hover) { .be-file-row:hover { background: var(--s2); } }
.be-row-working { background: var(--s2); }

.be-file-label { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; margin: 0; cursor: pointer; }
.be-file-label .form-check-input { flex-shrink: 0; margin: 0; }
.be-file-title { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.be-file-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 12px; }
.be-badge-done { color: var(--action); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.be-badge-working { color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.be-badge-error { color: var(--danger); font-weight: 500; }
.be-remove-btn { color: var(--ink2); padding: 4px; min-width: 28px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: var(--r-control); }
@media (hover: hover) { .be-remove-btn:hover { color: var(--danger); } }

.be-setting-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13.5px; color: var(--ink); }
.be-setting-label { font-weight: 500; margin: 0; }
.be-scale-input { width: 75px; min-height: 32px; padding: 0 8px; text-align: center; border: 0; border-radius: var(--r-control); background: var(--s2); color: var(--ink); font-size: 13.5px; }
.be-scale-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.be-setting-hint { font-size: 12px; color: var(--ink2); }

@media (pointer: coarse) {
  .be-mode-btn { min-height: 44px; }
  .be-scale-input { min-height: 44px; }
  .be-file-row { min-height: 48px; }
  .be-remove-btn { min-width: 44px; min-height: 44px; }
}

/* Movable shapes: one tile per chord type, stepped with arrows; the count sits at the bottom of the tile */
.ref-shape-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; cursor: default; }
.ref-shape-count { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ref-shape-nav-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; border: 0; border-radius: var(--r-control, 8px); background: transparent; color: var(--ink2); cursor: pointer; transition: background var(--dur-fast, 150ms) var(--ease-out); }
.ref-shape-nav-btn:disabled { opacity: 0.3; cursor: default; }
.ref-shape-nav-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .ref-shape-nav-btn:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 8%, transparent); } }
@media (pointer: coarse) { .ref-shape-nav-btn { min-width: 44px; min-height: 44px; } }

/* Chord tiles: the whole tile plays the chord; cursor pointer everywhere except the shape nav */
.ref-chord-card.ref-chord-play { cursor: pointer; }
.ref-chord-card.ref-chord-play:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ref-chord-play { cursor: pointer; border-radius: var(--r-control, 8px); }
.ref-chord-play:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Web CTA banner: warns about browser storage eviction and links to native app */
.web-cta-banner {
  background: var(--s2);
  border-radius: var(--r-card, 12px);
  padding: 16px 20px;
  margin: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
  transition: padding var(--dur-fast, 150ms) var(--ease-out),
              gap var(--dur-fast, 150ms) var(--ease-out);
}

.web-cta-banner.is-collapsed {
  padding: 8px 20px;
  gap: 16px;
}

.setpage > .web-cta-banner {
  margin: 0 0 24px 0;
}

.setpage > .web-cta-banner.is-collapsed {
  margin: 0 0 16px 0;
}

.web-cta-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.web-cta-banner.is-collapsed .web-cta-desc {
  display: none;
}

.web-cta-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.web-cta-desc {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.45;
}

.web-cta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.web-cta-btn {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.web-cta-toggle-btn {
  background: transparent;
  border: 0;
  color: var(--ink2);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-control, 8px);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast, 150ms) var(--ease-out), color var(--dur-fast, 150ms) var(--ease-out);
}

.web-cta-toggle-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) {
  .web-cta-toggle-btn:hover {
    background: var(--s3);
    color: var(--ink);
  }
}

@media (max-width: 768px) {
  .web-cta-banner {
    flex-direction: column;
    align-items: flex-start;
    margin: max(env(safe-area-inset-top, 0px), 12px) 16px 0;
    padding: 14px 16px;
    gap: 12px;
  }
  .web-cta-banner.is-collapsed {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 10px;
  }
  .setpage > .web-cta-banner {
    margin: 0 0 16px 0;
  }
  .setpage > .web-cta-banner.is-collapsed {
    margin: 0 0 12px 0;
  }
  .web-cta-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .web-cta-banner.is-collapsed .web-cta-actions {
    width: auto;
    justify-content: flex-end;
  }
}

@media (max-width: 576px) {
  .web-cta-banner {
    margin: max(env(safe-area-inset-top, 0px), 8px) 8px 0;
    padding: 12px 14px;
  }
  .web-cta-banner.is-collapsed {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .setpage > .web-cta-banner {
    margin: 0 0 14px 0;
  }
  .setpage > .web-cta-banner.is-collapsed {
    margin: 0 0 10px 0;
  }
}

@media (pointer: coarse) {
  .web-cta-btn,
  .web-cta-toggle-btn {
    min-height: 44px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- Add custom music dialog: tone steps, no outlines, no icons beside text ---------- */
.cm-card { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
.cm-card form { display: flex; flex-direction: column; min-height: 0; }
.cm-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px; overflow-y: auto; }
.cm-field { min-width: 0; }
.cm-field .form-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink2) !important; margin-bottom: 6px; }
.cm-hint { font-size: 12px; line-height: 1.4; color: var(--ink2); margin-top: 6px; }
.cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cm-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; background: transparent; border: 0; }
@media (max-width: 480px) { .cm-row { grid-template-columns: 1fr; } }
.cm-switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--s2); border-radius: var(--r-control, 8px); }
.cm-switch .form-check-label { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.cm-switch .cm-hint { margin-top: 2px; }

/* ---------- Classical / Staff Text Tabs: Intra-System Bar Cursor & Horizontal Ribbon ---------- */
.text-content {
  width: fit-content;
  max-width: min(1200px, calc(100% - 24px));
  box-sizing: border-box;
}
.tab-section-container {
  position: relative;
  width: max-content;
  max-width: 100%;
}
.ts-bar-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
}
.ts-bar-cursor[hidden] {
  display: none !important;
}

#output.txt-ribbon-output {
  padding: 16px;
}
.txt-ribbon-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  user-select: none;
}
.txt-ribbon-header {
  padding: 14px 18px;
  background: var(--s1);
  color: var(--ink);
  border-radius: var(--r-card, 8px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace, var(--tab-cjk-fonts);
  font-size: 13px;
  line-height: 1.45;
}
.txt-ribbon-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.txt-ribbon-header-summary {
  flex: 1 1 280px;
  min-width: 0;
}
.txt-ribbon-header-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.txt-ribbon-header-line:first-child {
  font-weight: 600;
}
.txt-ribbon-header-more {
  margin-top: 8px;
}
.txt-ribbon-header-more > summary {
  cursor: pointer;
  color: var(--ink2);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 12px;
}
.txt-ribbon-notes-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--s2);
  color: var(--ink);
  border-radius: var(--r-control, 6px);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

.txt-ribbon-stage {
  position: relative;
  container-type: inline-size;
  background-color: var(--sheet-bg, #ffffff);
  color: var(--sheet-text, #1a1a1a);
  border-radius: var(--r-card, 8px);
  overflow: hidden;
}
body.sheet-mode-dark:not(.theme-sheet-active) .txt-ribbon-stage,
body.sheet-mode-dark:not(.theme-sheet-active) .txt-ribbon-gutter {
  background-color: #1c1d1f !important;
  color: #cacaca !important;
}
body.theme-sheet-active .txt-ribbon-stage,
body.theme-sheet-active .txt-ribbon-gutter {
  background-color: var(--bg-card-solid, var(--s1)) !important;
  color: var(--text-primary, var(--ink)) !important;
}

/* Paged follow (vertical score and text tab): the last line that fits the page takes one tone step while the cursor is in it, so the turn is seen coming */
.gp-turn-line {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  background: color-mix(in srgb, var(--sheet-text, #1a1a1a) 7%, transparent);
  transition: opacity var(--dur-fast, 150ms) var(--ease-out, ease-out);
}
.gp-turn-line.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .gp-turn-line { transition: none; }
}

.txt-ribbon-playhead {
  position: absolute;
  left: 25%;
  top: 0;
  bottom: 0;
  width: 20px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
}
/* One playhead on every file type (Guitar Pro, PDF, text): a pill outline with a pointed bottom, flat, in the playhead colour (--hue, as on the bar ruler) */
.ts-bar-cursor svg, .txt-ribbon-playhead svg { display: block; overflow: visible; }
.gp-reader-cursor .gp-reader-path, .ts-bar-cursor path, .txt-ribbon-playhead path { fill: none; stroke: var(--hue); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.txt-ribbon-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px 0;
  scrollbar-width: thin;
}
.txt-ribbon-scroll:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.txt-ribbon-track {
  display: inline-flex;
  align-items: flex-start;
  min-width: 100%;
  padding-right: 75%;
}
.txt-ribbon-gutter {
  position: sticky;
  left: 0;
  z-index: 4;
  padding: 8px 4px 8px 16px;
  background-color: var(--sheet-bg, #ffffff);
  color: var(--sheet-text, #1a1a1a);
  font-weight: 600;
}
.txt-ribbon-lead-pad {
  flex: 0 0 max(24px, calc(25cqw - 4.5ch));
}
.txt-ribbon-system {
  display: inline-flex;
  align-items: flex-start;
}
.ts-bar {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color var(--dur-fast, 120ms);
}
@media (hover: hover) {
  .ts-bar:hover {
    background: color-mix(in srgb, currentColor 6%, transparent);
  }
}
.txt-ribbon-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace, var(--tab-cjk-fonts);
  font-size: calc(15px * var(--text-scale, 1));
  line-height: 1.45;
  white-space: pre;
  min-height: 1.45em;
}
.txt-anno-line {
  opacity: 0.78;
}
.txt-ribbon-stave-gap {
  margin: 4px 0;
}

.txt-ribbon-legend {
  padding: 12px 16px;
  background: var(--s1);
  color: var(--ink);
  border-radius: var(--r-card, 8px);
  font-size: 13px;
}
.txt-ribbon-legend > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink2);
}
.txt-ribbon-legend-body {
  margin-top: 10px;
  padding-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace, var(--tab-cjk-fonts);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-x: auto;
}
@media (max-width: 640px) {
  #output.txt-ribbon-output {
    padding: 8px;
  }
  .txt-ribbon-header {
    padding: 10px 12px;
  }
  .txt-ribbon-gutter {
    padding-left: 10px;
  }
}

/* Sync sheet: the one place to line a recording up with the score. Rows, not cards; tone steps, no outlines; the one
   primary action (Tap along) is the only coloured control. */
.sync-sheet-card { max-width: min(460px, calc(100vw - 24px)) !important; }
.sync-sheet-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sync-sheet-status { margin: 0 0 4px; font: 500 15px system-ui, sans-serif; color: var(--ink); }
.sync-sheet-note { margin: 0 0 4px; font-size: 13px; color: var(--ink2); }
.sync-sheet-primary { display: block; width: 100%; margin: 12px 0 8px; min-height: 44px; }
.sync-sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sync-sheet-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--ink); text-align: left; }
.sync-sheet-row:hover, .sync-sheet-row:focus-visible, .sync-sheet-row[aria-expanded="true"] { background: var(--s2); }
.sync-sheet-row.is-armed { background: var(--s3); }
.sync-sheet-row-label { font: 500 14px system-ui, sans-serif; }
.sync-sheet-row-sub { font-size: 12px; color: var(--ink2); }
.sync-sheet-picker { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px 12px; }
.sync-sheet-picker .sync-sheet-row { background: var(--s1); }
.sync-sheet-picker .sync-sheet-row:hover, .sync-sheet-picker .sync-sheet-row:focus-visible, .sync-sheet-picker .sync-sheet-row.is-armed { background: var(--s2); }

/* Tap bar: the controls for tapping stay in one row; the rest sit behind More */
.sync-mode-bar .sync-mode-more { margin-top: 8px; }
.sync-mode-bar .sync-mode-more[hidden] { display: none; }

/* The Original panel lists every recording in one list; its heading shows only when there is a row, and the
   waveform of a file shows only while a file is the sound */
#realAudioRecordings:not(:has(.vrow)) { display: none; }
#ytDropdownPanel:not([data-rec-source="local"]) :is(#afPlayer, #afStemSection) { display: none !important; }

/* Auto-sync global progress line: 3px at the top edge, below the status bar and Dynamic Island on a phone
   (at top 0 it sits behind them and cannot be seen); hidden in Reading mode */
.auto-sync-progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10050;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.auto-sync-progress.is-active { opacity: 1; }
body.reading-mode .auto-sync-progress { opacity: 0 !important; }
.auto-sync-progress-fill {
  width: 100%;
  height: 100%;
  background: var(--hue);
  transform-origin: left center;
  transform: scaleX(var(--sync-progress, 0));
  transition: transform var(--dur-base) var(--ease-out);
}
.auto-sync-progress.is-indeterminate .auto-sync-progress-fill {
  transition: none;
  animation: autoSyncSweep 1.2s var(--ease-out) infinite;
}
@keyframes autoSyncSweep {
  0% { transform: translateX(-100%) scaleX(0.35); }
  50% { transform: translateX(30%) scaleX(0.45); }
  100% { transform: translateX(100%) scaleX(0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .auto-sync-progress, .auto-sync-progress-fill { transition: none; }
  .auto-sync-progress.is-indeterminate .auto-sync-progress-fill {
    animation: none;
    transform: scaleX(0.35);
  }
}

/* Edit text modal: a monospaced page the size of the dialog, so tab columns line up as they will in the reader */
.edit-text-area { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; line-height: 1.35; min-height: 40vh; max-height: 60vh; resize: vertical; white-space: pre; overflow: auto; }

/* Edit text tools: ghost text actions on one scrolling row; the chord and section choices open on a tone step below it */
.edit-text-tools, .edit-text-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.edit-text-tools::-webkit-scrollbar, .edit-text-row::-webkit-scrollbar { display: none; }
.edit-text-tools { margin: 0 0 8px; }
.edit-text-panel { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; padding: 4px; background: var(--s2); border-radius: var(--r-control); }
.edit-text-panel[hidden] { display: none; }
.edit-text-tool, .edit-text-chip {
  flex: none; border: 0; background: transparent; color: var(--ink2); font: 13px system-ui, sans-serif; white-space: nowrap;
  min-height: 40px; padding: 0 12px; border-radius: var(--r-control); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out);
}
.edit-text-chip { color: var(--ink); min-width: 40px; }
.edit-text-tool[aria-expanded="true"], .edit-text-chip[aria-pressed="true"] { background: var(--s3); color: var(--ink); }
@media (hover: hover) { .edit-text-tool:hover, .edit-text-chip:hover { background: var(--s3); } }
.edit-text-tool:active, .edit-text-chip:active { background: var(--s3); }
.edit-text-tool:focus-visible, .edit-text-chip:focus-visible { outline: 2px solid var(--hue); outline-offset: -2px; }
@media (pointer: coarse) { .edit-text-tool, .edit-text-chip { min-height: 44px; min-width: 44px; } }
@media (max-width: 576px) { .edit-text-area { min-height: 26vh; max-height: 34vh; } }
/* The text page is a tone step, not a bordered box: no outline, no glow; keyboard focus gets the plain ring */
.edit-text-area, .edit-text-area:focus { background-color: var(--s3); color: var(--ink); border: 0; box-shadow: none; border-radius: var(--r-control); }
.edit-text-area:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
.edit-text-area::placeholder { color: var(--ink2); }

/* No glow. --accent-glow is a legacy halo the look rules do not allow: hover and active states lose it, floating menus keep a plain
   dark shadow, and keyboard focus gets the plain ring. The selectors repeat style.css, so these win by order. */
@media (hover: hover) {
.brand-btn:hover,
.top-bar-song-btn:hover,
.theme-swatch-btn:hover,
.theme-modal-back-btn:hover:not(:disabled),
.theme-card:hover,
.theme-control-btn:hover:not(:disabled),
.settings-page input[type="file"]:hover::file-selector-button,
.settings-page input[type="file"]:hover::-webkit-file-upload-button,
#controllerPill .btn:hover,
.ref-chord-link:hover { box-shadow: none; }
}
.top-bar-song-btn:active,
.top-bar-song-btn.active,
input[type=range]::-webkit-slider-thumb,
#synthSpeedButtons .btn.active,
.btn-check:checked + .yt-mode-btn,
.settings-page .form-check-input:checked,
.lib-open-file-btn.active,
.controller-reading-banner,
#jamToggleBtn.jam-active,
.latency-flash.on,
.save-to-library-result.active,
.library-nav-add-circle,
input[type=range]::-moz-range-thumb,
.sync-marker,
.sync-target,
.sync-marker.is-selected { box-shadow: none; }
#topBar .hud-pill-group .btn-check:checked:focus + .btn,
#topBar .hud-pill-group .btn-check:checked:focus-visible + .btn,
.library-page-view .library-song-row:focus-visible,
.library-page-view .library-song-row.nav-focused,
.library-page-view .library-card:focus-visible,
.library-page-view .library-card.nav-focused,
.library-page-view .library-row-card:focus-visible,
.library-page-view .library-row-card.nav-focused,
.library-page-view .library-pinned-card:focus-visible,
.library-page-view .library-pinned-card.nav-focused,
.library-page-view .library-track-row:focus-visible,
.library-page-view .library-track-row.nav-focused,
.library-page-view .open-file-dropzone:focus-visible,
.library-page-view .open-file-dropzone.nav-focused,
.library-page-view .open-file-provider-item:focus-visible,
.library-page-view .open-file-provider-item.nav-focused,
.theme-modal-backdrop .theme-card:focus-visible,
.theme-modal-backdrop .theme-card.nav-focused,
.library-page-view .tab-row:focus-visible,
.library-page-view .tab-row.nav-focused,
.library-page-view button:focus-visible,
.library-page-view button.nav-focused,
.library-page-view a:focus-visible,
.library-page-view a.nav-focused,
.library-page-view input:not(.search-input):focus-visible,
.library-page-view input:not(.search-input).nav-focused,
.library-page-view select:focus-visible,
.library-page-view select.nav-focused,
.settings-page button:focus-visible,
.settings-page button.nav-focused,
.settings-page a:focus-visible,
.settings-page a.nav-focused,
.settings-page input:not(.btn-check):focus-visible,
.settings-page input:not(.btn-check).nav-focused,
.settings-page select:focus-visible,
.settings-page select.nav-focused,
.theme-modal-backdrop .theme-modal-card button:focus-visible,
.theme-modal-backdrop .theme-modal-card button.nav-focused,
.theme-modal-backdrop .theme-modal-card a:focus-visible,
.theme-modal-backdrop .theme-modal-card a.nav-focused,
.theme-modal-backdrop .theme-modal-card input:not(.btn-check):focus-visible,
.theme-modal-backdrop .theme-modal-card input:not(.btn-check).nav-focused,
.theme-modal-backdrop .theme-modal-card select:focus-visible,
.theme-modal-backdrop .theme-modal-card select.nav-focused,
.theme-modal-backdrop .theme-modal-card [tabindex="0"]:focus-visible,
.theme-modal-backdrop .theme-modal-card [tabindex="0"].nav-focused,
.modal.show button:focus-visible,
.modal.show button.nav-focused,
.dropdown-menu.show .dropdown-item:focus-visible,
.dropdown-menu.show .dropdown-item.nav-focused,
#toolsMenu .tools-item:focus-visible,
#toolsMenu .tools-item.nav-focused,
.settings-page .btn-check:focus + .btn,
.settings-page .btn-check:focus-visible + .btn,
.settings-page .btn-check.nav-focused + .btn,
.theme-modal-backdrop .btn-check:focus + .btn,
.theme-modal-backdrop .btn-check:focus-visible + .btn,
.theme-modal-backdrop .btn-check.nav-focused + .btn,
.library-page-view .btn-check:focus + .btn,
.library-page-view .btn-check:focus-visible + .btn,
.library-page-view .btn-check.nav-focused + .btn,
.ref-chord-link:focus-visible { box-shadow: none !important; outline: 2px solid var(--hue); outline-offset: -2px; }
#tunerToggleBtn.active,
.library-song-row.song-drop-active,
.album-card.album-drop-active,
.album-detail-view.album-drop-active,
.ref-control-btn.active { box-shadow: none !important; }
.theme-card.active { box-shadow: none; background: var(--s3); }
@media (hover: hover) and (pointer: fine) {
.library-card:hover,
.library-pinned-card:hover .pinned-play-badge:not(.has-cover),
.library-pinned-card:hover .pinned-play-badge.has-cover { box-shadow: none; }
}
/* A drop target takes a tone step instead of the halo it had */
.library-song-row.song-drop-active, .album-card.album-drop-active, .album-detail-view.album-drop-active { background-color: var(--s3) !important; }

/* No coloured glows and no resting drop shadows. These repeat the style.css selectors and use !important, because some of the
   originals sit in higher-specificity chains (the dark sheet rule did). Hover and active keep their tone steps; focus keeps its ring. */
#synthToggleBtn.active,
#synthToggleBtn.active-audio-mode,
#ytToggleBtn.active,
#ytToggleBtn.active-audio-mode,
#ytToggleBtn.btn-source-local.active,
#ytToggleBtn.btn-source-local.active-audio-mode,
.badge-btn-y,
.badge-btn-a,
.badge-btn-x,
.badge-btn-b,
.library-body-header,
.search-sticky-header,
.library-disc-header,
.album-cover-img,
.album-cover-banner,
.theme-swatch-btn,
.theme-swatch-btn:hover,
.theme-card-gradient-bar,
.theme-colorway-chip,
.top-bar-song-btn.is-static,
.top-bar-song-btn.disabled,
.top-bar-song-btn[disabled],
.top-bar-song-btn.is-static:hover,
.top-bar-song-btn.disabled:hover,
.top-bar-song-btn[disabled]:hover,
.pinned-play-badge.has-cover,
.library-pinned-card:hover,
#globalAudioControls,
#audioSourcePill,
#synthMiniPill,
#ytMiniPill { box-shadow: none !important; }
@media (hover: hover) { .btn-theme-danger:hover:not(:disabled) { box-shadow: none !important; } }
.gp-reader-cursor svg, .ref-circle-slice.active, .ref-circle-svg, .controller-svg-diagram,
.pinned-play-badge.has-cover .pinned-play-icon { filter: none !important; }

/* One shadow for what floats over the content: menus, popovers, toasts, banners and the panels that open from the reader's five words.
   Dialogs (.theme-modal-card) and everything at rest have none; the scrim and the tone steps separate those. No glow, no colour. */
:root { --shadow-float: 0 8px 24px rgb(0 0 0 / 0.35); }
.dropdown-menu,
.popover-pop,
.theme-dropdown-menu,
.tools-menu,
.view-menu,
.guitar-menu,
.more-menu,
.score-options-panel,
.synth-panel,
.yt-panel,
.pdf-bookmarks-panel,
.page-scrubber-popover,
.ct-menu,
.ct-moremenu,
.theme-toast,
.update-banner,
.jam-request-card,
.tabpick,
.ruler-tip,
#pinchScaleReadout { box-shadow: var(--shadow-float) !important; }

/* One monospace stack for tab text, so columns line up: the system's own fixed-width font, never the bare `monospace` keyword
   (a different, smaller face). The page, the measuring div that paginates it and the Edit text window must all use it. */
:root { --font-tab: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pageWrapper, .pageWrapper > div, .text-content, .measure-div { font-family: var(--font-tab), var(--tab-cjk-fonts); }
.edit-text-area { font-family: var(--font-tab); }

/* A disc heading in a multi-disc album: a quiet line of grey text above its tracks, not a box */
.library-disc-header { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 12px 16px 4px; font-size: 13px; color: var(--ink2); }
.library-disc-header .library-disc-count { color: var(--ink2); opacity: .8; }

/* ---------- Storage diagram (Settings, Data management): two bars to one scale, one hue per kind ----------
   The one place besides the bar ruler's section families where hue is allowed: the kinds must be told apart at a glance. */
.stor { display: flex; flex-direction: column; gap: 14px; padding: 14px; margin: 0 0 4px; background: var(--s2); border-radius: var(--r); }
.stor-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.stor-head b { font-weight: 500; font-size: 15px; color: var(--ink); flex: 1; min-width: 0; }
.stor-head span { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.stor-refresh { background: transparent; border: 0; padding: 0 8px; min-height: 24px; color: var(--ink2); font-size: 13px; font-weight: 500; border-radius: var(--r-control, 8px); }
@media (hover: hover) { .stor-refresh:hover:not(:disabled) { background: var(--s3); color: var(--ink); } }
.stor-refresh:focus-visible { outline: 2px solid var(--hue); outline-offset: 1px; }
@media (pointer: coarse) { .stor-refresh { min-height: 44px; min-width: 44px; margin: -10px 0; } }
.stor-track { display: flex; gap: 2px; height: 12px; border-radius: var(--r-control, 8px); overflow: hidden; background: var(--s3); }
.stor-track { position: relative; }
.stor-load { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: color-mix(in srgb, var(--ink) 18%, var(--s3)); border-radius: inherit; transform: translateX(-100%); animation: task-progress-slide 1.4s linear infinite; }
@media (prefers-reduced-motion: reduce) { .stor-load { animation: none; transform: none; width: 100%; opacity: .5; } }
.stor-seg { display: block; height: 100%; flex: none; min-width: 2px; }
.stor-k0 { background: oklch(0.68 0.14 250); }
.stor-k1 { background: oklch(0.68 0.14 45); }
.stor-k2 { background: oklch(0.68 0.14 155); }
.stor-k3 { background: oklch(0.68 0.14 320); }
.stor-k4 { background: oklch(0.68 0.14 95); }
.stor-note { margin: -6px 0 0; font-size: 13px; color: var(--ink2); }
.stor-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.stor-foot .stor-legend { flex: 1; min-width: 0; }
.stor-refresh { flex: none; margin-left: auto; }
.stor-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink2); }
.stor-legend li { display: inline-flex; align-items: center; gap: 8px; }
.stor-key { display: block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ==========================================================================
   Sound: what you play is in the dock (Full band | Backing); where it comes from is the switch at the top of the panels
   (Synth | Original). Each panel then runs: the parts, set up, and last the audio latency. See soundSwitch.js.
   ========================================================================== */
/* Synth and Original stay in the dock only as hidden state (which sound is selected); the Sound panel's switch presses them */
.dock-src #mobileSynthToggleBtn, .dock-src #mobileYtToggleBtn { display: none !important; }
.dock-src .mobile-dock-btn[hidden] { display: none !important; }
.dock-src .mobile-dock-btn[aria-pressed="true"] { background: var(--s3) !important; color: var(--ink) !important; }
.dock-src .mobile-dock-btn:disabled { opacity: 0.38; pointer-events: none; }
/* Narrow phones keep "Full band" and "Backing" on one line */
.dock-src #dockFullBandBtn .audio-src-label, .dock-src #dockBackingBtn .audio-src-label { display: inline !important; white-space: nowrap; }

/* The panel's header is the Synth | Original switch; the old title and the source glyphs are not shown */
#synthDropdownPanel .synth-panel-header > div:not(.sound-source):not(:last-child),
#ytDropdownPanel .yt-panel-header > div:not(.sound-source):not(:last-child) { display: none !important; }
#synthDropdownPanel .sound-source, #ytDropdownPanel .sound-source { flex: 1; min-width: 0; margin-right: 8px; width: auto; display: flex; }
#synthDropdownPanel .sound-source .btn, #ytDropdownPanel .sound-source .btn { flex: 1; justify-content: center; }
#synthDropdownPanel .sound-source .btn:disabled, #ytDropdownPanel .sound-source .btn:disabled { opacity: 0.38; }

/* Synth: the track-mode radios stay as state (the dock and the Guitars only action press them); only the text-tab Hear choice shows */
#synthTrackGpGroup { display: none !important; }
body.gp-file-active #synthTrackModeContainer { display: none !important; }
#synthGuitarsOnlyBtn[aria-pressed="true"] { color: var(--ink) !important; }
#synthGuitarsOnlyBtn:disabled { opacity: 0.38; }

/* Original: the slot rows are state the dock presses; the recordings list and Add fold under one row */
#recSlotField[hidden] { display: none !important; }
.rec-part > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 0 12px; margin-bottom: 8px; border-radius: var(--r-control); background: var(--s3);
  color: var(--ink); font-size: 14px; font-weight: 600;
}
.rec-part > summary::-webkit-details-marker { display: none; }
.rec-part > summary::after {
  content: ''; width: 7px; height: 7px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2);
  transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease-out); flex: none;
}
.rec-part[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.rec-part > summary:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
@media (hover: hover) { .rec-part > summary:hover { background: var(--s2); filter: brightness(1.12); } }
/* Open, the recordings list already has its own heading; the row above it names the group */
.rec-part[open] > summary { background: transparent; padding-left: 0; }
#recListLabel { display: none; }
@media (prefers-reduced-motion: reduce) { .rec-part > summary::after { transition: none; } }

/* Audio latency is last in both panels: a set-once value, the same row for every sound */
#synthLatencySection, #ytLatencySection { margin-top: 20px; margin-bottom: 0 !important; }

/* Recordings: one expandable section per part, Full band and Backing, each row naming what that part plays. The lists the
   panel always kept are hidden state */
#realAudioRecordings > #recListLabel, #realAudioRecordings > #recEmbeddedList, #realAudioRecordings > #afFileSection,
#realAudioRecordings > #ytVideoSection { display: none !important; }
.rec-part > summary > span:first-child { flex: none; white-space: nowrap; }
.rec-part > summary .rec-part-now { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: 13px; color: var(--ink2); }
.rec-part[open] > summary .rec-part-now { display: none; }
.rec-part .rec-slots { margin-bottom: 8px; }
.rec-part-empty { margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--ink2); }
.rec-part-empty[hidden] { display: none; }

/* ---- Loose follow: a recording with no sync points. The reading marker (shared with the text tabs) glides down the score ---- */

/* Rough follow on the recording bar: a status, an Earlier | Later group that adjusts it, and Sync, which replaces it */
.rec-loose { display: inline-flex; align-items: stretch; background: var(--s2); border-radius: var(--r-control); overflow: hidden; }
.rec-loose .ct-text { border-radius: 0; min-height: 28px; padding: 0 12px; font-size: 13px; white-space: nowrap; transition: background-color var(--dur-fast), color var(--dur-fast); }
.rec-loose .ct-text + .ct-text { box-shadow: inset 1px 0 0 var(--s3); }
@media (hover: hover) { .rec-loose .ct-text:hover { background: var(--s3); } }
.rec-loose .ct-text:active { background: var(--s3); color: var(--ink); }
.rec-loose .ct-text:focus-visible { outline-offset: -2px; }
.rec-strip.is-loose .rec-actions { align-items: center; gap: 8px; }
/* Phones: a row of its own under the progress track: the status on the left, the group and Sync on the right, 44px tall */
body.phone-reader:not(.library-view-active) .rec-strip.is-loose { flex-wrap: wrap; row-gap: 4px; }
body.phone-reader:not(.library-view-active) .rec-strip.is-loose .rec-end { display: flex; flex: 1 1 100%; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
body.phone-reader:not(.library-view-active) .rec-strip.is-loose .rec-status { flex: 1 1 auto; font-size: 13px; }
body.phone-reader:not(.library-view-active) .rec-strip.is-loose .rec-actions { flex: none; }
body.phone-reader:not(.library-view-active) .rec-strip.is-loose .rec-actions .ct-text { min-height: 44px; padding: 0 14px; font-size: 14px; }
body.phone-reader:not(.library-view-active) .rec-strip.is-loose .rec-actions .ct-text::after { display: none; }
@media (prefers-reduced-motion: reduce) { .rec-loose .ct-text { transition: none; } }

/* Add a video: one button for each part it can go to */
.yt-add-to { display: flex; gap: 8px; }
.yt-add-to .btn { flex: 1 1 0; }
@media (pointer: coarse) { .yt-add-to .btn { min-height: 44px; } }
body.phone-reader .yt-add-to .btn { min-height: 44px; }
#ytDropdownPanel .yt-add-to .rec-text-btn { background: var(--s2) !important; border-radius: var(--r-control); color: var(--ink); text-align: center; }
@media (hover: hover) { #ytDropdownPanel .yt-add-to .rec-text-btn:hover { background: var(--s3) !important; } }
#ytDropdownPanel .yt-add-to .rec-text-btn:active { background: var(--s3) !important; }

/* Add stems: the sheet that makes a set of stems from loose files */
.add-stems-card { max-width: min(560px, calc(100vw - 24px)) !important; }
.add-stems-intro, .add-stems-foot { margin: 0 0 12px; font-size: 13px; color: var(--ink2); }
.add-stems-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.add-stems-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 110px; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-control); background: var(--s2); }
.add-stems-file { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--ink); }
.add-stems-file > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-stems-meta { font-size: 12px; color: var(--ink2); }
.add-stems-notes p { margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.add-stems-actions { display: flex; justify-content: flex-end; gap: 8px; }
.add-stems-go:disabled { opacity: .5; }
@media (max-width: 640px) {
  .add-stems-row { grid-template-columns: 1fr 1fr; }
  .add-stems-file { grid-column: 1 / -1; }
  .add-stems-actions .btn { min-height: 44px; }
}

/* ==========================================================================
   Boot screen (index.html, removed by main.js once the app is ready). It paints before the CDN files arrive, so it uses
   only theme tokens from the local stylesheets; the inline script in the head applies the saved theme first.
   ========================================================================== */
#bootSplash {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: var(--ground);
  transition: opacity var(--dur-fast) var(--ease-out);
}
#bootSplash.boot-done { opacity: 0; pointer-events: none; }
/* Top strip so the desktop window can still be dragged while the splash covers the title bar */
#bootSplash .boot-drag { display: none; }
html:is(.tauri-macos, .tauri-windows):not(.window-fullscreen) #bootSplash .boot-drag { display: block; position: absolute; top: 0; left: 0; right: 0; height: 40px; }
#bootSplash .boot-brand { display: flex; flex-direction: column; align-items: center; gap: 20px; }
/* A crisp white outline (no blur) keeps the dark pick visible on the darkest grounds */
#bootSplash .boot-mark { width: 128px; height: 128px; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff); }
#bootSplash .boot-wordmark { font: 700 28px/1 var(--font-display); letter-spacing: -.01em; color: var(--ink); }
#bootSplash .boot-wordmark b { font-weight: 700; color: var(--ink2); }
#bootSplash .boot-bar { width: 120px; height: 2px; border-radius: 1px; background: var(--s3); overflow: hidden; }
#bootSplash .boot-bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--ink2); animation: bootSlide 1.1s ease-in-out infinite; }
@keyframes bootSlide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { #bootSplash .boot-bar::after { animation: none; width: 100%; opacity: 0.5; } }

/* While a tab loads, the playback chrome waits: the dock, the fretboard and the page strip belong to the tab that is
   opening, not the one that was open before (`body.reader-loading`, set by utils/loadingCard.js). */
body.reader-loading #fretboardDock,
body.reader-loading #pageStrip { display: none !important; }
/* The dock keeps its place while a tab loads (hidden, not removed), so its controls do not pop in and push the layout. */
body.reader-loading #mobilePlaybackDock { visibility: hidden !important; pointer-events: none !important; }
/* The five words (View, Practice, Sound, Guitar, Tools) belong to the opening tab too: hidden, not removed, so the title keeps its place. */
body.reader-loading :is(#viewPill, #practicePill, #soundPill, #guitarPill, #toolsPill) { visibility: hidden !important; pointer-events: none !important; }

/* The top bar is quiet while a tab loads: the title stays as the tab's name and the way back stays, but the song menu's
   chevron, the setlist arrows and the page controls (which would read 0%) are hidden in place, so nothing moves when they
   return. The rule under the bar goes too (transparent, so the bar keeps its height). */
body.reader-loading #topBar { border-bottom-color: transparent; }
body.reader-loading :is(#topBarSongTitleBtn .song-title-chevron, #setlistNav, #navButtons) { visibility: hidden !important; pointer-events: none !important; }
body.reader-loading #topBarSongTitleBtn { pointer-events: none !important; }

/* Android TV: the Google Drive device-code dialog */
.tv-device-card { max-width: 640px; width: 90%; text-align: center; }
.tv-device-code {
    font-family: var(--font-display);
    font-size: 3.5rem;
    letter-spacing: 0.08em;
    margin: 0 0 1rem;
}

/* Library covers fade in once loaded instead of popping in over their tone square */
@keyframes coverFadeIn { from { opacity: 0; } to { opacity: 1; } }
#libraryPage img.cover-fade-in { animation: coverFadeIn var(--dur-fast) var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { #libraryPage img.cover-fade-in { animation: none; } }

/* One focus ring everywhere: the hue, 2px. The rail, the settings sections, the tools list, the search box and the
   player chrome each had their own (a faint blue edge, white, an orange glow, or nothing), so a controller user could
   not learn what "selected" looks like. Keyboard and controller focus share it. */
.library-bottom-nav .library-nav-tab:focus-visible,
.library-bottom-nav .library-nav-tab.nav-focused,
.setnav button:focus-visible,
.setnav button.nav-focused,
.tools-page-row:focus-visible,
.tools-page-row.nav-focused {
  box-shadow: none !important;
  outline: 2px solid var(--hue) !important;
  outline-offset: -2px;
}
.library-search-bar:focus-within,
.library-search-bar:has(.nav-focused) {
  box-shadow: none;
  border-color: transparent;
  outline: 2px solid var(--hue);
  outline-offset: -2px;
}
/* The play button, the dock and the top bar sit on filled or round shapes, so their ring stands off the edge */
#mobilePlaybackDock button:focus-visible,
#mobilePlaybackDock button.nav-focused,
#topBar button:focus-visible,
#topBar button.nav-focused {
  box-shadow: none !important;
  outline: 2px solid var(--hue);
  outline-offset: 2px;
}
/* Shortcuts that only exist on a Mac are listed on a Mac only (the class is set in gamepadManager.js) */
html:not(.is-mac) .mac-only { display: none !important; }

/* Sound Off: the Synth panel shows the switch and one line; the volume and the mix have nothing to set */
#soundOffNote { display: none; }
body.sound-off #synthDropdownPanel .synth-panel-body > :not(#soundOffNote) { display: none !important; }
body.sound-off #soundOffNote { display: block; }
body.sound-off #synthVolumeSlider, body.sound-off #dockVolumeBtn { opacity: 0.38; pointer-events: none; }

/* ==========================================================================
   Auto-scroll pace (utils/autoScroll.js): Slower | 1.0x | Faster
   The group is a .dock-src too, so every size (phone strip, short landscape, Duo tabletop) sizes it like the sound switch.
   ========================================================================== */
body:not(.auto-scroll-on) .dock-pace, body.auto-scroll-on .dock-src:not(.dock-pace) { display: none !important; }
.dock-pace-value { align-self: center; min-width: 5ch; padding: 0 4px; text-align: center; font: 600 13px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink2); }
.dock-pace .rbtn:disabled { opacity: .35; }
.dock-pace .rbtn i { font-size: 1.1em; }
/* Reading mode keeps the two keys and drops the number, so the progress track keeps its room */
body.reading-mode .dock-pace-value { display: none; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-pace-value { flex: none; min-width: 6ch; font-size: 20px; }
html.duo-tabletop body.phone-reader:not(.reading-mode):not(.library-view-active) .dock-pace .rbtn i { font-size: 1.5em; }

/* --- Match picker (a service found several matches): flat rows on a tone step, one step more on hover --- */
.match-card { max-width: 480px; width: 90%; display: flex; flex-direction: column; max-height: min(80vh, 640px); }
.match-sub { color: var(--ink2); }
.match-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.match-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; border-radius: var(--r-control); background: var(--s2); color: var(--ink); text-align: left; }
.match-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.match-title { overflow-wrap: anywhere; }
.match-detail { color: var(--ink2); font-size: 0.875em; overflow-wrap: anywhere; }
@media (hover: hover) { .match-row:hover { background: var(--s3); } }
@media (pointer: coarse) { .match-row { min-height: 56px; } }

/* --- Job progress dialog (a service making a file): a flat bar on a tone step, ink fill, no colour --- */
.job-progress-card { max-width: 440px; width: 90%; }
.job-progress-head { display: flex; justify-content: space-between; gap: 12px; color: var(--ink2); min-height: 1.25em; }
.job-progress-label { overflow-wrap: anywhere; }
.job-progress-percent { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.job-progress-bar { height: 6px; border-radius: var(--r-control); background: var(--s3); overflow: hidden; }
.job-progress-fill { height: 100%; width: 100%; background: var(--ink); transform-origin: left center; transform: scaleX(0); transition: transform var(--dur-base) var(--ease-out); }
.job-progress-bar[data-indeterminate] .job-progress-fill { width: 35%; transform: none; transition: none; animation: jobProgressSlide 1.4s var(--ease-out) infinite; }
@keyframes jobProgressSlide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) {
  .job-progress-fill { transition: none; }
  .job-progress-bar[data-indeterminate] .job-progress-fill { animation: none; width: 100%; opacity: 0.35; }
}

#afStemVocals[hidden] { display: none !important; }
