/* ─── ClayStage · dark UI ──────────────────────────────────────────────── */

@font-face { font-family: 'StandIn-Serif';  src: url('../assets/fonts/Fraunces.ttf');        font-display: swap; }
@font-face { font-family: 'StandIn-SerifI'; src: url('../assets/fonts/Fraunces-Italic.ttf'); font-style: italic; font-display: swap; }
@font-face { font-family: 'StandIn-Geo';    src: url('../assets/fonts/SpaceGrotesk.ttf');    font-display: swap; }
@font-face { font-family: 'StandIn-Grot';   src: url('../assets/fonts/Archivo.ttf');         font-display: swap; }
@font-face { font-family: 'StandIn-UI';     src: url('../assets/fonts/Inter.ttf');           font-display: swap; }
@font-face { font-family: 'StandIn-Mono';   src: url('../assets/fonts/SplineSansMono.ttf');  font-display: swap; }
@font-face { font-family: 'StandIn-SerifL'; src: url('../assets/fonts/Spectral-Light.ttf');  font-display: swap; }
@font-face { font-family: 'StandIn-GeoL';   src: url('../assets/fonts/Poppins-Light.ttf');   font-display: swap; }
@font-face { font-family: 'StandIn-GeoB';   src: url('../assets/fonts/Poppins-Bold.ttf');    font-display: swap; }

input[type=range] { accent-color: var(--accent); }
:root {
  --bg:       #101214;
  --bg-deep:  #0b0c0e;
  --panel:    #16181b;
  --panel-2:  #1b1e22;
  --panel-3:  #22262b;
  --line:     #272b30;
  --line-2:   #32373d;
  --text:     #e8e6e1;
  --text-dim: #989da3;
  --text-faint:#6b7077;
  --accent:   #6366f1;   /* ClayStage Indigo (locked brand accent) */
  --accent-dim:#4f46e5;
  --accent-ink:#ffffff;
  --mint:     #1fd98b;   /* success only */
  --danger:   #e4572e;
  --bone:     #f4f1ec;
  --radius:   10px;
  --radius-s: 7px;
  font-size: 13px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'StandIn-UI', 'Inter', -apple-system, system-ui, sans-serif;
  font-weight: 450;
  letter-spacing: .01em;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 6px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-dim); }
svg-i { display: inline-flex; width: 15px; height: 15px; }
svg-i svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Topbar ───────────────────────────────────────────────────────────── */
#topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: var(--bg-deep); border-bottom: 1px solid var(--line);
  position: relative; z-index: 30;
}
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark { font-family: 'StandIn-Geo'; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.wordmark span { color: var(--accent); }
#scene-title {
  background: transparent; border: 1px solid transparent; padding: 4px 8px; border-radius: 6px;
  color: var(--text-dim); width: 180px;
}
#scene-title:hover { border-color: var(--line-2); }
#scene-title:focus { color: var(--text); border-color: var(--accent-dim); }
.tb-center { display: flex; align-items: center; gap: 4px; }
.tb-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.tb-btn {
  padding: 5px 10px; border-radius: var(--radius-s); color: var(--text-dim);
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.tb-btn:hover { background: var(--panel-2); color: var(--text); }
.tb-btn.danger:hover { color: var(--danger); }
.tb-btn:disabled { opacity: .35; pointer-events: none; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.world-toggle { display: flex; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; }
.world-toggle button { padding: 3px 12px; border-radius: 6px; color: var(--text-faint); font-size: 12px; }
.world-toggle button.active { background: var(--panel-3); color: var(--text); }
#ratio-select { padding: 5px 8px; background: var(--panel-2); }
#btn-generate {
  background: var(--generate, var(--accent)); color: var(--accent-ink, #06262d); font-weight: 600; padding: 7px 18px;
  border-radius: 8px; letter-spacing: .02em; transition: filter .15s;
}
#btn-generate:hover { filter: brightness(1.12); }
#btn-generate.busy { filter: grayscale(.4) brightness(.8); pointer-events: none; }
/* animated dotLottie button — the .lottie supplies its own art, so drop the
   accent fill/padding and let the canvas fill a button-shaped (≈3:1) slot */
#btn-generate.has-lottie { background: none; padding: 0; border-radius: 9px; height: 50px; width: 156px; overflow: hidden; }
#btn-generate.has-lottie:hover { filter: brightness(1.06); }
/* Runway-style: the Lottie Generate button stays clickable mid-render so you can
   queue more generations (the feed tracks each one) — .busy must not block it */
#btn-generate.has-lottie.busy { pointer-events: auto; filter: none; }
#btn-generate .gen-lottie { width: 100%; height: 100%; display: block; }

/* ─── Topbar · responsive ──────────────────────────────────────────────────
   Desktop (>820px) is untouched. Below 820px the three groups stop colliding;
   below 520px the bar becomes horizontally scrollable so every control stays
   reachable down to ~380px. What collapses where:
     ≤820px — tighten gaps/padding; drop the "Saved" text + Projects select to
              a compact form; shrink the scene-title field; let groups shrink.
     ≤520px — hide brand wordmark + non-essential chips (credits/world/res/count);
              allow the bar to scroll sideways; keep undo/redo, Save/Open, model
              picker, ratio and Generate usable & tappable.                     */
@media (max-width: 820px) {
  /* Below desktop the three groups can't all fit, so instead of squeezing them
     (which made them overlap), the WHOLE bar scrolls sideways. Single 64px row
     (height must stay 64px — the camera bar offset tracks it), nowrap, every
     control keeps its intrinsic width, so nothing ever overlaps. */
  #topbar {
    justify-content: flex-start; gap: 8px; padding: 0 10px; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #topbar::-webkit-scrollbar { height: 0; }
  .tb-left, .tb-center, .tb-right { flex: 0 0 auto; }
  .tb-left { gap: 8px; }
  .tb-center { gap: 2px; }
  .tb-right { gap: 6px; }
  /* every control keeps its own width — never squashes into a neighbour */
  .tb-left > *, .tb-center > *, .tb-right > * { flex: 0 0 auto; }
  .tb-sep { margin: 0 3px; }
  .tb-btn { padding: 5px 8px; }
  #scene-title { width: 120px; min-width: 100px; flex: 0 0 auto; }
  /* the "Saved" word is redundant beside the dot — show just a status dot.
     #topbar-prefixed so it beats the base #save-state rule later in the file. */
  #topbar #save-state { font-size: 0; padding: 4px; width: 7px; box-sizing: content-box; }
  #topbar #save-state::before {
    content: ""; display: block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--text-faint);
  }
  #topbar #save-state.on::before { background: var(--mint); }
  /* collapse Projects to a narrow icon-ish select */
  #topbar #projects-select { max-width: 40px; padding: 4px 2px; }
  #topbar #model-select { max-width: 140px; }
}
@media (max-width: 520px) {
  /* phones: tighten + drop the brand wordmark and non-essential render chips so
     the scroll is shorter; undo/redo, Save/Open, model, ratio, Generate stay */
  #topbar { gap: 6px; padding: 0 8px; }
  #scene-title { width: 96px; min-width: 96px; }
  .wordmark, #credits-chip, #world-toggle, #res-select, #count-select { display: none; }
  #model-select { max-width: 120px; }
}

