:root {
  --bg: #0b0e14;
  --surface: #121722;
  --surface2: #192030;
  --border: #263044;
  --text: #e6edf7;
  --muted: #8b9bb4;
  --primary: #3b82f6;
  --accent: #a855f7;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.brand-logo {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
  flex-shrink: 0;
  user-select: none;
}
.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: #232836;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.brand-logo:hover .brand-logo-img {
  transform: scale(1.18) rotate(180deg);
}
.brand-logo-text {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #f4f4f5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.85);
  background: rgba(11, 14, 20, 0.32);
  backdrop-filter: blur(4px);
  padding: 0 3px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
}
.brand-logo-alpha {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(153, 27, 27, 0.78);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.12em;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.auth-box { display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.field { display: flex; align-items: center; gap: 5px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; }
.field span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.field input, .field select {
  background: transparent; border: none; color: var(--text); outline: none; font-size: 12px;
}
.field select option { background: var(--surface); color: var(--text); }
.mini-field { padding: 3px 7px; }

.btn {
  border: 1px solid transparent; border-radius: 7px; padding: 6px 11px;
  font-weight: 600; font-size: 12px; cursor: pointer; color: #fff; background: var(--surface2);
  transition: transform 0.08s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--primary); }
.btn.accent { background: var(--accent); }
.btn.success { background: var(--success); }
.btn.secondary { border-color: var(--border); color: var(--text); }
.btn.mini { padding: 4px 8px; font-size: 11px; border-color: var(--border); color: var(--text); }
.btn.danger { color: #fca5a5; border-color: #7f1d1d; }

/* Progress Banner */
.progress-banner {
  background: #101829;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.progress-meta .mono { margin-left: auto; color: var(--muted); }
.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.25);
  border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track {
  width: 100%; height: 5px; border-radius: 99px;
  background: var(--surface2); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 25%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.35s ease;
}
.progress-fill.indeterminate {
  width: 35% !important;
  animation: slideIndet 1.4s ease-in-out infinite;
}
@keyframes slideIndet {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* 2-row DAW layout: Top = Monitor + Sidebar, Bottom = Full-Width Timeline Dock */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  grid-template-rows: auto auto;
  gap: 12px;
  padding: 12px 14px 14px;
  flex: 1;
}

.monitor-panel, .sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.monitor-header, .panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}

.view-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tab {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 10px; cursor: pointer; font-weight: 600; font-size: 12px;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.pill {
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  font-family: ui-monospace, monospace;
}
.meta-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.bpm-pill {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bpm-pill.analyzed {
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.14);
}

/* Video Stage — full-bleed */
.video-stage {
  position: relative;
  background: #05070b;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 490px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.video-stage.solo-active {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.45), 0 0 18px rgba(249, 115, 22, 0.18);
}
.video-stage.portrait {
  max-height: 490px;
}
.video-stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 2;
}
.transition-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: #000;
}
.stage-overlay {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 20px);
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 6px 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  pointer-events: auto;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.stage-overlay.solo-active {
  border-color: rgba(249, 115, 22, 0.72);
  background: rgba(28, 15, 7, 0.86);
}
#activeLaneLabel {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buf-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #94a3b8;
}
.buf-ring svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.buf-ring-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.24);
  stroke-width: 2.2;
}
.buf-ring-arc {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 37.7;
  stroke-dashoffset: 37.7;
  transform: rotate(-90deg);
  transform-origin: 8px 8px;
  transition: stroke-dashoffset 0.25s ease, stroke 0.25s ease;
}
.buf-ring-check {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.buf-ring.done .buf-ring-check {
  opacity: 1;
}
.stage-buf-ring {
  width: 16px;
  height: 16px;
}
.solo-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.solo-lock-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.32);
}
.solo-lock-btn.locked {
  color: #fb923c;
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.75);
}
.solo-lock-btn.locked:hover {
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.34);
}

/* Centered Loading Placeholder for Sequence Preview & Solo Lane */
.stage-loading {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(6, 9, 16, 0.88);
  backdrop-filter: blur(4px);
  text-align: center;
  padding: 16px;
}
.spinner-lg { width: 26px; height: 26px; border-width: 3px; }
.stage-loading-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.stage-loading-sub { font-size: 11.5px; color: var(--muted); max-width: 360px; }

