/* ═══════════════════════════════════════════════════════════════════════
   OmniCut — by OmniChrome
   Dark-only OmniChrome design system. Editor component styles are OmniCut's own.

   TOKENS: the :root below is a LOCAL-DEV FALLBACK. The canonical token block
   is /static/omnichrome-tokens.css (OmniClipper repo, shared origin), linked
   from index.html AFTER this file so it wins in prod. Edit tokens there, not
   here — this copy only keeps :3200 styled when the shared file is absent.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* brand */
  --brand-magenta: #ff2db7;
  --brand-blue: #2e93f0;
  --brand-gradient: linear-gradient(95deg, #ff2db7 0%, #2e93f0 100%);
  --brand-gradient-45: linear-gradient(45deg, #ff2db7 0%, #2e93f0 100%);
  --brand-gradient-subtle: linear-gradient(95deg, rgba(255,45,183,0.15) 0%, rgba(46,147,240,0.15) 100%);
  /* accent (electric blue) */
  --accent: #3aa0ff;
  --accent-hover: #5fb3ff;
  --accent-active: #2384ec;
  --accent-subtle: rgba(58,160,255,0.14);
  --accent-border: rgba(58,160,255,0.45);
  --accent-bright: #6fc0ff;
  /* magenta */
  --magenta: #ff2db7;
  --magenta-hover: #e81fa3;
  --magenta-subtle: rgba(255,45,183,0.12);
  --magenta-border: rgba(255,45,183,0.35);
  /* semantic */
  --green: #00e08a; --green-subtle: rgba(0,224,138,0.16);
  --red: #ff3355; --red-subtle: rgba(255,51,85,0.16);
  --amber: #ffb020; --amber-subtle: rgba(255,176,32,0.16);
  --violet: #b06bff; --violet-subtle: rgba(176,107,255,0.16);
  /* dark immersive surfaces (only theme) */
  --bg: #06081a; --bg-2: #090d24;
  --surface: #0e1430; --surface-2: #161e44; --surface-3: #212e63;
  --border: #2b3a6e; --border-subtle: #1a2347;
  --text: #eef1fb; --text-2: #c2c9e6; --muted: #8089b0; --muted-2: #565d85;
  /* glass */
  --glass: rgba(22,30,68,0.55); --glass-strong: rgba(22,30,68,0.82);
  --glass-border: rgba(130,165,255,0.22); --glass-blur: blur(16px);
  /* immersive backdrops */
  --bg-immersive: radial-gradient(circle at 18% -10%, rgba(58,160,255,0.16), transparent 45%), radial-gradient(circle at 95% 110%, rgba(255,45,183,0.14), transparent 50%), #06081a;
  --bg-grid-img: linear-gradient(rgba(130,165,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(130,165,255,0.04) 1px, transparent 1px);
  /* glow */
  --glow-blue: 0 0 28px rgba(58,160,255,0.5);
  --glow-magenta: 0 0 28px rgba(255,45,183,0.5);
  --glow-accent: 0 0 52px rgba(58,160,255,0.3);
  /* geometry */
  --radius-xs: 4px; --radius-sm: 10px; --radius: 14px; --radius-lg: 20px; --radius-xl: 28px; --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.3);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms; --duration: 200ms; --duration-slow: 340ms;
  /* fonts */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, sans-serif;
  --font-brand: "Josefin Sans", var(--font);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* layout */
  --topbar-h: 52px;
  --library-w: 264px;
  --inspector-w: 288px;
  --timeline-h: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.bg-immersive { position: fixed; inset: 0; background: var(--bg-immersive); z-index: -2; }
.bg-grid { position: fixed; inset: 0; background-image: var(--bg-grid-img); background-size: 46px 46px; z-index: -1; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12px; }
.pad { padding: 10px 14px; }

/* ── topbar ─────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--glass); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}
/* Orb-as-"O" + wordmark, matching the OmniChrome / OmniClipper lockups.
   Sized by height so the letterforms match theirs optically: the viewBox is
   60 units tall and the wordmark is 56, so height:22px ≈ 20px caps. */
.brand {
  display: inline-flex; align-items: center;
  color: inherit; text-decoration: none;
}
.brand:hover { opacity: 0.85; }
.brand-lockup { height: 22px; width: auto; display: block; }
.topbar-spacer { flex: 1; }
.app-switcher { display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.app-switcher a {
  font-size: 12px; padding: 5px 9px; border-radius: 7px;
  color: var(--muted); text-decoration: none;
  border: 1px solid transparent;
}
.app-switcher a:hover {
  border-color: var(--glass-border); background: var(--glass);
  color: var(--text);
}
.project-name {
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text); padding: 4px 10px; min-width: 130px; max-width: 240px;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.project-name:hover { border-color: var(--border); }
.project-name:focus { outline: none; border-color: var(--accent); }
.save-state { font-size: 11px; color: var(--muted); min-width: 46px; text-align: right; }
.save-state.dirty { color: var(--amber); }

/* buttons / controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2);
  padding: 6px 14px; cursor: pointer; white-space: nowrap;
  transition: all var(--duration-fast) var(--ease);
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent-border); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary {
  background: var(--accent); border: none; color: #fff; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover { background: var(--accent-hover); box-shadow: var(--glow-accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn.sm { padding: 3px 10px; font-size: 12.5px; }
.btn.danger:hover { background: var(--red-subtle); color: var(--red); border-color: var(--red); }
.btn.play {
  width: 40px; height: 40px; border-radius: var(--radius-full); font-size: 15px;
  background: var(--accent-subtle); border: 1px solid var(--accent-border); color: var(--accent-bright);
}
.btn.play:hover { box-shadow: var(--glow-blue); }
.ctl {
  background: #141416; border: 1px solid #34343a; color: var(--text-2);
  border-radius: var(--radius-md); padding: 5px 8px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.ctl:focus { outline: none; border-color: var(--accent); }

/* ── Display type ───────────────────────────────────────────────────── */
/* Newsreader 500 is the redesign's single serif voice. Loaded at 400/500 only,
   so never ask for 600/700 here. */
.dlg h3, .help-head h3, .help-modal h3 {
  font-family: var(--font-brand); font-weight: 500; letter-spacing: -0.01em;
}

/* ── Micro-labels ───────────────────────────────────────────────────── */
/* IBM Plex Mono, uppercase, wide tracking. Deliberately NOT applied to .clip
   labels — mono is wider and would clip at tight timeline zooms. */
.pane-sub, .insp-section h4, .track-head, .clip-badge, .tpl-anim,
.trans-tile, .save-state {
  font-family: var(--font-mono); font-weight: 400;
}

/* ── workspace ──────────────────────────────────────────────────────── */
.workspace { flex: 1; display: flex; min-height: 0; }
.panel {
  background: var(--glass); backdrop-filter: var(--glass-blur);
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: var(--glow-inset);
}
.library { width: var(--library-w); border-right: 1px solid var(--glass-border); }
.inspector { width: var(--inspector-w); border-left: 1px solid var(--glass-border); overflow-y: auto; }

.tabs { display: flex; gap: 2px; padding: 8px 8px 0; }
.tab {
  flex: 1; padding: 7px 0; border: none; background: transparent; color: var(--muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; cursor: pointer; font-weight: 600;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text-2); }
/* Neutral fill rather than --accent-subtle: the dashboard stretches these tabs
   ~275px wide, where a 14% accent wash reads as a coloured block. The bright
   label + accent underline carry the active affordance on their own. */
.tab.active { color: var(--accent-bright); border-bottom-color: var(--accent); background: rgba(255,255,255,0.04); }
.tabpane { flex: 1; overflow-y: auto; padding: 10px; }

.import-drop {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 18px 10px; cursor: pointer; color: var(--text-2); text-align: center;
  transition: all var(--duration) var(--ease); margin-bottom: 10px;
}
.import-drop:hover, .import-drop.over {
  border-color: var(--accent); background: var(--accent-subtle); box-shadow: var(--glow-accent);
}
.import-icon { font-size: 20px; color: var(--accent-bright); }

.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.asset {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden; cursor: grab; position: relative;
  box-shadow: var(--glow-inset);
  transition: all var(--duration-fast) var(--ease);
}
.asset:hover { border-color: var(--accent-border); box-shadow: var(--shadow); transform: translateY(-1px); }
.asset .thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--bg-2);
}
.asset .audio-thumb {
  width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--green); background: var(--green-subtle);
}
.asset .meta { padding: 4px 6px; font-size: 11px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .dur {
  position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 1px 5px;
  background: rgba(9,9,10,0.72); border-radius: var(--radius-xs); color: #fff;
}
.asset .del {
  position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; line-height: 16px;
  border-radius: var(--radius-xs); border: none; background: rgba(9,9,10,0.72); color: var(--red);
  cursor: pointer; opacity: 0; font-size: 11px;
}
.asset:hover .del { opacity: 1; }
.asset.uploading { cursor: default; pointer-events: none; }
.asset.uploading .thumb, .asset.uploading .audio-thumb { opacity: 0.55; }
.up-bar {
  position: absolute; left: 8px; right: 8px; top: calc(50% - 12px); height: 5px;
  background: rgba(242,242,244,0.12); border-radius: 999px; overflow: hidden;
}
.up-bar span { display: block; height: 100%; border-radius: 999px;
  background: var(--accent);
  transition: width 0.15s linear; }

.text-preset {
  width: 100%; margin-bottom: 8px; padding: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease);
}
.text-preset:hover { border-color: var(--violet); background: var(--violet-subtle); }
.tp-demo { display: block; text-align: center; color: var(--text); }
.tp-title { font-size: 20px; font-weight: 700; }
.tp-subtitle { font-size: 15px; font-weight: 600; color: var(--text-2); }
/* Deliberately #000/#fff, not tokens: this is a caption-style demo swatch and
   lib/ass.js burns captions onto black. Re-theming it would make the library
   preview misrepresent the exported video. */