/* ─── Layout ───────────────────────────────────────────────────────────── */
/* must track #topbar height (64px) — a stale value here pushes the camera bar
   off the bottom and clips the library footer */
main { display: flex; height: calc(100% - 64px); }
#library { width: 264px; min-width: 264px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
#viewport-wrap { flex: 1; position: relative; background: var(--bg); min-width: 0; overflow: hidden; /* clips the frame mask so it can't bleed over the library */ }
#viewport { width: 100%; height: 100%; display: block; outline: none; }
#right { width: 292px; min-width: 292px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }

/* ─── Library accordion ────────────────────────────────────────────────── */
.lib-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; font-family: 'StandIn-Geo'; font-size: 13px; letter-spacing: .04em;
  color: var(--text-dim); text-transform: uppercase;
}
.lib-header button { color: var(--text-faint); padding: 4px; border-radius: 6px; }
.lib-header button:hover { color: var(--text); background: var(--panel-2); }
#lib-accordion { flex: 1; overflow-y: auto; overflow-x: hidden; }
.lib-footer { padding: 9px 14px; font-size: 11px; color: var(--text-faint); border-top: 1px solid var(--line); }

.acc-section { border-top: 1px solid var(--line); }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 11px 14px;
  color: var(--text-dim); transition: color .12s;
}
.acc-head:hover { color: var(--text); }
.acc-head .chev { margin-left: auto; transition: transform .18s; width: 12px; height: 12px; }
.acc-section.open .acc-head { color: var(--text); }
.acc-section.open .acc-head .chev { transform: rotate(90deg); }
.acc-head .cnt { font-size: 11px; color: var(--text-faint); }
.acc-body { display: none; padding: 2px 10px 12px; }
.acc-section.open .acc-body { display: block; }

.lib-search { width: 100%; padding: 6px 9px; margin: 2px 0 8px; font-size: 12px; background: var(--panel-2); }
.cat-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 9px; }
.cat-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 20px; background: var(--panel-2);
  color: var(--text-faint); border: 1px solid transparent;
}
.cat-chip:hover { color: var(--text); }
.cat-chip.active { color: var(--accent); border-color: var(--accent-dim); background: color-mix(in srgb, var(--accent) 6%, transparent); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
.tile {
  position: relative; border-radius: var(--radius-s); overflow: hidden; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); transition: border-color .12s, transform .12s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tile.active { border-color: var(--accent); }
.tile canvas, .tile .sw { width: 100%; aspect-ratio: 1; display: block; }
.tile .t-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 10.5px;
  line-height: 1.25; color: #ddd; background: linear-gradient(transparent, rgba(8,9,10,.85));
  pointer-events: none;
}
.tile .t-badge {
  position: absolute; top: 5px; right: 5px; font-size: 9px; letter-spacing: .05em; padding: 2px 6px;
  border-radius: 10px; background: rgba(201,205,210,.92); color: #111; font-weight: 600; pointer-events: none;
}
.tile.dragging { opacity: .45; }

.font-card {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-s);
  background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; margin-bottom: 7px;
  transition: border-color .12s;
}
.font-card:hover { border-color: var(--accent-dim); }
.font-card .fc-prev { font-size: 21px; color: var(--bone); }
.font-card .fc-name { font-size: 10.5px; color: var(--text-faint); }