/* Unified Pre-Buffered Lane Players (switches cleanly between Single/Sequence & All Lanes Grid) */
.stage-lanes {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #05070b;
}
.stage-lanes.mode-single .mosaic-tile {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.stage-lanes.mode-single .mosaic-tile video {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.stage-lanes.mode-single .mosaic-tile-label,
.stage-lanes.mode-single .mosaic-tile-badge,
.stage-lanes.mode-single .mosaic-tile-pending {
  display: none;
}

.stage-lanes.mode-mosaic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  background: #060910;
}
.stage-lanes.mode-mosaic .mosaic-tile {
  position: relative;
  background: #0d121d;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 1 !important;
}
.stage-lanes.mode-mosaic .mosaic-tile:hover { border-color: var(--primary); }
.stage-lanes.mode-mosaic .mosaic-tile.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,0.45); }
.stage-lanes.mode-mosaic .mosaic-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic-tile-label {
  position: absolute; left: 6px; bottom: 6px; z-index: 3;
  background: rgba(8, 11, 18, 0.82);
  padding: 2px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 600;
  max-width: calc(100% - 12px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mosaic-tile-badge {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #6ee7b7;
  padding: 1px 6px; border-radius: 99px;
  font-size: 10px; font-weight: 600;
}
.mosaic-tile-pending {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); font-size: 11px; background: #0d121d;
}

/* ==================== Full-Width Bottom Timeline Dock ==================== */
.timeline-dock {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dock-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dock-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
.dock-sep {
  width: 1px; height: 18px; background: var(--border); margin: 0 2px;
}
.track-title {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px;
}
.vol-wrap { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.vol-wrap input { width: 68px; accent-color: var(--primary); }
.zoom-controls { display: flex; align-items: center; gap: 5px; }
.zoom-controls input { width: 92px; accent-color: var(--accent); }
.zoom-label { min-width: 36px; text-align: center; color: var(--muted); font-size: 11px; }
.chk { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.hint { font-size: 11px; color: var(--muted); }

/* Single shared horizontal scroll & linked-zoom viewport */
.timeline-scroll-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #090c12;
}
.timeline-zoom-inner {
  position: relative;
  min-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.track-row {
  position: relative;
  width: 100%;
}
.track-row.audio-row {
  border-bottom: 1px solid var(--border);
}
.track-tag {
  position: sticky;
  left: 6px;
  top: 4px;
  z-index: 5;
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(230, 237, 247, 0.72);
  background: rgba(11, 14, 20, 0.75);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
  margin: 4px 0 -20px 6px;
}

.waveform-wrap {
  position: relative;
  width: 100%;
  min-height: 82px;
  padding: 3px 0;
  overflow: hidden;
}
#waveform { width: 100%; overflow: hidden; }
.mir-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 4;
}
.mir-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 5;
  left: 0%;
}
.waveform-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; pointer-events: none;
}

/* MIR Toolbar & Section/Vibe Header Strip (Option B) */
.mir-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 9px;
  border-radius: 7px;
  background: #0d131f;
  border: 1px solid var(--border);
}
.mir-controls, .mir-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mir-controls {
  flex-wrap: wrap;
}
.mir-status {
  flex-wrap: nowrap;
  max-width: 100%;
}
.mir-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-right: 2px;
}
.mir-bpm-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mir-bpm-badge.analyzed {
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.16);
}
.time-sig-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.time-sig-control:focus-within {
  border-color: rgba(168, 85, 247, 0.65);
}
.time-sig-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.time-sig-select,
.time-sig-den {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 1px 2px;
}
.time-sig-select option,
.time-sig-den option {
  background: var(--surface);
  color: var(--text);
}
.time-sig-custom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 4px;
  border-left: 1px solid var(--border);
}
.time-sig-num {
  width: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 0 2px;
  outline: none;
}
.time-sig-num:focus {
  border-color: rgba(168, 85, 247, 0.7);
}
.time-sig-slash {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.mir-toggle {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.mir-toggle:hover { color: var(--text); border-color: rgba(168,85,247,0.5); }
.mir-toggle.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.65);
  color: #f3e8ff;
}
.mir-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  font-size: 10.5px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lg-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-left: 3px;
}
.lg-kick { background: #f59e0b; }
.lg-snare { background: #fb7185; transform: rotate(45deg); border-radius: 1px; }
.lg-hat { background: #22d3ee; }
.lg-onset { background: transparent; border: 1.5px solid #c084fc; border-radius: 50%; }

.mir-readout {
  font-size: 11px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}
.mir-readout-msg {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 540px;
  vertical-align: middle;
}
.mir-readout-slots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mir-sep {
  color: rgba(139, 155, 180, 0.55);
  flex: 0 0 auto;
  user-select: none;
}
.mir-slot {
  display: inline-block;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mir-slot-time { width: 7.5ch; text-align: right; }
.mir-slot-section { width: 9.5ch; text-align: left; }
.mir-slot-energy { width: 11.5ch; text-align: right; }
.mir-slot-lead { width: 12.5ch; text-align: left; }
.mir-slot-drums { width: 9.5ch; text-align: left; }
.mir-slot-hits { width: 32.5ch; text-align: left; }
.mir-slot-muted { color: var(--muted); opacity: 0.6; }
.mir-badge {
  font-size: 10px;
  padding: 1px 7px;
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
  flex-shrink: 0;
  white-space: nowrap;
}

.track-row.mir-section-row {
  border-bottom: 1px solid var(--border);
  background: #0b0f18;
}
.mir-sections-wrap {
  position: relative;
  width: 100%;
  height: 26px;
  overflow: hidden;
  cursor: pointer;
}
.mir-section-blocks {
  position: absolute;
  inset: 0 0 4px 0;
  z-index: 2;
}
.mir-section-block {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255,255,255,0.22);
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.92);
  white-space: nowrap;
  transition: filter 0.1s ease;
}
.mir-section-block:hover { filter: brightness(1.22); }
.mir-sec-label {
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mir-sec-energy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  color: rgba(226, 232, 240, 0.72);
}
.mir-sec-nodrums {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(236, 72, 153, 0.22);
  border: 1px solid rgba(236, 72, 153, 0.5);
  color: #fbcfe8;
}
.mir-stem-ribbon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  display: block;
  pointer-events: none;
  z-index: 3;
}

.seq-track-wrap {
  position: relative;
  width: 100%;
  height: 76px;
  user-select: none;
  overflow: hidden;
}
#timelineCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none;
}
.seq-clips {
  position: absolute; inset: 0; z-index: 2;
}
.seq-clip {
  position: absolute;
  top: 8px; bottom: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.28);
  padding: 6px 10px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: filter 0.1s ease;
}
.seq-clip:hover { filter: brightness(1.1); }
.seq-clip.selected {
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
  z-index: 4;
}
.seq-clip-title {
  font-size: 11.5px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.seq-clip-sub {
  font-size: 10px; color: rgba(255,255,255,0.86);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.seq-handle {
  position: absolute; top: 0; bottom: 0; width: 10px;
  cursor: ew-resize; z-index: 5;
  display: flex; align-items: center; justify-content: center;
}
.seq-handle.left { left: 0; }
.seq-handle.right { right: 0; }
.seq-handle::after {
  content: ""; width: 2px; height: 22px; border-radius: 2px;
  background: rgba(255,255,255,0.55);
}

/* Single unified playhead across BOTH audio and visuals */
.seq-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #f43f5e;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.85);
  z-index: 8;
  pointer-events: none;
  left: 0%;
}
.seq-playhead::before {
  content: "";
  position: absolute; top: 0; left: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #f43f5e;
}

.clip-inspector {
  padding: 7px 10px;
  background: #0d131f;
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inspector-group, .auto-arrange-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 2px;
}
.num-input {
  width: 52px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.num-input.num-sec { width: 58px; }
.num-input.num-parts { width: 46px; }
.inspector-badge {
  font-weight: 700; font-size: 11.5px;
  padding: 2px 8px; border-radius: 5px;
  background: var(--surface2);
}
.insp-director-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.28);
  font-size: 11px;
  color: var(--text);
}
.dir-swatch-row {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 2px;
}
.dir-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  display: inline-block;
}
.dir-pill {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.pin-btn.pinned {
  border-color: rgba(251, 191, 36, 0.75);
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}
.reroll-seg-btn {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.14);
  color: #e9d5ff;
}
.reroll-seg-btn:hover:not(:disabled) {
  border-color: rgba(192, 132, 252, 0.85);
  background: rgba(168, 85, 247, 0.28);
}
.dir-seed-input {
  width: 84px;
}
.stage-toast {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 25;
  padding: 6px 11px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.seq-clip.pinned {
  box-shadow: inset 0 2.5px 0 #fbbf24;
}
.seq-clip.edited {
  outline: 1px dashed rgba(253, 224, 71, 0.7);
  outline-offset: -2px;
}
#inspRange { color: var(--muted); margin-left: auto; }

/* Sidebar cards */
.export-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.lane-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 250px;
  overflow-y: auto;
}
.lane-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.lane-card:hover { border-color: var(--primary); }
.lane-card.selected { border-color: var(--primary); background: #162238; box-shadow: 0 0 0 1px var(--primary); }

.lane-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 3px; }
.lane-title { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.lane-mini-bar {
  margin-top: 5px; height: 3px; border-radius: 99px;
  background: var(--surface2); overflow: hidden;
}
.lane-mini-bar > div {
  height: 100%; background: var(--success); transition: width 0.3s ease;
}
.lane-dl-ring {
  width: 14px;
  height: 14px;
}

.badge-ready { color: var(--success); }
.badge-streaming { color: #38bdf8; }

.export-status {
  margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; word-break: break-word;
}
.export-status a { color: var(--primary); font-weight: 600; }

.ai-restyle-form {
  display: flex; flex-direction: column; gap: 6px; margin-top: 7px;
}
.ai-restyle-form .field { justify-content: space-between; }
.ai-restyle-form .field select { flex: 1; text-align: right; }
.ai-prompt {
  width: 100%; resize: vertical; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px;
  font-family: inherit; font-size: 12px; outline: none;
}
.ai-prompt:focus { border-color: var(--accent); }

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .mosaic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Subtle dim on Sequence Arranger while Solo Lock is active */
.seq-row.solo-bypassed .seq-clips {
  opacity: 0.46;
  filter: saturate(0.48);
}

/* Lane Header & Hide Button */
.panel-head-left, .panel-head-right {
  display: flex; align-items: center; gap: 7px;
}
.link-btn {
  background: none; border: none; color: var(--primary);
  font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline;
}
.lane-card { position: relative; }
.lane-hide-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px;
  border-radius: 4px; flex-shrink: 0;
}
.lane-hide-btn:hover { color: #fca5a5; background: rgba(239,68,68,0.18); }

/* Scalable Scene Library Modal (9,400+ scenes with 16:9 preview video slots) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 13, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.catalog-modal {
  width: min(1140px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.catalog-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.catalog-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 16px; background: #0e131e; border-bottom: 1px solid var(--border);
}
.cat-search {
  flex: 1 1 260px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); padding: 7px 10px; font-size: 12.5px; outline: none;
}
.cat-search:focus { border-color: var(--primary); }
.cat-source-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.pill-btn {
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 99px; padding: 5px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.pill-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-select {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 8px; font-size: 12px; outline: none;
}
.cat-error-banner {
  margin: 10px 16px 0;
  padding: 8px 12px;
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 12px;
}
.catalog-grid {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-content: start;
  gap: 12px;
}
.cat-card {
  background: #0e1420;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cat-card:hover {
  border-color: rgba(59, 130, 246, 0.75);
  background: #121a2a;
}
.cat-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.cat-card.selected {
  border-color: var(--primary);
  background: #131f36;
  box-shadow: 0 0 0 1px var(--primary), 0 0 18px rgba(59, 130, 246, 0.25);
}
.cat-card.already-added {
  cursor: default;
  opacity: 0.72;
}
.cat-card.already-added:hover {
  border-color: var(--border);
  background: #0e1420;
}
.cat-preview-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #080b12;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-preview-slot video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cat-preview-poster {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 10px; text-align: center;
}
.cat-preview-badge {
  position: absolute; left: 7px; top: 7px;
  background: rgba(8,11,18,0.78); border: 1px solid rgba(255,255,255,0.14);
  padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 600; color: #e2e8f0;
}
.cat-select-indicator {
  position: absolute;
  right: 7px;
  top: 7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(8, 11, 18, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cat-card:hover .cat-select-indicator {
  border-color: rgba(255, 255, 255, 0.78);
}
.cat-card.selected .cat-select-indicator {
  background: var(--primary);
  border-color: #93c5fd;
  color: #fff;
}
.cat-card.already-added .cat-select-indicator {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
}
.cat-preview-hint {
  font-size: 10.5px; color: rgba(255,255,255,0.7);
  background: rgba(8,11,18,0.58); padding: 2px 8px; border-radius: 99px;
}
.cat-body {
  padding: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1;
}
.cat-title { font-weight: 700; font-size: 12.5px; color: var(--text); line-height: 1.25; }
.cat-author { font-size: 11px; color: var(--muted); }
.cat-desc {
  font-size: 11.5px; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.cat-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: var(--surface2); color: #93c5fd; border: 1px solid var(--border);
}
.cat-actions {
  margin-top: auto; padding-top: 6px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.catalog-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--border); background: #0e131e;
}
.cat-pagination {
  display: flex; align-items: center; gap: 8px;
}
.cat-footer-mid {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.cat-footer-actions {
  display: flex; align-items: center; gap: 10px;
}

/* Project Bar & My Projects Modal */
.project-bar {
  display: flex; align-items: center; gap: 6px;
  margin-left: 6px; padding-left: 10px;
  border-left: 1px solid var(--border);
}
.project-title-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 7px;
  width: 170px;
  outline: none;
}
.project-title-input:hover { border-color: var(--border); background: var(--surface2); }
.project-title-input:focus { border-color: var(--primary); background: var(--surface2); }
.save-pill {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.save-pill.saved { color: #6ee7b7; border-color: rgba(16,185,129,0.45); }
.save-pill.saving { color: #93c5fd; border-color: rgba(59,130,246,0.45); }

.projects-modal {
  width: min(760px, 100%);
  max-height: 82vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.projects-list {
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0e1420;
  border: 1px solid var(--border);
}
.project-row.current {
  border-color: var(--primary);
  background: #131e33;
}
.project-row-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.project-row-title { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row-meta { font-size: 11px; color: var(--muted); }
.project-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Two-State Render Settings UX (Empty Project Setup Card + Collapsible Batch Drawer) */
.empty-setup-card {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 35%, rgba(28, 39, 64, 0.55), rgba(5, 7, 11, 0.94) 72%);
  overflow-y: auto;
}
.empty-setup-inner {
  width: min(640px, 100%);
  background: rgba(18, 23, 34, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
}
.empty-setup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.empty-setup-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.empty-setup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.render-settings-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.render-settings-form .field {
  flex: 1 1 130px;
  justify-content: space-between;
}
.render-settings-form .field select {
  text-align: right;
}
.render-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.render-settings-toggle.open {
  border-color: var(--primary);
  color: #93c5fd;
}
.render-settings-toggle.dirty {
  border-color: var(--warn);
  color: #fde68a;
}
.render-settings-drawer {
  background: #0e1420;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.render-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}
.render-drawer-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.render-dirty-hint {
  font-size: 11px;
  color: #fde68a;
  margin-right: auto;
}

/* ==================== Bottom RunPod Debug Section ==================== */
.debug-dock {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.debug-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.debug-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.debug-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 12.5px;
  padding: 3px 6px;
  cursor: pointer;
}
.debug-toggle-btn:hover {
  background: var(--surface2);
  border-color: var(--border);
}
.debug-pill-active {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}
.debug-pill-failed {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.14);
}
.debug-pill-done {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
}
.debug-endpoints {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.debug-ep-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.debug-ep-link:hover {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.5);
}
.debug-filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.debug-pill-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.debug-pill-btn:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.5);
}
.debug-pill-btn.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.65);
  color: #dbeafe;
}
.debug-updated {
  font-size: 10.5px;
  color: var(--muted);
}
.debug-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.debug-error-banner {
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 11.5px;
}
.debug-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  background: #0b0f18;
  border: 1px dashed var(--border);
  border-radius: 7px;
}
.debug-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0b0f18;
}
.debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.debug-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  background: #0f1523;
  white-space: nowrap;
}
.debug-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(38, 48, 68, 0.55);
  vertical-align: middle;
}
.debug-table tr.debug-row:hover td {
  background: rgba(59, 130, 246, 0.06);
}
.debug-table tr.debug-row.is-failed td {
  background: rgba(239, 68, 68, 0.05);
}
.debug-table tr.debug-row.is-prev-job {
  opacity: 0.72;
}
.debug-job-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  max-width: 300px;
}
.debug-job-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.debug-job-label {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.debug-job-sub {
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.rp-kind {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.rp-kind-audio {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}
.rp-kind-lane {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #bfdbfe;
}
.rp-kind-export {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}
.rp-prev-tag {
  font-size: 9.5px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--muted);
}
.debug-rpid-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.debug-rpid-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #cbd5e1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.debug-icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.debug-icon-btn:hover {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}
.rp-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.rp-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.rp-status.pulsing .rp-status-dot {
  animation: rpPulse 1.2s ease-in-out infinite;
}
@keyframes rpPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}
.rp-st-queue {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.rp-st-progress {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
}
.rp-st-completed {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.42);
}
.rp-st-failed {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
}
.rp-st-cancelled {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.debug-status-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.rp-slow {
  color: #fbbf24;
  font-weight: 600;
}
.debug-details-cell {
  max-width: 340px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.debug-err-inline {
  color: #fca5a5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  word-break: break-word;
}
.debug-actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.debug-detail-row td {
  background: #080c14;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.debug-detail-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.debug-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.debug-kv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
}
.debug-kv-k {
  color: var(--muted);
}
.debug-kv-v {
  color: var(--text);
}
.debug-detail-err {
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}
.debug-json-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.debug-json {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #05080f;
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
