/* ==========================================================================
   AUTONOMOUS COMPING ENGINEER & INTERACTIVE LEAD-SHEET STUDIO
   High-End Dark Studio Gear Mobile-First Theme
   ========================================================================== */

/* 1. DESIGN TOKENS & SYSTEM VARIABLES */
:root {
  --bg-primary: #0a0b0e;
  --bg-surface: #14171f;
  --bg-surface-elevated: #1e222d;
  --bg-surface-inset: #090a0d;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-active: rgba(0, 229, 255, 0.5);
  
  --text-main: #f4f6fa;
  --text-muted: #8e95a5;
  --text-dim: #555b6a;
  
  --accent: #00e5ff;
  --accent-hover: #33ebff;
  --accent-glow: rgba(0, 229, 255, 0.35);
  
  --accent-amber: #ffb400;
  --accent-amber-glow: rgba(255, 180, 0, 0.3);
  --accent-red: #ff3b30;
  --accent-red-glow: rgba(255, 59, 48, 0.3);
  --accent-green: #30d158;
  --accent-purple: #bf5af2;
  
  --radius-full: 9999px;
  --radius-lg: 16px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
  
  --dock-height: 98px;
  --playhead-pos: 0%;
}

/* 2. RESET & BASE ELEMENTS */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: transparent;
}

button {
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

/* 3. APPLICATION SHELL */
#app-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  max-width: 1024px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  background-color: var(--bg-primary);
  overflow: hidden;
  box-sizing: border-box;
}

/* 4. TOP TELEMETRY BAR (#top-bar) */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 54px;
  z-index: 30;
  flex-shrink: 0;
  gap: 8px;
}

.top-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand-logo-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

@keyframes gear-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.gear-spinner {
  transform-origin: 50px 50px;
  animation: gear-spin 12s linear infinite;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.brand-title {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text-main);
  text-transform: uppercase;
  line-height: 1;
  user-select: none;
}

.brand-bold {
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.brand-narrow {
  font-family: 'Arial Narrow', 'Nimbus Sans Narrow', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-main);
  opacity: 0.9;
}

#song-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  min-width: 52px;
}

.pill-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  line-height: 1;
}

.pill-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.telemetry-key-pill {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  min-width: auto;
}

.key-center-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 32px;
}

.btn-key-transpose {
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-key-transpose svg {
  display: block;
  pointer-events: none;
}

.btn-key-transpose:hover {
  background: var(--bg-hover, rgba(0, 229, 255, 0.14));
  border-color: var(--accent);
  color: var(--accent);
}

.btn-key-transpose:active {
  transform: scale(0.92);
  background: rgba(0, 229, 255, 0.22);
}

.telemetry-sync-pill {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  min-width: auto;
}

.telemetry-sync-pill .pill-label {
  margin-right: 2px;
}

.telemetry-sync-pill .btn-sync-nudge {
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.telemetry-sync-pill .btn-sync-nudge:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.telemetry-sync-pill .dock-sync-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 46px;
  text-align: center;
}

#telemetry-status-pill {
  max-width: 120px;
}

#session-status-display {
  display: block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transpose-controls {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0 4px;
}

.transpose-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin: 0 4px;
  line-height: 1;
}

.btn-upload-icon-only,
.btn-export-icon-only,
.btn-close-project-icon,
.btn-menu-drawer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-close-project-icon:hover {
  color: #ff5252;
  border-color: rgba(255, 82, 82, 0.45);
  background: rgba(255, 82, 82, 0.12);
}

.btn-menu-drawer-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 242, 254, 0.12);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-icon:active {
  background: rgba(0, 229, 255, 0.2);
  color: var(--accent);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action:active {
  background: var(--accent);
  color: #000;
}

/* Recording Controls */
.btn-record {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-record:active {
  background: var(--accent-red);
  color: #fff;
}

.btn-record.recording {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-red-glow);
  animation: pulse-rec 1.5s infinite ease-in-out;
}

@keyframes pulse-rec {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
  flex-shrink: 0;
}

.btn-record.recording .rec-dot {
  background-color: #fff;
  box-shadow: 0 0 6px #fff;
}

.rec-timer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* 5. NASHVILLE SCALE DEGREE BAR (#nashville-bar) */
#nashville-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #101218;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

#nashville-bar::-webkit-scrollbar {
  display: none;
}

.degree-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 36px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.degree-chip:active,
.degree-chip.active {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(255, 180, 0, 0.15);
  box-shadow: 0 0 10px rgba(255, 180, 0, 0.25);
}

/* 6. HORIZONTAL ARRANGEMENT RIBBON & INLINE CONTROLS */
.ribbon-controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 12px;
  flex-shrink: 0;
}

