:root {
  --radius: 0.5rem;
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --primary-color: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #ccfbf1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --popover: #ffffff;
  --popover-foreground: #0f172a;
  --primary: #0d9488;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #1e293b;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #f1f5f9;
  --accent-foreground: #0f766e;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #cbd5e1;
  --input: #cbd5e1;
  --ring: #0d9488;
  --brand: #0d9488;
  --brand-foreground: #ffffff;
  --brand-soft: #ccfbf1;
  --wave: #0d9488;
  --selection: rgba(13, 148, 136, 0.22);
  --marker: #f59e0b;
  --marker-foreground: #451a03;
  --marker-soft: #fef3c7;
  --timeline: #f8fafc;
  --timeline-tick: #64748b;
}

[data-theme="dark"],
.dark {
  --bg-app: #091316;
  --bg-surface: #0f1f23;
  --bg-subtle: #162c32;
  --bg-hover: #1e3a42;
  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #244751;
  --primary-color: #14b8a6;
  --primary-hover: #0d9488;
  --primary-light: rgba(20, 184, 166, 0.15);

  --background: #091316;
  --foreground: #f8fafc;
  --card: #0f1f23;
  --card-foreground: #f8fafc;
  --popover: #0f1f23;
  --popover-foreground: #f8fafc;
  --primary: #14b8a6;
  --primary-foreground: #042f2e;
  --secondary: #162c32;
  --secondary-foreground: #f8fafc;
  --muted: #162c32;
  --muted-foreground: #94a3b8;
  --accent: #1e3a42;
  --accent-foreground: #5eead4;
  --destructive: #f87171;
  --destructive-foreground: #ffffff;
  --border: #244751;
  --input: #244751;
  --ring: #14b8a6;
  --brand: #14b8a6;
  --brand-foreground: #042f2e;
  --brand-soft: #162c32;
  --wave: #2dd4bf;
  --selection: rgba(45, 212, 191, 0.25);
  --marker: #fbbf24;
  --marker-foreground: #451a03;
  --marker-soft: #78350f;
  --timeline: #0b171a;
  --timeline-tick: #64748b;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
.ic { width: 16px; height: 16px; }
.ic-sm { width: 14px; height: 14px; }
.muted { color: var(--text-muted); }
.primary-t { color: var(--primary-color); }

/* Header matching Infinity Office suite style */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.brand-icon {
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-color);
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.title {
  width: 220px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  outline: none;
  transition: all 0.15s ease;
}
.title:hover {
  background: var(--bg-subtle);
  border-color: var(--border-color);
}
.title:focus {
  background: var(--bg-surface);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
}
.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}
.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.btn-secondary {
  background: var(--bg-subtle);
}

/* Menu Bar */
.menu-bar, .menubar {
  height: 28px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 2px;
  font-size: 0.82rem;
  position: relative;
  z-index: 500;
  flex-shrink: 0;
}

.menu-item {
  position: relative;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 500;
  user-select: none;
  transition: background-color 0.12s ease;
}
.menu-item:hover, .menu-item.active {
  background-color: var(--bg-hover);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  padding: 6px 0;
  z-index: 600;
}
.menu-item.active > .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  gap: 10px;
  transition: all 0.12s ease;
  user-select: none;
}
.dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 13px;
}
.dropdown-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}
.dropdown-item:hover i {
  color: var(--primary-color);
}
.dropdown-item .shortcut,
.dropdown-item .menu-shortcut {
  margin-left: auto;
  padding-left: 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
}
.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 5px 0;
}

/* Toolbars */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}
.toolbar-edit {
  background: var(--bg-subtle);
}
.btn-tb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}
.btn-tb:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}
.btn-tb:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-icon {
  padding: 5px 8px;
}
.separator {
  height: 20px;
  width: 1px;
  background: var(--border-color);
  margin: 0 4px;
}
.zoom-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 0 4px;
  color: var(--text-muted);
}
.snap-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  margin: 0 4px;
}

/* Main Area */
main {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trackhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px 6px 0 0;
}
.track-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
#track-info {
  color: var(--text-muted);
  font-size: 12px;
}

#timeline-scroll {
  position: relative;
  overflow: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  height: 330px;
  touch-action: none;
}
#wave {
  display: block;
  height: 310px;
  touch-action: none;
}
#marker-layer {
  position: absolute;
  left: 0;
  top: 34px;
  height: 32px;
  pointer-events: none;
}
.marker-pin {
  position: absolute;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--marker);
  color: var(--marker-foreground);
  padding: 3px 6px;
  pointer-events: auto;
  touch-action: none;
  border: 0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: grab;
}
.marker-pin.active {
  outline: 2px solid var(--text-main);
}

#empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
}
#empty[hidden] { display: none; }
.empty-wave {
  font-size: 54px;
  color: var(--primary-color);
  opacity: 0.85;
}
#empty h2 {
  margin: 0;
  font-size: 18px;
}
.empty-desc {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty-actions {
  display: flex;
  gap: 10px;
}

/* Transport */
.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.btn-transport {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.btn-transport:hover {
  background: var(--bg-hover);
}
.btn-play {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.btn-play:hover {
  background: var(--primary-hover);
}
.btn-transport.record {
  color: var(--destructive);
}
.btn-transport[aria-pressed="true"] {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}
#clock {
  font: 20px monospace;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
  padding: 4px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}
.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  color: var(--text-muted);
}
.volume input {
  width: 90px;
  accent-color: var(--primary-color);
}

/* Selection */
.selection {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.selection label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.selection input[type=number] {
  width: 110px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 5px 8px;
  background: var(--bg-surface);
  color: var(--text-main);
}
.queue-badge, .badge {
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
}

/* Effects */
.effects, .markers {
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.effects h2, .markers h2 {
  margin: 0 0 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-effects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.gain-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}
.gain-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.gain-group input[type=number] {
  width: 65px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 6px;
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Markers */
.marker-row, .library-row, .batch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  flex-wrap: wrap;
}
.marker-row input, .batch-row input[type=text] {
  flex: 1;
  min-width: 100px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-surface);
}

/* Dialog / Modal */
dialog {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 640px;
  max-width: calc(100% - 24px);
  max-height: 85vh;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dialog-head h2 { font-size: 18px; margin: 0; }
.modal-close-btn {
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
}
.modal-close-btn:hover { color: var(--destructive); }
#dialog-body { display: grid; gap: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.library-name { flex: 1; min-width: 120px; }
.library-name strong, .library-name small { display: block; }
.field { display: grid; gap: 6px; font-size: 12px; }
.field select, .field input {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 8px;
  background: var(--bg-surface);
  color: var(--text-main);
}
.suite-row { padding: 10px; border-bottom: 1px solid var(--border-color); }
progress { width: 100%; accent-color: var(--primary-color); }

/* Common Modal Styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.modal-card {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  width: 520px;
  max-width: calc(100% - 32px);
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-lg { width: 620px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--destructive); }
.modal-body { padding: 16px 18px; }

.shortcut-grid {
  display: grid;
  gap: 8px;
}
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}
.shortcut-key {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--text-muted);
}

#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: var(--bg-surface);
  padding: 10px 18px;
  border-radius: 6px;
  max-width: 90%;
  font-size: 13px;
  font-weight: 500;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .header { padding: 0 10px; gap: 8px; }
  .logo-title { font-size: 13px; }
  .title { width: 140px; }
  .status { display: none; }
  .header-right-actions span { display: none; }
}


/* PWA Installation Button */
.btn-pwa-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-light, #ccfbf1);
  color: var(--primary-color, #0d9488);
  border: 1px solid var(--primary-color, #0d9488);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin-right: 6px;
}

.btn-pwa-install:hover {
  background-color: var(--primary-color, #0d9488);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-pwa-install:active {
  transform: translateY(0);
}

[data-theme="dark"] .btn-pwa-install,
.dark .btn-pwa-install {
  background-color: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border-color: #14b8a6;
}

[data-theme="dark"] .btn-pwa-install:hover,
.dark .btn-pwa-install:hover {
  background-color: #14b8a6;
  color: #042f2e;
}

[data-pwa-installed="true"] .btn-pwa-install {
  display: none !important;
}


/* ========================================================
   Multi-Voice Track Timeline Modal & Editor Styling
   ======================================================== */
.mt-modal-content {
  width: 95vw;
  max-width: 1400px;
  height: 85vh;
  max-height: 850px;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.mt-modal-header {
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mt-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.mt-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.mt-time-badge {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--bg-surface);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  margin-left: 8px;
}

.mt-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}

.mt-track-controls-col {
  width: 250px;
  min-width: 250px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mt-timeline-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.mt-ruler-wrapper {
  height: 32px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-app);
  position: relative;
  overflow: hidden;
}

.mt-ruler {
  height: 100%;
  position: relative;
}

.mt-ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0,0,0,0.1);
  font-size: 10px;
  padding-left: 4px;
  color: var(--text-muted);
}
[data-theme="dark"] .mt-ruler-tick {
  background: rgba(255,255,255,0.1);
}

.mt-ruler-tick.major {
  background: var(--border-color);
  font-weight: 600;
  border-left: 1px solid var(--primary-color);
}

.mt-lanes-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--bg-app);
}

.mt-lanes {
  position: relative;
  min-height: 100%;
}

.mt-track-header {
  height: 90px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  border-left: 5px solid var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-surface);
}

.mt-th-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mt-track-name {
  font-weight: 600;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 2px 4px;
  border-radius: 4px;
  width: 170px;
}
.mt-track-name:focus {
  background: var(--bg-app);
  border-color: var(--primary-color);
  outline: none;
}

.mt-th-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mt-btn-pill {
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
}
.mt-btn-pill:hover {
  background: var(--bg-hover);
}
.mt-btn-pill.active-mute {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}
.mt-btn-pill.active-solo {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}
.mt-btn-pill.active-rec {
  background: #ef4444;
  color: #fff;
  animation: pulse-rec 1s infinite alternate;
}
@keyframes pulse-rec {
  from { opacity: 0.8; }
  to { opacity: 1; transform: scale(1.05); }
}

.mt-upload-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.mt-th-vol {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.mt-vol-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--primary-color);
  cursor: pointer;
}
.mt-vol-val {
  min-width: 32px;
  text-align: right;
  font-family: monospace;
}

.mt-lane {
  height: 90px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  background: repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(0,0,0,0.03) 60px);
}
[data-theme="dark"] .mt-lane {
  background: repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.03) 60px);
}

.mt-clip {
  position: absolute;
  top: 6px;
  height: 76px;
  background: var(--bg-surface);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  border: 1px solid var(--border-color);
  border-top-width: 4px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  flex-direction: column;
}

.mt-clip.dragging {
  cursor: grabbing;
  opacity: 0.85;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 10;
}

.mt-clip-title {
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.mt-clip-del {
  border: none;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 2px;
}
.mt-clip-del:hover {
  color: var(--destructive);
}

.mt-clip-wave {
  flex: 1;
  display: block;
}

.mt-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 50;
  pointer-events: none;
}
.mt-playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.mt-empty-hint {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.mt-empty-lanes-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  opacity: 0.6;
}