/* ─── Viewport overlays ────────────────────────────────────────────────── */
#viewport-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--text-faint); background: rgba(11,12,14,.55); padding: 5px 12px;
  border-radius: 16px; pointer-events: none; backdrop-filter: blur(6px); white-space: nowrap;
}
#tool-hud {
  position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(16,18,20,.78); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px; backdrop-filter: blur(8px);
}
#tool-hud button { padding: 6px 11px; border-radius: 6px; color: var(--text-dim); font-size: 12px; text-align: left; }
#tool-hud button:hover { color: var(--text); background: var(--panel-2); }
#tool-hud button.active { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }

#cam-bar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: rgba(16,18,20,.82); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(8px); max-width: calc(100% - 40px);
}
#cam-chips { display: flex; gap: 4px; }
.cam-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px;
  font-size: 12px; color: var(--text-dim); border: 1px solid transparent; white-space: nowrap;
}
.cam-chip:hover { color: var(--text); background: var(--panel-2); }
.cam-chip.active { color: color-mix(in srgb, var(--accent) 50%, #ffffff); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.cam-chip .lk { width: 11px; height: 11px; opacity: .8; }
.cam-add { padding: 5px 9px; color: var(--text-faint); border-radius: 8px; font-size: 14px; }
.cam-add:hover { color: var(--text); background: var(--panel-2); }
/* only the ACTIVE chip should read as selected — suppress the mouse-click focus
   ring (it looked like a second highlighted camera); keep it for keyboard nav */
.cam-chip:focus:not(:focus-visible) { outline: none; }
.cam-chip:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
#aperture-scrub { display: inline-flex; }
#aperture-scrub .scrub { flex: 0 0 58px; width: 58px; height: 24px; }
/* Autodrive timeline bar (sits just above the camera bar) */
#timeline-bar {
  position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  background: rgba(16,18,20,.82); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(8px); max-width: calc(100% - 40px); font-size: 12px; color: var(--text-dim);
}
#timeline-bar:empty,
#timeline-bar.tl-hidden { display: none; }
.tl-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; color: var(--text); border: 1px solid var(--line-2); }
.tl-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
#tl-scrub { width: 180px; accent-color: var(--accent); }
.tl-time { font-variant-numeric: tabular-nums; min-width: 38px; }
.tl-lbl { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#timeline-bar .scrub { flex: 0 0 48px; width: 48px; height: 22px; }
/* Autodrive inspector section */
.r-subhead { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 12px 0 6px; padding-top: 9px; border-top: 1px solid var(--line-2); }
.ad-row { display: flex; align-items: center; gap: 5px; margin: 4px 0; }
.ad-l { flex: 0 0 46px; font-size: 11px; color: var(--text-faint); }
.ad-type { flex: 0 0 80px; }
.ad-axis, .ad-axis-spacer { flex: 0 0 44px; }
.ad-row .scrub { flex: 1; height: 24px; }
.ad-grp { margin: 9px 0 2px; }
.ad-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.ad-pb { flex: 0 0 92px; }
.ad-ease { text-align: left; font-size: 11px; }
/* clickable easing-curve thumbnail → opens the Easing Library popup */
.ad-ease-thumb { flex: 1; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding-right: 8px; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; color: var(--text); min-width: 0; }
.ad-ease-thumb:hover { border-color: var(--accent-dim); }
.ad-ease-thumb svg { width: 46px; height: 100%; flex: 0 0 46px; display: block; }
.ad-ease-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-unit { font-size: 10px; color: var(--text-faint); flex: 0 0 auto; }
/* chained animation ranges (multi-range) */
.ad-rangehd { display: flex; align-items: center; justify-content: space-between; margin: 9px 0 3px; padding-top: 7px; border-top: 1px dashed var(--line-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.ad-rangex { color: var(--text-faint); padding: 0 3px; display: inline-flex; }
.ad-rangex:hover { color: var(--danger); }
.ad-rangex svg { width: 13px; height: 13px; }
.ad-addrange { width: 100%; justify-content: center; gap: 5px; font-size: 11px; padding: 6px; margin-top: 7px; border: 1px dashed var(--line-2); border-radius: 7px; color: var(--text-dim); }
.ad-addrange:hover { border-color: var(--accent-dim); color: var(--accent); }
.ad-addrange svg { width: 13px; height: 13px; }
.cam-cap { flex: 0 0 auto; font-size: 10px; padding: 3px 6px; gap: 3px; border: 1px solid var(--line-2); }
.cam-cap svg { width: 12px; height: 12px; }
#cam-edit.active { border-color: var(--accent); color: var(--accent); }
/* Easing Library popup (port of the AutoDrive easing browser) */
/* .help-card.ez-card (two classes) beats the base .help-card width:420px that
   comes later in the file — without this the easing grid is crammed into 420px */
.help-card.ez-card { width: min(940px, 94vw); max-height: 88vh; overflow: auto; }
.ez-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
/* minmax(0,1fr) (not the default minmax(auto,1fr)) so 7 columns always fit the
   card instead of overflowing and clipping the right column */
.ez-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ez-cell { display: flex; flex-direction: column; gap: 4px; padding: 5px; border: 2px solid transparent; border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.ez-cell:hover { border-color: var(--accent-dim); }
.ez-cell.sel { border-color: #fa9e33; }
.ez-empty { background: none; cursor: default; }
.ez-thumb { width: 100%; height: 54px; background: var(--bg-deep); border-radius: 5px; display: block; }
.ez-name { font-size: 11px; color: var(--text-dim); text-align: center; }
.cb-sep { width: 1px; height: 20px; background: var(--line-2); }
.cb-focal { display: flex; align-items: center; gap: 8px; }
#focal-slider { width: 110px; accent-color: var(--accent); background: transparent; border: none; }
#focal-readout { font-family: 'StandIn-Mono'; font-size: 11px; color: var(--text-dim); width: 44px; }
#btn-proj, #btn-cam-lock { padding: 5px 10px; border-radius: 8px; color: var(--text-dim); font-size: 12px; }
#btn-proj:hover, #btn-cam-lock:hover { background: var(--panel-2); color: var(--text); }
#btn-cam-lock.locked { color: var(--accent); }

#safe-frame { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
#viewport-wrap { --sf-dim: 0.32; }
.sf-box { border: 1px dashed rgba(232,230,225,.16); position: absolute; box-shadow: 0 0 0 2000px rgba(11,12,14,var(--sf-dim)); }

/* boot loader — shifting cubes in theme blue while the studio loads.
   Translucent so the app faintly shows through as it comes up. */
#boot-loader {
  position: fixed; inset: 0; z-index: 300; background: rgba(11, 12, 14, 0.72);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center;
  transition: opacity 0.35s ease;
}

/* camera-remix anchor banner above Generate */
.remix-banner {
  display: flex; align-items: center; gap: 9px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 10px; padding: 7px 9px; margin-bottom: 8px; font-size: 11.5px; color: var(--text-dim);
}
.remix-banner img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.remix-banner span { flex: 1; line-height: 1.35; }
.remix-banner button { color: var(--text-dim); padding: 2px 6px; border-radius: 6px; flex-shrink: 0; }
.remix-banner button:hover { background: var(--panel-2); color: var(--text); }
#boot-anim { width: 150px; height: 150px; }
#boot-loader span { color: #6b7077; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }

/* composition guides — thirds / golden spiral, stretched to the render ratio */
#comp-guides { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
#comp-guides.on { display: block; }
#comp-guides line, #comp-guides path { stroke: rgba(190, 226, 235, 0.55); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
#btn-guides { padding: 5px 9px; border-radius: 8px; color: var(--text-dim); display: flex; align-items: center; }
#btn-guides:hover { background: var(--panel-2); color: var(--text); }
#btn-guides.active { color: var(--accent); }
#model-select { padding: 5px 6px; background: var(--panel-2); max-width: 168px; }

#status-toast {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text);
  padding: 8px 16px; border-radius: 10px; font-size: 12px; opacity: 0; transition: all .22s;
  pointer-events: none; max-width: 70%; text-align: center;
}
#status-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Right panels ─────────────────────────────────────────────────────── */
.r-section { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); min-height: 36px; }
.r-section.grow { flex: 1; min-height: 120px; }
.r-head {
  padding: 10px 14px; font-family: 'StandIn-Geo'; font-size: 11.5px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 8px;
}
.r-head span { font-family: 'StandIn-UI'; text-transform: none; letter-spacing: 0; color: var(--text-faint); font-size: 11px; }
.r-body { overflow-y: auto; padding: 0 12px 12px; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
#sec-inspector .r-body { max-height: min(680px, 58vh); }
#sec-outliner .r-body { max-height: 200px; }
.empty-note { color: var(--text-faint); font-size: 12px; padding: 6px 2px 10px; }

.insp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.insp-row label { width: 86px; min-width: 86px; font-size: 11.5px; color: var(--text-dim); }
.insp-row input[type=range] { flex: 1; accent-color: var(--accent); background: transparent; border: none; }
.insp-row input[type=text], .insp-row textarea, .insp-row select { flex: 1; padding: 5px 8px; font-size: 12px; min-width: 0; }
.insp-row textarea { resize: vertical; min-height: 44px; }
.insp-row .val { font-family: 'StandIn-Mono'; font-size: 10.5px; color: var(--text-faint); width: 40px; text-align: right; }
.insp-row .seg { display: flex; flex: 1; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 2px; }
.insp-row .seg button { flex: 1; padding: 3px 0; font-size: 11px; color: var(--text-faint); border-radius: 5px; }
.insp-row .seg button.active { background: var(--panel-3); color: var(--text); }
.insp-title { display: flex; align-items: center; gap: 8px; padding: 4px 0 10px; }
.insp-title b { font-weight: 600; font-size: 13px; }
.insp-title .kind { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.mat-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border-radius: 16px;
  background: var(--panel-2); border: 1px solid var(--line-2); font-size: 11.5px; color: var(--text-dim);
}
.mat-chip .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); }
.mat-chip button { color: var(--text-faint); font-size: 13px; line-height: 1; }
.mat-chip button:hover { color: var(--danger); }
.insp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.insp-actions .tb-btn { border: 1px solid var(--line-2); font-size: 11.5px; padding: 4px 9px; }
.pick-banner {
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 7px; padding: 6px 10px; font-size: 11.5px; margin-bottom: 8px;
}

.ol-item {
  display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px;
  color: var(--text-dim); font-size: 12px; cursor: pointer;
}
.ol-item:hover { background: var(--panel-2); color: var(--text); }
.ol-item.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.ol-item .ol-ico { width: 13px; height: 13px; opacity: .75; }
.ol-item .ol-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-item .ol-dot { width: 8px; height: 8px; border-radius: 50%; }
.ol-item .ol-eye { opacity: 0; }
.ol-item:hover .ol-eye { opacity: .7; }
.ol-item.indent { padding-left: 24px; }

/* ─── Generations feed ─────────────────────────────────────────────────── */
#gen-feed { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.gen-card {
  border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel-2); transition: border-color .12s;
}
.gen-card:hover { border-color: var(--line-2); }
.gen-card img, .gen-card video { width: 100%; display: block; }
.gen-card .g-meta { display: flex; align-items: center; gap: 6px; padding: 6px 9px; font-size: 10.5px; color: var(--text-faint); }
.gen-card .g-world { padding: 1px 7px; border-radius: 9px; font-size: 9.5px; letter-spacing: .04em; }
.gen-card .g-world.light { background: rgba(244,241,236,.12); color: var(--bone); }
.gen-card .g-world.dark { background: rgba(0,0,0,.45); color: var(--text-dim); border: 1px solid var(--line-2); }
.gen-card.pending { position: relative; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.gen-card.pending::after {
  content: ''; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-card.failed { border-color: rgba(228,87,46,.5); min-height: 0; }
.gen-card .g-err {
  padding: 10px 12px 6px; font-size: 11.5px; line-height: 1.45; color: var(--danger);
  white-space: normal; word-break: break-word; user-select: text;
}
.gen-card { position: relative; }
.g-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 5px; opacity: 0; transition: opacity .15s; }
.gen-card:hover .g-actions { opacity: 1; }
.g-act {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: rgba(10,11,12,.72); border: 1px solid var(--line-2); border-radius: 7px;
  color: var(--text); font-size: 13px; text-decoration: none; cursor: pointer; backdrop-filter: blur(6px);
}
.g-act:hover { border-color: var(--accent-dim); color: var(--accent); }
#lb-x {
  position: absolute; top: 18px; right: 22px; width: 36px; height: 36px; border-radius: 10px;
  background: rgba(16,18,20,.7); border: 1px solid var(--line-2); color: var(--text);
  font-size: 15px; z-index: 101; backdrop-filter: blur(6px);
}
#lb-x:hover { color: var(--accent); border-color: var(--accent-dim); }
#save-state {
  font-size: 10.5px; color: var(--text-faint); padding: 2px 8px; border-radius: 9px;
  border: 1px solid transparent; transition: all .25s; white-space: nowrap;
}
#save-state.on { color: var(--mint); border-color: rgba(31,217,139,.25); }
#res-select, #count-select { padding: 5px 6px; background: var(--panel-2); }