.ribbon-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.btn-ribbon-role,
.btn-ribbon-action {
  flex: 1;
  min-height: 24px;
  height: 24px;
  padding: 2px 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  white-space: nowrap;
}

.btn-ribbon-role:hover,
.btn-ribbon-action:hover {
  background: var(--bg-surface-hover, #2a2e39);
  color: var(--text-main);
  border-color: var(--border-strong, #4a5060);
}

.btn-ribbon-role:active,
.btn-ribbon-action:active {
  transform: scale(0.97);
}

.btn-ribbon-role.active {
  background: var(--accent-amber);
  color: #000;
  border-color: var(--accent-amber);
  box-shadow: 0 0 10px rgba(255, 180, 0, 0.4);
}

.btn-ribbon-danger {
  color: #ff5252;
}

.btn-ribbon-danger:hover {
  background: rgba(255, 82, 82, 0.15);
  border-color: #ff5252;
  color: #ff7b7b;
}

#btn-ribbon-start,
#btn-ribbon-end {
  color: #4caf50;
}

#btn-ribbon-start:hover,
#btn-ribbon-end:hover {
  background: rgba(76, 175, 80, 0.15);
  border-color: #4caf50;
  color: #81c784;
}

#ribbon-container {
  position: relative;
  height: 42px;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  overflow-x: auto !important;
  overflow-y: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

#playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 4px #fff;
  z-index: 30;
  pointer-events: none;
  left: var(--playhead-pos, 0%);
  transition: left 0.05s linear;
}

#playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 8px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.ribbon-track {
  display: flex;
  align-items: stretch;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100%;
  position: relative;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.ribbon-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  min-width: 28px !important;
  margin: 0 !important;
  height: 100% !important;
  border-radius: 4px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  touch-action: pan-x;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.block-label {
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.block-duration {
  display: none !important;
}

.ribbon-block:active,
.ribbon-block.selected {
  border-color: var(--accent-amber) !important;
  box-shadow: 0 0 0 2px var(--accent-amber), 0 0 14px rgba(255, 180, 0, 0.6) !important;
  z-index: 20 !important;
}

.ribbon-block.dragging {
  opacity: 0.85;
  transform: scale(1.05);
  z-index: 40;
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px var(--accent-glow);
  border-color: var(--accent);
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.block-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-role-tag {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  user-select: none;
  touch-action: manipulation;
}

.btn-role-tag:hover,
.btn-role-tag:active {
  background: rgba(255, 255, 255, 0.14);
  border-color: currentColor;
  transform: scale(1.03);
}

.block-score {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.block-lyrics {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 7. SYNCHRONIZED LEAD SHEET (#leadsheet-container) */
#leadsheet-container {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px 12px 14px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.leadsheet-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px 24px;
  background: var(--bg-surface-inset);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: auto 0;
  gap: 12px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.25));
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.empty-desc {
  font-size: 0.88rem;
  max-width: 460px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.empty-btn-rec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  background: rgba(255, 59, 48, 0.16);
  border: 1.5px solid var(--accent-red);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 0 16px var(--accent-red-glow);
  transition: all 0.15s ease;
}

.empty-btn-rec:active {
  transform: scale(0.97);
  background: var(--accent-red);
}

.empty-btn-rec.recording {
  background: var(--accent-red);
  color: #fff;
  animation: pulse-rec 1.5s infinite ease-in-out;
}

.empty-btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  background: rgba(0, 229, 255, 0.12);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 0 16px var(--accent-glow);
  transition: all 0.15s ease;
}

.empty-btn-upload:active {
  transform: scale(0.97);
  background: var(--accent);
  color: #000;
}

.sheet-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leadsheet-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 3px 6px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.leadsheet-line.stanza-break {
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.leadsheet-line.instrumental-line {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px 0;
  margin: 4px 0;
  align-items: flex-end;
  gap: 3px 6px;
}

.inline-section-hint {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-muted, #8e9bb0);
  opacity: 0.55;
  margin-right: 8px;
  margin-bottom: 2px;
  align-self: flex-end;
  user-select: none;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.22);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
  align-self: center;
}

.instrumental-beat-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--text-muted, #8e9bb0);
  opacity: 0.45;
  text-align: center;
  letter-spacing: 0.12em;
  width: 100%;
  min-height: 16px;
  line-height: 1.2;
  user-select: none;
}

.chord-lyric-pair {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 2px;
}

.chord-lyric-pair.instrumental-pair {
  align-items: center;
}

.chord-tag {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  min-height: 17px;
  transition: color 0.12s ease, background-color 0.12s ease, text-shadow 0.12s ease;
}

.chord-tag.active-chord {
  color: #fff;
  background: rgba(255, 180, 0, 0.35);
  text-shadow: 0 0 10px rgba(255, 180, 0, 0.85);
  box-shadow: 0 0 8px rgba(255, 180, 0, 0.45);
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 800;
}

.chord-tag.selected-chord {
  outline: 2px solid var(--accent);
  background: rgba(0, 229, 255, 0.22);
  color: #fff !important;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

.syllable {
  font-size: 1.02rem;
  color: var(--text-main);
  line-height: 1.35;
  border-radius: 3px;
  padding: 1px 2px;
  user-select: text;
  /* Requirement 3: Smooth, slower fade out on exit */
  transition: background-color 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.35s ease-out,
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s ease-out;
}

.syllable:hover {
  background: rgba(255, 255, 255, 0.08);
}

.syllable:active {
  background: rgba(0, 229, 255, 0.2);
}

.syllable.active-singing {
  color: #fff !important;
  background: rgba(0, 229, 255, 0.30) !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.55), 0 0 3px rgba(255, 255, 255, 0.7) !important;
  /* Snappy 80ms attack */
  transition: background-color 0.08s ease-in,
              color 0.08s ease-in,
              box-shadow 0.08s ease-in !important;
}

.syllable.section-highlight {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Lyrics Edit Modal */
.lyrics-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lyrics-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.lyrics-modal-content {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface-elevated, #16181f);
  border: 1px solid var(--border-medium, #2e3444);
  border-radius: var(--radius, 8px);
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1001;
}

.lyrics-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lyrics-modal-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #8e95a5);
}

.lyrics-editor-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-inset, #0e1015);
  border: 1px solid var(--border-medium, #2e3444);
  border-radius: 6px;
  color: var(--text-main, #f4f6fa);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

.lyrics-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Export Options Modal */
.export-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.export-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}

.export-modal-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface-elevated, #16181f);
  border: 1px solid var(--border-medium, #2e3444);
  border-radius: var(--radius, 8px);
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1001;
}

.export-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.export-modal-header .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-modal-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #8e95a5);
  margin: 0;
  line-height: 1.4;
}

.export-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .export-options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.export-option-card {
  background: var(--bg-surface-inset, #0e1015);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease;
}

.export-option-card:hover {
  border-color: var(--border-medium, #2e3444);
}

.export-option-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.export-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.export-badge-audio {
  background: rgba(255, 183, 3, 0.15);
  color: #ffb703;
  border-color: rgba(255, 183, 3, 0.3);
}

.export-option-card h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.export-card-desc {
  font-size: 0.76rem;
  color: var(--text-muted, #8e95a5);
  margin: 0;
  line-height: 1.35;
  flex-grow: 1;
}

.btn-export-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm, 6px);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-export-sheet {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium, #2e3444);
  color: var(--text-main);
}

.btn-export-sheet:hover,
.btn-export-sheet:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-main);
}

.btn-export-wav {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.btn-export-wav:hover,
.btn-export-wav:active {
  background: #33ebff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.45);
}

/* Section Role Modal Window (Opens below ribbon on double-tap) */
.section-role-modal {
  position: fixed;
  top: 125px; /* Sits directly below the arrangement ribbon */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 16px;
  pointer-events: auto;
}

.section-role-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  z-index: 1;
}

.section-role-modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin-top: 0;
  background: var(--bg-surface-elevated, #16181f);
  border: 1px solid var(--border-medium, #2e3444);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 229, 255, 0.12);
  padding: 14px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: roleModalSlideDown 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes roleModalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-role-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-role-modal-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #8e95a5);
  margin: 0;
  line-height: 1.3;
}

.section-role-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

@media (max-width: 480px) {
  .section-role-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.section-role-buttons-grid .btn-ribbon-role {
  flex: none;
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 6px 8px;
  background: var(--bg-surface, #1e222d);
  border: 1px solid var(--border-medium, #2e3444);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-main, #f4f6fa);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  white-space: nowrap;
}

.section-role-buttons-grid .btn-ribbon-role:hover {
  background: var(--bg-surface-hover, #2a2e39);
  color: #fff;
  border-color: var(--accent, #00e5ff);
}

.section-role-buttons-grid .btn-ribbon-role:active {
  transform: scale(0.97);
}

.section-role-buttons-grid .btn-ribbon-role.active {
  background: var(--accent-amber, #ffb300);
  color: #000;
  border-color: var(--accent-amber, #ffb300);
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.45);
}

/* Direct Lyric / Chord Edit Modal */
.direct-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.direct-edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.direct-edit-modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface-elevated, #16181f);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius, 10px);
  padding: 22px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 229, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1051;
  animation: directEditModalIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes directEditModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.direct-edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.direct-edit-modal-header .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.direct-edit-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #8e95a5);
  margin: 0;
}

.direct-edit-input-wrap {
  width: 100%;
}

.direct-edit-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-inset, #0c0e12);
  border: 1.5px solid var(--border-medium, #2e3444);
  border-radius: 8px;
  color: var(--text-main, #f4f6fa);
  font-size: 1.15rem;
  padding: 10px 14px;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.direct-edit-input:focus {
  outline: none;
  border-color: var(--accent, #00e5ff);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.30);
}

.direct-edit-input.chord-mode {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  color: var(--accent, #00e5ff);
  letter-spacing: 0.05em;
}

.direct-edit-chord-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: -4px;
}

.btn-chord-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-main, #f4f6fa);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-chord-chip:hover,
.btn-chord-chip:active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent, #00e5ff);
  color: var(--accent, #00e5ff);
}

.direct-edit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* 8. SLIDE-UP TAKE INSPECTOR (#take-inspector, #take-inspector-overlay) */
.take-inspector-overlay,
#take-inspector-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 6, 9, 0.78);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.take-inspector-overlay.sheet-open,
#take-inspector-overlay.sheet-open {
  opacity: 1;
  pointer-events: auto;
}

.take-inspector,
#take-inspector {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 1024px;
  margin: 0 auto;
  max-height: 75vh;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-medium);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.85);
  z-index: 90;
  padding: 16px 18px 30px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.take-inspector.sheet-open,
#take-inspector.sheet-open {
  transform: translate3d(0, 0, 0);
}

.take-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.inspector-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.inspector-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

.inspector-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#inspector-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

#inspector-close-btn:active {
  color: #fff;
  background: var(--accent-red);
}

.boundary-nudge-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.nudge-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.nudge-controls {
  display: flex;
  gap: 16px;
}

.nudge-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nudge-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

.nudge-btn-row {
  display: flex;
  gap: 6px;
}

.btn-nudge,
.nudge-btn {
  flex: 1;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-nudge:active,
.nudge-btn:active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.15);
}

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

.take-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease;
}

.take-item.keeper {
  border-color: var(--accent-amber);
  background: rgba(255, 180, 0, 0.05);
}

.take-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.take-label {
  font-weight: 700;
  color: var(--text-main);
}

.take-score {
  font-family: var(--font-mono);
  color: var(--accent);
}

.take-duration {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.take-actions {
  display: flex;
  gap: 8px;
}

.transport-btn {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.78rem;
  transition: all 0.15s ease;
}

.transport-btn:active {
  background: rgba(0, 229, 255, 0.2);
  color: var(--accent);
  border-color: var(--accent);
}

.take-promote-btn {
  background: rgba(255, 180, 0, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.take-promote-btn:active {
  background: var(--accent-amber);
  color: #000;
}

.take-trim-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trim-legend {
  font-size: 0.68rem;
  color: var(--text-dim);
  flex: 1;
  text-align: center;
}

/* 9. BOTTOM MOBILE ERGONOMIC TRANSPORT DOCK (#transport-dock) */
#transport-dock {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  background-color: rgba(18, 21, 29, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 8px)) 16px;
  gap: 8px;
  z-index: 60;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
}

/* Tier 1: Scrubber Bar & Timestamp Displays */
.dock-scrubber-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.time-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 42px;
  text-align: center;
  user-select: none;
}

.timeline-scrubber {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.timeline-scrubber:hover {
  background: rgba(255, 255, 255, 0.15);
}

.timeline-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  transition: transform 0.1s ease;
}

.timeline-scrubber::-webkit-slider-thumb:active {
  transform: scale(1.25);
  box-shadow: 0 0 16px var(--accent);
}

.timeline-scrubber::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
}

/* Tier 2: Controls Row (Desktop Default: single horizontal row) */
.dock-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.dock-transport-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-transport-mini {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.btn-transport-mini:active {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(0.95);
}

.btn-transport-mini.active,
#btn-dock-loop.active {
  background: rgba(0, 229, 255, 0.22);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

#btn-dock-undo:disabled,
#btn-dock-undo.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
  pointer-events: none;
}


.btn-record-transport {
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 0 8px;
  gap: 5px;
}

.btn-record-transport:hover {
  background: rgba(255, 59, 48, 0.22);
}

.btn-record-transport:active {
  background: var(--accent-red);
  color: #fff;
}

.btn-record-transport.recording {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-red-glow);
  animation: pulse-rec 1.5s infinite ease-in-out;
}

.dock-play-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #050608;
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-glow);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.dock-play-btn:active {
  transform: scale(0.94);
  box-shadow: 0 0 24px var(--accent);
}

.dock-play-btn.playing {
  background: var(--accent-amber);
  color: #000;
  box-shadow: 0 0 16px var(--accent-amber-glow);
}

.btn-transport-slice {
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 180, 0, 0.14);
  border: 1.5px solid var(--accent-amber);
  color: var(--accent-amber);
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.btn-transport-slice:active {
  background: var(--accent-amber);
  color: #000;
  transform: scale(0.95);
  box-shadow: 0 0 12px var(--accent-amber-glow);
}

.dock-secondary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

/* Tier 3: Extended Mix Balance & Lyrics Button */
.dock-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.dock-bottom-row .dock-balance-wrapper,
.dock-balance-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  width: 100%;
  max-width: none;
}

.dock-lyrics-wrapper {
  display: flex;
  flex-shrink: 0;
}

.balance-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.60rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.label-vocal { color: var(--accent); }
.label-mix { color: var(--text-dim); }
.label-guitar { color: var(--accent-amber); }

.transport-slider {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.transport-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
}

.transport-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
}

.dock-toggle-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dock-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dock-checkbox {
  display: none;
}

.toggle-pill {
  width: 32px;
  height: 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-pill::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s ease, background 0.2s ease;
}

.dock-checkbox:checked + .toggle-pill {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent);
}

