:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-elev-2: #1a1418;
  --bg-deep: #060606;
  --border: #2a1820;
  --border-pink: #3b1f2a;
  --text: #f5e1e8;
  --text-dim: #8e6a76;
  --pink: #ff8fb3;
  --pink-bright: #ff5d92;
  --pink-deep: #d63a76;
  --pink-soft: #ffb7c5;
  --danger: #ff6b6b;
  --good: #7be8a3;
  --radius: 4px;
  --shadow: 0 0 28px rgba(255, 93, 146, 0.08);
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 143, 179, 0.035) 0, rgba(255, 143, 179, 0.035) 1px, transparent 1px, transparent 3px);
  z-index: 100;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
  z-index: 99;
}

/* The studio page covers the full viewport like a real editor — disable
   scanlines and vignette there so they don't bleed into the panels. */
body.studio-body { overflow: hidden; height: 100vh; }
body.studio-body::before, body.studio-body::after { display: none; }

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--pink-bright); text-decoration: underline; }

.muted { color: var(--text-dim); }
.hidden { display: none !important; }

@keyframes blink-cursor { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.cursor::after { content: "▊"; display: inline-block; margin-left: 6px; color: var(--pink); animation: blink-cursor 1s step-end infinite; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--border-pink); background: var(--bg); position: relative; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; font-family: var(--mono); }
.brand:hover { text-decoration: none; color: var(--pink-soft); }
.brand-mark { width: auto; height: auto; background: none; box-shadow: none; display: inline-block; line-height: 1; }
.brand-mark::before { content: "❀"; color: var(--pink-bright); font-size: 18px; text-shadow: 0 0 10px rgba(255, 93, 146, 0.55); }
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.brand-name::before { content: "~/"; color: var(--text-dim); }
.nav { display: inline-flex; align-items: center; gap: 12px; }
.nav-link { color: var(--text-dim); text-decoration: none; font-size: 12px; font-family: var(--mono); }
.nav-link:hover { color: var(--pink); text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border-pink); background: var(--bg-elev); color: var(--text); font-family: var(--mono); font-weight: 500; font-size: 13px; text-decoration: none; cursor: pointer; transition: all 0.12s ease; letter-spacing: 0.02em; }
.btn:hover { background: var(--bg-elev-2); border-color: var(--pink); color: var(--pink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.compact { height: 28px; padding: 0 10px; font-size: 11px; }
.btn-primary { background: transparent; border: 1px solid var(--pink-bright); color: var(--pink-bright); text-shadow: 0 0 8px rgba(255, 93, 146, 0.4); }
.btn-primary::before { content: "$ "; opacity: 0.65; }
.btn-primary:hover { background: rgba(255, 93, 146, 0.08); color: var(--pink-soft); border-color: var(--pink-soft); box-shadow: 0 0 16px rgba(255, 93, 146, 0.25); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn-link { background: transparent; border: none; color: var(--pink); padding: 0; height: auto; font-weight: 600; cursor: pointer; font-family: var(--mono); }
.btn-link:hover { text-decoration: underline; }
.btn.delete { background: transparent; border-color: rgba(255, 107, 107, 0.4); color: var(--danger); }
.btn.delete:hover { background: rgba(255, 107, 107, 0.06); border-color: var(--danger); box-shadow: 0 0 12px rgba(255, 107, 107, 0.2); }

.hero { max-width: 880px; margin: 0 auto; padding: 56px 24px 36px; text-align: left; position: relative; z-index: 1; }
.hero-title { font-size: clamp(26px, 4.5vw, 36px); line-height: 1.2; margin: 0 0 14px; font-weight: 600; font-family: var(--mono); color: var(--pink-bright); text-shadow: 0 0 14px rgba(255, 93, 146, 0.35); letter-spacing: -0.01em; }
.accent { color: var(--pink-soft); text-shadow: 0 0 10px rgba(255, 183, 197, 0.4); }
.hero-sub { color: var(--text-dim); font-size: 13px; max-width: 640px; margin: 0 0 30px; line-height: 1.6; }
.hero-sub::before { content: "# "; color: var(--pink-deep); }

.dropzone { border: 1px dashed var(--border-pink); background: rgba(255, 93, 146, 0.02); border-radius: var(--radius); padding: 50px 20px; cursor: pointer; transition: all 0.15s ease; }
.dropzone:hover, .dropzone.drag { border-color: var(--pink); background: rgba(255, 93, 146, 0.06); box-shadow: 0 0 24px rgba(255, 93, 146, 0.12); }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dz-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--pink); background: transparent; color: var(--pink); font-size: 22px; font-family: var(--mono); border-radius: var(--radius); text-shadow: 0 0 10px rgba(255, 143, 179, 0.55); }
.dz-title { font-weight: 600; font-size: 14px; margin-top: 8px; color: var(--text); font-family: var(--mono); }
.dz-sub { color: var(--text-dim); font-size: 12px; }

.card { margin-top: 22px; padding: 16px 18px; background: var(--bg-elev); border: 1px solid var(--border-pink); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; position: relative; }
.card-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-weight: 600; font-family: var(--mono); color: var(--pink); font-size: 13px; }
.card-value { color: var(--text-dim); font-variant-numeric: tabular-nums; font-family: var(--mono); }