/* ─── Lightbox / Help ──────────────────────────────────────────────────── */
#lightbox, #help-overlay {
  position: fixed; inset: 0; background: rgba(5,6,7,.72); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
#lightbox[hidden], #help-overlay[hidden] { display: none; }
.lb-card { max-width: min(1100px, 92vw); max-height: 92vh; display: flex; gap: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.lb-card img { max-width: 70%; object-fit: contain; background: var(--bg-deep); }
.lb-meta { display: flex; flex-direction: column; padding: 18px; gap: 14px; min-width: 260px; max-width: 340px; }
#lb-prompt { font-size: 11.5px; color: var(--text-dim); overflow-y: auto; white-space: pre-wrap; flex: 1; line-height: 1.5; user-select: text; }
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-actions .tb-btn { flex: 0 0 auto; }
.help-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 26px 30px; width: 420px; }
.help-card h3 { font-family: 'StandIn-Geo'; font-weight: 500; margin-bottom: 18px; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 12px; margin-bottom: 20px; }
.help-grid span { color: var(--text-faint); font-family: 'StandIn-Mono'; font-size: 11px; }
.help-grid b { font-weight: 450; color: var(--text-dim); }

/* ─── Misc ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid var(--panel); }
::-webkit-scrollbar-track { background: transparent; }
.admin-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 4px; }
.admin-form input, .admin-form select { padding: 6px 9px; font-size: 12px; }
.admin-form .tb-btn { border: 1px solid var(--line-2); justify-content: center; }
.admin-drop {
  border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 18px 10px; text-align: center;
  color: var(--text-dim); font-size: 12px; cursor: pointer; transition: all .15s;
}
.admin-drop span { color: var(--text-faint); font-size: 11px; }
.admin-drop:hover, .admin-drop.over { border-color: var(--accent-dim); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }

#credits-chip {
  font-family: 'StandIn-Mono'; font-size: 11px; color: var(--text-dim);
  padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 14px; white-space: nowrap;
}
#credits-chip.low { color: var(--danger); border-color: rgba(228,87,46,.4); }
#projects-select {
  background: transparent; border: 1px solid transparent; color: var(--text-faint);
  font-size: 12px; padding: 4px 4px; max-width: 120px;
}
#projects-select:hover { border-color: var(--line-2); color: var(--text); }
.kbd {
  font-family: 'StandIn-Mono'; font-size: 9px; color: var(--text-faint);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; margin-left: 6px;
}
/* auth screen */
#auth-screen { position: fixed; inset: 0; background: radial-gradient(120% 120% at 30% 10%, #14181c 0%, #0b0c0e 70%); display: flex; align-items: center; justify-content: center; z-index: 200; }
.auth-card { width: 360px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 30px 32px; display: flex; flex-direction: column; gap: 10px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.auth-brand img { height: 22px; }
.auth-sub { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin-bottom: 8px; }
.auth-err { background: rgba(228,87,46,.1); border: 1px solid rgba(228,87,46,.4); color: var(--danger); border-radius: 8px; padding: 8px 11px; font-size: 12px; }
.auth-card input { padding: 10px 12px; font-size: 13px; }
.auth-primary { background: var(--accent); color: var(--accent-ink, #06262d); font-weight: 600; border-radius: 9px; padding: 10px; }
.auth-primary:hover { filter: brightness(1.1); }
.auth-secondary { color: var(--text-dim); padding: 8px; border-radius: 9px; border: 1px solid var(--line-2); }
.auth-secondary:hover { color: var(--text); background: var(--panel-2); }
.auth-div { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 11px; margin: 4px 0; }
.auth-div::before, .auth-div::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-google { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 10px; border-radius: 9px; border: 1px solid var(--line-2); color: var(--text); background: var(--panel-2); }
.auth-google:disabled { opacity: .45; cursor: not-allowed; }
.auth-foot { color: var(--text-faint); font-size: 10.5px; line-height: 1.5; margin-top: 8px; }

/* header brand + profile */
#brand-gem { height: 20px; width: auto; }
#profile-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 14px; color: var(--text-dim); font-size: 12px; }
#profile-chip:hover { color: var(--text); border-color: var(--accent-dim); }
#profile-chip .pc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
#profile-chip em { font-style: normal; color: var(--accent); font-size: 10px; letter-spacing: .05em; }

/* library admin mode */
#btn-admin.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
#btn-admin.disabled { opacity: .4; }
.lib-admin-bar { position: absolute; top: 5px; left: 5px; display: flex; gap: 3px; z-index: 3; }
.lib-admin-bar button { width: 22px; height: 22px; border-radius: 6px; background: rgba(10,11,12,.8); border: 1px solid var(--line-2); color: var(--text); font-size: 11px; }
.lib-admin-bar button:hover { border-color: var(--accent-dim); color: var(--accent); }
.tile.lib-hidden { opacity: .35; }
.lib-rename { width: 100%; padding: 2px 5px; font-size: 10.5px; background: var(--panel-3); pointer-events: auto; }
.coming-soon { border: 1px dashed var(--line-2); border-radius: 10px; padding: 16px 14px; color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.coming-soon span { display: block; color: var(--accent); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }

/* pending card status, resizers */
.g-pending-meta { position: absolute; inset: auto 8px 8px 8px; display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--text-dim); z-index: 2; }
.g-pending-meta .g-pct { font-family: 'StandIn-Mono'; color: var(--accent); }
.g-pending-meta .g-slow { color: var(--text-faint); flex: 1; }
.g-pending-meta .g-cancel { margin-left: auto; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--text-dim); font-size: 10.5px; }
.g-pending-meta .g-cancel:hover { color: var(--danger); border-color: rgba(228,87,46,.5); }
.r-resize { height: 5px; cursor: ns-resize; background: transparent; }
.r-resize:hover { background: var(--accent-dim); }
#lib-resize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: ew-resize; z-index: 5; }
#lib-resize:hover { background: var(--accent-dim); }
#library { position: relative; }
.r-body { height: auto; }

/* profile menu (custom — no native dialogs) */
#profile-menu {
  position: fixed; z-index: 150; width: 230px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 7px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.pm-id { padding: 9px 11px 7px; }
.pm-name { font-weight: 600; font-size: 13px; }
.pm-email { color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }
.pm-role { color: var(--accent); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; margin-top: 5px; }
.pm-div { height: 1px; background: var(--line); margin: 5px 4px; }
.pm-item { display: block; width: 100%; text-align: left; padding: 8px 11px; border-radius: 7px; color: var(--text-dim); font-size: 12.5px; }
.pm-item:hover { background: var(--panel-2); color: var(--text); }
.pm-item.danger:hover { color: var(--danger); }
.pm-item:disabled { opacity: .4; pointer-events: none; }

/* v3: modals, users/projects dashboards, uploads, outliner extras */
.cs-modal {
  position: fixed; inset: 0; background: rgba(5,6,7,.72); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; z-index: 160;
}
.cs-modal-body { overflow-y: auto; }
.usr-row, .prj-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.usr-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.usr-id b { font-size: 12.5px; font-weight: 600; }
.usr-id span { font-size: 11px; color: var(--text-faint); }
.usr-status { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; }
.usr-status.approved { color: var(--mint); background: rgba(31,217,139,.1); }
.usr-status.pending { color: #f5b942; background: rgba(245,185,66,.12); }
.usr-status.disabled { color: var(--danger); background: rgba(228,87,46,.12); }
.usr-role { padding: 4px 6px; font-size: 11.5px; }
.usr-row .tb-btn, .prj-row .tb-btn { border: 1px solid var(--line-2); font-size: 11.5px; padding: 4px 9px; }

.up-status { border-radius: 8px; padding: 8px 11px; font-size: 12px; margin: -2px 0 2px; }
.up-status.busy { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); border: 1px solid var(--accent-dim); }
.up-status.ok { background: rgba(31,217,139,.08); color: var(--mint); border: 1px solid rgba(31,217,139,.3); }
.up-status.err { background: rgba(228,87,46,.08); color: var(--danger); border: 1px solid rgba(228,87,46,.35); }
.up-bar { display: block; height: 3px; background: var(--panel-3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--accent); transition: width .15s; }

.mat-preview {
  display: block; width: 100%; max-width: 200px; aspect-ratio: 1; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--line-2); margin-top: 7px;
}
.ol-lock { opacity: 0; padding: 0 2px; display: inline-flex; color: var(--text-faint); }
.ol-lock svg-i { width: 13px; height: 13px; }
.ol-item:hover .ol-lock, .ol-lock.on { opacity: .8; }
.ol-lock.on { color: var(--accent); opacity: .95; }
.ol-del { opacity: 0; color: var(--text-faint); font-size: 11px; padding: 0 3px; }
.ol-item:hover .ol-del { opacity: .75; }
.ol-del:hover { color: var(--danger); }
.ol-empty { min-height: 26px; }
.ol-part { border-left: 1px solid var(--line-2); margin-left: 13px; padding-left: 10px; }
.ol-tree { color: var(--text-faint); font-size: 10px; margin-right: -2px; }
.ol-chev { color: var(--text-faint); font-size: 13px; width: 18px; margin-left: -4px; }
.ol-chev:hover { color: var(--accent); }
/* material preview disclosure arrow — readable, not a speck */
.mat-prev-toggle { font-size: 13px; line-height: 1; color: var(--text-faint); padding: 0 4px; }
.mat-prev-toggle:hover { color: var(--accent); }
/* timeline frame value lands on a whole second (multiple of 24fps) → accent */
.tl-onsec .scrub-in { color: var(--accent); font-weight: 600; }
.sw-custom { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 30px; color: var(--text-faint); background: var(--panel-3); }
.lib-hidden { opacity: .45; }
.lib-admin-bar {
  position: absolute; top: 5px; left: 5px; display: flex; gap: 3px; z-index: 3;
}
.lib-admin-bar button {
  width: 22px; height: 22px; border-radius: 6px; background: rgba(10,11,12,.8);
  border: 1px solid var(--line-2); color: var(--text); font-size: 11px; backdrop-filter: blur(4px);
}
.lib-admin-bar button:hover { border-color: var(--accent-dim); color: var(--accent); }
.lib-rename { width: 100%; padding: 2px 5px; font-size: 10.5px; pointer-events: auto; }
#right-resize {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; z-index: 5;
}
#right-resize:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); }
#right { position: relative; }
#brand-gem { height: 17px; width: auto; display: block; }
/* brand-supplied horizontal lockup (mark + wordmark in one SVG) — taller, the
   text wordmark is hidden so this carries the whole logo */