.dock-checkbox:checked + .toggle-pill::after {
  transform: translateX(14px);
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.toggle-text {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dock-sync-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-elevated, #161820);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.dock-sync-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  user-select: none;
  margin-right: 2px;
}

.btn-sync-nudge {
  background: var(--bg-surface-inset, #111319);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  width: 22px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-sync-nudge:hover {
  background: var(--bg-surface-hover, #2a2e39);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.btn-sync-nudge:active {
  transform: scale(0.92);
}

.dock-sync-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-amber, #ffb400);
  min-width: 52px;
  text-align: center;
  user-select: none;
}

.dock-export-wrapper {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-dock-action,
.btn-dock-primary {
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-dock-action {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.btn-dock-action:active {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-dock-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #0099cc 100%);
  color: #050608;
  border: none;
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-dock-primary:active {
  transform: scale(0.97);
  box-shadow: 0 0 18px var(--accent);
}

/* 10. MEDIA QUERIES FOR ADAPTIVE DESKTOP & MOBILE */
@media (min-width: 768px) {
  #top-bar {
    padding: 12px 20px;
  }
  
  #ribbon-container {
    height: 44px;
    margin: 0;
  }
  
  .ribbon-block {
    min-width: 0;
    height: 100%;
    margin: 0;
  }
  
  #leadsheet-container {
    padding: 20px;
  }
  
  .syllable {
    font-size: 1.15rem;
  }
  
  .chord-tag {
    font-size: 0.95rem;
  }
  
  #transport-dock {
    padding: 10px 24px;
    gap: 10px;
  }
}

/* Mobile Portrait (< 768px, e.g. Galaxy S26 Ultra in portrait) */
@media (max-width: 767px) {
  #top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 5px 10px;
    min-height: auto;
    gap: 4px 6px;
  }

  .top-left-group {
    order: 1;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .brand-badge {
    order: 1;
    flex: 0 0 auto;
    gap: 6px;
  }

  .brand-logo-svg {
    width: 24px;
    height: 24px;
  }

  .brand-title {
    font-size: 0.90rem;
    letter-spacing: 0.03em;
  }

  .top-actions {
    order: 2;
    flex: 0 0 auto;
    gap: 4px;
  }

  .transpose-controls .btn-icon {
    min-width: 26px;
    height: 28px;
    font-size: 0.72rem;
  }

  .btn-action, .btn-record {
    height: 28px;
    padding: 0 8px;
    font-size: 0.70rem;
  }

  .btn-upload-icon-only,
  .btn-export-icon-only,
  .btn-close-project-icon,
  .btn-menu-drawer-icon {
    width: 28px;
    height: 28px;
    padding: 0;
  }

  /* Telemetry Status Strip occupies Row 2 of Top Bar */
  #song-info {
    order: 3;
    flex: 1 0 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding-top: 4px;
    margin-top: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .telemetry-pill {
    flex: 1 1 0%;
    padding: 2px 4px;
    min-width: 0;
  }

  .pill-label {
    font-size: 0.52rem;
  }

  .pill-value {
    font-size: 0.70rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #telemetry-status-pill {
    flex: 2 1 0%;
    max-width: none;
  }

  #session-status-display {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #nashville-bar {
    padding: 3px 6px;
    gap: 4px;
    min-height: 28px;
  }

  .degree-chip {
    padding: 3px 8px;
    font-size: 0.70rem;
    min-height: 26px;
  }

  #ribbon-container {
    height: 38px;
    margin: 0;
  }

  .ribbon-block {
    min-width: 0;
    height: 100%;
    margin: 0;
  }

  .btn-role-tag {
    font-size: 0.68rem;
  }

  #leadsheet-container {
    padding: 8px 10px;
  }

  .syllable {
    font-size: 0.96rem;
  }

  .chord-tag {
    font-size: 0.80rem;
  }

  .leadsheet-empty-state {
    padding: 20px 14px;
    gap: 8px;
    margin: auto 0;
  }

  .empty-icon {
    font-size: 2.2rem;
  }

  .empty-title {
    font-size: 1.1rem;
  }

  .empty-desc {
    font-size: 0.80rem;
    max-width: 320px;
    margin-bottom: 8px;
  }

  .empty-actions {
    gap: 10px;
  }

  .empty-btn-rec, .empty-btn-upload {
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.85rem;
  }

  #transport-dock {
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 8px)) 10px;
    gap: 5px;
  }

  .dock-scrubber-bar {
    gap: 8px;
  }

  .time-label {
    font-size: 0.68rem;
    min-width: 34px;
  }

  .timeline-scrubber {
    height: 5px;
  }

  .timeline-scrubber::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
  }

  .timeline-scrubber::-moz-range-thumb {
    width: 15px;
    height: 15px;
  }

  /* Scrubber controls row (Tier 2) & Mix row (Tier 3) on Mobile Portrait */
  .dock-controls-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }

  .dock-transport-group {
    display: flex;
    align-items: center;
    gap: 4px;
    width: auto;
    margin: 0;
  }

  .btn-transport-mini {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 0.70rem;
    padding: 0;
  }

  .dock-play-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 1rem;
  }

  .btn-transport-slice {
    height: 36px;
    min-height: 36px;
    padding: 0 6px;
    font-size: 0.68rem;
  }

  .dock-toggle-wrapper {
    flex-shrink: 0;
    margin-left: auto;
  }

  .dock-bottom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
  }

  .dock-bottom-row .dock-balance-wrapper,
  .dock-balance-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .balance-labels {
    font-size: 0.52rem;
  }

  .transport-slider {
    height: 4px;
  }

  .transport-slider::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
  }

  .transport-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
  }

  .dock-toggle-wrapper {
    flex-shrink: 0;
  }

  .toggle-pill {
    width: 26px;
    height: 15px;
  }

  .toggle-pill::after {
    width: 9px;
    height: 9px;
  }

  .dock-checkbox:checked + .toggle-pill::after {
    transform: translateX(11px);
  }

  .toggle-text {
    font-size: 0.58rem;
  }

  .dock-sync-wrapper {
    height: 30px;
    padding: 1px 4px;
    gap: 2px;
  }

  .btn-sync-nudge {
    width: 18px;
    height: 20px;
    font-size: 0.75rem;
  }

  .dock-sync-val {
    font-size: 0.65rem;
    min-width: 44px;
  }

  .dock-sync-label {
    font-size: 0.55rem;
  }

  .dock-export-wrapper {
    flex-shrink: 0;
    gap: 4px;
  }

  .btn-dock-action, .btn-dock-primary {
    height: 30px;
    min-height: 30px;
    padding: 0 6px;
    font-size: 0.65rem;
  }
}