.progress { width: 100%; height: 4px; background: var(--bg-elev-2); border-radius: 0; overflow: hidden; border: 1px solid var(--border); }
.progress-bar { width: 0%; height: 100%; background: var(--pink-bright); box-shadow: 0 0 8px rgba(255, 93, 146, 0.5); transition: width 0.25s ease; }

.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-input { flex: 1 1 280px; min-width: 220px; height: 34px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border-pink); background: var(--bg-elev-2); color: var(--pink-soft); font-family: var(--mono); font-size: 12px; }
.share-input:focus { outline: none; border-color: var(--pink); }

.watch .player-shell { max-width: 1080px; margin: 24px auto; padding: 0 20px 60px; position: relative; z-index: 1; }
.player-frame { border-radius: var(--radius); overflow: hidden; background: black; box-shadow: var(--shadow); aspect-ratio: 16 / 9; border: 1px solid var(--border-pink); }
.player-frame video { width: 100%; height: 100%; display: block; background: black; }
.meta { margin-top: 22px; }
.title { font-size: 18px; margin: 0 0 10px; font-family: var(--mono); color: var(--pink); font-weight: 600; }
.title::before { content: "▶ "; color: var(--pink-bright); }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { font-size: 11px; color: var(--text-dim); background: var(--bg-elev); border: 1px solid var(--border-pink); border-radius: var(--radius); padding: 3px 8px; font-family: var(--mono); }

.auth-shell { max-width: 440px; margin: 60px auto; padding: 0 20px; position: relative; z-index: 1; }
.auth-card { padding: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field.compact { margin: 0; flex: 1; }
.field-label { font-size: 11px; color: var(--text-dim); font-weight: 500; font-family: var(--mono); text-transform: lowercase; letter-spacing: 0.04em; }
.field-label::before { content: "> "; color: var(--pink); }
.input { height: 36px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--border-pink); background: var(--bg-elev-2); color: var(--text); font-size: 13px; outline: none; transition: border-color 0.12s ease, box-shadow 0.12s ease; width: 100%; font-family: var(--mono); }
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 143, 179, 0.08); }
textarea.input, input[type="file"].input { padding: 8px 10px; height: auto; }
input[type="range"] { width: 100%; accent-color: var(--pink); }

.error { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius); background: rgba(255, 107, 107, 0.05); border: 1px solid rgba(255, 107, 107, 0.4); color: var(--danger); font-size: 12px; font-family: var(--mono); }
.error::before { content: "✗ "; }
.success { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius); background: rgba(123, 232, 163, 0.05); border: 1px solid rgba(123, 232, 163, 0.35); color: var(--good); font-size: 12px; font-family: var(--mono); }
.success::before { content: "✓ "; }

.page-title { font-size: 17px; margin: 0; font-family: var(--mono); color: var(--pink-bright); font-weight: 600; text-shadow: 0 0 8px rgba(255, 93, 146, 0.3); letter-spacing: -0.01em; }