.tp-caption { font-size: 12px; background: #000; color: #fff; padding: 2px 8px;
  border-radius: var(--radius-xs); display: inline-block; }

/* text templates + stickers (library panes) */
.pane-sub { padding: 10px 10px 4px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 0 8px; }
.tpl-tile {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 6px 7px; cursor: pointer; overflow: hidden;
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: var(--radius-xs);
  transition: border-color .15s;
}
.tpl-tile:hover { border-color: var(--accent-border); }
.tpl-demo { font-size: 15px; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; border-radius: 3px; }
.tpl-anim { font-size: 8.5px; letter-spacing: 0.06em; color: var(--muted); }
.tpl-tile .del {
  position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--muted);
  opacity: 0; transition: opacity .15s;
}
.tpl-tile:hover .del { opacity: 1; }
.tpl-tile .del:hover { color: var(--danger); }
.stick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 0 8px; }
.stick-tile {
  padding: 6px 0; font-size: 22px; line-height: 1; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-xs); transition: all .15s;
}
.stick-tile:hover { background: var(--surface-2);
  border-color: var(--accent-border); transform: scale(1.15); }

/* template hover-preview: replay the entrance animation on a loop-with-hold
   cycle (0.8s play, hold to 1.4s), matching the editor/export timing */
.tpl-tile:hover .tpl-demo[data-anim="fade"] { animation: tplFade 1.4s ease-out infinite; }
.tpl-tile:hover .tpl-demo[data-anim="pop"] { animation: tplPop 1.4s ease-out infinite; }
.tpl-tile:hover .tpl-demo[data-anim="slide-up"] { animation: tplSlideUp 1.4s ease-out infinite; }
.tpl-tile:hover .tpl-demo[data-anim="slide-down"] { animation: tplSlideDown 1.4s ease-out infinite; }
@keyframes tplFade {
  0% { opacity: 0; }
  57%, 100% { opacity: 1; }
}
@keyframes tplPop {
  0% { opacity: 0; transform: scale(.4); }
  40% { transform: scale(1.08); }
  57%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes tplSlideUp {
  0% { opacity: 0; transform: translateY(10px); }
  57%, 100% { opacity: 1; transform: none; }
}
@keyframes tplSlideDown {
  0% { opacity: 0; transform: translateY(-10px); }
  57%, 100% { opacity: 1; transform: none; }
}

/* keyframes: ◇ auto-key buttons (inspector) + ◆ marks (timeline clips) */
.kf-btn { background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 0 2px; line-height: 1; }
.kf-btn.armed { color: var(--accent-border); }
.kf-btn.on { color: var(--accent); }
.kf-ease { max-width: 76px; }
.kf-mark { position: absolute; bottom: 1px; width: 8px; height: 8px; z-index: 2;
  background: var(--accent); transform: rotate(45deg); cursor: pointer;
  border: 1px solid rgba(242,242,244,0.55); }

/* ── stage ──────────────────────────────────────────────────────────── */
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.preview-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 18px; position: relative;
}
#preview {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  outline: 1px solid var(--border-subtle);
  cursor: crosshair;
  /* The backing store is a fraction of project res (PREVIEW_SCALE); let the
     browser blow it up without re-smoothing back toward HD — cheaper to
     composite and an honestly lower-res preview. */
  image-rendering: pixelated;
}
.preview-qual {
  position: absolute; top: 24px; left: 24px;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  color: var(--text-2); background: var(--glass-strong);
  border: 1px solid var(--glass-border); backdrop-filter: var(--glass-blur);
  pointer-events: none; user-select: none;
}
.transport {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 6px 18px 10px;
}
.transport-mid { flex: 1; display: flex; justify-content: center; gap: 8px; }
.time { font-family: var(--font-mono); font-size: 13px; min-width: 64px; }
.muted { color: var(--muted); }

