/* ===== OmniFlows Video Editor — Polished Dark UI ===== */
#tool-editor.editor-active {
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}

.oe-root {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  background: #15161b;
  color: #e8e8ee;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  overflow: hidden;
}

/* ===== Editor Fullscreen Mode =====
 * When `body.oe-fs` is set, hide the OmniFlows chrome (header, sidebar,
 * plan banner, etc.) and let the editor fill the whole viewport.
 * Toggle from the editor topbar; ESC also exits.
 */
body.oe-fs > header.header-glass,
body.oe-fs aside.sidebar,
body.oe-fs #planBanner,
body.oe-fs #warningBanner,
body.oe-fs #demoBanner,
body.oe-fs #refPendingWithdrawBanner,
body.oe-fs .orb {
  display: none !important;
}
body.oe-fs .service-layout {
  height: 100vh !important;
  min-height: 100vh !important;
}
body.oe-fs main.main-content {
  padding: 0 !important;
}
body.oe-fs #tool-editor.editor-active {
  height: 100vh;
}
body.oe-fs .oe-root { height: 100vh; }
/* Hide the floating WhatsApp button in fullscreen too */
body.oe-fs .wa-float, body.oe-fs #waFloat,
body.oe-fs [class*="whatsapp"], body.oe-fs [id*="whatsapp"] {
  display: none !important;
}

/* Fullscreen button in editor topbar */
.oe-fs-btn { font-size: 14px; line-height: 1; padding: 6px 10px; }
body.oe-fs .oe-fs-btn-icon-fs { display: none; }
body:not(.oe-fs) .oe-fs-btn-icon-exit { display: none; }

