@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Noto Sans Devanagari'),
       url('../assets/fonts/NotoSansDevanagari-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Noto Sans Devanagari Bold'),
       url('../assets/fonts/NotoSansDevanagari-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local('Noto Sans Devanagari Black'),
       url('../assets/fonts/NotoSansDevanagari-Black.ttf') format('truetype');
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  font-family: 'Noto Sans Devanagari', sans-serif;
}

canvas#main {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Loading & Start screens */
#overlay-ui {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: #000;
}

#overlay-ui.hidden {
  display: none;
}

#loading-screen {
  text-align: center;
  color: #FF9933;
}
#start-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.loading-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.loading-skip-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #888;
  font-size: 0.7rem;
  cursor: pointer;
  margin-bottom: 1rem;
}
.loading-skip-option input { accent-color: #FF9933; }

/* ===== Dashboard ===== */
.dash-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.dash-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  padding: 30px 24px;
}

/* Logo */
.dash-logo {
  text-align: center;
  margin-bottom: 28px;
}
.dash-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FF9933, #FF5500);
  color: #000;
  font-size: 1.5rem;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(255, 153, 51, 0.4);
}
.dash-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  margin: 0;
  text-shadow: 0 2px 20px rgba(255, 153, 51, 0.3);
}
.dash-subtitle {
  font-size: 0.8rem;
  color: #666;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Sections */
.dash-section {
  margin-bottom: 20px;
}
.dash-section-label {
  font-size: 0.6rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  padding-left: 2px;
}

/* Music row */
.dash-music-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
}
.dash-music-icon { font-size: 1.2rem; }
.dash-music-name {
  flex: 1;
  color: #aaa;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons */
.dash-btn {
  font-family: inherit;
  font-size: 0.7rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.dash-btn-outline {
  background: none;
  border: 1px solid rgba(255, 153, 51, 0.4);
  color: #FF9933;
}
.dash-btn-outline:hover { background: rgba(255, 153, 51, 0.1); }
.dash-btn-ghost {
  background: none;
  border: 1px solid #333;
  color: #888;
}
.dash-btn-ghost:hover { background: #222; color: #ddd; }

/* Launch grid */
.dash-launch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dash-launch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: inherit;
}
.dash-launch-card:hover {
  border-color: rgba(255, 153, 51, 0.4);
  background: rgba(255, 153, 51, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.dash-launch-icon { font-size: 1.6rem; }
.dash-launch-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}
.dash-launch-desc {
  font-size: 0.6rem;
  color: #666;
  line-height: 1.4;
}
.dash-launch-clean:hover { border-color: rgba(150, 150, 150, 0.4); }
.dash-launch-saved:hover { border-color: rgba(100, 220, 100, 0.4); }
.dash-launch-ai {
  border-color: rgba(160, 100, 255, 0.15);
}
.dash-launch-ai:hover {
  border-color: rgba(160, 100, 255, 0.5);
  background: rgba(160, 100, 255, 0.05);
  box-shadow: 0 6px 20px rgba(160, 100, 255, 0.15);
}
.dash-launch-ai .dash-launch-title { color: #c8a0ff; }

/* Options row */
.dash-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 8px;
}
.dash-option-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #888;
  font-size: 0.7rem;
  cursor: pointer;
}
.dash-option-check input { accent-color: #FF9933; }

/* Dashboard status bar */
.dash-status {
  text-align: center;
  font-size: 0.7rem;
  min-height: 20px;
  padding: 4px 0;
  transition: opacity 0.3s;
}
.dash-status:empty { opacity: 0; }
.dash-status.loading { color: #FF9933; }
.dash-status.success { color: #6d6; }
.dash-status.error { color: #f66; }

/* Shortcuts (collapsible) */
.dash-shortcuts {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}
.dash-shortcuts-toggle {
  font-size: 0.65rem;
  color: #555;
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.dash-shortcuts-toggle::-webkit-details-marker { display: none; }
.dash-shortcuts-toggle::before { content: '+ '; }
.dash-shortcuts[open] .dash-shortcuts-toggle::before { content: '- '; }
.dash-shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 8px 0;
  font-size: 0.6rem;
}
.dash-shortcuts-grid span:nth-child(odd) {
  color: #FF9933;
  font-family: monospace;
  font-weight: 600;
}
.dash-shortcuts-grid span:nth-child(even) { color: #666; }

.progress-bar-container {
  width: 300px;
  height: 6px;
  background: #222;
  border-radius: 3px;
  margin: 0 auto 1rem;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: #FF9933;
  border-radius: 3px;
  transition: width 0.2s;
}

.loading-status {
  font-size: 0.85rem;
  color: #888;
}

.start-choices {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.start-choice-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 1.3rem;
  padding: 0.8rem 2.5rem;
  background: #FF9933;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.1s;
}

.start-choice-btn:hover {
  transform: scale(1.05);
}

.start-clean {
  background: #333;
  color: #ddd;
  border: 1px solid #666;
}

.start-clean:hover {
  background: #444;
}

.start-saved {
  background: #1a2a1a;
  color: #6d6;
  border: 1px solid #4a4;
}
.start-saved:hover {
  background: #2a4a2a;
}

/* Saved sessions panel */
.saved-sessions {
  max-height: 200px;
  overflow-y: auto;
  margin: 0.8rem 0;
  border: 1px solid #333;
  border-radius: 8px;
  background: rgba(0,0,0,0.5);
}
.saved-sessions.hidden { display: none; }
.saved-session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #222;
  cursor: pointer;
  transition: background 0.15s;
}
.saved-session-item:last-child { border-bottom: none; }
.saved-session-item:hover { background: rgba(255,153,51,0.1); }
.saved-session-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.saved-session-icon.timeline { color: #FF9933; }
.saved-session-icon.recipe { color: #6d6; }
.saved-session-name {
  flex: 1;
  color: #ddd;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-session-meta {
  color: #666;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.saved-session-type {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.saved-session-type.timeline {
  background: rgba(255,153,51,0.15);
  color: #FF9933;
}
.saved-session-type.recipe {
  background: rgba(100,220,100,0.1);
  color: #6d6;
}
.saved-no-items {
  padding: 16px;
  text-align: center;
  color: #666;
  font-size: 0.75rem;
}
.saved-session-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.saved-action-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.saved-action-btn:hover { background: #333; color: #ddd; }
.saved-action-btn.del { border-color: #633; color: #a66; }
.saved-action-btn.del:hover { background: #322; color: #f88; }

/* AI Settings Panel */
.ai-settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 800;
  background: rgba(15, 15, 20, 0.98);
  border: 1px solid rgba(255, 153, 51, 0.3);
  border-radius: 12px;
  padding: 20px;
  width: 380px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
.ai-settings-panel.hidden { display: none; }
.ai-settings-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.ai-settings-title {
  flex: 1;
  color: #FF9933;
  font-weight: 700;
  font-size: 1rem;
}
.ai-settings-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
}
.ai-settings-info {
  color: #555;
  font-size: 0.65rem;
  margin-bottom: 16px;
  line-height: 1.4;
}
.ai-settings-row {
  margin-bottom: 12px;
}
.ai-settings-label {
  display: block;
  color: #ddd;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.ai-settings-hint {
  display: block;
  color: #666;
  font-size: 0.6rem;
  margin-bottom: 4px;
}
.ai-settings-input {
  width: 100%;
  padding: 6px 10px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #ddd;
  font-size: 0.75rem;
  font-family: monospace;
  outline: none;
}
.ai-settings-input:focus { border-color: #FF9933; }
.ai-settings-status {
  font-size: 0.6rem;
  margin-left: 8px;
}

/* AI Progress overlay */
/* AI Generate button in property panel */
.pp-ai-gen-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, rgba(160,100,255,0.2), rgba(100,50,200,0.2));
  border: 1px solid rgba(160,100,255,0.4);
  color: #c8a0ff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.pp-ai-gen-btn:hover {
  background: linear-gradient(135deg, rgba(160,100,255,0.3), rgba(100,50,200,0.3));
  border-color: rgba(160,100,255,0.6);
}
.pp-ai-status {
  font-size: 0.6rem;
  color: #888;
  padding: 4px 0;
  text-align: center;
}

/* AI Options dialog */
.ai-options-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 850;
  background: rgba(15, 15, 20, 0.98);
  border: 1px solid rgba(160, 100, 255, 0.3);
  border-radius: 12px;
  padding: 24px;
  width: 380px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
.ai-options-title {
  color: #c8a0ff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.ai-options-desc {
  color: #666;
  font-size: 0.7rem;
  margin-bottom: 14px;
}
.ai-options-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ai-options-row input[type="checkbox"] {
  accent-color: #a06ff0;
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-options-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ai-options-label {
  color: #ddd;
  font-size: 0.75rem;
  font-weight: 600;
}
.ai-options-opt-desc {
  color: #555;
  font-size: 0.6rem;
}
.ai-options-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.ai-options-gen {
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(160,100,255,0.3), rgba(100,50,200,0.3));
  border: 1px solid rgba(160,100,255,0.5);
  color: #c8a0ff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
}
.ai-options-gen:hover { background: linear-gradient(135deg, rgba(160,100,255,0.4), rgba(100,50,200,0.4)); }
.ai-options-cancel {
  padding: 8px 20px;
  background: none;
  border: 1px solid #444;
  color: #888;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
}
.ai-options-cancel:hover { background: #222; }

.ai-progress {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 900;
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid #FF9933;
  border-radius: 12px;
  padding: 30px 40px;
  text-align: center;
}
.ai-progress.hidden { display: none; }
.ai-progress-title { color: #FF9933; font-size: 1rem; margin-bottom: 8px; }
.ai-progress-status { color: #aaa; font-size: 0.8rem; }
.ai-progress-cancel {
  margin-top: 12px;
  background: rgba(255,60,60,0.2);
  border: 1px solid rgba(255,60,60,0.4);
  color: #f66;
  padding: 4px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.record-hint {
  display: block;
  color: #666;
  font-size: 0.6rem;
  margin-top: 4px;
  line-height: 1.4;
}

/* VJ Recording indicator */
.vj-rec-indicator {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 0, 0, 0.85);
  border: 1px solid #c33;
  border-radius: 20px;
  padding: 6px 16px;
  backdrop-filter: blur(4px);
}
.vj-rec-indicator.hidden { display: none; }
.vj-rec-dot {
  width: 10px;
  height: 10px;
  background: #f33;
  border-radius: 50%;
  animation: vj-rec-pulse 1s ease-in-out infinite;
}
@keyframes vj-rec-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #f33; }
  50% { opacity: 0.3; box-shadow: 0 0 8px #f33; }
}
.vj-rec-label {
  color: #f99;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.vj-rec-stop-btn {
  background: #522;
  border: 1px solid #a44;
  color: #faa;
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.vj-rec-stop-btn:hover {
  background: #733;
}

.start-music-pick {
  margin-bottom: 1.2rem;
  text-align: center;
}
.music-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: #aaa;
  font-size: 0.85rem;
}
#music-file-name {
  color: #ccc;
  font-style: italic;
}
.music-browse-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  background: #333;
  color: #ddd;
  border: 1px solid #666;
  border-radius: 6px;
  cursor: pointer;
}
.music-browse-btn:hover { background: #555; }

.start-record-option {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
}
.start-record-option input[type="checkbox"] {
  accent-color: #FF9933;
  margin-right: 0.3rem;
}

.hint {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #666;
}

.hidden {
  display: none !important;
}

/* Debug overlay */
#debug-overlay {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  font-family: monospace;
  font-size: 13px;
  color: #0f0;
  background: rgba(0,0,0,0.7);
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  gap: 16px;
}

#debug-overlay.hidden {
  display: none;
}

/* Overlay effect controls */
#overlay-controls {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.overlay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.overlay-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.7rem;
  padding: 4px 10px;
  background: rgba(255,153,51,0.2);
  color: #FF9933;
  border: 1px solid #FF9933;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.overlay-btn-adv {
  border-color: rgba(100,200,255,0.5);
  color: rgba(100,200,255,0.9);
  background: rgba(100,200,255,0.1);
}

.overlay-btn-adv:hover {
  background: rgba(100,200,255,0.3);
}

.overlay-btn-adv.active {
  background: rgba(100,200,255,0.85);
  color: #000;
}

.overlay-btn:hover {
  background: rgba(255,153,51,0.4);
}

.overlay-btn.active {
  background: #FF9933;
  color: #000;
}

.overlay-upload-btn {
  font-size: 0.75rem;
  padding: 5px 10px;
  background: rgba(255,153,51,0.15);
  color: #FF9933;
  border: 1px dashed #FF9933;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}

.overlay-upload-btn:hover {
  background: rgba(255,153,51,0.35);
}

/* Song & Segment Navigator */
#nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 100vh;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  border-right: 1px solid rgba(255, 153, 51, 0.3);
  overflow-y: auto;
  padding: 0;
  backdrop-filter: blur(10px);
}

#nav-panel.hidden {
  display: none;
}

.nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 153, 51, 0.2);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1;
}
.nav-header .nav-title { flex: 1; }
.nav-add-btn {
  background: rgba(255,153,51,0.15);
  border: 1px solid rgba(255,153,51,0.4);
  color: #FF9933;
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.nav-add-btn:hover { background: rgba(255,153,51,0.3); }
.nav-bookmark-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.15s;
}
.nav-bookmark-item:hover { background: rgba(255,153,51,0.08); }
.nav-bookmark-item.active { background: rgba(255,153,51,0.15); }
.nav-bookmark-time {
  font-family: monospace;
  font-size: 0.65rem;
  color: #FF9933;
  min-width: 36px;
}
.nav-bookmark-name {
  flex: 1;
  font-size: 0.75rem;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-bookmark-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.nav-bookmark-item:hover .nav-bookmark-actions { opacity: 1; }
.nav-bm-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  font-size: 0.55rem;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
}
.nav-bm-btn:hover { background: #333; color: #ddd; }
.nav-bm-btn.del { border-color: #633; color: #a66; }
.nav-bm-btn.del:hover { background: #322; color: #f88; }
.nav-empty {
  padding: 20px;
  text-align: center;
  color: #555;
  font-size: 0.7rem;
}

.nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: #FF9933;
}

#nav-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

#nav-close:hover {
  color: #FF9933;
}

.nav-song {
  border-bottom: 1px solid rgba(255, 153, 51, 0.1);
}

.nav-song-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FF9933;
  padding: 12px 20px 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-song-title:hover {
  background: rgba(255, 153, 51, 0.1);
}

.nav-segments {
  display: flex;
  flex-direction: column;
  padding: 0 8px 8px;
}

.nav-seg {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.72rem;
  text-align: left;
  padding: 6px 12px;
  margin: 1px 0;
  background: transparent;
  color: #aaa;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-seg:hover {
  background: rgba(255, 153, 51, 0.15);
  color: #fff;
}

.nav-seg.active {
  background: rgba(255, 153, 51, 0.25);
  color: #FF9933;
  font-weight: 700;
}

/* Scrubber */
.nav-scrubber {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 153, 51, 0.2);
  position: sticky;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
}

.nav-scrubber span {
  font-family: monospace;
  font-size: 0.7rem;
  color: #888;
  min-width: 38px;
}

#nav-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#nav-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FF9933;
  cursor: pointer;
}

#nav-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FF9933;
  border: none;
  cursor: pointer;
}

/* Persistent seek bar (outside fullscreen) */
.seek-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 0;
}
/* Hide seek bar in fullscreen */
:fullscreen .seek-bar-row,
::backdrop .seek-bar-row {
  display: none;
}
#seek-play-btn {
  background: none;
  border: 1px solid rgba(255,153,51,0.5);
  color: #FF9933;
  font-size: 0.8rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
#seek-play-btn:hover {
  background: rgba(255,153,51,0.15);
}
.seek-bar-row span {
  font-family: monospace;
  font-size: 0.65rem;
  color: #aaa;
  min-width: 32px;
}
#seek-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF9933;
  cursor: pointer;
}
#seek-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF9933;
  border: none;
  cursor: pointer;
}