/* Mobile Landscape (all phones in landscape orientation: width >= 560px and height <= 650px) */
@media (orientation: landscape) and (max-height: 650px) {
  #top-bar {
    min-height: 32px;
    padding: 2px 10px;
    flex-wrap: nowrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .top-left-group {
    order: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .brand-badge {
    order: 0;
    flex: 0 0 auto;
    gap: 5px;
  }

  .brand-logo-svg {
    width: 20px;
    height: 20px;
  }

  .brand-title {
    font-size: 0.80rem;
  }

  #song-info {
    order: 0;
    flex: 0 0 auto;
    display: flex;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    gap: 4px;
  }

  .top-actions {
    order: 0;
    flex: 0 0 auto;
  }

  .telemetry-pill {
    padding: 1px 4px;
    min-width: 28px;
    flex: 0 0 auto;
  }

  .pill-label {
    font-size: 0.48rem;
  }

  .pill-value {
    font-size: 0.65rem;
  }

  #telemetry-status-pill {
    max-width: 90px;
  }

  .btn-icon {
    min-width: 24px;
    height: 24px;
    font-size: 0.70rem;
  }

  .btn-action, .btn-record {
    height: 24px;
    padding: 0 6px;
    font-size: 0.65rem;
  }

  .btn-upload-icon-only,
  .btn-export-icon-only,
  .btn-close-project-icon,
  .btn-menu-drawer-icon {
    width: 24px;
    height: 24px;
    padding: 0;
  }

  #nashville-bar {
    min-height: 22px;
    padding: 1px 6px;
    gap: 3px;
  }

  .degree-chip {
    padding: 1px 6px;
    font-size: 0.65rem;
    min-height: 20px;
  }

  #ribbon-container {
    height: 34px;
    margin: 0;
  }

  .ribbon-block {
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 3px 4px;
  }

  .btn-role-tag {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .block-tag {
    font-size: 0.65rem;
  }

  .block-score {
    font-size: 0.58rem;
  }

  .block-lyrics {
    font-size: 0.58rem;
  }

  #leadsheet-container {
    padding: 4px 10px;
  }

  .syllable {
    font-size: 0.90rem;
  }

  .chord-tag {
    font-size: 0.75rem;
  }

  .leadsheet-empty-state {
    padding: 8px 12px;
    margin: auto 0;
    gap: 4px;
  }

  .empty-icon {
    font-size: 1.4rem;
    margin-bottom: 0;
  }

  .empty-title {
    font-size: 0.90rem;
  }

  .empty-desc {
    font-size: 0.72rem;
    max-width: 440px;
    margin-bottom: 4px;
    line-height: 1.3;
  }

  .empty-actions {
    gap: 8px;
  }

  .empty-btn-rec, .empty-btn-upload {
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.75rem;
  }

  #transport-dock {
    padding: 2px 10px calc(2px + env(safe-area-inset-bottom, 2px)) 10px;
    gap: 2px;
  }

  .dock-scrubber-bar {
    gap: 6px;
  }

  .time-label {
    font-size: 0.62rem;
    min-width: 28px;
  }

  .timeline-scrubber {
    height: 3px;
  }

  .timeline-scrubber::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
  }

  .timeline-scrubber::-moz-range-thumb {
    width: 12px;
    height: 12px;
  }

  /* Single horizontal row on Landscape */
  .dock-controls-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .dock-transport-group {
    display: flex;
    align-items: center;
    gap: 4px;
    width: auto;
    margin: 0;
  }

  .btn-transport-mini {
    min-width: 28px;
    height: 28px;
    font-size: 0.65rem;
    padding: 0 3px;
  }

  .dock-play-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 0.80rem;
  }

  .btn-transport-slice {
    height: 28px;
    padding: 0 5px;
    font-size: 0.65rem;
  }

  .dock-toggle-wrapper {
    flex-shrink: 0;
    margin-left: auto;
  }

  .dock-bottom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
  }

  .dock-bottom-row .dock-balance-wrapper,
  .dock-balance-wrapper {
    flex: 1;
    max-width: none;
  }

  .balance-labels {
    font-size: 0.50rem;
  }

  .transport-slider {
    height: 3px;
  }

  .transport-slider::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
  }

  .btn-dock-action, .btn-dock-primary {
    height: 26px;
    min-height: 26px;
    padding: 0 5px;
    font-size: 0.62rem;
  }
}