/* ---------- Top bar ---------- */
.oe-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #25262e 0%, #20212a 100%);
  border-bottom: 1px solid #32343d;
  flex-shrink: 0;
}
.oe-topbar input.oe-name {
  background: #15161b;
  border: 1px solid #32343d;
  color: #e8e8ee;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  width: 240px;
  transition: border-color .15s;
}
.oe-topbar input.oe-name:focus { outline: none; border-color: #c2703e; }
.oe-btn {
  background: #2c2e37;
  color: #e8e8ee;
  border: 1px solid #3e404a;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.oe-btn:hover { background: #383a45; border-color: #52545f; }
.oe-btn:active { transform: translateY(1px); }
.oe-btn.primary {
  background: linear-gradient(135deg, #d4764e, #c2703e);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(194, 112, 62, 0.25);
}
.oe-btn.primary:hover { filter: brightness(1.1); box-shadow: 0 4px 12px rgba(194, 112, 62, 0.35); }
.oe-btn.danger { background: #3a2424; border-color: #5a3434; color: #f0a0a0; }
.oe-btn.danger:hover { background: #4a2828; border-color: #7a3838; }
.oe-btn.ghost { background: transparent; border-color: transparent; color: #a8a8b0; }
.oe-btn.ghost:hover { background: #2a2c34; color: #e8e8ee; }
.oe-btn[disabled] { opacity: .5; cursor: not-allowed; }
.oe-spacer { flex: 1; }
.oe-status {
  font-size: 11px;
  color: #8a8a92;
  margin-right: 6px;
  font-weight: 500;
}
.oe-status.saving { color: #d4764e; }
.oe-status.saved { color: #7ac17a; }

/* ---------- Body: 3 columns ---------- */
.oe-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------- Library (left): vertical icon rail + content panel ---------- */
.oe-lib {
  width: 326px;
  background: #1c1d24;
  border-right: 1px solid #32343d;
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  min-height: 0;
}
.oe-rail {
  width: 64px;
  background: #16171d;
  border-right: 1px solid #25262f;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  gap: 2px;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.oe-rail-btn {
  position: relative;
  background: transparent;
  border: none;
  color: #8a8a92;
  padding: 9px 4px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: color .12s, background .12s;
  border-radius: 6px;
  margin: 0 4px;
}
.oe-rail-btn:hover:not(.active) { color: #d8d8e0; background: rgba(255,255,255,0.04); }
.oe-rail-btn.active {
  color: #d4764e;
  background: linear-gradient(180deg, rgba(212,118,78,0.18), rgba(212,118,78,0.08));
}
.oe-rail-btn.active::before {
  content: "";
  position: absolute;
  left: -4px; top: 8px; bottom: 8px;
  width: 2px;
  background: #d4764e;
  border-radius: 0 2px 2px 0;
}
.oe-rail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
}
.oe-rail-icon svg { width: 22px; height: 22px; display: block; }
.oe-rail-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
  line-height: 1;
}
.oe-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.oe-panel-title {
  flex-shrink: 0;
  padding: 12px 14px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #e8e8ee;
  letter-spacing: .01em;
  border-bottom: 1px solid #25262f;
}

.oe-lib-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
}
.oe-lib-empty {
  text-align: center;
  color: #6a6a72;
  font-size: 12px;
  padding: 36px 16px;
  line-height: 1.6;
}
.oe-lib-search {
  width: 100%;
  background: #15161b;
  border: 1px solid #32343d;
  padding: 7px 11px;
  border-radius: 6px;
  color: #e8e8ee;
  font-size: 12px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.oe-lib-search:focus { outline: none; border-color: #c2703e; }

/* Filter chips */
.oe-chips { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.oe-chip {
  background: #2a2c34;
  border: 1px solid #3a3c45;
  color: #a8a8b0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: all .15s;
}
.oe-chip:hover { background: #34363f; color: #e8e8ee; }
.oe-chip.active { background: #c2703e; border-color: #c2703e; color: #fff; }

/* Asset cards */
.oe-asset {
  background: #25272f;
  border: 1px solid #32343d;
  border-radius: 8px;
  padding: 9px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: all .12s;
  display: flex;
  gap: 9px;
  align-items: center;
}
.oe-asset:hover {
  border-color: #c2703e;
  background: #2a2c34;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.oe-asset .oe-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: #15161b;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #6a6a72;
}
.oe-asset .oe-thumb img,
.oe-asset .oe-thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.oe-asset .oe-asset-meta { flex: 1; min-width: 0; }
.oe-asset .oe-asset-tool {
  font-size: 12px;
  font-weight: 600;
  color: #e8e8ee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
}
.oe-asset .oe-asset-sub {
  font-size: 10.5px;
  color: #8a8a92;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oe-kind-pill {
  display: inline-block;
  padding: 1.5px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.oe-kind-pill.video { background: #1e3a5c; color: #8ab8e8; }
.oe-kind-pill.audio { background: #3c2a5c; color: #b89ce8; }
.oe-kind-pill.image { background: #2a5c3c; color: #8ce8a0; }

/* Upload zone */
.oe-upload-zone {
  border: 2px dashed #3e404a;
  border-radius: 10px;
  padding: 32px 12px;
  text-align: center;
  color: #8a8a92;
  cursor: pointer;
  transition: all .15s;
  background: rgba(255,255,255,0.01);
}
.oe-upload-zone:hover,
.oe-upload-zone.drag {
  border-color: #c2703e;
  color: #e8e8ee;
  background: rgba(194,112,62,0.05);
}
.oe-upload-zone svg { color: #d4764e; }

/* Themes grid */
.oe-themes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.oe-theme-card {
  border-radius: 8px;
  padding: 18px 8px;
  text-align: center;
  cursor: pointer;
  border: 2px solid #32343d;
  background: #15161b;
  transition: all .15s;
  position: relative;
  overflow: hidden;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.oe-theme-card:hover {
  border-color: #c2703e;
  transform: translateY(-1px);
}
.oe-theme-card .oe-theme-name {
  position: absolute;
  bottom: 4px;
  left: 0; right: 0;
  font-size: 9px;
  color: #a8a8b0;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}

/* Subtitles panel */
.oe-subs-area {
  width: 100%;
  height: 180px;
  background: #15161b;
  border: 1px solid #32343d;
  border-radius: 6px;
  padding: 10px;
  color: #e8e8ee;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  resize: vertical;
}
.oe-subs-area:focus { outline: none; border-color: #c2703e; }

/* ---------- Center column ---------- */
.oe-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #18191f;
}

/* Preview */
.oe-preview-wrap {
  flex: 1;
  background: linear-gradient(180deg, #0a0a0d 0%, #0d0e12 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 16px;
}
.oe-preview-stage {
  position: relative;
  background: #000;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  overflow: hidden;
  container-type: size;
}
.oe-preview-stage video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.oe-preview-stage .oe-text-overlay {
  position: absolute;
  pointer-events: auto;
  cursor: move;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}
/* Selection chrome — a thin orange dashed outline so the user knows
   the overlay is "live" and draggable. The corner handle (.oe-text-
   overlay-handle) is hidden until selected to keep the preview clean. */
.oe-preview-stage .oe-text-overlay.selected {
  outline: 1.5px dashed #d4764e;
  outline-offset: 4px;
  border-radius: 2px;
}
.oe-preview-stage .oe-text-overlay-handle {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 16px;
  height: 16px;
  background: #d4764e;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  display: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 2;
}
.oe-preview-stage .oe-text-overlay.selected .oe-text-overlay-handle {
  display: block;
}
/* Stickers get a subtle hover hint so users discover they're interactive
   even before clicking. Doesn't apply to plain text overlays so subtitle
   playback stays distraction-free. */
.oe-preview-stage .oe-text-overlay.sticker:hover:not(.selected) {
  outline: 1px dashed rgba(255,255,255,0.35);
  outline-offset: 4px;
}
.oe-preview-empty {
  text-align: center;
  color: #5a5a62;
  padding: 40px;
  user-select: none;
}
.oe-preview-empty svg {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  opacity: .35;
}
.oe-preview-empty .title {
  font-size: 14px;
  font-weight: 600;
  color: #8a8a92;
  margin-bottom: 4px;
}
.oe-preview-empty .sub {
  font-size: 12px;
  color: #5a5a62;
}

/* Playback bar */
.oe-playbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #1c1d24;
  border-top: 1px solid #32343d;
  flex-shrink: 0;
}
.oe-play-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4764e, #c2703e);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(194,112,62,0.4);
}
.oe-play-btn:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(194,112,62,0.55); }
.oe-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #b8b8c0;
  min-width: 130px;
  font-weight: 500;
}

/* ---------- Timeline ---------- */
.oe-timeline-wrap {
  height: 320px;
  background: #1a1b22;
  border-top: 1px solid #32343d;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.oe-timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #1c1d24;
  border-bottom: 1px solid #32343d;
}
.oe-timeline-toolbar .label {
  font-size: 11px;
  color: #8a8a92;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.oe-zoom { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.oe-zoom .zlabel { font-size: 10px; color: #8a8a92; font-weight: 600; }
.oe-zoom input { width: 110px; }

.oe-timeline {
  flex: 1;
  overflow-x: auto;
  /* Auto-Y so the extra sticker lane (S1) under T1 stays reachable
     even when projects pile up extra rows. */
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
}
.oe-ruler {
  height: 24px;
  background: #15161b;
  border-bottom: 1px solid #32343d;
  position: sticky;
  top: 0;
  z-index: 5;
  min-width: 100%;
}
.oe-ruler-tick {
  position: absolute;
  top: 0; bottom: 0;
  border-left: 1px solid #32343d;
  font-size: 9px;
  color: #6a6a72;
  padding: 5px 4px;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}
.oe-tracks { position: relative; min-width: 100%; }
.oe-track {
  height: 64px;
  border-bottom: 1px solid #1c1d24;
  position: relative;
  background: #18191f;
}
.oe-track-label {
  position: sticky;
  left: 0;
  width: 48px;
  height: 100%;
  background: #1c1d24;
  border-right: 1px solid #32343d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #8a8a92;
  z-index: 4;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.oe-track[data-type="video"] { background: linear-gradient(180deg, #18191f 0%, #1a1c25 100%); }
.oe-track[data-type="audio"] { background: linear-gradient(180deg, #18191f 0%, #1c1a25 100%); }
.oe-track[data-type="text"]  { background: linear-gradient(180deg, #18191f 0%, #1a251c 100%); }
/* Sticker lane — slightly purple so it's visually distinct from the
   regular text lane immediately above it. Smaller height so the two
   text-related lanes together take roughly the same vertical space as
   one video/audio lane. */
.oe-track[data-type="text"][data-lane="sticker"] {
  background: linear-gradient(180deg, #1a1c25 0%, #221a2a 100%);
  height: 48px;
}
.oe-track[data-type="text"][data-lane="sticker"] .oe-track-label {
  color: #c08af0;
}
.oe-clip.text.sticker {
  background: linear-gradient(135deg, #6e3ec7 0%, #4f2a99 100%);
  border: 1px solid #8a5ddf;
}
.oe-clip.text.sticker .oe-clip-label {
  font-size: 18px;
  line-height: 1;
}

.oe-clip {
  position: absolute;
  top: 6px; bottom: 6px;
  border-radius: 5px;
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  overflow: hidden;
  user-select: none;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: box-shadow .12s;
}
.oe-clip.video { background: linear-gradient(135deg, #2a4a72, #3a5e8c); }
.oe-clip.audio { background: linear-gradient(135deg, #4a3a72, #5e4a8c); }
.oe-clip.text  {
  background: linear-gradient(135deg, #3a724a, #4a8c5e);
  border-radius: 14px;  /* pill for text clips */
  height: 26px;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
}
.oe-clip.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(212,118,78,0.65), 0 4px 12px rgba(0,0,0,0.5);
}
.oe-clip:active { cursor: grabbing; }
.oe-clip:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.oe-clip-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.oe-trim {
  position: absolute;
  top: 0; bottom: 0;
  width: 8px;
  background: rgba(255,255,255,0);
  cursor: ew-resize;
  z-index: 2;
  transition: background .12s;
}
.oe-trim:hover, .oe-trim.dragging { background: rgba(255,255,255,0.45); }
.oe-trim.left { left: 0; }
.oe-trim.right { right: 0; }
/* Visual fade indicator */
.oe-clip .oe-fade-in {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}
.oe-clip .oe-fade-out {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  background: linear-gradient(-90deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.oe-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: #ff5050;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 10px rgba(255,80,80,0.6);
}
.oe-playhead::before {
  content: '';
  position: absolute;
  top: -2px; left: -5px;
  border: 6px solid transparent;
  border-top-color: #ff5050;
}
/* Wider invisible grab area so the playhead is easy to drag */
.oe-playhead-grip {
  position: absolute;
  top: 0; bottom: 0;
  left: -7px;
  width: 16px;
  cursor: ew-resize;
  pointer-events: auto;
  z-index: 7;
}
.oe-playhead-grip:hover { background: rgba(255,80,80,0.15); }

/* Make ruler interactive */
.oe-ruler { cursor: pointer; user-select: none; }

/* Drop target highlight when dragging a transition over a clip */
.oe-clip.drop-target {
  outline: 2px dashed #f0c060;
  outline-offset: 2px;
  filter: brightness(1.15);
}

/* Fade tag on clip edges — shows which transition kind is active */
.oe-fade-tag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100% - 6px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.oe-fade-in, .oe-fade-out { position: relative; }

/* Transition kind pill in props panel */
.oe-kind-pill {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #d4764e, #c2703e);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
  text-align: center;
  margin-right: 6px;
}
.oe-kind-pill:empty,
.oe-kind-pill:is(:empty) { display: none; }
.oe-kind-clear {
  background: #25272f;
  border: 1px solid #32343d;
  color: #8a8a92;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.oe-kind-clear:hover {
  background: #3a2a25;
  color: #fff;
  border-color: #d4764e;
}

/* Transitions library */
.oe-trans-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a92;
  margin: 16px 0 8px 2px;
}
.oe-trans-cat:first-of-type { margin-top: 4px; }
.oe-trans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
@media (max-width: 1180px) {
  /* Narrow panel — drop transition cards to single column */
  .oe-trans-grid { grid-template-columns: 1fr; }
}

/* ---------- Stickers panel ---------- */
.oe-stickers-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.oe-sticker-btn {
  background: #25272f;
  border: 1px solid #32343d;
  border-radius: 7px;
  font-size: 22px;
  line-height: 1;
  padding: 6px 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
  user-select: none;
}
.oe-sticker-btn:hover {
  background: #2f313a;
  border-color: #d4764e;
  transform: translateY(-1px);
}
.oe-sticker-btn:active { transform: scale(0.94); }

/* ---------- Filters panel ---------- */
.oe-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.oe-filter-card {
  background: #25272f;
  border: 1px solid #32343d;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: center;
}
.oe-filter-card:hover {
  background: #2a2c34;
  border-color: #c2703e;
  transform: translateY(-1px);
}
.oe-filter-card.active {
  border-color: #d4764e;
  background: linear-gradient(180deg, rgba(212,118,78,0.18), rgba(212,118,78,0.06));
  box-shadow: 0 0 0 1px rgba(212,118,78,0.4);
}
.oe-filter-swatch {
  display: block;
  width: 100%;
  height: 60px;
  border-radius: 5px;
  border: 1px solid #16171d;
}
.oe-filter-name {
  font-size: 11px;
  font-weight: 600;
  color: #e8e8ee;
  letter-spacing: .02em;
}
.oe-trans-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #25272f;
  border: 1px solid #32343d;
  border-radius: 7px;
  cursor: grab;
  user-select: none;
  transition: background .12s, border-color .12s, transform .08s;
  min-width: 0;
}
.oe-trans-card:hover { background: #2a2c34; border-color: #d4764e; }
.oe-trans-card:active { cursor: grabbing; transform: scale(0.97); }
.oe-trans-card.dragging { opacity: 0.55; }
.oe-trans-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, #d4764e, #c2703e);
  color: #fff;
  border-radius: 6px;
  flex-shrink: 0;
}
.oe-trans-meta { flex: 1; min-width: 0; overflow: hidden; }
.oe-trans-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #e8e8ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oe-trans-desc {
  font-size: 10px;
  color: #8a8a92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Preview dims badge */
.oe-preview-wrap { cursor: pointer; }
.oe-preview-stage { transition: aspect-ratio .25s ease; }
.oe-preview-dims {
  position: absolute;
  bottom: 8px; right: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.4);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* ---------- Properties (right) ---------- */
.oe-props {
  width: 290px;
  background: #1c1d24;
  border-left: 1px solid #32343d;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.oe-props-section {
  padding: 14px 16px;
  border-bottom: 1px solid #25262f;
}
.oe-props-section:last-child { border-bottom: none; }
.oe-props-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8a8a92;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.oe-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.oe-row:last-child { margin-bottom: 0; }
.oe-row label {
  flex: 0 0 78px;
  font-size: 11px;
  color: #a8a8b0;
  font-weight: 500;
}
.oe-row input[type="text"],
.oe-row input[type="number"],
.oe-row select {
  flex: 1;
  background: #15161b;
  border: 1px solid #32343d;
  color: #e8e8ee;
  padding: 6px 9px;
  border-radius: 5px;
  font-size: 12px;
  transition: border-color .15s;
  min-width: 0;
}
.oe-row input:focus, .oe-row select:focus {
  outline: none; border-color: #c2703e;
}
.oe-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #c2703e;
  cursor: pointer;
}
.oe-row input[type="color"] {
  flex: 1;
  padding: 0;
  height: 30px;
  cursor: pointer;
  background: #15161b;
  border: 1px solid #32343d;
  border-radius: 5px;
}
.oe-row .vlabel {
  font-size: 10px;
  color: #8a8a92;
  font-family: 'JetBrains Mono', monospace;
  min-width: 42px;
  text-align: right;
  font-weight: 500;
}

/* ---------- Custom range slider (the big visual fix) ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  flex: 1;
  height: 18px;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track {
  background: #2a2c34;
  height: 4px;
  border-radius: 2px;
  border: 1px solid #32343d;
}
input[type="range"]::-moz-range-track {
  background: #2a2c34;
  height: 4px;
  border-radius: 2px;
  border: 1px solid #32343d;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: #d4764e;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  margin-top: -6px;
  border: 2px solid #1c1d24;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform .12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb {
  background: #d4764e;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  border: 2px solid #1c1d24;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* Originality pack accent box */
.oe-originality {
  background: linear-gradient(135deg, rgba(212,118,78,0.10), rgba(194,112,62,0.04));
  border: 1px solid rgba(212,118,78,0.28);
  border-radius: 9px;
  padding: 12px 12px 6px;
}
.oe-originality-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.oe-originality-head .title {
  font-size: 12px;
  font-weight: 700;
  color: #e8e8ee;
  flex: 1;
}
.oe-originality-head .badge {
  font-size: 9px;
  background: rgba(212,118,78,0.2);
  color: #d4764e;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
}
.oe-originality.disabled { opacity: 0.5; }

/* No-selection hint */
.oe-noclip-hint {
  font-size: 12px;
  color: #8a8a92;
  line-height: 1.55;
  padding: 8px 0;
}
.oe-noclip-hint .row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.oe-noclip-hint kbd {
  background: #2a2c34;
  border: 1px solid #3a3c45;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: #c4c4cc;
}

/* ---------- Modal ---------- */
.oe-modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: oe-fadein .15s ease;
}
@keyframes oe-fadein { from { opacity: 0; } to { opacity: 1; } }
.oe-modal {
  background: #25272f;
  border: 1px solid #3a3c45;
  border-radius: 12px;
  padding: 26px 28px;
  min-width: 400px;
  max-width: 560px;
  color: #e8e8ee;
  box-shadow: 0 24px 70px rgba(0,0,0,0.7);
}
.oe-modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.oe-modal p {
  font-size: 13px;
  color: #b8b8c0;
  margin-bottom: 14px;
  line-height: 1.55;
}
.oe-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}
.oe-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(212,118,78,0.25);
  border-top-color: #d4764e;
  border-radius: 50%;
  animation: oe-spin .8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes oe-spin { to { transform: rotate(360deg); } }

/* ---------- Project picker ---------- */
.oe-picker {
  padding: 40px;
  max-width: 1000px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
}
.oe-picker h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: -0.02em;
}
.oe-picker .sub {
  color: #b8b8c0;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.5;
}
.oe-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.oe-pcard {
  background: #25272f;
  border: 1px solid #32343d;
  border-radius: 10px;
  padding: 18px;
  cursor: pointer;
  transition: all .15s;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.oe-pcard:hover {
  border-color: #c2703e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.oe-pcard.new {
  background: linear-gradient(135deg, rgba(212,118,78,0.18), rgba(194,112,62,0.08));
  border-color: rgba(212,118,78,0.4);
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.oe-pcard.new .plus {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(212,118,78,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #d4764e;
  font-weight: 600;
  flex-shrink: 0;
}
.oe-pcard h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oe-pcard .meta {
  font-size: 11px;
  color: #8a8a92;
}

/* ---------- Scrollbars ---------- */
.oe-lib-body::-webkit-scrollbar,
.oe-props::-webkit-scrollbar,
.oe-timeline::-webkit-scrollbar,
.oe-picker::-webkit-scrollbar { width: 8px; height: 8px; }
.oe-lib-body::-webkit-scrollbar-thumb,
.oe-props::-webkit-scrollbar-thumb,
.oe-timeline::-webkit-scrollbar-thumb,
.oe-picker::-webkit-scrollbar-thumb {
  background: #32343d;
  border-radius: 4px;
}
.oe-lib-body::-webkit-scrollbar-thumb:hover,
.oe-props::-webkit-scrollbar-thumb:hover,
.oe-timeline::-webkit-scrollbar-thumb:hover,
.oe-picker::-webkit-scrollbar-thumb:hover {
  background: #44464f;
}