.seek-action-btn {
  background: none;
  border: 1px solid rgba(255,153,51,0.4);
  color: #FF9933;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.seek-action-btn:hover {
  background: rgba(255,153,51,0.15);
}
.seek-action-btn.recording {
  color: #ff3333;
  border-color: #ff3333;
  animation: rec-blink 1s ease-in-out infinite;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Export section in nav panel */
.nav-export {
  border-top: 2px solid rgba(255, 153, 51, 0.3);
}

.nav-export-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.72rem;
  text-align: left;
  padding: 6px 12px;
  margin: 1px 0;
  background: rgba(51, 153, 255, 0.1);
  color: #6af;
  border: 1px solid rgba(51, 153, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  width: 100%;
}

.nav-export-btn:hover {
  background: rgba(51, 153, 255, 0.25);
  color: #fff;
}

.nav-export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Export status overlay */
#export-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

#export-overlay.hidden {
  display: none;
}

.export-status-box {
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 153, 51, 0.4);
  border-radius: 12px;
  padding: 28px 40px;
  text-align: center;
  min-width: 320px;
}

.export-label {
  font-size: 1rem;
  font-weight: 700;
  color: #FF9933;
  margin-bottom: 16px;
}

.export-status-box .progress-bar-container {
  margin: 0 auto 12px;
  width: 260px;
}