/* Scrubber mini record button */
.btn-record-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 45, 85, 0.12);
  border: 1px solid rgba(255, 45, 85, 0.35);
  border-radius: 12px;
  padding: 2px 8px;
  height: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-record-mini:hover {
  background: rgba(255, 45, 85, 0.22);
  border-color: rgba(255, 45, 85, 0.6);
}

.btn-record-mini.recording {
  background: rgba(255, 45, 85, 0.35);
  border-color: #ff2d55;
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.5);
}

.btn-record-mini .rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff2d55;
  display: inline-block;
  box-shadow: 0 0 6px #ff2d55;
}

.btn-record-mini.recording .rec-dot {
  animation: pulse-red 1s infinite alternate;
}

.btn-record-mini .rec-timer {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #fff;
  font-weight: 700;
}

@keyframes pulse-red {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 4px #ff2d55; }
  100% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 10px #ff2d55; }
}

/* Dock Share / Export icon-only button */
.btn-dock-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  width: 32px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Lead sheet stanza spacing & line breaks */
.leadsheet-line.stanza-break {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Section highlights on lead sheet */
.syllable.section-highlight,
.syllable.active-section-highlight {
  background: rgba(255, 180, 0, 0.22);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 180, 0, 0.45);
  text-shadow: 0 0 6px rgba(255, 180, 0, 0.8);
  color: #fff;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* Temporary Floating Processing Toast */
.processing-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 20, 26, 0.92);
  border: 1px solid var(--accent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 229, 255, 0.35);
  padding: 10px 18px;
  border-radius: 24px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.processing-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.processing-toast.is-error {
  border-color: #ff3b30;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 59, 48, 0.4);
}