#brand-gem.brand-logo-wide { height: 26px; }
.auth-brand img { height: 22px; }

.r-head { cursor: pointer; user-select: none; }
.r-head .r-chev { margin-left: auto; font-size: 10px; color: var(--text-faint); transition: transform .18s; }
.r-section.collapsed .r-body { display: none; }
.r-section.collapsed .r-chev { transform: rotate(-90deg); }
.r-section.collapsed.grow { flex: 0; min-height: 0; }
.gen-card .g-badge4k, .gen-card .g-badgevid {
  position: absolute; top: 7px; left: 7px; font-size: 9px; letter-spacing: .06em; font-weight: 700;
  padding: 2px 7px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 85%, transparent); color: var(--accent-ink, #04222b);
}
.gen-card .g-badgevid { background: rgba(0,0,0,.7); color: #fff; }
.vm-l { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
/* video-modal segmented controls (length + preset tabs) */
.help-card .seg { display: inline-flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 2px; }
.help-card .seg button { padding: 5px 14px; font-size: 12px; color: var(--text-faint); border-radius: 5px; }
.help-card .seg button.active { background: var(--panel-3); color: var(--text); }
/* motion-preset grid */
.vm-presets { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow: auto; padding: 1px; }
.vm-pill { padding: 5px 11px; font-size: 12px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel-2); color: var(--text); cursor: pointer; }
.vm-pill:hover { border-color: var(--accent-dim); color: var(--accent); }
.vm-pill.sel { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* C4D-style transform scrub fields (Controls → Scale / Rotate) */
.xyz { display: flex; gap: 5px; flex: 1; align-items: center; }
.xyz-link, .xyz-link-spacer { width: 24px; height: 26px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.xyz-link { border: 1px solid var(--line-2); border-radius: 6px; color: var(--text-faint); background: var(--panel-2); cursor: pointer; }
.xyz-link:hover { color: var(--accent); border-color: var(--accent-dim); }
.xyz-link.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.scrub { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; height: 26px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; cursor: ew-resize; overflow: hidden; }
.scrub:hover { border-color: var(--accent-dim); }
.scrub.scrubbing { border-color: var(--accent); }
.scrub-ax { flex: 0 0 auto; padding: 0 4px; font-style: normal; font-size: 10px; color: var(--text-faint); pointer-events: none; }
.scrub-in { flex: 1; width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); font-size: 12px; padding: 0 5px 0 0; text-align: right; cursor: ew-resize; }
.scrub-in:focus { cursor: text; outline: none; background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Timeline in/out preview markers — two handles + a tinted active region riding
   on top of the #tl-scrub track (the scrub itself stays fully interactive). */
.tl-scrub-wrap { position: relative; width: 180px; height: 18px; display: flex; align-items: center; }
.tl-scrub-wrap #tl-scrub { width: 100%; }
.tl-region {
  position: absolute; top: 50%; transform: translateY(-50%); height: 6px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 3px; pointer-events: none; z-index: 1;
}
.tl-mark {
  position: absolute; top: 50%; width: 10px; height: 18px; margin-left: -5px;
  transform: translateY(-50%); border-radius: 3px; cursor: ew-resize; z-index: 2;
  background: var(--panel-2); border: 1px solid var(--accent);
  touch-action: none;
}
.tl-mark:hover { background: var(--accent); }

/* ── Camera Cuts (Stage object) — injected into the Animation library section ── */
.cuts-block { margin: 12px 0 2px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.cuts-head { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); padding-bottom: 6px; }
.cuts-empty { font-size: 11px; color: var(--text-faint); line-height: 1.4; padding: 2px 0 6px; }
.cuts-list { display: flex; flex-direction: column; gap: 5px; }
.cuts-row { display: flex; align-items: center; gap: 5px; }
.cuts-frame { flex: 0 0 56px; height: 26px; padding: 0 6px; font-size: 12px; text-align: right; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; }
.cuts-frame:hover { border-color: var(--accent-dim); }
.cuts-cam { flex: 1; min-width: 0; height: 26px; padding: 0 6px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; }
.cuts-cam:hover { border-color: var(--accent-dim); }
.cuts-x { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--text-faint); background: var(--panel-2); cursor: pointer; }
.cuts-x:hover { color: var(--danger); border-color: var(--danger); }
.cuts-x svg { width: 13px; height: 13px; }
.cuts-add { width: 100%; justify-content: center; gap: 5px; font-size: 11px; padding: 7px; margin-top: 8px; border: 1px dashed var(--line-2); border-radius: 7px; color: var(--text-dim); }
.cuts-add:hover { border-color: var(--accent-dim); color: var(--accent); }
.cuts-add svg { width: 13px; height: 13px; }

/* AutoDrive collapsible subhead (models / text / cameras) */
.r-subhead.ad-fold { cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.r-subhead.ad-fold:hover { color: var(--text); }
.ad-fold-chev { color: var(--text-faint); font-size: 11px; margin-left: 8px; transition: color .12s; }
.r-subhead.ad-fold:hover .ad-fold-chev { color: var(--accent); }

/* ── Scene motion transfer (Animate modal → "Motion transfer" mode) ─────────
   Reference-video drop zone, inline preview, length read-out + sound toggle. */
.vm-drop {
  position: relative; border: 1px dashed var(--line-2); border-radius: 10px;
  background: var(--panel-2); min-height: 120px; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: border-color .12s, background .12s;
}
.vm-drop.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.vm-drop.busy { opacity: .6; pointer-events: none; }
.vm-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px; text-align: center; color: var(--text-dim); font-size: 12.5px; }
.vm-drop-empty svg-i { width: 22px; height: 22px; color: var(--text-faint); }
.vm-pick-link { color: var(--accent); text-decoration: underline; }
.vm-pick-link:hover { color: var(--accent); opacity: .8; }
.vm-use-last { border: 1px solid var(--line-2); margin-top: 2px; gap: 6px; }
.vm-use-last:hover { border-color: var(--accent-dim); color: var(--accent); }
.vm-use-last svg-i { width: 14px; height: 14px; }
.vm-ref-preview { width: 100%; max-height: 220px; object-fit: contain; background: var(--bg-deep); display: block; }
.vm-dur-val { font-size: 12px; color: var(--text); text-align: right; }

/* ── billing: upgrade / top-up modal (Phase 1) ───────────────────────────── */
#credits-chip.low { color: #ff7a7a; }
.bill-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.bill-tier { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.bill-tier-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bill-tier-name { font-weight: 600; font-size: 14px; }
.bill-tier-price { color: var(--accent); font-weight: 600; font-size: 13px; }
.bill-tier-credits { font-size: 12.5px; color: var(--text); }
.bill-tier-blurb { font-size: 12px; color: var(--text-dim); }
.bill-tier-feats { list-style: none; padding: 0; margin: 2px 0 0; display: flex; flex-direction: column; gap: 3px; }
.bill-tier-feats li { font-size: 11.5px; color: var(--text-dim); padding-left: 14px; position: relative; }
.bill-tier-feats li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.bill-buy, .bill-buy-pack { margin-top: auto; padding: 8px 12px; border-radius: 7px; border: 1px solid var(--accent-dim); background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.bill-buy:hover:not(:disabled), .bill-buy-pack:hover:not(:disabled) { filter: brightness(1.08); }
.bill-buy:disabled, .bill-buy-pack:disabled { opacity: .6; cursor: default; }
.bill-pack { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 12.5px; }