.export-time {
  font-family: monospace;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 16px;
}

.export-quality {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.export-quality-label {
  color: #888;
  font-size: 0.75rem;
}
#export-quality-select {
  background: #222;
  color: #ddd;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}
.export-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.export-save {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.8rem;
  padding: 8px 24px;
  background: rgba(60, 180, 60, 0.2);
  color: #6d6;
  border: 1px solid rgba(60, 180, 60, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.export-save:hover {
  background: rgba(60, 180, 60, 0.4);
}
.export-cancel {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.8rem;
  padding: 8px 24px;
  background: rgba(255, 60, 60, 0.2);
  color: #f66;
  border: 1px solid rgba(255, 60, 60, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.export-cancel:hover {
  background: rgba(255, 60, 60, 0.4);
}

/* ===== Timecode Editor Panel ===== */
#editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 580px;
  max-width: 95vw;
  height: 100vh;
  z-index: 350;
  background: rgba(0, 0, 0, 0.94);
  border-left: 1px solid rgba(255, 153, 51, 0.3);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

#editor-panel.hidden {
  display: none;
}

#editor-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

#editor-close:hover {
  color: #FF9933;
}

#editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

#editor-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 153, 51, 0.2);
  background: rgba(0, 0, 0, 0.95);
}

.ed-footer-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.8rem;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 153, 51, 0.3);
  background: rgba(255, 153, 51, 0.1);
  color: #FF9933;
  transition: background 0.15s;
}