.processing-toast.is-info {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.toast-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 229, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
}

.toast-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.toast-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent, #00e5ff), #60efff);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  border-radius: 2px;
  transition: width 0.35s ease-out;
}

.processing-toast.is-error .toast-progress-bar {
  background: #ff3b30;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

.toast-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.1;
}

.processing-toast.is-error .toast-title {
  color: #ff3b30;
}

.processing-toast.is-info .toast-title {
  color: var(--text-dim);
}

.toast-message {
  font-size: 0.82rem;
  font-weight: 500;
  color: #f0f0f5;
  white-space: nowrap;
}

/* Resync In-Modal Status Banner */
.resync-modal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  margin-top: 10px;
  margin-bottom: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.28);
  color: var(--accent);
  transition: all 0.2s ease;
}

.resync-modal-status.is-error {
  background: rgba(255, 69, 58, 0.12);
  border-color: rgba(255, 69, 58, 0.35);
  color: #ff6b6b;
}

.resync-modal-status.is-success {
  background: rgba(48, 209, 88, 0.12);
  border-color: rgba(48, 209, 88, 0.35);
  color: #30d158;
}

/* ==========================================================================
   NAVIGATION DRAWER (#nav-drawer, #nav-drawer-overlay)
   ========================================================================== */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 6, 9, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-drawer-overlay.drawer-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 290px;
  max-width: 82vw;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-medium);
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.85);
  z-index: 110;
  display: flex;
  flex-direction: column;
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-drawer.drawer-open {
  transform: translate3d(0, 0, 0);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
}

