/* ==========================================================================
   ClipLine Audio Studio — Dark Studio DAW Theme
   ========================================================================== */

:root {
  --bg-deep: #0b0e14;
  --bg-panel: #121620;
  --bg-elevated: #181d2a;
  --bg-hover: #21283a;
  --bg-input: #0d1119;

  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.28);
  --emerald: #10b981;
  --amber: #f59e0b;
  --danger: #f43f5e;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --header-col-w: 220px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.studio-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ==================== TOP TRANSPORT BAR ==================== */
.top-bar {
  height: 54px;
  background: linear-gradient(180deg, #161b27 0%, #111520 100%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 20;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: grid;
  place-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-top: 2px;
}

.transport-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.play-btn {
  width: 36px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #041018;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

.play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.play-btn.is-playing {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.35);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.icon-btn.sm {
  width: 26px;
  height: 26px;
  font-size: 14px;
  font-weight: 600;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--accent);
  color: var(--accent);
}

.timecode-display {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 12px;
  margin: 0 6px;
  border-radius: 7px;
  background: #090c12;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.tc-main {
  font-size: 14px;
  font-weight: 600;
  color: #38bdf8;
  min-width: 78px;
}

.tc-sep {
  color: var(--text-muted);
}

.tc-total {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-btns {
  display: flex;
  gap: 4px;
}

.master-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vu-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #090c12;
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: 7px;
}

.vu-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.master-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.master-vol-wrap input[type="range"] {
  width: 78px;
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 34px;
}

.mono-xs {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #03111a;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.38);
}

.btn-accent {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.btn-accent:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.26);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-secondary.is-active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--amber);
  color: #fcd34d;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-ghost.is-active {
  background: rgba(244, 63, 94, 0.16);
  border-color: var(--danger);
  color: #fda4af;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.flex-1 {
  flex: 1;
}

/* ==================== WORKSPACE SPLIT ==================== */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* LEFT SIDEBAR */
.sidebar {
  width: 318px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  padding: 12px;
  min-height: 0;
}

.media-pool-panel {
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.clipper-panel {
  flex-shrink: 0;
  background: #10141d;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-header h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.panel-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1.5px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 10px;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
}

.drop-zone strong {
  display: block;
  font-size: 12.5px;
}

.drop-zone span {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.media-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.media-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 18px 10px;
  line-height: 1.45;
}

.media-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.media-card:hover {
  background: var(--bg-hover);
}

.media-card.is-selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
}

.media-color-dot {
  width: 4px;
  align-self: stretch;
  border-radius: 99px;
  flex-shrink: 0;
}

.media-info {
  flex: 1;
  min-width: 0;
}

.media-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin: 1px 0 3px;
}

.media-mini-wave {
  width: 100%;
  height: 20px;
  display: block;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.25);
}

.media-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ==================== SOURCE CLIPPER ==================== */
.clipper-empty {
  padding: 16px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
}

.clipper-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border-left: 3px solid var(--accent);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clipper-canvas-wrap {
  height: 78px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0c0f17;
  position: relative;
}

.clipper-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.clipper-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 6px;
}

.num-field,
.text-field,
.select-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.num-field span,
.text-field span,
.select-field span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.num-field input,
.text-field input,
.select-field select {
  width: 100%;
  padding: 5px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.text-field input,
.select-field select {
  font-family: var(--font-sans);
}

.len-readout {
  padding: 5px 7px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  text-align: center;
}

.clipper-controls-row {
  display: flex;
  gap: 6px;
}

.clipper-controls-row #btnClipperAudition {
  flex: 1;
}

.clipper-place-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border-subtle);
}

.clipper-dest-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.clipper-action-row {
  display: flex;
  gap: 6px;
}

/* ==================== TIMELINE MAIN AREA ==================== */
.timeline-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

.timeline-toolbar {
  height: 44px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
  overflow-x: auto;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  margin: 0 2px;
}

.toolbar-spacer {
  flex: 1;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tool-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tool-btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
  color: #e0f2fe;
}

.tool-btn.danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.16);
  border-color: var(--danger);
  color: #fda4af;
}

.tool-btn.sm {
  padding: 4px 8px;
  font-size: 11px;
}

.mini-select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11.5px;
}