.ed-footer-btn:hover {
  background: rgba(255, 153, 51, 0.25);
}

.ed-save-btn {
  background: rgba(50, 200, 80, 0.2);
  color: #5d5;
  border-color: rgba(50, 200, 80, 0.4);
}

.ed-save-btn:hover {
  background: rgba(50, 200, 80, 0.35);
}

.ed-reset-btn {
  background: rgba(255, 60, 60, 0.15);
  color: #f88;
  border-color: rgba(255, 60, 60, 0.3);
  margin-left: auto;
}

.ed-reset-btn:hover {
  background: rgba(255, 60, 60, 0.3);
}

/* Editor section title */
.ed-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FF9933;
  padding: 12px 0 6px;
  border-bottom: 1px solid rgba(255, 153, 51, 0.15);
  margin-bottom: 6px;
}

/* Editor table layout */
.ed-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
}

.ed-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.ed-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.ed-cell {
  font-size: 0.72rem;
  color: #ccc;
  padding: 2px 4px;
  min-width: 0;
}

.ed-hdr {
  color: #888;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ed-label {
  flex: 1;
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ed-narrow {
  flex: 0 0 auto;
  width: 40px;
  text-align: center;
}

.ed-center {
  text-align: center;
}

.ed-lyric {
  flex: 1;
  min-width: 120px;
}

/* Editor inputs */
.ed-input {
  font-family: monospace;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  border: 1px solid rgba(255, 153, 51, 0.2);
  border-radius: 3px;
  padding: 4px 6px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.ed-input:focus {
  border-color: #FF9933;
}

.ed-num {
  width: 64px;
  text-align: right;
}

.ed-text {
  font-family: 'Noto Sans Devanagari', monospace;
  width: 100%;
}

.ed-select {
  font-family: 'Noto Sans Devanagari', sans-serif;
  width: 110px;
  cursor: pointer;
}

.ed-cb {
  width: 16px;
  height: 16px;
  accent-color: #FF9933;
  cursor: pointer;
}

/* "Now" button */
.ed-now-btn {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 6px;
  background: rgba(50, 200, 80, 0.15);
  color: #5d5;
  border: 1px solid rgba(50, 200, 80, 0.3);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}

.ed-now-btn:hover {
  background: rgba(50, 200, 80, 0.35);
}

/* Delete button */
.ed-del-btn {
  font-size: 0.85rem;
  padding: 1px 6px;
  background: none;
  color: #666;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.1s;
}

.ed-del-btn:hover {
  color: #f66;
}

/* Add row button */
.ed-add-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.72rem;
  padding: 6px 14px;
  background: rgba(255, 153, 51, 0.08);
  color: #FF9933;
  border: 1px dashed rgba(255, 153, 51, 0.3);
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 16px;
  transition: background 0.1s;
}

.ed-add-btn:hover {
  background: rgba(255, 153, 51, 0.2);
}

/* ===== Timeline Editor Panel ===== */
#tl-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 280px;
  z-index: 500;
  background: rgba(18, 18, 22, 0.97);
  border-top: 1px solid rgba(255, 153, 51, 0.3);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}