.nav-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-drawer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-drawer-title {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text-main);
  text-transform: uppercase;
  line-height: 1;
}

.nav-drawer-subtitle {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.btn-drawer-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.btn-drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.nav-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 10px;
  text-transform: uppercase;
}

.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.nav-drawer-item svg {
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.nav-drawer-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: #ffffff;
}

.nav-drawer-item:hover svg {
  transform: scale(1.12);
}

.nav-drawer-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.nav-drawer-session-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.session-status-dot.active {
  background-color: var(--accent-success, #30d158);
  box-shadow: 0 0 8px var(--accent-success, #30d158);
}

.nav-drawer-version {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}

/* Comp vs. Raw Playback Toggle */
.comp-raw-toggle-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
}

.btn-mode-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted, #8e9bb0);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-mode-toggle.active {
  background: var(--accent, #00e5ff);
  color: #0d1117;
  box-shadow: 0 1px 4px rgba(0, 229, 255, 0.3);
}

/* Take Inspector Badges & Notes */
.take-status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.take-status-badge.complete {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.take-status-badge.aborted_false_start {
  background: rgba(255, 82, 82, 0.15);
  color: #ff5252;
  border: 1px solid rgba(255, 82, 82, 0.3);
}

.take-status-badge.breakdown {
  background: rgba(255, 171, 0, 0.15);
  color: #ffab00;
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.take-status-badge.keeper {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.take-notes {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted, #8e9bb0);
  margin-top: 2px;
  font-style: italic;
}

/* Tempo Sync Toggle & Indicators */
.btn-tempo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface-elevated, #1c2333);
  border: 1px solid var(--border-subtle, #2b3648);
  border-radius: 14px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #8e9bb0);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-tempo-toggle:hover {
  border-color: var(--border-main, #3d4d65);
  color: var(--text-main, #f0f4f8);
}

.btn-tempo-toggle.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.45);
  color: #00e5ff;
}

.tempo-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted, #64748b);
  display: inline-block;
}

.btn-tempo-toggle.active .tempo-indicator-dot {
  background: #00e5ff;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.7);
}

.section-tempo-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.3);
  margin-left: 4px;
  letter-spacing: 0.2px;
}

.section-tempo-badge.tempo-flagged {
  background: rgba(255, 171, 0, 0.2);
  color: #ffab00;
  border-color: rgba(255, 171, 0, 0.4);
}

.take-tempo-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  color: var(--text-muted, #8e9bb0);
  margin-top: 3px;
}

.take-tempo-info .tempo-val {
  font-weight: 700;
  color: var(--text-main, #e2e8f0);
}