.zoom-cluster {
  display: flex;
  align-items: center;
  gap: 5px;
}

.zoom-cluster input[type="range"] {
  width: 82px;
}

/* TIMELINE GRID (2x2) */
.timeline-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--header-col-w) 1fr;
  grid-template-rows: 34px 1fr;
  overflow: hidden;
}

.timeline-corner {
  background: #121620;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.ruler-scroll {
  overflow: hidden;
  background: #121620;
  position: relative;
}

.ruler-inner {
  position: relative;
  height: 34px;
}

#rulerCanvas {
  display: block;
  cursor: ew-resize;
}

.playhead-cap {
  position: absolute;
  top: 0;
  left: -6px;
  width: 12px;
  height: 14px;
  background: #f43f5e;
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
  pointer-events: none;
  z-index: 12;
  will-change: transform;
}

.loop-bar {
  position: absolute;
  top: 0;
  height: 8px;
  background: rgba(148, 163, 184, 0.25);
  border-bottom: 2px solid rgba(148, 163, 184, 0.5);
  cursor: grab;
  z-index: 8;
}

.loop-bar.is-enabled {
  background: rgba(56, 189, 248, 0.35);
  border-bottom-color: var(--accent);
}

.loop-handle {
  position: absolute;
  top: 0;
  width: 7px;
  height: 100%;
  cursor: ew-resize;
}

.loop-handle-left { left: -2px; }
.loop-handle-right { right: -2px; }

/* TRACK HEADERS */
.track-headers-wrap {
  overflow: hidden;
  background: #111520;
  border-right: 1px solid var(--border-subtle);
}

.track-header {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: #131824;
  transition: background 0.12s ease;
}

.track-header.is-selected {
  background: #1a2132;
}

.track-header.is-muted {
  opacity: 0.55;
}

.track-color-bar {
  width: 4px;
  flex-shrink: 0;
}

.track-header-inner {
  flex: 1;
  min-width: 0;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.track-top-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.track-name-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  padding: 2px 4px;
}

.track-name-input:hover,
.track-name-input:focus {
  background: var(--bg-input);
  border-color: var(--border-strong);
  outline: none;
}

.track-ms-btns {
  display: flex;
  align-items: center;
  gap: 3px;
}