#tl-panel.hidden {
  display: none;
}

/* Toolbar */
.tl-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.tl-toolbar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #FF9933;
  margin-right: 8px;
}

.tl-transport-btn {
  font-size: 0.85rem !important;
  padding: 2px 8px !important;
  min-width: 28px;
  line-height: 1;
}
.tl-transport-btn.playing {
  color: #FF9933 !important;
  border-color: #FF9933 !important;
}
.tl-time-display {
  font-family: monospace;
  font-size: 0.65rem;
  color: #aaa;
  min-width: 80px;
  text-align: center;
}

.tl-toolbar button {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.65rem;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s;
}

.tl-toolbar button:hover {
  background: rgba(255, 153, 51, 0.2);
  color: #FF9933;
}

.tl-spacer {
  flex: 1;
}

/* Body: sidebar + scroll area */
#tl-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar (track headers) */
#tl-sidebar {
  width: 120px;
  min-width: 120px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  flex-shrink: 0;
}

.tl-track-hdr {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 2px;
}

.tl-track-name {
  flex: 1;
  font-size: 0.65rem;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-track-vis,
.tl-track-del {
  font-size: 0.7rem;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.tl-track-vis:hover,
.tl-track-del:hover {
  color: #FF9933;
}

.tl-track-vis.tl-off {
  color: #444;
}

/* Scroll area */
#tl-scroll-area {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
}

/* Ruler */
#tl-ruler {
  height: 20px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  cursor: pointer;
}