.clips-shell { max-width: 1100px; margin: 24px auto; padding: 0 20px 60px; position: relative; z-index: 1; }
.clips-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.quota-banner { margin: 0 0 18px; padding: 10px 14px; background: rgba(255, 143, 179, 0.05); border: 1px dashed var(--pink); border-radius: var(--radius); color: var(--pink-soft); font-size: 12px; font-family: var(--mono); }
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.clip-card { background: var(--bg-elev); border: 1px solid var(--border-pink); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: all 0.12s ease; }
.clip-card:hover { border-color: var(--pink); box-shadow: 0 0 18px rgba(255, 93, 146, 0.15); transform: translateY(-1px); }
.clip-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: black; overflow: hidden; }
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 36px; background: var(--bg-elev-2); color: var(--pink); }
.clip-duration { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.85); color: var(--pink-soft); font-size: 10px; padding: 2px 6px; border-radius: var(--radius); font-variant-numeric: tabular-nums; font-family: var(--mono); border: 1px solid var(--border); }
.clip-badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.85); color: var(--pink); font-size: 10px; padding: 2px 7px; border-radius: var(--radius); font-family: var(--mono); border: 1px solid var(--pink); }
.clip-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.clip-title { font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); color: var(--pink-soft); }
.clip-meta { font-size: 11px; font-family: var(--mono); }
.clip-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); font-family: var(--mono); }

.editor-shell { max-width: 1280px; margin: 24px auto; padding: 0 20px 60px; position: relative; z-index: 1; }
.editor-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 18px; gap: 12px; }
.editor-header > .page-title { text-align: center; }
@media (max-width: 880px) { .editor-header { grid-template-columns: 1fr; text-align: left; } .editor-header > .page-title { text-align: left; } }
.editor-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 920px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-main { display: flex; flex-direction: column; gap: 14px; }
.editor-controls { display: flex; flex-direction: column; gap: 12px; }
.control-group { background: var(--bg-elev); border: 1px solid var(--border-pink); border-radius: var(--radius); padding: 14px 16px; }
.control-title { margin: 0 0 10px; font-size: 12px; font-family: var(--mono); color: var(--pink); font-weight: 600; text-transform: lowercase; letter-spacing: 0.04em; }
.checkbox-row { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 13px; font-family: var(--mono); color: var(--text-dim); }
.checkbox-row input[type="checkbox"] { accent-color: var(--pink); }

.trim-panel { background: var(--bg-elev); border: 1px solid var(--border-pink); border-radius: var(--radius); padding: 14px 18px 18px; }
.trim-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.trim-times { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; font-family: var(--mono); }
.trim-times b { color: var(--pink-soft); margin-left: 4px; font-weight: 600; }
.trim-slider { padding: 6px 10px 4px; }
.trim-track { position: relative; height: 32px; }
.trim-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 0; }
.trim-fill { position: absolute; top: 50%; height: 4px; margin-top: -2px; background: var(--pink-bright); box-shadow: 0 0 8px rgba(255, 93, 146, 0.4); pointer-events: none; z-index: 1; }
.trim-range { position: absolute; top: 0; left: 0; width: 100%; height: 32px; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; margin: 0; z-index: 2; }
.trim-range::-webkit-slider-runnable-track { background: transparent; height: 32px; border: none; }
.trim-range::-moz-range-track { background: transparent; height: 32px; border: none; }
.trim-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--pink-bright); border: 2px solid var(--bg); cursor: grab; pointer-events: auto; box-shadow: 0 0 8px rgba(255, 93, 146, 0.6); margin-top: 0; }
.trim-range::-webkit-slider-thumb:active { cursor: grabbing; }
.trim-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--pink-bright); border: 2px solid var(--bg); cursor: grab; pointer-events: auto; box-shadow: 0 0 8px rgba(255, 93, 146, 0.6); }
.trim-range:focus { outline: none; }
.trim-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

/* ===================================================================
   Studio (Premiere-Pro-style multi-clip editor at /studio)
   =================================================================== */
.studio-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  height: 46px;
  padding: 0 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-pink);
  position: relative; z-index: 30;
  flex-shrink: 0;
}
.brand-area { display: inline-flex; align-items: center; gap: 12px; }
.studio-tag {
  font-size: 10px; font-family: var(--mono);
  color: var(--pink-bright); border: 1px solid var(--pink-bright);
  border-radius: 2px; padding: 1px 6px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.studio-projecttitle { display: flex; justify-content: center; }
.project-title-input {
  width: clamp(180px, 40vw, 400px);
  height: 28px; padding: 0 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--pink-soft);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  outline: none;
}
.project-title-input:focus { border-color: var(--pink); }
.studio-actions { display: inline-flex; align-items: center; gap: 8px; }

.studio-workspace {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) minmax(180px, auto);
  gap: 6px;
  padding: 6px;
  height: calc(100vh - 46px);
  background: var(--bg-deep);
}
.studio-toprow {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(360px, 2fr) minmax(240px, 320px);
  gap: 6px;
  min-height: 0;
}
@media (max-width: 1100px) {
  .studio-toprow { grid-template-columns: 1fr 1fr; }
  .studio-toprow .inspector-panel { grid-column: span 2; }
}
@media (max-width: 720px) {
  .studio-toprow { grid-template-columns: 1fr; }
  .studio-toprow .inspector-panel { grid-column: auto; }
}