.mini-pill {
  width: 21px;
  height: 21px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.mini-pill.active-mute {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.mini-pill.active-solo {
  background: var(--amber);
  border-color: var(--amber);
  color: #111;
}

.mini-icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mini-icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mini-icon-btn.danger:hover:not(:disabled) {
  color: var(--danger);
}

.mini-icon-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.track-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: var(--text-muted);
}

.ctrl-mini input[type="range"] {
  width: 100%;
  min-width: 0;
}

.ctrl-mini.pan-mini {
  max-width: 78px;
}

/* TRACK LANES & CLIPS */
.lanes-scroll {
  overflow: auto;
  position: relative;
  background: #0c0f16;
}

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

.tracks-stage {
  position: relative;
  min-height: 100%;
}

.tracks-stage.tool-razor .timeline-clip {
  cursor: crosshair;
}

.track-lane {
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s ease;
}

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

.track-lane.is-drop-target {
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.timeline-empty-hint {
  position: absolute;
  top: 56px;
  left: 36px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(18, 22, 32, 0.85);
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: 12.5px;
  pointer-events: none;
}

.timeline-clip {
  position: absolute;
  top: 5px;
  height: 76px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--clip-color, #38bdf8) 22%, #131824);
  border: 1px solid color-mix(in srgb, var(--clip-color, #38bdf8) 60%, transparent);
  overflow: hidden;
  user-select: none;
  cursor: grab;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.1s ease;
}

.timeline-clip:active {
  cursor: grabbing;
}

.timeline-clip.is-selected {
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--clip-color, #38bdf8) 55%, transparent), 0 6px 16px rgba(0, 0, 0, 0.45);
  z-index: 4;
}

.timeline-clip.is-muted {
  opacity: 0.42;
  filter: grayscale(0.75);
}

.clip-header {
  height: 20px;
  background: color-mix(in srgb, var(--clip-color, #38bdf8) 42%, #0e131e);
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.clip-title {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-meta {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(248, 250, 252, 0.8);
  white-space: nowrap;
}

.clip-wave-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.clip-wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.clip-fade-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.clip-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 6;
}

.clip-trim-handle.trim-left { left: 0; }
.clip-trim-handle.trim-right { right: 0; }

.clip-trim-handle:hover {
  background: rgba(255, 255, 255, 0.28);
}

.clip-fade-handle {
  position: absolute;
  top: 19px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #0f172a;
  cursor: ew-resize;
  z-index: 7;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.timeline-clip:hover .clip-fade-handle,
.timeline-clip.is-selected .clip-fade-handle {
  opacity: 0.92;
}

.clip-fade-handle:hover {
  transform: scale(1.25);
  background: var(--accent);
}

.playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1.5px;
  background: #f43f5e;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.7);
  pointer-events: none;
  z-index: 15;
  will-change: transform;
}

.loop-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(56, 189, 248, 0.06);
  border-left: 1px dashed rgba(56, 189, 248, 0.4);
  border-right: 1px dashed rgba(56, 189, 248, 0.4);
  pointer-events: none;
  z-index: 1;
}

.snap-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
  pointer-events: none;
  z-index: 14;
}

.razor-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  border-left: 1.5px dashed #f43f5e;
  pointer-events: none;
  z-index: 14;
}

/* ==================== BOTTOM CLIP INSPECTOR BAR ==================== */
.inspector-bar {
  height: 52px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 14px;
  overflow-x: auto;
}

.inspector-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.inspector-fields {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.insp-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insp-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.insp-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-primary);
  padding: 4px 6px;
  font-size: 11.5px;
}

.insp-input.wide {
  width: 130px;
}

.insp-input.num {
  width: 68px;
  font-family: var(--font-mono);
}

.insp-input.num.sm {
  width: 58px;
}

.insp-range {
  width: 80px;
}

.insp-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* ==================== CUSTOM RANGE SLIDERS ==================== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 99px;
  background: #242c3f;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b0e14;
  cursor: pointer;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.75);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: #141925;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.modal-card.compact {
  max-width: 440px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-body {
  padding: 18px 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #10141e;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full,
.checkbox-field.full {
  grid-column: 1 / -1;
}

.form-field span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.form-field input,
.form-field select {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.export-summary {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #bae6fd;
}

.progress-wrap {
  margin-top: 14px;
}

.progress-track {
  height: 7px;
  border-radius: 99px;
  background: var(--bg-input);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.12s ease;
}

.progress-label {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

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

.shortcut-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.tip-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.08);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  bottom: 64px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  padding: 9px 14px;
  border-radius: 8px;
  background: #1b2232;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left: 3px solid var(--emerald);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--accent);
}

/* ==================== SCROLLBARS ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0d1018;
}

::-webkit-scrollbar-thumb {
  background: #273044;
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: #38445f;
}

/* ==================== RESPONSIVE POLISH ==================== */
@media (max-width: 1340px) {
  :root {
    --header-col-w: 190px;
  }

  .sidebar {
    width: 280px;
  }

  .top-bar {
    padding: 0 10px;
    gap: 8px;
  }

  .vu-group {
    display: none;
  }

  .master-vol-wrap input[type="range"] {
    width: 60px;
  }

  .master-vol-wrap .mono-sm {
    display: none;
  }

  .timecode-display {
    padding: 4px 8px;
    margin: 0 2px;
  }

  .timeline-toolbar {
    padding: 0 8px;
    gap: 5px;
  }

  .tool-btn {
    padding: 4px 7px;
    font-size: 11.5px;
  }

  .zoom-cluster input[type="range"] {
    width: 58px;
  }

  .inspector-fields {
    gap: 8px;
  }

  .insp-input.wide {
    width: 98px;
  }

  .insp-input.num {
    width: 58px;
  }

  .insp-range {
    width: 64px;
  }
}

@media (max-width: 1120px) {
  .brand-tag,
  .tc-sep,
  .tc-total {
    display: none;
  }

  .sidebar {
    width: 256px;
  }

  .btn {
    padding: 6px 9px;
    font-size: 12px;
  }

  .inspector-bar {
    height: auto;
    min-height: 48px;
    padding: 6px 10px;
  }

  .inspector-fields {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