.tl-ruler-mark {
  position: absolute;
  top: 0;
  font-family: monospace;
  font-size: 0.55rem;
  color: #888;
  padding: 3px 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

/* Lanes wrapper */
#tl-lanes-wrap {
  position: relative;
}

/* Lanes */
#tl-lanes {
  position: relative;
}

.tl-lane {
  height: 32px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tl-lane:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* Clips */
.tl-clip {
  position: absolute;
  top: 2px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.1s;
}

.tl-clip:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.tl-clip-sel {
  border-color: #FF9933 !important;
  box-shadow: 0 0 6px rgba(255, 153, 51, 0.4);
}

.tl-clip-label {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Resize handles */
.tl-handle {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
}

.tl-handle-l {
  left: 0;
}

.tl-handle-r {
  right: 0;
}

.tl-handle:hover {
  background: rgba(255, 153, 51, 0.3);
}

/* Audio track */
.tl-lane-audio {
  height: 50px !important;
  background: #0a1a0a;
  border-bottom: 1px solid #2a4a2a;
}
.tl-track-hdr-audio {
  height: 50px !important;
  background: #0d1a0d;
  border-bottom: 1px solid #2a4a2a;
}
.tl-track-hdr-audio .tl-track-name {
  color: #6d6;
  font-weight: 700;
}
.tl-clip-audio {
  background: linear-gradient(180deg, #1a3a1a, #0d2a0d) !important;
  border: 1px solid #3a3 !important;
  height: 44px !important;
  top: 3px !important;
}
.tl-clip-audio.selected {
  border-color: #6d6 !important;
  box-shadow: 0 0 6px rgba(100, 220, 100, 0.3);
}
.tl-clip-audio .tl-clip-label {
  color: #5b5;
  font-size: 9px;
  z-index: 1;
  position: relative;
}
.tl-clip-audio .tl-handle {
  background: rgba(70, 170, 70, 0.4);
}
.tl-clip-audio .tl-handle:hover {
  background: rgba(100, 220, 100, 0.5);
}
.tl-clip-waveform {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
}
.tl-audio-gap {
  position: absolute;
  top: 3px;
  height: 44px;
  background: #1a0a0a;
  border: 1px dashed #533;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.6;
}
.tl-ripple-toast {
  background: #1a2a1a;
  border-top: 1px solid #4a4;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}
.tl-ripple-toast .tl-ripple-msg { color: #6d6; }
.tl-ripple-toast .tl-ripple-label { color: #aaa; }
.tl-ripple-toast button {
  padding: 2px 12px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  border: 1px solid;
}
.tl-ripple-yes { background: #2a4a2a; border-color: #4a4 !important; color: #6d6; }
.tl-ripple-no { background: #222; border-color: #444 !important; color: #888; }
.tl-ripple-timer { color: #555; font-size: 9px; margin-left: auto; }

/* Playhead */
#tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #FF9933;
  z-index: 10;
  pointer-events: none;
}

#tl-playhead::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #FF9933;
}

/* Property Panel */
#tl-props {
  width: 240px;
  min-width: 240px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  padding: 6px;
  flex-shrink: 0;
}

.pp-empty {
  font-size: 0.7rem;
  color: #666;
  text-align: center;
  padding: 20px 8px;
}

.pp-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: #FF9933;
  padding: 4px 0 8px;
  border-bottom: 1px solid rgba(255, 153, 51, 0.2);
  margin-bottom: 6px;
}

.pp-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.pp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.pp-label {
  font-size: 0.6rem;
  color: #999;
  width: 70px;
  min-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-color {
  width: 32px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  padding: 0;
}

.pp-range-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.pp-range {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  outline: none;
}

.pp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF9933;
  cursor: pointer;
}

.pp-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF9933;
  border: none;
  cursor: pointer;
}

.pp-range-val {
  font-family: monospace;
  font-size: 0.55rem;
  color: #888;
  min-width: 28px;
  text-align: right;
}

.pp-num {
  width: 60px;
  font-family: monospace;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 3px 4px;
  outline: none;
}

.pp-num:focus {
  border-color: #FF9933;
}

.pp-text {
  flex: 1;
  font-family: 'Noto Sans Devanagari', monospace;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 3px 4px;
  outline: none;
}

.pp-text:focus {
  border-color: #FF9933;
}

.pp-select {
  flex: 1;
  font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 3px 4px;
  outline: none;
  cursor: pointer;
}

.pp-select option {
  background: #1a1a1a;
  color: #eee;
}

.pp-cb {
  width: 14px;
  height: 14px;
  accent-color: #FF9933;
  cursor: pointer;
}

/* Active toolbar button */
.tl-btn-active {
  background: rgba(255, 153, 51, 0.25) !important;
  color: #FF9933 !important;
  border-color: rgba(255, 153, 51, 0.4) !important;
}

/* Track reorder buttons */
.tl-track-btn {
  font-size: 0.5rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0 1px;
  line-height: 1;
}

.tl-track-btn:hover {
  color: #FF9933;
}

/* Lane drop highlight (during cross-track drag) */
.tl-lane-drop {
  background: rgba(255, 153, 51, 0.1) !important;
  outline: 1px dashed rgba(255, 153, 51, 0.4);
  outline-offset: -1px;
}

/* Add Clip dropdown menu */
.tl-add-menu {
  position: absolute;
  z-index: 600;
  background: rgba(20, 20, 28, 0.98);
  border: 1px solid rgba(255, 153, 51, 0.3);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.tl-add-search {
  width: calc(100% - 16px);
  margin: 4px 8px;
  padding: 5px 8px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #ddd;
  font-size: 0.7rem;
  outline: none;
  font-family: inherit;
}
.tl-add-search:focus { border-color: #FF9933; }
.tl-add-search::placeholder { color: #666; }

.tl-add-menu-cat {
  font-size: 0.6rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px 2px;
}

.tl-add-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 12px;
  background: none;
  border: none;
  color: #ccc;
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.tl-add-menu-item:hover {
  background: rgba(255, 153, 51, 0.15);
  color: #fff;
}

.tl-add-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Context menu */
.tl-ctx-menu {
  position: absolute;
  z-index: 700;
  background: rgba(20, 20, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.tl-ctx-item {
  display: block;
  width: 100%;
  padding: 5px 14px;
  background: none;
  border: none;
  color: #ccc;
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.68rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.tl-ctx-item:hover:not(:disabled) {
  background: rgba(255, 153, 51, 0.15);
  color: #fff;
}

.tl-ctx-item:disabled {
  color: #555;
  cursor: default;
}

.tl-ctx-danger:hover:not(:disabled) {
  background: rgba(255, 60, 60, 0.2);
  color: #f88;
}

.tl-ctx-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 3px 8px;
}

/* Locked track */
.tl-lane-locked {
  opacity: 0.5;
  pointer-events: auto;
}

.tl-lane-locked .tl-clip {
  cursor: default;
}

.tl-lane-locked .tl-handle {
  cursor: default;
  display: none;
}

.tl-track-locked {
  background: rgba(255, 255, 255, 0.03);
}

.tl-track-locked .tl-track-name {
  color: #777;
  font-style: italic;
}

.tl-lock-on {
  color: #FF9933 !important;
}

/* Waveform canvas — positioned absolutely, JS updates left on scroll */
#tl-waveform {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

/* Path property row */
.pp-path-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.pp-path-count {
  font-family: monospace;
  font-size: 0.6rem;
  color: #888;
  min-width: 36px;
}

.pp-path-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.6rem;
  padding: 2px 8px;
  background: rgba(255, 153, 51, 0.15);
  color: #FF9933;
  border: 1px solid rgba(255, 153, 51, 0.3);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s;
}

.pp-path-btn:hover {
  background: rgba(255, 153, 51, 0.3);
}

.pp-path-clear {
  background: rgba(255, 60, 60, 0.1);
  color: #f88;
  border-color: rgba(255, 60, 60, 0.2);
  padding: 2px 5px;
}

.pp-path-clear:hover {
  background: rgba(255, 60, 60, 0.25);
}

/* ===== Path Editor Overlay ===== */
#path-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 460;
  pointer-events: none;
}

.pe-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 153, 51, 0.3);
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.pe-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #FF9933;
  margin-right: 8px;
}

.pe-btn {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.7rem;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}

.pe-btn:hover {
  background: rgba(255, 153, 51, 0.2);
  color: #FF9933;
}

.pe-btn-done {
  background: rgba(50, 200, 80, 0.2);
  color: #5d5;
  border-color: rgba(50, 200, 80, 0.3);
}

.pe-btn-done:hover {
  background: rgba(50, 200, 80, 0.35);
}

.pe-btn-cancel {
  background: rgba(255, 60, 60, 0.15);
  color: #f88;
  border-color: rgba(255, 60, 60, 0.25);
}

.pe-btn-cancel:hover {
  background: rgba(255, 60, 60, 0.3);
}

.pe-hint {
  font-size: 0.6rem;
  color: #777;
}

.pe-spacer {
  flex: 1;
}

/* ── Flow Recipe Panel ── */
#flow-panel {
  position: fixed;
  top: 60px;
  right: 10px;
  width: 420px;
  max-height: calc(100vh - 80px);
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid #444;
  border-radius: 8px;
  z-index: 90;
  overflow-y: auto;
  font-size: 0.8rem;
  color: #ddd;
}
#flow-panel.hidden { display: none; }

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  background: rgba(30, 30, 50, 0.9);
  border-radius: 8px 8px 0 0;
}
.flow-title { font-weight: 700; font-size: 0.9rem; color: #fff; }
.flow-close-btn {
  background: none; border: none; color: #aaa; font-size: 1.1rem; cursor: pointer;
}
.flow-close-btn:hover { color: #fff; }

.flow-toolbar {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid #222;
  align-items: center;
}
.flow-toolbar button {
  background: #333; border: 1px solid #555; color: #ddd; padding: 3px 10px;
  border-radius: 4px; cursor: pointer; font-size: 0.75rem;
}
.flow-toolbar button:hover { background: #555; }
.flow-autoplay-label {
  margin-left: auto; font-size: 0.75rem; color: #888;
}
.flow-autoplay-on { color: #0f0 !important; font-weight: 700; }

.flow-list { padding: 4px 8px; }
.flow-recipe-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-bottom: 1px solid #222;
}
.flow-recipe-editing { background: rgba(60, 60, 120, 0.3); }
.flow-recipe-autoplay { border-left: 3px solid #0f0; }
.flow-recipe-name { flex: 1; font-weight: 600; }
.flow-recipe-steps { color: #888; font-size: 0.7rem; margin-right: 4px; }

.flow-btn {
  background: #333; border: 1px solid #555; color: #ddd; padding: 2px 8px;
  border-radius: 3px; cursor: pointer; font-size: 0.7rem;
}
.flow-btn:hover { background: #555; }
.flow-del-btn { color: #f66; }
.flow-del-btn:hover { background: #622; }
.flow-play-btn { color: #6f6; }
.flow-play-btn:hover { background: #262; }
.flow-timeline-btn { color: #FF9933; }
.flow-timeline-btn:hover { background: #432; }

.flow-empty { color: #666; padding: 12px; text-align: center; font-style: italic; }

.flow-editor { padding: 8px 12px; border-top: 1px solid #444; }

.flow-ed-header {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
}
.flow-ed-name {
  flex: 1; background: #222; border: 1px solid #555; color: #fff;
  padding: 4px 8px; border-radius: 4px; font-size: 0.8rem;
}

.flow-steps { display: flex; flex-direction: column; gap: 6px; }

.flow-step {
  background: rgba(40, 40, 60, 0.6);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 8px;
}
.flow-step-header {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px;
}
.flow-step-num { font-weight: 700; color: #aaf; min-width: 28px; }
.flow-step-range { color: #888; font-size: 0.7rem; margin-left: auto; }
.flow-time-input {
  width: 55px; background: #222; border: 1px solid #555; color: #fff;
  padding: 2px 4px; border-radius: 3px; font-size: 0.75rem;
}
.flow-step-overlays {
  display: flex; flex-wrap: wrap; gap: 2px 8px; padding-top: 4px;
}
.flow-ov-label {
  display: flex; align-items: center; gap: 3px; font-size: 0.7rem; color: #bbb;
  cursor: pointer;
}
.flow-ov-label input[type="checkbox"] { accent-color: #66f; }
.flow-step-del { margin-left: auto; }