/* ── inspector ──────────────────────────────────────────────────────── */
.inspector-empty {
  margin: auto; text-align: center; color: var(--muted); padding: 20px;
}
.insp-glyph {
  font-size: 26px; margin-bottom: 10px; color: var(--muted-2);
}
.insp-section { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.insp-section h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 10px;
}
.insp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.insp-row label { flex: 0 0 76px; font-size: 12px; color: var(--text-2); }
.insp-row input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 0; }
.insp-row .val {
  flex: 0 0 44px; text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.insp-row input[type="number"], .insp-row input[type="text"], .insp-row select {
  flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 4px 7px; color: var(--text);
}
.insp-row input:focus, .insp-row select:focus, .insp-row textarea:focus {
  outline: none; border-color: var(--accent-border);
}
.grade-strip {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.grade-swatch {
  width: 26px; height: 26px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); cursor: pointer; padding: 0;
  transition: transform 0.08s, border-color 0.08s;
}
.grade-swatch:hover { transform: scale(1.12); border-color: var(--accent-border); }
.insp-row input[type="color"] {
  width: 34px; height: 26px; padding: 1px; border: 1px solid var(--border);
  border-radius: var(--radius-xs); background: var(--surface); cursor: pointer;
}
.insp-row input[type="checkbox"] { accent-color: var(--accent); }
.insp-section textarea {
  width: 100%; min-height: 56px; resize: vertical; background: #141416;
  border: 1px solid #34343a; border-radius: var(--radius-xs); padding: 6px 8px; color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.clip-badge {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius-full);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}
.clip-badge.video { background: var(--accent-subtle); color: var(--accent-bright); }
.clip-badge.image { background: var(--amber-subtle); color: var(--amber); }
.clip-badge.audio { background: var(--green-subtle); color: var(--green); }
.clip-badge.text  { background: var(--violet-subtle); color: var(--violet); }
.clip-badge.captions { background: var(--magenta-subtle); color: var(--magenta); }
.insp-actions { display: flex; gap: 6px; padding: 12px 14px; }

/* ── timeline ───────────────────────────────────────────────────────── */
.timeline-zone {
  flex: 0 0 var(--timeline-h); display: flex; flex-direction: column;
  background: var(--glass-strong); backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.tl-toolbar {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.tl-toolbar input[type="range"] { width: 110px; accent-color: var(--accent); }
.tl-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
#snapBtn.active { color: var(--accent-bright); background: var(--accent-subtle); }

.tl-scroll { flex: 1; overflow: auto; position: relative; }
.tl-inner { position: relative; min-width: 100%; width: max-content; }
.tl-ruler { display: block; position: sticky; top: 0; z-index: 5; cursor: ew-resize;
  background: var(--bg-2); border-bottom: 1px solid var(--border-subtle); }

.track { display: flex; height: 52px; border-bottom: 1px solid var(--border-subtle); }
.track-head {
  flex: 0 0 90px; position: sticky; left: 0; z-index: 4;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: var(--surface); border-right: 1px solid var(--border);
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.track-head .kind { font-size: 13px; }
.track-lane { position: relative; flex: 1; min-width: 0; }
.track-lane.drop-ok { background: var(--accent-subtle); }

.clip {
  position: absolute; top: 5px; bottom: 5px; border-radius: var(--radius-xs);
  border: 1px solid transparent; overflow: hidden; cursor: grab;
  display: flex; align-items: center; padding: 0 10px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis;
  transition: box-shadow var(--duration-fast) var(--ease);
}
/* Clip kinds stay hue-coded — a fully greyscale timeline is hard to scan across
   many tracks — but the hues are pulled into the monochrome palette. Class names
   are load-bearing: tests/ui-e2e.js selects .clip.video/.text/.captions. */
.clip.video { background: linear-gradient(180deg, rgba(111,141,255,0.28), rgba(111,141,255,0.14)); border-color: var(--accent-border); color: var(--accent-bright); }
.clip.image { background: linear-gradient(180deg, rgba(201,165,74,0.26), rgba(201,165,74,0.13)); border-color: var(--amber); color: var(--amber); }
.clip.audio { background: linear-gradient(180deg, rgba(63,191,143,0.24), rgba(63,191,143,0.12)); border-color: var(--green); color: var(--green); }
.clip.text  { background: linear-gradient(180deg, rgba(200,200,205,0.20), rgba(200,200,205,0.10)); border-color: var(--violet); color: var(--violet); }
/* light indigo fill, so the label needs a brighter tint than --magenta for contrast */
.clip.captions { background: linear-gradient(180deg, rgba(159,178,255,0.24), rgba(159,178,255,0.12)); border-color: var(--magenta-border); color: #c3cfff; }
.clip.selected { box-shadow: 0 0 0 1.5px var(--accent), var(--glow-blue); z-index: 3; }
.clip .wave { position: absolute; inset: 0; opacity: 0.55; pointer-events: none; }
.clip .label { position: relative; overflow: hidden; text-overflow: ellipsis; }
.clip .grip {
  position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2;
}
.clip .grip.l { left: 0; border-left: 3px solid rgba(242,242,244,0.45); }
.clip .grip.r { right: 0; border-right: 3px solid rgba(242,242,244,0.45); }
.clip .grip:hover { background: rgba(242,242,244,0.14); }

.playhead {
  position: absolute; top: 0; bottom: 0; left: 90px; width: 1.5px; z-index: 6;
  background: var(--magenta); box-shadow: var(--glow-magenta); pointer-events: none;
}
.playhead-cap {
  position: sticky; top: 0; margin-left: -5px; width: 11px; height: 12px;
  background: var(--magenta); clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ── dialogs ────────────────────────────────────────────────────────── */
.dlg {
  /* margin:auto restores the browser's modal-dialog centering, which the
     `* { margin:0 }` reset above otherwise cancels (pinning dialogs top-left). */
  margin: auto;
  background: linear-gradient(180deg, #1f1f23, #191919); color: var(--text);
  border: 1px solid #34343a; border-radius: var(--radius-lg);
  box-shadow: var(--glow-inset), var(--shadow-lg); padding: 22px; min-width: 380px;
}
.dlg::backdrop { background: rgba(9,9,10,0.72); backdrop-filter: blur(4px); }
.dlg h3 { margin-bottom: 16px; font-size: 17px; }
.dlg-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.dlg-row label { font-size: 12.5px; color: var(--text-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dlg-status { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.aup-plats { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 12px; }
.aup-plats label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.aup-plats input[type=checkbox] { width: auto; margin: 0; flex: none; cursor: pointer; }
.aup-plats .aup-soon { opacity: 0.5; cursor: not-allowed; }
.aup-plats .aup-soon input { cursor: not-allowed; }
.progress {
  height: 8px; border-radius: var(--radius-full); background: var(--surface-3);
  overflow: hidden; margin-bottom: 8px;
}
.progress-bar {
  height: 100%; width: 0%; border-radius: var(--radius-full);
  background: var(--accent); transition: width 300ms var(--ease);
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ── transitions ─────────────────────────────────────────────────────── */
.trans-marker {
  position: absolute; top: 50%; width: 13px; height: 13px; padding: 0;
  transform: translateY(-50%) rotate(45deg); z-index: 6; cursor: pointer;
  background: var(--glass-strong); border: 1.5px solid var(--muted);
  border-radius: 3px; transition: border-color .15s, transform .15s;
}
.trans-marker:hover {
  border-color: var(--accent);
  transform: translateY(-50%) rotate(45deg) scale(1.25);
}
.trans-marker.set { background: var(--accent); border-color: var(--accent); }

.trans-pop {
  position: fixed; z-index: 90; width: 264px; padding: 10px;
  background: var(--glass-strong); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  box-shadow: var(--glow-inset), var(--shadow-md);
}
.tp-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px;
}
.tp-dur {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  font-size: 12px; color: var(--muted);
}
.tp-dur input[type=range] { flex: 1; }
.tp-dur .tabular { color: var(--text-2); min-width: 42px; text-align: right; }

.trans-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  max-height: 240px; overflow-y: auto;
}
#pane-trans .trans-grid { grid-template-columns: repeat(3, 1fr); padding: 10px 10px 0; max-height: none; }
.trans-tile {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px 5px; font-size: 10px; letter-spacing: 0.04em; color: var(--muted); cursor: pointer;
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: var(--radius-xs);
  transition: border-color .15s, color .15s;
}
.trans-tile .ti { font-size: 17px; line-height: 1; color: var(--text-2); }
.trans-tile:hover { border-color: var(--accent-border); color: var(--text); }
.trans-tile.active { border-color: var(--accent); color: var(--text); background: var(--accent-subtle); }

/* hover-preview: the shared kit canvas overlays the tile; the name stays
   readable on top, the icon hides while the animation plays */
.trans-tile { position: relative; overflow: hidden; }
.trans-pv {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: inherit; pointer-events: none;
}
.trans-tile.previewing .ti { visibility: hidden; }
.trans-tile.previewing span:not(.ti) {
  position: relative; z-index: 1; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
}

/* OmniChrome help panel — shared pattern across all three apps */
.help-wrap { position: relative; }
.help-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 500;
  display: none; width: 240px; padding: 8px;
  background: var(--glass-strong); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--glow-inset), var(--shadow-lg); font-family: var(--font);
}
.help-panel.open { display: block; }
.help-head { padding: 6px 8px 8px; }
.help-head h3 {
  font-size: 14px; font-family: var(--font-brand); font-weight: 500;
  letter-spacing: -0.01em; margin: 0; color: var(--text);
}
.help-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 10px;
  color: var(--text-2); font-size: 13px; text-decoration: none;
  cursor: pointer; background: none; border: none; width: 100%; text-align: left;
}
.help-item:hover { background: var(--surface-2); color: var(--text); }
.help-item svg { width: 16px; height: 16px; flex: none; }

.help-modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; background: rgba(9,9,10,0.72);
}
.help-modal-overlay.open { display: flex; }
.help-modal {
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto; padding: 22px;
  background: var(--glass-strong); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-family: var(--font);
}
.help-modal h3 {
  margin: 0 0 14px; font-size: 17px; font-family: var(--font-brand);
  font-weight: 500; letter-spacing: -0.01em; color: var(--text);
}
.help-modal dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.help-modal dt { text-align: right; }
.help-modal dd { margin: 0; color: var(--text-2); font-size: 13px; }
.help-modal kbd {
  font-family: var(--font-mono, monospace); font-size: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px;
}