/* Generic panel */
.panel {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0;
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
  height: 28px;
  flex-shrink: 0;
}
.panel-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pink);
  font-weight: 600;
}
.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}

/* Media bin */
.media-body { padding: 6px 8px; }
.media-list { display: flex; flex-direction: column; gap: 4px; }
.media-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  user-select: none;
  transition: border-color 0.1s ease, background 0.1s ease;
}
.media-item:hover { border-color: var(--pink); }
.media-item.dragging { opacity: 0.6; }
.media-thumb {
  width: 56px; height: 32px; flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  display: grid; place-items: center;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .ph { color: var(--pink); font-size: 14px; }
.media-meta { min-width: 0; flex: 1; }
.media-name { font-size: 12px; color: var(--pink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-sub { font-size: 10px; }
.media-add {
  width: 22px; height: 22px; padding: 0;
  background: transparent;
  color: var(--pink);
  border: 1px solid var(--border-pink);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 14px; line-height: 1;
  cursor: pointer;
}
.media-add:hover { color: var(--pink-bright); border-color: var(--pink); }
.media-hint { font-size: 10px; padding: 8px 4px 0; line-height: 1.5; }

.upload-progress {
  margin: 0 0 8px;
  padding: 6px 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius);
}
.upload-line { display: flex; align-items: center; font-size: 11px; margin-bottom: 4px; }

/* Preview / program panel */
.preview-body { display: flex; flex-direction: column; padding: 0; gap: 0; }
.preview-frame {
  flex: 1 1 auto;
  min-height: 120px;
  background: black;
  display: grid; place-items: center;
  position: relative;
  border-radius: 0;
  border: none;
  box-shadow: none;
  aspect-ratio: auto;
}
.preview-frame video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  background: black;
}
.transport {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: var(--bg-elev-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.time-current { font-size: 12px; color: var(--pink-soft); font-variant-numeric: tabular-nums; min-width: 64px; }
.time-sep { font-size: 12px; }
.time-total { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 64px; }
.transport-buttons { margin-left: auto; display: inline-flex; gap: 4px; }
.transport-btn {
  width: 28px; height: 26px; padding: 0;
  background: var(--bg-elev);
  color: var(--pink);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--mono);
  line-height: 1;
}
.transport-btn:hover { border-color: var(--pink); color: var(--pink-bright); }
.transport-btn.primary {
  width: 32px;
  border-color: var(--pink-bright);
  color: var(--pink-bright);
  box-shadow: 0 0 10px rgba(255, 93, 146, 0.2);
}
.transport-btn.primary:hover { background: rgba(255, 93, 146, 0.08); color: var(--pink-soft); }

/* Inspector */
.inspector-panel .panel-body { padding: 10px; }
.insp-section { margin-bottom: 14px; }
.insp-section:last-child { margin-bottom: 0; }
.insp-label {
  display: flex; align-items: center;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.insp-value { font-size: 12px; color: var(--pink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-sub { font-size: 10px; }
.insp-row { display: flex; gap: 6px; align-items: center; }
.insp-field { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.insp-field span { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.insp-field input {
  height: 26px; padding: 0 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  width: 100%;
}
.insp-field input:focus { border-color: var(--pink); }
.insp-pill { padding: 0 6px !important; height: 22px !important; font-size: 10px !important; flex: 1; }
.insp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.insp-check input { accent-color: var(--pink); }
.insp-actions { display: flex; flex-direction: column; gap: 6px; }

/* Timeline */
.timeline-pane { min-height: 180px; }
.timeline-toolbar { gap: 12px; }
.timeline-tools { display: inline-flex; gap: 6px; }
.zoom-control { display: inline-flex; align-items: center; gap: 4px; }
.zoom-control input[type="range"] { width: 100px; }
.zoom-btn {
  width: 22px; height: 22px; padding: 0;
  background: var(--bg-elev);
  color: var(--pink);
  border: 1px solid var(--border-pink);
  border-radius: 2px;
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
}
.zoom-btn:hover { border-color: var(--pink); color: var(--pink-bright); }

.timeline-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: var(--bg-deep);
}
.timeline-inner { position: relative; }

.ruler {
  position: relative;
  height: 22px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
  margin-left: 60px;
  cursor: pointer;
}
.tick { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.tick.major { border-left: 1px solid var(--border-pink); }
.tick.major span {
  position: absolute; top: 2px; left: 4px;
  font-size: 9px; color: var(--text-dim);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tick.minor { border-left: 1px solid var(--border); height: 8px; top: auto; bottom: 0; }

.track-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.track-label {
  width: 60px; flex-shrink: 0;
  padding: 6px 10px;
  background: var(--bg-elev-2);
  border-right: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--mono);
  font-weight: 600;
  display: flex; align-items: center;
}
.track-area {
  position: relative;
  flex: 1; min-height: 56px;
  background: var(--bg);
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(255, 143, 179, 0.04) 39px, rgba(255, 143, 179, 0.04) 40px);
}
.track-area.drag-over {
  background: rgba(255, 93, 146, 0.05);
  outline: 1px dashed var(--pink);
  outline-offset: -2px;
}
.track-row.track-audio .track-area { min-height: 36px; background-color: rgba(255,143,179,0.02); }

.track-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; padding: 8px;
  pointer-events: none;
}

/* The vertical playhead line + handle. */
.playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--pink-bright);
  box-shadow: 0 0 6px rgba(255, 93, 146, 0.6);
  pointer-events: none;
  z-index: 5;
}
.playhead::before {
  content: "";
  position: absolute; top: 0; left: -4px;
  width: 9px; height: 9px;
  background: var(--pink-bright);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(255, 93, 146, 0.6);
}

/* Segments on the V1 track. */
.segments-layer { position: relative; height: 56px; }
.seg-clip {
  position: absolute;
  top: 4px; bottom: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border-pink);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.seg-clip:hover { border-color: var(--pink); }
.seg-clip.sel { border-color: var(--pink-bright); box-shadow: 0 0 12px rgba(255, 93, 146, 0.3); z-index: 2; }
.seg-bg {
  position: absolute; inset: 0;
  background-color: rgba(0,0,0,0.7);
  background-size: cover; background-position: center;
  opacity: 0.45;
}
.seg-label {
  position: relative;
  padding: 4px 6px;
  display: flex; align-items: center; gap: 4px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255,143,179,0.15), rgba(255,143,179,0.05));
  pointer-events: none;
}
.seg-name { font-size: 10px; color: var(--pink-soft); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.seg-badge { font-size: 9px; color: var(--pink); background: rgba(0,0,0,0.5); padding: 1px 4px; border-radius: 2px; border: 1px solid var(--border-pink); }
.seg-badge.mute { color: var(--danger); border-color: rgba(255,107,107,0.4); }

.seg-handle {
  position: absolute; top: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
  background: transparent;
  z-index: 3;
}
.seg-handle.left { left: 0; }
.seg-handle.right { right: 0; }
.seg-handle:hover { background: rgba(255, 93, 146, 0.3); }
.seg-clip.sel .seg-handle { background: rgba(255, 93, 146, 0.15); }
.seg-clip.sel .seg-handle:hover { background: rgba(255, 93, 146, 0.4); }

/* Segments on the A1 track (mirror of V1). */
.audio-layer { position: relative; height: 36px; }
.seg-audio {
  position: absolute;
  top: 4px; bottom: 4px;
  background: rgba(255, 143, 179, 0.12);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}
.seg-audio:hover { border-color: var(--pink); }
.seg-audio.sel { border-color: var(--pink-bright); }
.seg-audio.muted { opacity: 0.35; background: var(--bg-elev-2); }
.audio-wave {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(255, 143, 179, 0.4);
  box-shadow: 0 0 4px rgba(255, 143, 179, 0.5);
}

/* Render overlay */
.render-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: grid; place-items: center;
  z-index: 1000;
}
.render-card {
  width: min(440px, calc(100vw - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--pink-bright);
  border-radius: var(--radius);
  box-shadow: 0 0 28px rgba(255, 93, 146, 0.25);
  padding: 18px 20px;
}

.footer { text-align: center; color: var(--text-dim); font-size: 11px; padding: 30px 20px 36px; font-family: var(--mono); position: relative; z-index: 1; }
.footer::before { content: "# "; color: var(--pink-deep); }

@media (max-width: 540px) {
  .topbar { padding: 12px 14px; }
  .hero { padding-top: 36px; }
  .dropzone { padding: 36px 14px; }
}

::selection { background: var(--pink); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-pink); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--pink-deep); }
