/* Dark is the default. Light mode is data-theme="light" on <html> (theme.js), which swaps these
   tokens below; the full-size viewer and the storyboard's screen keep the dark ones (pictures read
   best on black). Each accent has an "-ink" twin for text in that color: the same shade here, a
   deeper one in light mode, so gold or teal text still reads on a light page. */
:root, :root[data-theme="light"] :is(.lightbox, .sbd-screen, .sc-card) {
  --bg: #0c0b10;
  --bg-2: #131119;
  --panel: #17151f;
  --panel-2: #1d1a27;
  --line: #2a2735;
  --line-soft: #221f2d;
  --ink: #f4f1ea;
  --ink-dim: #a39db0;
  --ink-faint: #6f6a7d;
  --accent: #e8b04b;      /* warm gold — the "high-gloss" cue */
  --accent-2: #c8643c;    /* burnt amber */
  --gold: #ffcf45;        /* bright gold */
  --like: #ff6f91;        /* ♥ liked — kept by us (approved-by-client is teal) */
  --violet: #9a86ff;
  --teal: #5fd6c2;
  --danger: #e2685f;
  --accent-ink: var(--accent);
  --accent-2-ink: var(--accent-2);
  --gold-ink: var(--gold);
  --like-ink: var(--like);
  --violet-ink: var(--violet);
  --teal-ink: var(--teal);
  --danger-ink: var(--danger);
  --glow-a: rgba(154,134,255,.10);
  --glow-b: rgba(232,176,75,.07);
  --drop: rgba(0,0,0,.8);   /* the shadow under a floating bar or card */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -18px rgba(0,0,0,.7);
  --mono: 'Space Mono', monospace;
  --display: 'Fraunces', serif;
  --body: 'Manrope', sans-serif;
}
/* Light mode: warm ivory paper, white panels, the same gold */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0eb;
  --bg-2: #f8f7f3;
  --panel: #ffffff;
  --panel-2: #f6f4ef;
  --line: #dcd8cf;
  --line-soft: #e8e5de;
  --ink: #1b1922;
  --ink-dim: #46414f;     /* about 9.7:1 on white */
  --ink-faint: #6b6576;   /* about 5.6:1 on white, 4.9:1 on the page */
  --accent: #e2a63c;
  --accent-2: #cc6a40;
  --gold: #f0b400;
  --like: #f25c84;
  --violet: #8b76f6;
  --teal: #45c7b1;
  --danger: #dc5a50;
  --accent-ink: #94600d;
  --accent-2-ink: #a8481f;
  --gold-ink: #8a6500;
  --like-ink: #c9315a;
  --violet-ink: #5b45d3;
  --teal-ink: #0b7c6b;
  --danger-ink: #b9372c;
  --glow-a: rgba(154,134,255,.08);
  --glow-b: rgba(232,176,75,.12);
  --drop: rgba(60,45,20,.28);
  --shadow: 0 18px 44px -20px rgba(60,45,20,.30);
}

/* Cinema, the default (docs/cinema.md): graphite surfaces, one gold for the action that moves the
   work on, headings in URW Gothic and the rest in Nimbus Sans, both served from public/fonts (their
   licence beside them). The metric overrides are the fonts' own hhea values, so a line sits the same
   on Windows as on a Mac. Nimbus Sans has a Regular and a Bold: 600 and under take the Regular. */
@font-face { font-family: StudioGothic; src: url('/fonts/URWGothic-Demi.woff2?v=1') format('woff2'); font-weight: 1 1000; font-style: normal; font-display: swap; ascent-override: 73.9%; descent-override: 26.1%; line-gap-override: 20%; }
@font-face { font-family: StudioSans; src: url('/fonts/NimbusSans-Regular.woff2?v=1') format('woff2'); font-weight: 1 649; font-style: normal; font-display: swap; ascent-override: 72.9%; descent-override: 27.1%; line-gap-override: 20%; }
@font-face { font-family: StudioSans; src: url('/fonts/NimbusSans-Bold.woff2?v=1') format('woff2'); font-weight: 650 1000; font-style: normal; font-display: swap; ascent-override: 72.9%; descent-override: 27.1%; line-gap-override: 20%; }
:root[data-theme="cinema"] {
  color-scheme: dark;
  --bg: #101113;          /* the studio around everything */
  --bg-2: #141518;        /* the top bar */
  --panel: #17191c;       /* a surface */
  --panel-2: #22252a;     /* a raised one */
  --line: #35393e;
  --line-soft: #2a2d32;
  --ink: #f3f3ef;
  --ink-dim: #b2b6bd;
  --ink-faint: #8f949c;   /* 5.8:1 on a surface */
  --accent: #f7c66c;
  --accent-2: #efbd63;
  --gold: #f7c66c;
  --like: #ffabc8;
  --violet: #b4adff;
  --teal: #5caa99;
  --danger: #ef8f7e;
  --accent-ink: #f7c66c;
  --accent-2-ink: #efbd63;
  --gold-ink: #f7c66c;
  --like-ink: #ffabc8;
  --violet-ink: #d0bdff;
  --teal-ink: #9ae6d4;
  --danger-ink: #ffb4a6;
  --glow-a: transparent;  /* no glow where the work is */
  --glow-b: transparent;
  --drop: rgba(0,0,0,.6);
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px -16px rgba(0,0,0,.75);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --display: StudioGothic, Arial, sans-serif;
  --body: StudioSans, Arial, sans-serif;
  /* Cinema's own surfaces and states */
  --cn-header: #141518;
  --cn-rail: #141619;
  --cn-head: #181a1e;       /* the scene's head */
  --cn-card: #1b1d21;       /* a take, a reference, the upload order */
  --cn-card-line: #393d44;
  --cn-btn: #26292e;
  --cn-btn-hover: #34383e;
  --cn-btn-line: #44484f;
  --cn-field: #121417;
  --cn-field-line: #555b64;
  --cn-mono: #c8cad0;
  --cn-primary: #f7c66c;
  --cn-primary-ink: #1d1509;
  --cn-primary-line: #efbd63;
  --cn-sel: #3b3022;        /* a picked row */
  --cn-sel-line: #80613a;
  --cn-step-line: #85633c;
  --cn-focus: #b4adff;
  --cn-ref: #d0bdff;        /* @imageN */
  --cn-ok-fill: #1f463e;    /* approved */
  --cn-ok-ink: #9ae6d4;
  --cn-ok-badge: #4a8a7c;
  --cn-ok-card: #5caa99;
  --cn-like-fill: #412435;
  --cn-err-fill: #482925;
  --cn-player: #08090a;
  --cn-card-shadow: 0 5px 14px #0004;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--body);
  background:
    radial-gradient(1200px 700px at 78% -10%, var(--glow-a), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, var(--glow-b), transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden { display: none !important; }

/* The shell: the top bar across, the sidebar (the project and its scenes) and the work area under it. */
#app { --sb-w: 252px; display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); height: 100vh; transition: grid-template-columns .18s ease; }
/* folded sidebar: a narrow rail of scene covers, which opens over the page while you point at it
   (sb-peek, sidebar.js) — its column stays the rail's, so nothing under it moves */
#app.sb-collapsed { --sb-w: 72px; }
/* the studio (/) and /admin share the shell; each hides the other's parts */
#app:not(.admin-mode) .admin-only, #app.admin-mode .studio-only { display: none !important; }
#app.no-project .tb-crumbs, #app.no-project .tb-views { visibility: hidden; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; min-width: 0; padding-right: 20px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tb-brand { flex-shrink: 0; width: var(--sb-w); height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 20px; border-right: 1px solid var(--line); transition: width .18s ease, padding .18s ease; }
.tb-logo { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
/* 26px high is 150px wide, the smallest the wordmark goes: any smaller and the face's eyes and
   mouth run together */
.tb-wordmark { height: 26px; width: auto; display: block; }
.sb-toggle {
  margin-left: auto; width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-faint);
  font-size: 15px; line-height: 1; cursor: pointer; transition: color .12s ease, border-color .12s ease, transform .18s ease;
}
.sb-toggle:hover { color: var(--accent-ink); border-color: var(--accent); }
.sb-collapsed .tb-brand { padding: 0 0 0 0; justify-content: center; }
.sb-collapsed .tb-logo { display: none; }
.sb-collapsed .sb-toggle { margin: 0; transform: rotate(180deg); }
/* client / project — both edit in place */
.tb-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.crumb-client, .crumb-project {
  field-sizing: content; min-width: 3ch; max-width: 40ch; padding: 4px 6px; border: 1px solid transparent; border-radius: 7px;
  background: none; outline: none; font-family: var(--body); text-overflow: ellipsis;
}
.crumb-client { color: var(--accent-ink); font-size: 13.5px; font-weight: 600; }
.crumb-client::-webkit-calendar-picker-indicator { display: none !important; }   /* the suggestions still open as you type */
.crumb-client::placeholder { color: var(--ink-faint); font-weight: 500; }
.crumb-project { color: var(--ink); font-size: 14.5px; font-weight: 700; }
.crumb-client:hover, .crumb-project:hover { border-color: var(--line); }
.crumb-client:focus, .crumb-project:focus { border-color: var(--accent); background: var(--bg); }
.crumb-sep { color: var(--ink-faint); font-size: 15px; }
.crumb-admin { font-size: 14.5px; font-weight: 700; }
/* Library · Assets · Tune */
.tb-views { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tb-view {
  padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink-dim);
  font-family: var(--body); font-size: 13px; font-weight: 600; cursor: pointer; transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.tb-view:hover { color: var(--ink); background: var(--panel); }
.tb-view.active { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tb-view.tab-drop { color: #1a1206; background: var(--accent); }
.tb-admin { flex-shrink: 0; display: inline-flex; align-items: center; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-faint); font-size: 12px; font-weight: 600; text-decoration: none; transition: color .12s ease, border-color .12s ease; }
.tb-admin:hover { color: var(--ink); border-color: var(--ink-faint); }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  gap: 4px;
  /* min-height:0 is load-bearing: a grid item defaults to min-height:auto, which lets a long
     scene list stretch the sidebar past the window (the page itself doesn't scroll). */
  min-height: 0;
  overflow: hidden;
  /* its own width, so it can open past its column; over the page while it does */
  position: relative; z-index: 60; width: var(--sb-w);
  transition: width .18s ease, box-shadow .18s ease;
}
#app.sb-peek .sidebar { width: 252px; box-shadow: 18px 0 40px -16px rgba(0, 0, 0, .6); }

/* the project switcher, and its menu of every project under its client */
.proj-switch { flex-shrink: 0; padding: 14px 12px 6px; }
.ps-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .12s ease;
}
.ps-btn:hover, .ps-btn[aria-expanded="true"] { border-color: var(--ink-faint); }
.ps-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* the client over the project, the bigger of the two, bold and in the accent (Yossi, 2026-11-15: "the
   client's name bigger than the project's, or bold, or a colour") */
.ps-text small { font-family: var(--body); font-size: 14px; font-weight: 800; letter-spacing: 0; color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-text b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-caret { flex-shrink: 0; width: 7px; height: 7px; margin: 0 2px 3px 0; border-right: 1.5px solid var(--ink-faint); border-bottom: 1.5px solid var(--ink-faint); transform: rotate(45deg); }
.ps-btn[aria-expanded="true"] .ps-caret { margin: 3px 2px 0 0; transform: rotate(225deg); }
.ps-pop { position: fixed; z-index: 260; width: 330px; max-height: min(560px, calc(100vh - 140px)); display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); box-shadow: var(--shadow); }
.ps-pop-head { display: flex; gap: 8px; }
.ps-pop-head .project-search { flex: 1; width: auto; min-width: 0; }
.ps-pop-head .new-project-btn { padding: 8px 12px; font-size: 12.5px; box-shadow: none; }
/* the rail keeps the open sidebar's heights (the name keeps its lines at no width), so the row
   under the pointer is still that row when the rail opens */
.sb-collapsed:not(.sb-peek) .proj-switch { padding: 14px 10px 6px; }
.sb-collapsed:not(.sb-peek) .ps-btn { justify-content: center; gap: 0; padding: 8px 0; }
.sb-collapsed:not(.sb-peek) .ps-text { flex: 0 0 0; width: 0; visibility: hidden; }

.project-search {
  flex-shrink: 0; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12.5px; outline: none;
}
.project-search:focus { border-color: var(--accent); }
.project-search::placeholder { color: var(--ink-faint); }

.new-project-btn {
  font-family: var(--body); font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1206; border: none; border-radius: var(--radius-sm);
  padding: 11px 14px; cursor: pointer; letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .18s ease;
  box-shadow: 0 8px 22px -10px rgba(232,176,75,.7);
  flex-shrink: 0;
}
.new-project-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(232,176,75,.85); }
.new-project-btn.big { font-size: 14px; padding: 14px 22px; margin-top: 8px; }

/* min-height must not be auto (a flex item's default): the list would grow past the sidebar,
   pushing the footer off-screen, instead of scrolling. The floor keeps ~2 rows in a very
   short window, where the sidebar scrolls instead. */
.project-list { flex: 1; min-height: 110px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.project-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; color: var(--ink-dim);
  transition: background .12s ease, color .12s ease, border-color .12s;
}
.project-item:hover { background: var(--panel); color: var(--ink); }
.project-item.active { background: var(--panel-2); color: var(--ink); border-color: var(--line); }
.project-item .pname { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item .pdel { opacity: 0; font-size: 12px; color: var(--ink-faint); padding: 2px 6px; border-radius: 6px; }
.project-item:hover .pdel { opacity: 1; }
.project-item .pdel:hover { color: var(--danger-ink); background: rgba(226,104,95,.12); }
/* a client and its projects */
.pl-group { display: flex; flex-direction: column; gap: 2px; }
.pl-group + .pl-group { margin-top: 10px; }
.pl-client { display: flex; align-items: center; gap: 4px; }
.pl-client-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; text-align: left; cursor: pointer;
}
.pl-client-toggle:hover { color: var(--ink-dim); background: var(--panel); }
.pl-caret { flex-shrink: 0; font-size: 9px; transition: transform .15s ease; }
.pl-group.folded .pl-caret { transform: rotate(-90deg); }
.pl-client-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-count { flex-shrink: 0; padding: 0 6px; border-radius: 999px; background: var(--panel); color: var(--ink-faint); font-size: 10px; line-height: 16px; letter-spacing: 0; }
.pl-client-edit { opacity: 0; flex-shrink: 0; padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--ink-faint); font-size: 12px; cursor: pointer; }
.pl-client:hover .pl-client-edit, .pl-client-edit:focus { opacity: 1; }
.pl-client-edit:hover { color: var(--accent-ink); background: var(--panel); }
.pl-group .project-item { margin-left: 10px; padding: 8px 10px; }
.pl-empty { padding: 10px 6px; font-size: 12px; color: var(--ink-faint); }
.np-field { display: flex; flex-direction: column; margin-top: 12px; }
.np-field input {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 14px; outline: none;
}
.np-field input:focus { border-color: var(--accent); }


/* /admin: its pages, in the sidebar */
.admin-nav { flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; }
.an-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--ink-dim); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: color .12s ease, background .12s ease, border-color .12s ease; }
.an-item:hover { color: var(--ink); background: var(--panel); }
.an-item.active { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sb-collapsed:not(.sb-peek) .an-item { justify-content: center; padding: 10px 0; }
.sb-collapsed:not(.sb-peek) .an-item .sb-label { display: none; }

/* ── Main / empty ────────────────────────────────────── */
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main > .showcase-view { flex: 1; min-height: 0; }
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px; gap: 8px;
}
/* the brand's face, plain in the theme's ink: the mark takes no glow or second colour */
.empty-mark { width: 76px; height: 76px; color: var(--ink); margin-bottom: 10px; }
.empty-state h1 { font-family: var(--display); font-weight: 500; font-size: 40px; letter-spacing: -.02em; }
.empty-state p { color: var(--ink-dim); max-width: 460px; font-size: 15px; line-height: 1.6; margin-top: 4px; }

/* ── Workspace ───────────────────────────────────────── */
.workspace { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ws-header { flex-shrink: 0; padding: 14px 28px 0; border-bottom: 1px solid var(--line); }
/* Library, Assets and Tune are the whole project's: they take the work area, scene head and tools aside */
.workspace.project-mode .ws-header { display: none; }

/* the open scene: SCENE 02 · its name · its brief */
.scene-head { min-width: 0; }
.sh-eyebrow { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.sh-row { display: flex; align-items: center; gap: 14px; min-width: 0; margin-top: 2px; }
.sh-title { min-width: 0; font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-edit { flex-shrink: 0; }
.sh-brief { max-width: 980px; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-brief[data-scene-edit] { cursor: pointer; }
.sh-brief[data-scene-edit]:hover { color: var(--ink); }
.sh-brief.empty { color: var(--ink-faint); font-style: italic; }

/* the scene's tools in one row; the open tool's controls at its end */
.ws-toolrow { display: flex; align-items: center; gap: 16px; min-width: 0; margin-top: 8px; }
.ws-tabs { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
/* the tools in two groups — Images, then Videos — each named above its tabs (so the names take no
   room in the row), a rule between them */
.tab-group { flex-shrink: 0; display: flex; flex-direction: column; }
.tab-group + .tab-group { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.tab-group-label { padding: 0 14px; font-family: var(--mono); font-size: 9.5px; font-weight: 700; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); user-select: none; }
.tab-row { display: flex; gap: 2px; }
.tab-row .tab { padding-top: 6px; }
.tab {
  flex-shrink: 0; font-family: var(--body); font-weight: 600; font-size: 13.5px; color: var(--ink-faint);
  background: none; border: none; cursor: pointer; padding: 10px 14px 12px; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .12s ease, border-color .12s ease;
}
.tab:hover { color: var(--ink-dim); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tool-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.tool-actions:empty { display: none; }

.ws-body { flex: 1; min-height: 0; overflow: hidden; display: flex; }

/* the head of a project view (Library, Assets, Tune): back to the scene, the view's name */
.pv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.pv-title { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
/* the way back to the tools: plain to see, the first thing on the page */
/* it floats: sticky at the top of the view, over whatever scrolls under it */
.pv-backbar { position: sticky; top: 10px; z-index: 30; width: fit-content; max-width: 100%; margin-bottom: 12px; }
.pv-back { max-width: 100%; padding: 9px 16px 9px 13px; display: inline-flex; align-items: baseline; gap: 10px; border: 1px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--bg)); box-shadow: 0 8px 24px -10px var(--drop); color: var(--accent-ink); font-family: var(--body); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s, color .12s; }
.pv-back:hover { background: var(--accent); color: #1a1206; }
.pv-back-scene { font-size: 12px; font-weight: 600; opacity: .7; }
.pv-title h2 { font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: -.015em; line-height: 1.15; }
.pv-count { margin-left: 8px; font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink-faint); }
.pv-sub { max-width: 720px; margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--ink-dim); }
.pv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Chat panel ──────────────────────────────────────── */
.chat-panel { display: flex; flex-direction: column; flex: 1; height: 100%; position: relative; }
.chat-panel.drag-over { outline: 2px dashed var(--accent); outline-offset: -10px; }
.chat-panel.drag-over::after {
  content: "Drop image(s) to attach"; position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: rgba(8,5,12,.55); color: #fff; font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
}
.mini-btn {
  font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--ink-dim);
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; transition: all .12s ease; white-space: nowrap;
}
.mini-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.mini-btn.on { color: var(--accent-ink); border-color: var(--accent); }

/* Kling single/multi-shot segmented toggle */
.mode-toggle { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mode-toggle .seg {
  font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--ink-faint);
  background: transparent; border: none; padding: 7px 12px; cursor: pointer; white-space: nowrap; transition: all .12s ease;
}
.mode-toggle .seg + .seg { border-left: 1px solid var(--line); }
.mode-toggle .seg:hover { color: var(--ink); }
.mode-toggle .seg.active { background: var(--accent); color: #fff; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 30px; display: flex; flex-direction: column; gap: 18px; }
/* Clear, with the chat it clears (not beside ⚙ Tune, where it read as clearing the project) */
.chat-tools { flex-shrink: 0; display: flex; justify-content: flex-end; padding: 12px 30px 0; }
.chat-tools + .chat-scroll { padding-top: 12px; }
.chat-clear { color: var(--ink-faint); }
.chat-clear:hover { color: var(--danger-ink); border-color: var(--danger); }
.msg { max-width: 860px; }
.msg.user { align-self: flex-end; }
.msg.user .bubble {
  background: linear-gradient(135deg, rgba(154,134,255,.16), rgba(154,134,255,.06));
  border: 1px solid rgba(154,134,255,.28); border-radius: 14px 14px 4px 14px;
  padding: 12px 16px; font-size: 14px; line-height: 1.55; color: var(--ink);
}
.msg.assistant .bubble {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px;
  padding: 16px 18px; font-size: 14px; line-height: 1.62; color: var(--ink);
}
.msg .role-tag { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-bottom: 6px; letter-spacing: .06em; }
.msg.user .role-tag { text-align: right; }
.bubble pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; margin: 10px 0; position: relative;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #e9e4f2; white-space: pre-wrap; word-break: break-word;
}
.bubble .copy-block {
  position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: 10px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 6px; padding: 4px 8px; cursor: pointer;
}
.bubble .copy-block:hover { color: var(--accent-ink); border-color: var(--accent); }
/* a prompt already copied: its button stays lit, its block edged in the same colour */
.bubble .copy-block.copied { background: var(--teal); border-color: var(--teal); color: #0c1a17; font-weight: 700; }
.bubble .copy-block.copied:hover { filter: brightness(1.1); color: #0c1a17; }
.bubble pre.copied { border-color: var(--teal); }
/* a long prompt's second copy, at its foot (room kept so it never sits on the text) */
.bubble pre.has-foot-copy { padding-bottom: 42px; }
.bubble .copy-block.at-foot { top: auto; bottom: 8px; }
.bubble .prompt-card { border: 1px solid var(--line); border-radius: 10px; padding: 4px 0; margin: 12px 0; }
.bubble .prompt-card .pc-head {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--accent-ink);
  padding: 8px 14px 0; text-transform: uppercase;
}
.bubble strong { font-weight: 700; }
.bubble .gen-link {
  display: inline-flex; align-items: center; gap: 6px; margin: 6px 14px 10px;
  font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer;
  color: #1a1206; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; border-radius: 7px; padding: 6px 11px;
}
.bubble .gen-link:hover { filter: brightness(1.08); }
.bubble .pc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 14px 10px; }
.bubble .pc-actions .gen-link { margin: 0; }
.bubble .reuse-prompt {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--ink-dim); background: var(--panel);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px;
}
.bubble .reuse-prompt:hover { color: var(--accent-ink); border-color: var(--accent); }
/* ✎ edit beside copy on every prompt (prompt-edit.js): the two float at the block's top right, the
   prompt's first lines wrapping around them */
.bubble .pre-tools { float: right; display: inline-flex; align-items: center; gap: 6px; margin: -4px -6px 6px 12px; position: relative; z-index: 1; }
.bubble .pre-tools .copy-block { position: static; }
.bubble .edit-block { font-family: var(--mono); font-size: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.bubble .edit-block:hover { color: var(--accent-ink); border-color: var(--accent); }
.bubble .pe-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.bubble .pe-edit { margin: 10px 0; }
.bubble .prompt-card .pe-card { margin: 8px 14px; }
.bubble .pe-box { display: block; width: 100%; min-height: 120px; resize: vertical; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 8px; background: var(--bg); color: var(--ink);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.bubble .pe-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.bubble .pe-row .generate-btn { width: auto; margin: 0; padding: 7px 16px; font-size: 12.5px; }
.bubble .pe-hint { font-size: 11.5px; color: var(--ink-faint); }
.bubble .pc-actions.pe-wait { opacity: .35; pointer-events: none; }
.bubble .gpt-copy {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--ink-dim); background: var(--panel);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px;
}
.bubble .gpt-copy:hover { color: var(--accent-ink); border-color: var(--accent); }

.chat-images-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chat-images-strip img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* composer */
.composer { position: relative; border-top: 1px solid var(--line); padding: 16px 30px 20px; background: var(--bg-2); }
.fav-picker { position: absolute; left: 30px; right: 30px; bottom: 100%; margin-bottom: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); z-index: 20; max-height: 280px; overflow-y: auto; }
.fav-head { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 8px; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.fav-thumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg); aspect-ratio: 1; }
.fav-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-thumb:hover { border-color: var(--accent); }
.fav-thumb[disabled] { opacity: .5; cursor: default; }
.fav-empty { font-size: 12px; color: var(--ink-faint); padding: 6px 4px; }
/* the project's images above a message box — taller than the liked picker, it's the whole Library */
.fav-picker.proj-picker { max-height: min(460px, 60vh); }
.proj-pick-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
/* a narrow picker (NB Frames'): the hint goes under the tabs, and a tab that still can't fit shortens */
.proj-pick-head .mode-toggle { min-width: 0; max-width: 100%; }
.proj-pick-head .seg { padding: 5px 8px; font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.proj-pick-head span { font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-picker .fav-thumb { cursor: grab; }
/* reference cell = the thumb plus its own save/forget actions, revealed on hover so the
   grid stays a wall of images rather than a wall of buttons */
.ref-cell { position: relative; }
.ref-cell-acts { position: absolute; inset: 3px 3px auto auto; display: flex; gap: 3px; opacity: 0; transition: opacity .15s ease; }
.ref-cell:hover .ref-cell-acts, .ref-cell:focus-within .ref-cell-acts { opacity: 1; }
.ref-mini { width: 18px; height: 18px; line-height: 1; padding: 0; border: 0; border-radius: 5px; cursor: pointer;
  background: rgba(0,0,0,.72); color: #fff; font-size: 11px; display: grid; place-items: center; }
.ref-mini:hover { background: var(--accent); }
.ref-mini[disabled] { opacity: .5; cursor: default; }
/* kept references inside the Assets tab — raw source material, shown denser than the
   built asset cards so a few hundred of them stay scannable */
.kept-refs { margin-top: 26px; }
.kept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.kept-cell { position: relative; }
.kept-thumb { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); aspect-ratio: 1; }
.kept-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kept-thumb:hover { border-color: var(--accent); }
.kept-acts { position: absolute; inset: 4px 4px auto auto; display: flex; gap: 3px; opacity: 0; transition: opacity .15s ease; }
.kept-cell:hover .kept-acts, .kept-cell:focus-within .kept-acts { opacity: 1; }
/* import-from-another-project picker */
.assets-built-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.import-picker { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 14px; max-height: 340px; overflow-y: auto; }
.import-proj + .import-proj { margin-top: 14px; }
.import-cell { cursor: pointer; display: block; }
.import-cell input { position: absolute; top: 5px; left: 5px; z-index: 2; cursor: pointer; }
.import-cell input:checked ~ .kept-thumb { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.import-name { display: block; font-size: 10.5px; color: var(--ink-faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
/* inline variant (used in the generator's reference slot — sits in flow, not as an overlay) */
.fav-picker.inline { position: static; left: auto; right: auto; bottom: auto; margin: 10px 0 0; box-shadow: none; }
.composer-attach { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 5px; width: 18px; height: 18px; font-size: 11px; cursor: pointer; line-height: 1; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 13px 15px; font-family: var(--body); font-size: 14px; line-height: 1.5;
  outline: none; max-height: 200px; min-height: 50px;
}
.composer textarea:focus { border-color: var(--ink-faint); }
.composer textarea::placeholder { color: var(--ink-faint); }
.attach-btn, .send-btn {
  flex-shrink: 0; border: none; cursor: pointer; border-radius: 12px; height: 50px;
  font-family: var(--body); font-weight: 700; font-size: 14px; transition: all .12s ease;
}
.attach-btn { width: 50px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-dim); font-size: 18px; }
.attach-btn:hover { color: var(--accent-ink); border-color: var(--accent); }
.send-btn { padding: 0 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1206; }
.send-btn:hover { filter: brightness(1.08); }
.send-btn:disabled { opacity: .5; cursor: default; filter: none; }

/* ── Generate panel ──────────────────────────────────── */
.gen-panel { flex: 1; display: grid; grid-template-columns: var(--gen-left-w, 420px) 1fr; height: 100%; overflow: hidden; }
.gen-left { border-right: 1px solid var(--line); padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.gen-left h3 { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
/* the name on one line; the engines drop under it when the column is narrow */
.gen-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.gen-head h3 { white-space: nowrap; }
.gen-model-label { display: none; }   /* (Cinema puts "Model" over the engines; it names their group in every theme) */
.field-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 7px; display: block; }
.gen-left textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 14px; font-family: var(--body); font-size: 13.5px; line-height: 1.55;
  outline: none; resize: vertical; min-height: 200px;
}
.gen-left textarea:focus { border-color: var(--accent); }
.gen-controls { display: flex; gap: 12px; }
.gen-controls > div { flex: 1; }
select, .ar-select {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 11px 12px; font-family: var(--body); font-size: 13px; outline: none; cursor: pointer;
}
select:focus { border-color: var(--accent); }
.ref-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ref-add {
  width: 60px; height: 60px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel);
  color: var(--ink-faint); font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ref-add:hover { border-color: var(--accent); color: var(--accent-ink); }
.generate-btn {
  font-family: var(--body); font-weight: 800; font-size: 15px; letter-spacing: .01em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1206;
  border: none; border-radius: 12px; padding: 15px; cursor: pointer; transition: all .12s ease;
  box-shadow: 0 10px 26px -12px rgba(232,176,75,.8);
}
.generate-btn:hover { transform: translateY(-1px); }
.generate-btn:disabled { opacity: .55; cursor: default; transform: none; }
.gen-hint { font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }

.gen-right { padding: 24px; overflow-y: auto; }
.gen-right .section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.gen-right .section-head h3 { font-family: var(--display); font-weight: 500; font-size: 20px; }
.gen-right .gen-results-head { flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.gen-results-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
/* the generator's results: big enough to judge, at their own shape */
.gen-right .results-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.gen-right .img-card .imgwrap { aspect-ratio: auto; }
.gen-right .img-card .imgwrap img { height: auto; }
.gen-right .gen-skel { aspect-ratio: 16 / 10; }

.img-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .14s ease, border-color .14s ease; position: relative;
}
.img-card:hover { transform: translateY(-2px); border-color: var(--ink-faint); }
.img-card .imgwrap { aspect-ratio: 1; background: var(--bg); overflow: hidden; cursor: zoom-in; position: relative; }
.fav-badge { position: absolute; top: 8px; right: 8px; z-index: 2; display: none; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,.55); color: var(--like); font-size: 15px; line-height: 1; text-shadow: 0 0 8px rgba(255,111,145,.6); cursor: pointer; backdrop-filter: blur(2px); transition: background .12s, color .12s, transform .12s; }
.fav-badge:hover { background: rgba(217,75,61,.9); color: #fff; text-shadow: none; transform: scale(1.08); }
.img-card.favorited .fav-badge { display: flex; }
/* on hover, every card offers the ♥ on the image itself — as plain to find as the zoom */
.img-card:hover .fav-badge { display: flex; }
.img-card:not(.favorited) .fav-badge { color: rgba(255,255,255,.88); text-shadow: none; }
.img-card:not(.favorited) .fav-badge:hover { background: rgba(255,111,145,.88); color: #fff; }
.img-card .imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-card .card-foot { padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.img-card .card-foot .when { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.card-actions { display: flex; gap: 4px; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink-faint); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; font-size: 13px; transition: all .12s; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.icon-btn.fav:hover { color: var(--like-ink); border-color: var(--like); }
.icon-btn.fav.on { color: var(--like-ink); border-color: var(--like); background: rgba(255,111,145,.12); text-shadow: 0 0 9px rgba(255,111,145,.5); }
.icon-btn.appr:hover { color: var(--teal-ink); border-color: var(--teal); }
.icon-btn.appr.on { color: #0c1a17; border-color: var(--teal); background: var(--teal); }
.icon-btn.to-assets:hover { color: var(--accent-ink); border-color: var(--accent); }
/* approved by the client: a teal tag on the image itself */
.approved-badge { position: absolute; top: 8px; left: 8px; z-index: 2; display: none; padding: 3px 8px; border-radius: 6px; background: var(--teal); color: #0c1a17; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.img-card.approved .approved-badge { display: block; }
.img-card.approved { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }
.card-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.card-title { max-width: 100%; font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-menu button.danger { color: var(--danger-ink); }
.card-actions .icon-btn { width: 26px; height: 26px; font-size: 12px; }
.card-actions { gap: 3px; }
/* the browser's own image drag carries the file, so the card says it can leave the app */
.img-card .imgwrap::after {
  content: "⇱ drag out"; position: absolute; left: 40px; bottom: 8px; z-index: 2; padding: 2px 7px; border-radius: 6px;   /* right of the ⊕ */
  background: rgba(0,0,0,.6); color: #fff; font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.img-card .imgwrap:hover::after { opacity: 1; }
.icon-btn.del:hover { color: var(--danger-ink); border-color: var(--danger); }

.placeholder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.skeleton { aspect-ratio: 1; border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

.gen-empty { color: var(--ink-faint); font-size: 14px; text-align: center; padding: 80px 20px; line-height: 1.6; }

/* ── Library ─────────────────────────────────────────── */
.library-panel { flex: 1; padding: 24px 30px; overflow-y: auto; }
.lib-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.lib-head h3 { font-family: var(--display); font-weight: 500; font-size: 24px; }
.lib-filter { display: flex; gap: 6px; }
.lib-actions { display: flex; align-items: center; gap: 10px; }
.lib-upload:hover { color: var(--accent-ink); border-color: var(--accent); }
.library-panel.drag-over { outline: 2px dashed var(--accent); outline-offset: -8px; border-radius: 12px; }
.lib-prompt-tip { font-size: 11px; color: var(--ink-faint); max-width: 360px; line-height: 1.4; }

/* ── Gem editor (collapsible) ────────────────────────── */
.gem-editor { border-top: 1px solid var(--line-soft); }
.gem-toggle { width: 100%; text-align: left; background: none; border: none; color: var(--ink-faint); font-family: var(--mono); font-size: 11px; letter-spacing: .05em; padding: 12px 30px; cursor: pointer; }
.gem-toggle:hover { color: var(--ink-dim); }
.gem-body { padding: 0 30px 16px; }
.gem-body textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--ink-dim); border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; min-height: 120px; outline: none; resize: vertical; }
.gem-body textarea:focus { border-color: var(--accent); color: var(--ink); }
.gem-save-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.gem-save-row .saved-flash { font-family: var(--mono); font-size: 10px; color: var(--teal-ink); }
.gem-base { margin-top: 14px; }
.gem-base summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-faint); }
.gem-base summary:hover { color: var(--ink-dim); }
.gem-base pre { margin-top: 10px; max-height: 320px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--ink-dim); white-space: pre-wrap; word-break: break-word; }
.chat-att-thumb { cursor: default; }

/* NB Frames per-project cinematography builder */
.builder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 4px; }
.bf { display: flex; flex-direction: column; gap: 5px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; color: var(--ink-faint); }
.bf-wide { margin-top: 12px; }
.bf input, .bf select, .bf textarea { background: var(--bg); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 9px 10px; font-family: var(--mono); font-size: 11.5px; outline: none; }
.bf input:focus, .bf select:focus, .bf textarea:focus { border-color: var(--accent); }
.bf textarea { min-height: 70px; line-height: 1.5; resize: vertical; }
.gem-base pre.compiled { color: var(--teal-ink); }
@media (max-width: 720px) { .builder-grid { grid-template-columns: 1fr; } }

/* "Build from a reference image" analyze row */
.bf-analyze { padding: 12px; margin-bottom: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); }
.bf-analyze-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.bf-analyze .ref-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-btn.ghost { color: var(--ink-faint); }
.mini-btn.ghost:hover { color: var(--danger-ink); border-color: var(--danger); }

/* ── Sign-in overlay (Google, allowlisted) ──────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
.auth-overlay.hidden { display: none; }
.auth-card {
  width: 100%; max-width: 380px; text-align: center;
  padding: 40px 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
/* the sign-in and invitation cards open with the SHYOW.io wordmark (34px high, 197px wide) */
.auth-wordmark { display: block; height: 34px; width: auto; margin: 4px auto 14px; color: var(--ink); }
.auth-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; color: var(--ink-faint); margin-top: 8px; }
.auth-google {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
  background: var(--ink); color: #1a1a1a;
  border: 1px solid var(--ink);
  font-family: var(--body); font-weight: 700; font-size: 13.5px;
  transition: transform .08s ease, opacity .15s ease;
}
.auth-google:hover { transform: translateY(-1px); opacity: .94; }
.auth-google.hidden, .auth-signout.hidden { display: none; }
.auth-status { margin-top: 18px; min-height: 16px; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.auth-signout {
  margin-top: 14px; background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  text-decoration: underline; text-underline-offset: 3px;
}
.auth-signout:hover { color: var(--ink-dim); }
/* email and password — the way an account's people sign in */
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; text-align: left; }
.auth-form.hidden, .auth-or.hidden { display: none; }
.auth-input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; outline: none;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--ink-faint); }
.auth-submit {
  margin-top: 2px; padding: 11px 16px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1206;
  font-family: var(--body); font-weight: 800; font-size: 14px;
}
.auth-submit:disabled { opacity: .6; cursor: progress; }
.auth-link { align-self: center; margin-top: 2px; background: none; border: none; cursor: pointer; font-family: var(--body); font-size: 12.5px; color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; }
.auth-link:hover { color: var(--accent-ink); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 -8px; color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* An account's people see their studio only: no Admin, no CRM */
#app.member-mode .staff-only { display: none !important; }
#app.no-cost .cost-only { display: none !important; }   /* what it cost us: Yossi's and Liran's alone */
/* who's signed in (top bar, right): their initial, and a menu */
.tb-user {
  flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer;
  font-family: var(--body); font-weight: 800; font-size: 13px; text-transform: uppercase;
}
.tb-user:hover, .tb-user[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); }
.user-pop {
  position: fixed; top: 52px; right: 12px; z-index: 270; width: 290px; padding: 8px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); box-shadow: var(--shadow);
}
.up-who { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.up-who small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.up-who b { display: block; margin-top: 3px; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-who span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pop button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: none; border-radius: 9px; background: none; color: var(--ink); font-family: var(--body); font-size: 13.5px; text-align: left; cursor: pointer; }
.user-pop button:hover { background: var(--panel); }

/* the team window (an account's people) and Admin → Accounts (accounts-ui.js) */
.modal-card.team-card { max-width: 560px; }
.team-invite { display: flex; gap: 8px; margin-top: 4px; }
.team-email { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13.5px; outline: none; }
.team-email:focus { border-color: var(--accent); }
.team-role { width: auto; flex-shrink: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; }
.team-note { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-dim); }
.team-link { display: flex; gap: 8px; margin-top: 8px; }
.team-link input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 9px; background: color-mix(in srgb, var(--accent) 7%, var(--bg)); color: var(--ink); font-family: var(--mono); font-size: 11.5px; }
.team-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-2); }
.team-row.pending { border-style: dashed; background: none; }
.team-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-who b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-who span { font-size: 12px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-you, .team-chip { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); border: 1px solid var(--line); }
.team-chip { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); text-decoration: none; }
a.team-chip:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.team-chip.bad { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.team-x { flex-shrink: 0; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--ink-faint); cursor: pointer; }
.team-x:hover { color: var(--danger-ink); border-color: var(--danger); }
.acc-head { max-width: 760px; }
.acc-head h1 { font-family: var(--display); font-weight: 500; font-size: 30px; }
.acc-head p { margin-top: 6px; color: var(--ink-dim); font-size: 14px; line-height: 1.55; }
.acc-new { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 20px; max-width: 900px; }
.acc-new .np-field { flex: 1; min-width: 220px; margin-top: 0; }
.acc-new .new-project-btn { padding: 11px 18px; }
.acc-warn { margin-top: 14px; max-width: 760px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--ink-dim); font-size: 12.5px; }
.acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; margin-top: 22px; }
.acc-empty { color: var(--ink-faint); font-size: 13px; }
.acc-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.acc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.acc-card-head b { display: block; font-size: 16px; }
.acc-card-head span { font-size: 11.5px; color: var(--ink-faint); font-family: var(--mono); }
.acc-status { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line); }
.acc-status.active { color: var(--teal-ink); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.acc-status.provisioning { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.acc-status.failed { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.acc-status.closed { color: var(--ink-faint); }
.acc-sub { margin-top: 10px; font-size: 12.5px; color: var(--ink-dim); }
.acc-error { margin: 10px 0 8px; font-size: 12.5px; color: var(--danger-ink); }
.acc-card .team-invite { margin-top: 12px; }
.acc-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* ── Showcase admin view ───────────────────────────────────────────────────── */
.showcase-view { padding: 32px 36px; overflow-y: auto; }
.showcase-head h1 { font-family: var(--body); font-weight: 800; font-size: 26px; margin: 0 0 6px; color: var(--ink); }
.showcase-head p { color: var(--ink-dim); font-size: 13px; margin: 0 0 24px; }
.showcase-head a { color: var(--accent-ink); }
.sc-upload {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px;
  padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.sc-file { position: relative; overflow: hidden; }
.sc-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.sc-file span { display: inline-block; padding: 9px 14px; border-radius: 8px; border: 1px dashed var(--line); color: var(--ink-dim); font-family: var(--mono); font-size: 11.5px; }
.sc-input { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; min-width: 180px; }
.sc-input:focus { outline: none; border-color: var(--accent); }
.sc-status { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.showcase-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sc-empty { color: var(--ink-faint); font-family: var(--mono); font-size: 12px; padding: 20px 0; }
.sc-card { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 10; }
.sc-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-card-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: rgba(8,7,12,.72); }
.sc-card-title { color: var(--ink); font-weight: 700; font-size: 13px; }
.sc-card-cap { color: var(--ink-dim); font-family: var(--mono); font-size: 10.5px; margin-top: 2px; }
.sc-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; border: none; background: rgba(8,7,12,.66); color: var(--ink-dim); font-size: 12px; }
.sc-del:hover { background: var(--danger); color: #fff; }
.mini-btn.primary { border-color: var(--accent); color: var(--accent-ink); }
.mini-btn.primary:hover { background: var(--accent); color: #fff; }
.mini-btn[disabled] { opacity: .6; cursor: default; }
.thumb.saved { outline: 2px solid var(--teal); outline-offset: 1px; }

/* ── Lightbox ────────────────────────────────────────── */
/* Above every panel, modal and menu — it can be opened from any of them. The frame gets the whole
   screen but for the arrows on its sides and two lines of caption under it. */
.lightbox { position: fixed; inset: 0; background: rgba(6,5,9,.92); backdrop-filter: blur(8px); z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; justify-content: safe center; padding: 28px; gap: 10px; box-sizing: border-box; }
.lightbox img { flex: none; width: calc(100vw - 180px); height: calc(100vh - 140px); object-fit: contain; }   /* fills the space, a 1K frame too */
.lightbox-caption { flex: none; max-height: 44px; overflow-y: auto; max-width: 900px; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); line-height: 1.6; text-align: center; }
/* ⊕ — enlarge any image (wireZoom in app.js): one button, set on the image under the pointer */
.zoom-btn { position: fixed; z-index: 390; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(12,11,16,.8); color: #fff; cursor: zoom-in; backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.zoom-btn[hidden] { display: none; }
.zoom-btn:hover { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.zoom-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.lightbox-close { position: absolute; top: 24px; right: 28px; background: none; border: 1px solid var(--line); color: var(--ink); width: 40px; height: 40px; border-radius: 10px; font-size: 16px; cursor: pointer; }
.lightbox-close:hover { border-color: var(--accent); color: var(--accent-ink); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 52px; height: 72px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--ink); font-size: 34px; line-height: 1; cursor: pointer; transition: all .12s ease; }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }
.lightbox-nav:hover { background: rgba(255,255,255,.16); border-color: var(--accent); color: var(--accent-ink); }
/* a view's own buttons under the image (the Advisor's Keep and Like) */
.lightbox-actions { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; }
.lightbox-actions:empty { display: none; }
.lightbox.has-acts img { height: calc(100vh - 204px); }
.lightbox-count { flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-faint); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* the line between two panes, where the pointer is at it (splitters.js): drag to resize,
   double-click to reset. 8px to grab, the line itself 3px down its middle. */
.split-handle { position: fixed; z-index: 50; width: 8px; cursor: col-resize; touch-action: none; }
.split-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 3px; border-radius: 2px; background: var(--accent); opacity: .55; transition: opacity .12s ease; }
.split-handle:hover::after, .split-dragging .split-handle::after { opacity: 1; }
/* while dragging: the pointer stays a resize arrow and nothing gets selected */
body.split-dragging { user-select: none; cursor: col-resize; }
body.split-dragging * { cursor: col-resize !important; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: var(--shadow); animation: toastin .2s ease; }
.toast.err { border-color: var(--danger); color: #ffd9d5; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(26,18,6,.3); border-top-color: #1a1206; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Characters tab ─────────────────────────────────────────────── */
.chars-panel { flex: 1; height: 100%; overflow-y: auto; padding: 24px 30px 60px; }
.chars-new { max-width: 640px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 26px; margin-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.chars-new .section-head h3 { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.chars-hint { font-size: 13px; color: var(--ink-dim); line-height: 1.55; margin: -2px 0 4px; }
.chars-hint b { color: var(--ink); font-weight: 600; }
.char-text { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.char-text::placeholder { color: var(--ink-faint); }
.char-text:focus { border-color: var(--accent); outline: none; }
textarea.char-text { resize: vertical; min-height: 46px; line-height: 1.5; }
/* every asset at the same height, its image whole (a sheet is wide, a portrait tall) */
.chars-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.char-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.char-ref { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #000; line-height: 0; }   /* overflow: without it the image stretches the box */
.char-ref img { width: 100%; height: 100%; object-fit: contain; display: block; }
.char-meta .char-name { font-size: 16.5px; }
.char-actions { justify-content: space-between; }
.char-acts-r { display: flex; gap: 4px; }
.char-usein { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); font-weight: 700; }
.char-meta { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 9px; }
.char-name { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.char-notes { font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; }
.char-srcs { display: flex; gap: 6px; flex-wrap: wrap; }
.char-src { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); opacity: .75; }
.char-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; align-items: center; }
.char-actions .char-use { color: var(--accent-ink); border-color: var(--accent); }
.char-actions .char-seed { color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.char-skel { border: 1px solid var(--line); }

/* Assets tab additions — type picker, @tag field, gallery chips */
.asset-types { flex-wrap: wrap; align-self: flex-start; }
.asset-types .seg { padding: 7px 12px; font-size: 12.5px; white-space: nowrap; }
/* the engine a sheet renders on */
.asset-engine { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.asset-engine .field-label { margin: 0; }
.mode-toggle .seg:disabled { color: var(--ink-faint); opacity: .55; cursor: not-allowed; }
.sd-trust-hint { flex-basis: 100%; margin: 0; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--teal) 6%, transparent); font-size: 12.5px; }
/* Seedance takes this one as a reference: a Seedream original made from text alone */
.sd-trust { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--teal) 50%, transparent); border-radius: 6px; font-family: var(--mono); font-size: 10px; line-height: 1.5; color: var(--teal-ink); white-space: nowrap; vertical-align: middle; }
.asset-name-row { display: flex; gap: 10px; }
.asset-name-row #charName { flex: 1.6; }
.asset-name-row .asset-tag { flex: 1; font-family: var(--mono); font-size: 12.5px; color: var(--accent-ink); }
.asset-chip { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; padding: 2px 8px; margin-left: 7px; vertical-align: 2px; white-space: nowrap; }
.asset-chip.type { color: var(--ink-dim); background: var(--panel-2); border-color: var(--line); }
.asset-asis { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; cursor: pointer; }
.asset-asis input { margin-top: 2px; accent-color: var(--accent); cursor: pointer; }
.asset-asis b { color: var(--ink); }
.char-skel .skeleton { width: 100%; aspect-ratio: 16 / 9; border: none; border-radius: 0; }

/* Nano Banana 2: live "generating" spot + reveal of the finished image */
.gen-skel { display: flex; align-items: center; justify-content: center; }
.gen-load { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.spinner-lg { width: 24px; height: 24px; border: 2.5px solid rgba(255,255,255,.12); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.gen-load-label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.gen-load-time { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.gen-reveal { animation: genReveal .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes genReveal { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }

/* drag an image card onto a tab to attach it as a reference */
.img-card img { cursor: grab; }
.img-card img:active { cursor: grabbing; }
#wsTabs .tab.tab-drop { color: #1a1206; background: var(--accent); border-bottom-color: var(--accent); border-radius: 6px 6px 0 0; }

/* copy a sent message's whole block (text + reference images) back into the composer */
.msg-copy { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim); border-radius: 6px; padding: 3px 9px; font-size: 11px; font-family: var(--mono); cursor: pointer; transition: color .15s, border-color .15s; }
.msg-copy:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ── Expenses view ─────────────────────────────────────────────────────────── */
.exp-head { margin-bottom: 22px; }
.exp-head h1 { font-family: var(--display); font-weight: 500; font-size: 30px; margin: 0 0 6px; color: var(--ink); }
.exp-head p { color: var(--ink-dim); max-width: 640px; margin: 0; line-height: 1.5; }
.exp-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.exp-cards .exp-hero { grid-column: 1 / -1; }
.exp-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.exp-card.exp-hero { background: linear-gradient(150deg, rgba(232,176,75,.16), rgba(232,176,75,.03)); border-color: #6b5628; }
.exp-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.exp-card-num { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--ink); margin-top: 6px; line-height: 1.1; }
.exp-hero .exp-card-num { color: var(--accent-ink); font-size: 40px; }
.exp-card-sub { font-size: 12px; color: var(--ink-dim); margin-top: 5px; }
.exp-split { margin-top: 12px; font-size: 13px; color: var(--ink-dim); }
.exp-split select { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-family: var(--mono); margin: 0 4px; cursor: pointer; }
.exp-split b { color: var(--accent-ink); font-family: var(--mono); }
.exp-h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); margin: 26px 0 8px; font-weight: 700; }
.exp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.exp-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.exp-table th:not(:first-child), .exp-table td:not(:first-child) { text-align: right; }
.exp-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.045); color: var(--ink); }
.exp-table tbody tr:hover { background: rgba(255,255,255,.02); }
.exp-num { font-family: var(--mono); white-space: nowrap; }
.exp-sub { display: block; font-size: 10px; color: var(--ink-faint); margin-top: 2px; }
.exp-tot { color: var(--accent-ink); font-weight: 700; }
.exp-empty { color: var(--ink-faint); text-align: center !important; padding: 18px; }
.exp-settled td { opacity: .5; }
.exp-tag { display: inline-block; font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin-left: 8px; vertical-align: middle; }
.exp-settled-card { background: var(--panel); }
.exp-settled-card .exp-card-num { color: var(--ink-dim); font-size: 26px; }
.exp-note { margin-top: 22px; font-size: 12px; line-height: 1.65; color: var(--ink-faint); max-width: 720px; }
.exp-note b { color: var(--ink-dim); }
@media (max-width: 1040px) { .exp-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .exp-cards { grid-template-columns: 1fr; } }

/* ── Sharing a project with a guest (accounts-ui.js openShare, server/guests.js) ───────────────── */
.tb-share { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink-dim); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: color .12s, border-color .12s; }
.tb-share:hover { color: var(--accent-ink); border-color: var(--accent); }
#app.no-project .tb-share { display: none; }
.share-empty { margin: 4px 0 0; font-size: 13px; color: var(--ink-faint); }
.up-note { margin: 0 10px 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
/* a guest: no new projects; the name and client stay as the team set them */
#app.guest-mode :is(#newProjectBtn, #newProjectBtn2) { display: none !important; }
#app.guest-mode :is(.crumb-client, .crumb-project) { pointer-events: none; }
#app.guest-mode .crumb-client:placeholder-shown, #app.guest-mode .crumb-client:placeholder-shown + .crumb-sep { display: none; }
/* a project shared to view: everything shows, nothing to change (the server refuses it anyway) */
.tb-viewonly { display: none; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
#app.view-only .tb-viewonly { display: inline-flex; }
#app.view-only :is(.composer, .composer-row, .composer-attach, .send-btn, .generate-btn, .lib-upload, .sc-upload, .sn-add, .sn-edit, .sh-edit,
  .icon-btn.fav, .icon-btn.appr, .card-advisor, .adv-go, .adv-keep, .adv-write, .nbp-go, .nbw-write, .sd-generate, .sd-now, .sd-next, .sd-new-shot, .sbd-gate-go, .pc-sendall,
  .edit-block, .pe-ai, .nbp-acts [data-editbtn], .nbp-acts [data-undo], .nbp-acts [data-adv="edit"], .nbp-acts [data-adv="undo"],
  [data-ft-edit], [data-ft-editnow], [data-ft-reuse], [data-ft-word]) { display: none !important; }
/* the Footage clip view sits outside #app: the same, there */
.ft-detail-overlay.view-only :is([data-ft-editnow], [data-ft-mlnow], [data-ft-reuse], [data-ft-final], [data-ft-retry], [data-ft-word], [data-ft-resume], [data-ft-del], [data-ft-like], [data-ft-again], .ft-ask, .ft-rf-add, .ft-rf-del, .ft-rf-picker, .ft-rf-foot,
  .ft-render, .ft-render-all, .ft-sound, .ft-all, .edit-block, .more-like, .reuse-prompt, .pe-ai,
  [data-gr="refs"], [data-gr="assets"], [data-gr="library"], [data-gr="video"]) { display: none !important; }
.ft-detail-overlay.view-only :is(.ft-rf-role, .ft-rf-in) { pointer-events: none; }

/* ── Usage: what a project has used, by scene and model (usage.js) — on the Expenses pieces ───── */
.usage-panel { flex: 1; padding: 24px 30px 40px; overflow-y: auto; }
.use-month { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); }
.use-month select { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.use-cards { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.use-cards.team { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.use-cost .exp-card-num { color: var(--ink-dim); }
.use-empty { margin: 18px 0; font-size: 14px; color: var(--ink-faint); }
.use-scroll { overflow-x: auto; }
.use-table { min-width: 560px; }
.use-table th:nth-child(2), .use-table td:nth-child(2) { text-align: left; }
.use-table th.use-first { text-align: left; }
/* a scene's row: its name, what it made, its credits; its models under it */
.use-table tbody th { text-align: left; padding: 16px 12px 9px; font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.use-scene td { padding-top: 16px; padding-bottom: 9px; font-weight: 700; border-bottom-color: var(--line); }
.use-scene-group.none th, .use-scene-group.none td { font-weight: 400; color: var(--ink-faint); }
.use-scene-group.gone th span[dir] { font-style: italic; color: var(--ink-dim); }
.use-line td { padding-top: 7px; padding-bottom: 7px; font-size: 13px; color: var(--ink-dim); }
.use-line td:first-child { padding-left: 28px; }
.use-line.text td { color: var(--ink-faint); }
.use-bar { display: block; width: var(--w); min-width: 2px; max-width: 100%; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--accent); opacity: .85; }
.use-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--ink-faint); }
.use-scope { margin-right: 6px; }
@media (max-width: 1040px) { .use-cards, .use-cards.team { grid-template-columns: 1fr 1fr; } .use-cards .exp-hero { grid-column: 1 / -1; } }

/* ── Budget and hours (usage.js, work-clock.js, docs/budget.md) ─────────────────────────────────── */
/* the work clock: your time in the open project, lit while it counts. In Usage's head since 2026-11-17
   ("Your time ● 0:42"; it was a pill in the top bar's Usage button from 2026-11-15) */
.tb-clock { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-faint); font-family: var(--mono); font-size: 11.5px; font-weight: 700; line-height: 1.35; transition: color .12s, border-color .12s; }
.tb-clock[hidden] { display: none; }
.tb-clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); opacity: .55; }
.tb-clock.on { color: var(--ink); }
.tb-clock.on .tb-clock-dot { background: #5fc48a; opacity: 1; box-shadow: 0 0 0 2px rgba(95,196,138,.18); }
.use-clock { padding: 5px 11px 5px 10px; font-size: 12.5px; margin-right: 4px; }
.use-clock-word { margin-right: 3px; font-family: var(--body); font-weight: 600; color: var(--ink-dim); }
/* a storyboard's own Usage (board-usage.js): at the price list only, in a window from its bar */
.modal-card.bu-card { max-width: 760px; }
.bu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bu-head .modal-sub { flex: 1; min-width: 220px; }
.bu-head .use-month { margin-top: 6px; }
.bu-card .use-table { min-width: 460px; }
@media (max-width: 600px) {
  .use-cards.bu-cards { grid-template-columns: 1fr 1fr; }
  .use-cards.bu-cards .exp-hero { grid-column: 1 / -1; }
}
/* a meter with its steps marked: gold, then amber from 75%, red from 90% */
.bud-meter { position: relative; height: 8px; margin: 10px 0 8px; border-radius: 4px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.bud-fill { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 4px; background: var(--accent); }
.bud-meter i { position: absolute; top: 0; bottom: 0; left: var(--at); width: 2px; margin-left: -1px; background: var(--panel); opacity: .9; }
.bud-meter.near .bud-fill { background: #e08a2b; }
.bud-meter.high .bud-fill, .bud-meter.over .bud-fill { background: var(--danger); }
.bud-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: start; margin: 0 0 18px; }
.bud-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bud-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 14px; }
.bud-card.near { border-color: color-mix(in srgb, #e08a2b 55%, var(--line)); }
.bud-card.high, .bud-card.over { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.bud-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.bud-num small { font-size: 13px; font-weight: 400; color: var(--ink-dim); }
.bud-pct { margin-left: auto; font-size: 15px; color: var(--accent-ink); }
.bud-card.near .bud-pct { color: #e08a2b; }
.bud-card.high .bud-pct, .bud-card.over .bud-pct { color: var(--danger-ink); }
.bud-foot { font-size: 12px; color: var(--ink-dim); }
.bud-card.over .bud-foot { color: var(--danger-ink); }
.bud-none { margin-top: 10px; font-size: 13px; color: var(--ink-faint); line-height: 1.5; }
.bud-actions { display: flex; flex-direction: column; gap: 8px; min-width: 190px; }
.bud-actions .modal-btn { width: 100%; }
.bud-note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.bud-panel.empty { background: var(--panel-2); border: 1px dashed var(--line); border-radius: 12px; padding: 16px 18px; align-items: center; }
.bud-empty { font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); }
.bud-empty b { color: var(--ink); }
.bud-dim { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-faint); }
.bud-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.bud-head .modal-btn { margin-bottom: 6px; padding: 7px 14px; font-size: 12px; }
/* the hours' tables: numbers on the right, from the second column on */
.use-table.bud-tab :is(th, td):nth-child(n+2) { text-align: right; }
.use-table.bud-manual :is(th, td):is(:nth-child(2), :nth-child(4)) { text-align: left; }
.bud-tab tbody td { padding-top: 9px; padding-bottom: 9px; }
.bud-sum td { border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.bud-manual .icon-btn.del { width: 26px; height: 26px; font-size: 12px; }
.bud-all { margin-bottom: 20px; }
.bud-all .bud-cell { min-width: 220px; }
.bud-all .bud-cell .bud-meter { margin: 6px 0 2px; height: 6px; }
.bud-all .bud-cell.near .bud-pct { color: #e08a2b; }
.bud-all .bud-cell:is(.high, .over) .bud-pct { color: var(--danger-ink); }
.bud-all .bud-pct { margin-left: 6px; font-size: 12px; color: var(--accent-ink); }
/* the windows: the budget, time added by hand */
.modal-card.bud-form { max-width: 520px; }
.bud-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bud-sofar { margin: 14px 0 0; }
.bud-clear { margin-right: auto; }
/* the New project window with the producer's frame: wide enough for its three fields in a row, and
   the three never wider than the window (an input's own width would push the date out of it) */
.np-card:has(.np-frame) { max-width: 560px; }
.np-frame { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.np-frame .np-field { min-width: 0; }
.np-frame .np-field input { width: 100%; min-width: 0; }
.np-frame-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
/* the frame's date and its stop (2026-11-13): a third card, the stop's box, paid work paused, an ask
   waiting for its code, the history */
.bud-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bud-stop { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; font-size: 13px; color: var(--ink-dim); cursor: pointer; }
.bud-stop input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.np-stop { margin-top: 10px; }
.bud-paused { grid-column: 1 / -1; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line)); border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-2)); font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.bud-paused b { color: var(--danger-ink); }
.bud-main { display: grid; gap: 12px; min-width: 0; }
.bud-asked { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px;
  font-size: 13px; line-height: 1.5; color: var(--ink-dim); }
.bud-asked span { flex: 1 1 260px; }
.bud-asked .modal-btn { padding: 7px 14px; font-size: 12px; }
.bud-hist { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-dim); }
.bud-hist summary { cursor: pointer; color: var(--ink-faint); font-size: 12px; }
.bud-hist ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.bud-hist li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; line-height: 1.5; }
.bud-hist time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.bud-code { font-family: var(--mono); font-size: 24px; letter-spacing: .35em; text-align: center; }
.bud-ask [hidden] { display: none; }
.tb-clock.paused { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.tb-clock.paused .tb-clock-dot { background: var(--danger); opacity: 1; }
/* the alert: a step passed */
.modal-card.bud-alert { max-width: 480px; text-align: left; }
.bud-alert h3 { margin: 0 0 14px; font-family: var(--display); font-weight: 500; font-size: 21px; color: var(--ink); }
.bud-alert-kind { padding: 12px 0 4px; border-top: 1px solid var(--line); }
.bud-alert-head { display: flex; align-items: baseline; gap: 10px; }
.bud-alert-step { font-family: var(--mono); font-size: 34px; font-weight: 700; line-height: 1; color: var(--accent-ink); }
.bud-alert-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.bud-alert-kind.near .bud-alert-step { color: #e08a2b; }
.bud-alert-kind:is(.high, .over) .bud-alert-step { color: var(--danger-ink); }
.bud-alert-line { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-dim); }
.bud-alert-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-faint); }
/* the report (project-report.js): over the studio, its page in a frame, a bar that doesn't print */
.rep-overlay { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; background: rgba(0,0,0,.72); }
.rep-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.rep-title { margin-right: auto; font-size: 14px; color: var(--ink); }
.rep-csv { display: inline-flex; align-items: center; text-decoration: none; }
.rep-x { margin-left: 4px; }
.rep-frame { flex: 1; width: 100%; border: 0; background: #ece8e1; }
@media (max-width: 1100px) { .bud-cards.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .bud-panel { grid-template-columns: 1fr; } .bud-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; } .bud-actions .modal-btn { width: auto; } }
@media (max-width: 560px) { .bud-cards, .bud-cards.three, .np-frame { grid-template-columns: 1fr; } .np-frame { row-gap: 0; } .bud-hist li { grid-template-columns: 1fr; gap: 0; } }

/* ── Admin → Billing: every client account, what to charge and what it cost us (billing.js) ───── */
.bill-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: -6px 0 16px; }
.bill-dim { color: var(--ink-faint); font-size: 12.5px; }
.bill-bad { color: var(--danger-ink); font-size: 12.5px; }
.bill-cards .exp-hero { grid-column: auto; }
.bill-table { min-width: 860px; margin-top: 10px; }
.bill-table th:nth-child(2), .bill-table td:nth-child(2), .bill-table th:nth-child(6), .bill-table td:nth-child(6), .bill-table th:nth-child(7), .bill-table td:nth-child(7) { text-align: left; }
.bill-row { cursor: pointer; }
.bill-row th { text-align: left; padding: 12px; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); border-bottom: 1px solid var(--line); }
.bill-row th b { font-weight: 700; }
.bill-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bill-caret { display: inline-block; width: 16px; color: var(--ink-faint); }
.bill-acc.open .bill-row td, .bill-acc.open .bill-row th { border-bottom-color: transparent; }
.bill-detail > td { padding: 4px 12px 22px 28px !important; text-align: left !important; background: var(--panel); }
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 28px; }
.bill-grid .exp-table td, .bill-grid .exp-table th { padding: 7px 10px; font-size: 13px; }
.bill-grid .exp-table th:nth-child(2), .bill-grid .exp-table td:nth-child(2) { text-align: left; }
.bill-cap { position: relative; display: inline-block; min-width: 140px; padding-top: 8px; font-size: 12.5px; color: var(--ink-dim); }
.bill-cap-bar { position: absolute; top: 0; left: 0; height: 4px; width: var(--w); border-radius: 2px; background: var(--accent); }
.bill-cap.near .bill-cap-bar { background: #e08a2b; }
.bill-cap.over { color: var(--danger-ink); }
.bill-cap.over .bill-cap-bar { background: var(--danger); }
.bill-terms { display: grid; gap: 9px; }
.bill-terms label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-dim); }
.bill-terms input[type="number"], .bill-terms input[type="text"] { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; }
.bill-terms .bill-check { display: flex; align-items: center; gap: 8px; }
.bill-terms button { justify-self: start; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bill-mail-box { max-width: 680px; }
.bill-mail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.bill-mail-head b { color: var(--ink); }
.bill-mail-frame { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 1100px) { .bill-grid { grid-template-columns: 1fr; } }

/* ── Admin → Activity: everyone in the studio, what they made, where, what it came to (activity.js) ── */
.act-find { min-width: 210px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; }
.act-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .act-cards .exp-hero { grid-column: span 2; } }
.act-table { min-width: 980px; margin-top: 10px; }
.act-table > thead th:nth-child(-n+4), .act-table > tbody > tr > :nth-child(-n+4) { text-align: left; }
.act-made { max-width: 380px; line-height: 1.45; }
.act-quiet > .bill-row > :is(th, td), .act-quiet > .bill-row th b { color: var(--ink-faint); }
.act-sep td { padding: 20px 12px 8px !important; border-bottom: 1px solid var(--line) !important; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint) !important; text-align: left !important; }
.exp-table .act-sep tr:hover { background: none; }
.act-chip { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--ink-dim); vertical-align: 1px; }
.act-chip.ok { color: var(--teal-ink); border-color: color-mix(in srgb, var(--teal) 50%, var(--line)); }
.act-chip.bad { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.act-grid section > .exp-h2:first-child { margin-top: 14px; }
.act-total td { border-top: 1px solid var(--line); font-weight: 700; }
.act-facts { display: grid; gap: 6px; }
.act-fact { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.4; }
.act-fact > span { color: var(--ink-faint); }
.act-fact > b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.act-items { list-style: none; margin: 0; padding: 0; }
.act-items li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink); }
.act-ico { text-align: center; }
.act-what { min-width: 0; overflow-wrap: anywhere; }
.act-when { color: var(--ink-faint); font-size: 12px; white-space: nowrap; }
.act-more { margin-top: 10px; }
@media (max-width: 560px) { .act-find { min-width: 0; width: 100%; } .act-fact { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 560px) { .usage-panel { padding: 18px 16px 32px; } .use-cards, .use-cards.team { grid-template-columns: 1fr; } }

/* ── CRM view ──────────────────────────────────────────────────────────────── */
.crm-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 7px; border-radius: 999px; background: var(--accent); color: #1a1206; font-family: var(--mono); font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; vertical-align: 1px; }
.crm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.crm-title h1 { font-family: var(--display); font-weight: 500; font-size: 30px; margin: 0 0 6px; color: var(--ink); }
.crm-title p { color: var(--ink-dim); max-width: 620px; margin: 0; line-height: 1.5; font-size: 13.5px; }
.crm-title a { color: var(--accent-ink); }
.crm-tools { display: flex; gap: 10px; align-items: center; }
.crm-search { width: 260px; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.crm-search:focus { border-color: var(--accent); outline: none; }
.crm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.crm-stat { text-align: left; font: inherit; color: inherit; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
button.crm-stat { cursor: pointer; transition: border-color .15s; }
button.crm-stat:hover { border-color: var(--ink-faint); }
.crm-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.crm-stat b { font-family: var(--mono); font-size: 24px; color: var(--ink); line-height: 1.2; }
.crm-stat em { font-style: normal; font-size: 12px; color: var(--ink-dim); }
.crm-stat.is-due { border-color: #6b5628; background: linear-gradient(150deg, rgba(232,176,75,.16), rgba(232,176,75,.03)); }
.crm-stat.is-due b { color: var(--accent-ink); }
.crm-stages { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-dim); border-radius: 999px; padding: 6px 12px; font: 600 12.5px var(--body); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.crm-pill span { font-family: var(--mono); font-size: 11px; color: var(--st, var(--ink-faint)); }
.crm-pill:hover { color: var(--ink); border-color: var(--ink-faint); }
.crm-pill.on { background: var(--panel-2); border-color: var(--st, var(--ink)); color: var(--ink); }
.crm-body { display: grid; grid-template-columns: var(--crm-list-w, minmax(280px, 400px)) 1fr; gap: 16px; align-items: start; }
.crm-list { display: flex; flex-direction: column; gap: 6px; }
.crm-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-soft); border-radius: 11px; padding: 11px 13px; cursor: pointer; transition: background .12s, border-color .12s; }
.crm-row:hover { background: var(--panel-2); }
.crm-row.on { background: var(--panel-2); border-color: var(--accent); }
.crm-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crm-row-main b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-row-main span { font-size: 12px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.crm-age { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.crm-due { font-style: normal; color: var(--accent-ink); }
.crm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--ink-faint)); }
.crm-chip { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: var(--st, var(--ink-dim)); background: color-mix(in srgb, var(--st, var(--ink-dim)) 13%, transparent); border: 1px solid color-mix(in srgb, var(--st, var(--ink-dim)) 35%, transparent); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
/* one colour per stage, shared by the dot, the chip and the pill count */
.st-new { --st: var(--accent-ink); }
.st-contacted { --st: var(--violet-ink); }
.st-call { --st: #6fb3ff; }
.st-proposal { --st: #f09a5a; }
.st-won { --st: var(--teal-ink); }
.st-lost { --st: var(--ink-faint); }
.crm-empty { color: var(--ink-faint); font-size: 13px; padding: 26px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.crm-detail { position: sticky; top: 0; max-height: calc(100vh - 64px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.crm-d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.crm-d-head h2 { font-family: var(--display); font-weight: 500; font-size: 24px; color: var(--ink); line-height: 1.15; }
.crm-d-sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; }
.crm-icon { background: none; border: 1px solid transparent; color: var(--ink-faint); border-radius: 8px; padding: 5px 8px; cursor: pointer; font-size: 13px; }
.crm-icon:hover { color: var(--danger-ink); border-color: rgba(226,104,95,.35); background: rgba(226,104,95,.08); }
.crm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.crm-act { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px; font: 600 12.5px var(--body); cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s, filter .15s; }
.crm-act:hover { border-color: var(--accent); color: var(--accent-ink); }
.crm-act.primary { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.crm-act.primary:hover { color: #1a1206; filter: brightness(1.08); }
.crm-act:disabled { opacity: .5; cursor: default; }
.crm-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 11px; }
.crm-fields label, .crm-edit label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 700; }
.crm-fields select, .crm-fields input, .crm-edit input, .crm-edit select, .crm-edit textarea { font: 500 13.5px var(--body); text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.crm-fields :is(select, input):focus, .crm-edit :is(input, select, textarea):focus { border-color: var(--accent); outline: none; }
.crm-fields input[type="date"] { color-scheme: dark; }
.crm-info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 18px 0 0; font-size: 13.5px; }
.crm-info dt { color: var(--ink-faint); }
.crm-info dd { color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.crm-info a { color: var(--accent-ink); }
.crm-block { margin-top: 22px; }
.crm-block h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); font-weight: 700; margin-bottom: 10px; }
.crm-brief { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 11px; padding: 13px 15px; }
.crm-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.crm-note textarea { flex: 1; font: 13.5px/1.5 var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; resize: vertical; min-height: 42px; }
.crm-note textarea:focus { border-color: var(--accent); outline: none; }
.crm-timeline { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.crm-ev { font-size: 13px; color: var(--ink-dim); padding: 9px 12px; border-left: 2px solid var(--line); }
.crm-ev b { color: var(--ink); font-weight: 600; }
.crm-ev.note { border-left-color: var(--accent); background: var(--bg-2); border-radius: 0 9px 9px 0; }
.crm-ev-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-bottom: 3px; }
.crm-ev-text { color: var(--ink); white-space: pre-wrap; line-height: 1.5; }
.crm-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 18px; }
.crm-edit .wide { grid-column: 1 / -1; }
.crm-edit-actions { display: flex; justify-content: flex-end; }
.modal-card.crm-add { max-width: 580px; }
.crm-add .crm-edit { margin-top: 4px; }
.crm-add-err { color: var(--danger-ink); font-size: 13px; min-height: 18px; margin-top: 10px; }
@media (max-width: 1180px) { .crm-stats { grid-template-columns: 1fr 1fr; } .crm-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .crm-body { grid-template-columns: 1fr; }
  .crm-detail { position: static; max-height: none; }
  .crm-tools { width: 100%; }
  .crm-search { flex: 1; width: auto; }
}

/* "Send all N" — generate every NB Frames prompt at once, in parallel */
.pc-sendall { margin: 2px 0 12px; }
.gen-all { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #1a1206; border: none; border-radius: 8px; padding: 8px 16px; font-family: var(--mono); font-size: 13px; font-weight: 700; cursor: pointer; transition: filter .15s; }
.gen-all:hover { filter: brightness(1.08); }
.gen-all:disabled { opacity: .5; cursor: default; }

/* reference strip on an assistant output — the image(s) it was built from */
.ref-strip { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.ref-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.ref-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; transition: border-color .15s; }
.ref-thumb:hover { border-color: var(--accent); }

/* ── Modal / popup (Send-all reference review) ─────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 480px; width: 100%; max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--ink); }
.modal-x { background: none; border: none; color: var(--ink-faint); font-size: 18px; cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-sub { color: var(--ink-dim); font-size: 13px; line-height: 1.5; margin: 6px 0 16px; }
.sa-refs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sa-ref { position: relative; }
.sa-ref img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.sa-ref-x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: #d94b3d; color: #fff; border: 2px solid var(--panel); font-size: 13px; line-height: 1; cursor: pointer; }
.sa-none { color: var(--ink-faint); font-size: 13px; line-height: 1.5; background: var(--panel-2); border: 1px dashed var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.sa-add { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink-dim); font-size: 13px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 14px; transition: color .15s, border-color .15s; }
.sa-add:hover { color: var(--accent-ink); border-color: var(--accent); }
.sa-addwrap { margin-bottom: 4px; }
.sa-picker { margin-top: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; max-height: 300px; overflow-y: auto; }
.sa-pick-upload { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink-dim); font-size: 13px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 14px; margin-bottom: 12px; transition: color .15s, border-color .15s; }
.sa-pick-upload:hover { color: var(--accent-ink); border-color: var(--accent); }
.sa-pick-head { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.sa-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.sa-pick-thumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg); aspect-ratio: 1; transition: border-color .15s; }
.sa-pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa-pick-thumb:hover { border-color: var(--accent); }
.sa-pick-thumb.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; opacity: .65; }
.sa-pick-empty { color: var(--ink-faint); font-size: 13px; padding: 6px 2px; }
.sa-model { display: flex; align-items: center; gap: 12px; margin: 2px 0 4px; }
.sa-model-lbl { font-size: 13px; color: var(--ink-dim); font-family: var(--mono); letter-spacing: .04em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-btn { border: none; border-radius: 8px; padding: 9px 18px; font-family: var(--mono); font-size: 13px; font-weight: 700; cursor: pointer; }
.modal-btn.ghost { background: var(--panel-2); color: var(--ink-dim); border: 1px solid var(--line); }
.modal-btn.ghost:hover { color: var(--ink); }
.modal-btn.accent { background: var(--accent); color: #1a1206; }
.modal-btn.accent:hover { filter: brightness(1.08); }

/* ── Swap / Edit tab (GPT Image 2 / Nano Banana Pro) ───────────────────────── */
/* the inputs on the left, what they made on the right */
.swap-panel { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--swap-work-w, minmax(440px, 640px)) minmax(0, 1fr); }
.swap-work { min-height: 0; overflow-y: auto; padding: 18px 24px 24px 28px; border-right: 1px solid var(--line); }
.swap-out { min-width: 0; min-height: 0; overflow-y: auto; padding: 14px 22px 24px; }
.swap-out .results-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.swap-head h3 { font-family: var(--display); font-weight: 500; font-size: 20px; }
.swap-head p { margin-top: 4px; font-size: 13px; line-height: 1.55; color: var(--ink-dim); }
.swap-head p b { color: var(--ink); }
.swap-slot-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.swap-slot-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.swap-slot-label small { text-transform: none; letter-spacing: 0; opacity: .8; }
.swap-out .swap-empty { grid-column: 1 / -1; }
/* Storyboard: the two ways in */
.sb-choose { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 16px; margin: auto 0; padding: 40px 0; }
.sb-choice { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink-dim); text-align: left; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.sb-choice:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.sb-choice b { font-size: 16px; color: var(--ink); }
.sb-choice span { font-size: 13px; line-height: 1.55; }
.swap-nokey { background: rgba(217,75,61,.12); border: 1px solid #6b2a24; color: var(--ink-dim); border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 13px; }
.swap-nokey code { font-family: var(--mono); color: var(--accent-ink); }
.swap-slots { display: flex; align-items: center; gap: 14px; margin: 16px 0; }
.swap-slot { position: relative; flex: 1; cursor: pointer; }
.swap-slot-inner { aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: border-color .15s; }
.swap-slot:hover .swap-slot-inner { border-color: var(--accent); }
.swap-slot-inner span { color: var(--ink-faint); font-size: 13px; text-align: center; padding: 0 12px; }
.swap-slot-inner img { width: 100%; height: 100%; object-fit: cover; }
.swap-clear { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: none; font-size: 15px; line-height: 1; cursor: pointer; }
.swap-arrow { color: var(--accent-ink); font-size: 22px; flex: 0 0 auto; }
.swap-prompt { width: 100%; min-height: 70px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 12px; font-family: inherit; font-size: 14px; resize: vertical; margin-bottom: 12px; box-sizing: border-box; }
#swapResults { margin-top: 20px; }
.swap-slot.opt .swap-slot-inner { border-style: dotted; }
.swap-slot.drag .swap-slot-inner { border-color: var(--accent); border-style: solid; background: rgba(232,176,75,.10); box-shadow: 0 0 0 2px rgba(232,176,75,.28) inset; }
.swap-panel.drag-over { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 12px; }
.swap-hint { font-size: 12px; color: var(--ink-faint); text-align: center; margin: -4px 0 12px; }
.swap-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.swap-model { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.swap-model .seg { background: var(--panel-2); color: var(--ink-dim); border: none; padding: 7px 14px; font-family: var(--mono); font-size: 12px; cursor: pointer; transition: background .15s, color .15s; }
.swap-model .seg.on { background: var(--accent); color: #1a1206; font-weight: 700; }
.swap-model .seg:disabled { color: var(--ink-faint); cursor: default; }
.swap-left { display: inline-flex; align-items: center; gap: 10px; }
.swap-ab { background: var(--panel-2); color: var(--ink-dim); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; cursor: pointer; transition: background .15s, color .15s; }
.swap-ab.on { background: var(--accent); color: #1a1206; font-weight: 700; border-color: var(--accent); }
.ab-cell { position: relative; }
.ab-badge { position: absolute; top: 10px; left: 10px; z-index: 3; background: var(--accent); color: #1a1206; font-weight: 800; padding: 3px 11px; border-radius: 6px; font-size: 13px; font-family: var(--mono); box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* ── Seedance brief builder (seedance.js) ──────────────────────────────────────── */
/* builder on the left; on the prompt step the chat (the written prompts) joins on the right */
.sd-body { flex: 1; min-height: 0; display: flex; }
/* a column, so the bar at the end of each step sits at the bottom even when the step is short */
.sd-main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.sd-main > .sd-footbar, .sd-main > .sd-launchbar { margin-top: auto; }
.sd-out { display: none; flex-direction: column; min-height: 0; width: var(--sd-out-w, 38%); min-width: var(--sd-out-w, 340px); max-width: var(--sd-out-w, 560px); border-left: 1px solid var(--line); background: var(--bg-2); }
.sd-body.step-prompt .sd-out { display: flex; }
.sd-out-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 20px 0; }
.sd-out-head .field-label { margin: 0; }
.sd-out .chat-scroll { padding: 12px 20px 18px; gap: 14px; }
.sd-out .msg { max-width: none; }
.sd-out .msg.user .bubble { white-space: pre-wrap; font-size: 12px; line-height: 1.5; max-height: 150px; overflow-y: auto; }
.sd-out .composer { padding: 12px 16px 16px; }
/* section colours — the same hue marks a section, its blocks and its rail entries */
.sd-sec, .sd-rail-item { --sd-c: var(--accent-ink); }
[data-kind="look"] { --sd-c: var(--violet-ink); }
[data-kind="location"] { --sd-c: var(--teal-ink); }
[data-kind="prop"] { --sd-c: var(--accent-2-ink); }
[data-kind="opening"] { --sd-c: #7fb2ff; }   /* the opening frame: a hue of its own, frame one */
.sd-over { color: var(--danger-ink) !important; }

/* the steps above both columns: References → Prompt → Output, each a click away */
.sd-panel { min-width: 0; }
.sd-steps-wrap { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 12px 28px 0; }
.sd-steps3 { flex: 1; margin: 0; }
button.nbs-step { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; transition: background .12s ease; }
button.nbs-step:hover:not(:disabled):not(.active) { background: var(--panel); }
button.nbs-step:disabled { cursor: default; opacity: .55; }
.sd-body { margin-top: 12px; border-top: 1px solid var(--line); }
.sd-new-shot { flex-shrink: 0; width: auto; padding: 10px 16px; font-size: 13px; }

/* ① References: a card per role, the upload order beside them, and the way on at the bottom */
.sd-assets { display: grid; grid-template-columns: minmax(0, 1fr) var(--sd-side-w, 300px); align-items: start; }
.sd-board { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 22px 28px; }
.sd-board-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-board-title { display: none; }   /* (Cinema names the board: "References  5 attached") */
.sd-board-head .sd-gen-hint { flex: 1; min-width: 220px; font-size: 12.5px; color: var(--ink-faint); }
.sd-adds { display: flex; gap: 6px; }
.sd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.sd-cards-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1000px; }
.sd-block.sd-card { gap: 9px; padding: 10px; border: 1px solid var(--line); border-top: 3px solid var(--sd-c, var(--accent-ink)); border-radius: 14px; background: var(--panel); }
.sd-block.sd-card.sd-active { border-color: color-mix(in srgb, var(--sd-c, var(--accent-ink)) 55%, var(--line)); border-top-color: var(--sd-c, var(--accent-ink)); }
.sd-card-head { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.sd-card-head b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-card-tags { display: flex; align-items: center; gap: 6px; margin-top: -4px; }
.sd-drop.sd-card-img { position: relative; display: block; aspect-ratio: 4 / 3; min-height: 0; padding: 0; overflow: hidden; border-radius: 10px; }
.sd-card:not(.sd-empty) .sd-card-img { border-style: solid; border-color: transparent; }
.sd-empty .sd-card-img { background: color-mix(in srgb, var(--sd-c, var(--accent-ink)) 5%, transparent); border-color: color-mix(in srgb, var(--sd-c, var(--accent-ink)) 40%, var(--line)); }
.sd-empty-zone { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 14px; text-align: center; font-size: 11.5px; line-height: 1.35; color: var(--ink-faint); }
.sd-empty-ico { font-size: 20px; }
.sd-empty-zone small { font-family: var(--mono); font-size: 10px; }
.sd-thumb.sd-main-img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.sd-main-img .sd-n { left: 8px; bottom: 8px; padding: 1px 7px; font-size: 11px; line-height: 18px; border-radius: 6px; }
.sd-drop.sd-views { min-height: 0; padding: 4px; }
.sd-views .sd-thumb { width: 46px; height: 46px; }
.sd-card .sd-note { min-height: 52px; resize: none; font-family: var(--body); line-height: 1.45; }
.sd-card-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sd-card-acts .sd-add-btn { flex: 1; text-align: center; }
.sd-card-acts .sd-gem { flex-basis: 100%; }
.sd-side { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 380px); overflow-y: auto; margin: 16px 20px 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.sd-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sd-side-head b { font-size: 14px; }
.sd-order { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sd-order li { display: grid; grid-template-columns: 16px 44px minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 7px 5px 5px; border: 1px solid var(--line-soft); border-left: 3px solid var(--sd-c, var(--accent-ink)); border-radius: 9px; background: var(--panel); }
.sd-order-n { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); text-align: center; }
.sd-order img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.sd-order-meta { display: flex; flex-direction: column; min-width: 0; }
.sd-order-meta b { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.sd-order-meta small { font-size: 11px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-side-note { font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); }
.sd-footbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(6px); }
.sd-ready { min-width: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sd-ready b { font-size: 15px; }
.sd-ready span { font-size: 12.5px; color: var(--ink-dim); }
.sd-footbar .sd-next, .sd-launchbar .sd-generate { flex-shrink: 0; padding: 12px 24px; font-size: 14px; }
/* ② Prompt: the model and the button that writes it stay at the bottom, in view */
.sd-launchbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 12px 28px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(6px); }
.sd-launchbar .sd-launch { flex: 1; min-width: 0; padding: 0; border: 0; background: none; }
/* ② 🎬 at the bar's end: a prompt of your own straight to render (seedance.js nowHtml), in Output's teal */
.sd-now { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-left: 16px; border-left: 1px solid var(--line); }
.sd-now .sd-render { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 12px; font-family: var(--body); font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
  color: var(--teal-ink); background: var(--panel); border: 1px solid rgba(95,214,194,.45); border-radius: 8px; }
.sd-now .sd-render:hover:not(:disabled) { border-color: var(--teal); background: rgba(95,214,194,.1); }
.sd-now .sd-render.primary { padding: 7px 14px; font-size: 14px; color: #06201b; background: var(--teal); border-color: var(--teal); box-shadow: 0 4px 14px rgba(95,214,194,.25); }
.sd-now .sd-render.primary:hover:not(:disabled) { background: var(--teal); filter: brightness(1.08); }
.sd-now .sd-render.off { opacity: .5; }
.sd-now .sd-render:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; filter: none; }
.sd-now .sd-render.busy:disabled { opacity: .75; cursor: progress; }
.sd-now .sd-render .spinner { border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
.sd-now .sd-sound { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 10px; font-family: var(--body); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
  color: var(--ink-faint); background: none; border: 1px dashed var(--line); border-radius: 8px; }
.sd-now .sd-sound.on { color: var(--ink-dim); border-style: solid; }
.sd-now .sd-sound:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-faint); }
.sd-now .sd-sound:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 1199px) { .sd-now { padding-left: 0; border-left: 0; } }
/* ③ Output: the prompt and its upload order, the width of the screen */
.sd-body.step-output .sd-main { display: none; }
.sd-body.step-output .sd-out { display: flex; width: 100%; max-width: none; min-width: 0; border-left: 0; background: none; }
.sd-body.step-output .sd-out > * { width: 100%; max-width: 1100px; margin-left: auto; margin-right: auto; }
@media (max-width: 1150px) { .sd-assets { grid-template-columns: minmax(0, 1fr); } .sd-side { position: static; max-height: none; margin: 0 20px 16px 28px; } }

/* ① assets — a block's parts (the cards above set its frame) */
.sd-block { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); transition: border-color .12s ease, box-shadow .12s ease; }
.sd-block.sd-active { border-color: color-mix(in srgb, var(--sd-c) 55%, var(--line)); }
.sd-block.sd-target { box-shadow: 0 0 0 2px var(--sd-c); }
.sd-block-head { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.sd-name, .sd-note { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12.5px; outline: none; }
.sd-name { flex: 1; font-weight: 700; }
.sd-note { width: 100%; font-size: 12px; color: var(--ink-dim); }
.sd-name:focus, .sd-note:focus { border-color: var(--sd-c); }
.sd-chip { flex-shrink: 0; padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--sd-c) 32%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--sd-c) 10%, transparent); color: var(--sd-c); font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
button.sd-chip { cursor: pointer; }
button.sd-chip:hover { background: color-mix(in srgb, var(--sd-c) 22%, transparent); }
.sd-range-n { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.sd-x { width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; }
.sd-x:hover { background: var(--danger); }
/* ＋ on a character / prop card: another one right after it, without going back up */
.sd-plus { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--ink-dim); font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; }
.sd-plus:hover { color: var(--accent-ink); border-color: var(--accent); }
.sd-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 86px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; transition: border-color .12s ease, background .12s ease; }
.sd-drop.drag { border-color: var(--sd-c, var(--accent-ink)); background: color-mix(in srgb, var(--sd-c, var(--accent-ink)) 9%, transparent); }
.sd-thumb { position: relative; width: 68px; height: 68px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: grab; }
.sd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-thumb .sd-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; opacity: 0; transition: opacity .12s ease; }
.sd-thumb:hover .sd-x, .sd-thumb:focus-within .sd-x { opacity: 1; }
.sd-thumb.sd-dragging { opacity: .4; }
/* a picture smaller than Seedance takes (seedance.js checkSize): marked, and it goes enlarged */
.sd-thumb .sd-small { position: absolute; left: 3px; bottom: 3px; padding: 1px 5px; border-radius: 5px; background: rgba(176, 58, 18, .92); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; line-height: 14px; }
.sd-thumb.sd-main-img .sd-small { left: 8px; bottom: 8px; font-size: 11px; padding: 2px 7px; }
.sd-n { position: absolute; left: 3px; bottom: 3px; min-width: 16px; padding: 0 4px; border-radius: 5px; background: rgba(0,0,0,.75); color: #fff; font-family: var(--mono); font-size: 10px; line-height: 16px; text-align: center; }
.sd-add { display: flex; flex-direction: column; gap: 5px; }
.sd-add-btn { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 11.5px; font-weight: 700; text-align: left; white-space: nowrap; cursor: pointer; }
.sd-add-btn:hover { color: var(--sd-c); border-color: var(--sd-c); }
.sd-drop-hint { font-size: 11px; color: var(--ink-faint); }
.sd-inbox { padding: 12px 14px; border: 1px dashed var(--accent); border-radius: var(--radius); background: rgba(232,176,75,.05); }
.sd-inbox-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.sd-inbox-head span { font-size: 12px; color: var(--ink-faint); }
.sd-drawer { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 380px); overflow-y: auto; margin: 16px 20px 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); box-shadow: var(--shadow); }
.sd-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
/* five tabs in a narrow drawer: chips that wrap, not one segmented bar */
.sd-drawer-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; border: 0; background: none; overflow: visible; }
.sd-drawer-tabs .seg, .sd-drawer-tabs .seg + .seg { flex: 1 0 auto; padding: 5px 8px; font-size: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.sd-drawer-tabs .seg.active { background: var(--accent); border-color: var(--accent); }
.sd-drawer-hint { margin-bottom: 10px; font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); }
.sd-drawer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ② prompt: the upload-order rail beside the brief */
.sd-prompt { display: grid; grid-template-columns: var(--sd-rail-w, 210px) minmax(0, 1fr); align-items: start; }
.sd-rail { position: sticky; top: 61px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 240px); overflow-y: auto; padding: 16px 12px 16px 30px; }
.sd-rail-head { display: flex; align-items: center; justify-content: space-between; }
.sd-rail-head .field-label { margin: 0; }
.sd-rail-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sd-rail-item { display: grid; grid-template-columns: 16px 38px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 3px 8px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-left: 3px solid var(--sd-c); border-radius: 9px; background: var(--panel); }
.sd-rail-n { grid-row: span 2; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); text-align: center; }
.sd-rail-item img { grid-row: span 2; width: 38px; height: 38px; border-radius: 6px; object-fit: cover; cursor: zoom-in; }
.sd-rail-meta { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.sd-rail-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sd-rail-meta small { font-size: 10.5px; color: var(--ink-faint); }
.sd-rail-item .sd-chip { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sd-rail-empty, .sd-warn { font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.sd-warn { color: var(--accent-ink); }
.sd-dl { align-self: flex-start; }
.sd-brief { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 30px 30px 14px; }
.sd-brief-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sd-mode-hint { flex: 1; min-width: 200px; font-size: 12.5px; color: var(--ink-faint); }
.sd-text { width: 100%; min-height: 220px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.55; outline: none; resize: vertical; }
.sd-text:focus { border-color: var(--accent); }
.sd-text::placeholder { color: var(--ink-faint); }
/* ✎ Exact prompt: the words as they'll render — set like the prompts in Output */
.sd-text.sd-exact { min-height: 300px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
.sd-scene { min-height: 64px; font-size: 13.5px; }
.sd-shots { display: flex; flex-direction: column; gap: 10px; }
.sd-shot { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.sd-shot-head { display: flex; align-items: center; gap: 10px; }
.sd-shot-n { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); white-space: nowrap; }
.sd-shot-time { min-width: 62px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.sd-shot-len { min-width: 70px; }
.sd-shot-out, .sd-len-out { min-width: 40px; font-family: var(--mono); font-size: 12px; color: var(--ink); text-align: right; }
.sd-shot-acts { display: flex; gap: 4px; }
.sd-icon { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--ink-faint); font-size: 12px; cursor: pointer; }
.sd-icon:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-faint); }
.sd-icon:disabled { opacity: .35; cursor: default; }
.sd-shot-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sd-shot-specs input { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 11.5px; outline: none; }
.sd-shot-specs input:focus { border-color: var(--accent); }
.sd-action { min-height: 60px; background: var(--bg); font-size: 13.5px; }
.sd-add-shot { align-self: flex-start; }
.sd-settings { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sd-len { flex: 1; min-width: 240px; display: flex; flex-direction: column; }
.sd-len-row { display: flex; align-items: center; gap: 12px; }
.sd-aspect { width: 170px; display: flex; flex-direction: column; }
.sd-aspect select { padding: 9px 10px; }
.sd-range { flex: 1; width: 100%; accent-color: var(--accent); cursor: pointer; }
.sd-len-note { margin-top: -6px; font-size: 11.5px; color: var(--ink-faint); }
.sd-aspect.sd-missing select { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(226,104,95,.25); }
.sd-aspect.sd-missing .field-label { color: var(--danger-ink); }

/* the @ menu — opens at the caret in a brief field or the follow-up box */
.sd-mention {
  position: fixed; z-index: 300; width: 280px; max-height: 300px; overflow-y: auto; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: var(--shadow);
}
.sd-mention-head { padding: 4px 6px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--ink-faint); }
.sd-mention-item {
  --sd-c: var(--accent-ink); width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); text-align: left; cursor: pointer;
}
.sd-mention-item[data-kind="look"] { --sd-c: var(--violet-ink); }
.sd-mention-item[data-kind="location"] { --sd-c: var(--teal-ink); }
.sd-mention-item[data-kind="prop"] { --sd-c: var(--accent-2-ink); }
.sd-mention-item[data-kind="opening"] { --sd-c: #7fb2ff; }
.sd-mention-item.active, .sd-mention-item:hover { background: var(--panel); box-shadow: inset 2px 0 0 var(--sd-c); }
.sd-mention-item img, .sd-mention-ph { width: 34px; height: 34px; flex-shrink: 0; border-radius: 6px; object-fit: cover; }
.sd-mention-ph { display: grid; place-items: center; background: var(--bg); font-size: 15px; }
.sd-mention-main { display: flex; flex-direction: column; min-width: 0; }
.sd-mention-main b { font-family: var(--mono); font-size: 12px; color: var(--sd-c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-mention-main small { font-size: 11px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-mention-empty { padding: 8px; font-size: 12px; color: var(--ink-faint); }

/* narrower screens: tighter columns first, then the prompts drop below the builder, then the
   rail and drawer stack too */
@media (max-width: 1320px) {
  .sd-steps, .sd-sections { padding-left: 20px; padding-right: 20px; }
  .sd-prompt { grid-template-columns: var(--sd-rail-w, 176px) minmax(0, 1fr); }
  .sd-rail { padding-left: 20px; }
  .sd-brief { padding-right: 20px; }
  .sd-out { width: var(--sd-out-w, 34%); min-width: var(--sd-out-w, 320px); }
  .sd-drawer { margin-right: 20px; }
}
@media (max-width: 1180px) {
  .sd-body.step-prompt { flex-direction: column; overflow-y: auto; }
  .sd-body.step-prompt .sd-main { flex: none; overflow: visible; }
  .sd-out { width: auto; max-width: none; min-width: 0; height: 75vh; flex: none; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 1000px) {
  .sd-prompt, .sd-assets.with-drawer { grid-template-columns: minmax(0, 1fr); }
  .sd-rail { position: static; max-height: none; padding: 14px 20px 0; }
  .sd-rail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .sd-drawer { position: static; max-height: 360px; margin: 0 20px 20px; }
  .sd-brief { padding: 14px 20px 24px; }
}

/* ── Assets folder ─────────────────────────────────────────────────────────────── */
.assets-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.assets-head h3 { font-family: var(--display); font-weight: 500; font-size: 26px; letter-spacing: -.01em; margin-bottom: 4px; }
.assets-head .chars-hint { max-width: 640px; margin: 0; }
.assets-count { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.assets-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.assets-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.assets-search { width: 240px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; outline: none; }
.assets-search:focus { border-color: var(--accent); }
.assets-tools .mode-toggle { flex-wrap: wrap; }
.chars-panel { position: relative; }
.chars-panel.drag-over { outline: 2px dashed var(--accent); outline-offset: -10px; }
.chars-panel.drag-over::after {
  content: "Drop to save into Assets"; position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 40;
  padding: 10px 18px; border-radius: 10px; background: var(--accent); color: #1a1206; font-family: var(--mono); font-size: 12px; letter-spacing: .05em; pointer-events: none;
}
/* Ctrl+V on the Assets screen: said beside ⬆ Upload, and on the builder's row a paste would land in */
.asset-paste-hint { margin-left: -2px; font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; cursor: default; }
.ref-row.paste-here::after { content: "Ctrl+V pastes here"; font-size: 11.5px; color: var(--ink-faint); }
.char-ref { cursor: zoom-in; }
.char-ref img { -webkit-user-drag: element; }
.alp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.alp-head .fav-head { margin: 0; }
.alp-pick { padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.alp-pick:hover .kept-thumb { border-color: var(--accent); }
.sta-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.sta-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.np-field select { padding: 11px 12px; border-radius: 10px; }

/* ── "More like this" on every prompt ─────────────────────────────────────────── */
.bubble .more-like {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer;
}
.bubble .more-like:hover, .bubble .more-like.on { color: var(--violet-ink); border-color: var(--violet); }
.ml-form { display: flex; flex-direction: column; gap: 8px; margin: 0 14px 12px; padding: 10px; border: 1px solid color-mix(in srgb, var(--violet) 40%, var(--line)); border-radius: 10px; background: var(--bg); }
.ml-guide { width: 100%; resize: vertical; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.5; outline: none; }
.ml-guide:focus { border-color: var(--violet); }
.ml-row { display: flex; gap: 8px; }
.ml-go, .ml-cancel { padding: 7px 12px; border-radius: 7px; font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer; }
.ml-go { border: 0; background: var(--violet); color: #110b2b; }
.ml-go:disabled { opacity: .6; cursor: default; }
.ml-cancel { border: 1px solid var(--line); background: none; color: var(--ink-faint); }
.ml-cancel:hover { color: var(--ink); }
.msg.assistant .ml-form .spinner { border-color: rgba(17,11,43,.3); border-top-color: #110b2b; }

/* ── Kling: the three variations' names, each with a ? that explains it ───────────── */
.bubble .kling-arch { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; }
.kling-arch .ka-name { font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.ka-help-wrap { position: relative; display: inline-flex; }
.ka-help {
  display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-dim);
  font-family: var(--body); font-size: 11px; font-weight: 700; line-height: 1; cursor: help;
}
.ka-help:hover, .ka-help:focus-visible { color: var(--accent-ink); border-color: var(--accent); outline: none; }
.ka-tip {
  position: absolute; top: calc(100% + 9px); left: -6px; z-index: 30;
  width: max-content; max-width: min(300px, 70vw); padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 400; line-height: 1.55; color: var(--ink-dim); text-align: right;
  opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none;
  transition: opacity .12s, transform .12s, visibility .12s;
}
.ka-tip::before {
  content: ''; position: absolute; top: -5px; left: 11px; width: 8px; height: 8px; transform: rotate(45deg);
  background: var(--panel-2); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
}
.ka-tip > span { display: block; }
.ka-tip > span + span { margin-top: 6px; }
.ka-tip b { color: var(--ink); }
.ka-help-wrap:hover .ka-tip, .ka-help:focus-visible + .ka-tip { opacity: 1; visibility: visible; transform: none; }

/* ── Storyboard from a script ─────────────────────────────────────────────────── */
.sb-script { display: flex; flex-direction: column; gap: 10px; padding: 14px 30px 16px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.sb-script-head { font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.sb-script-head b { color: var(--ink); }
#sbScriptText { width: 100%; min-height: 150px; max-height: 40vh; resize: vertical; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-family: var(--mono); font-size: 12px; line-height: 1.55; outline: none; }
#sbScriptText:focus { border-color: var(--accent); }
#sbScriptText.drag { border-color: var(--accent); border-style: dashed; background: rgba(232,176,75,.06); }
.sb-script-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sb-file { cursor: pointer; }
.sb-script-meta { flex: 1; min-width: 120px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.sb-frames { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.sb-frames input { width: 64px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 13px; outline: none; }
.sb-frames input:focus { border-color: var(--accent); }
.sb-script-row .send-btn { height: 40px; }

/* the generator's optional title — shown on every image it makes */
.gen-title { width: 100%; margin-top: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; outline: none; }
.gen-title:focus { border-color: var(--accent); }

/* Kling V2V: a frame read from the source clip, with its timestamp */
.thumb .thumb-t { position: absolute; left: 2px; bottom: 2px; padding: 0 3px; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; font-family: var(--mono); font-size: 8.5px; line-height: 13px; white-space: nowrap; }

/* ── Scenes: the list in the sidebar (scenes.js) ──────────────────────────────── */
.scene-nav { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sn-head { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px 18px; }
.sn-label { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.sn-count { flex: 1; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); opacity: .8; }
.sn-add { flex-shrink: 0; padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--ink-dim); font-family: var(--body); font-size: 11.5px; font-weight: 700; line-height: 16px; height: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sn-add:hover { color: var(--accent-ink); border-color: var(--accent); }
.sn-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 0 10px 12px; }
.sn-item {
  position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 11px; padding: 6px; border: 1px solid transparent; border-radius: 11px;
  background: none; color: var(--ink-dim); text-align: left; cursor: pointer; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.sn-item:hover { background: var(--panel); color: var(--ink); }
.sn-item.active { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--ink); }
.sn-thumb { position: relative; flex-shrink: 0; width: 64px; height: 46px; overflow: hidden; border-radius: 7px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.sn-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sn-ph { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--ink-faint); background: linear-gradient(135deg, var(--panel-2), var(--bg)); }
.sn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sn-name { display: flex; align-items: baseline; gap: 7px; min-width: 0; font-size: 13.5px; font-weight: 700; color: inherit; }
.sn-n { flex-shrink: 0; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent-ink); }
.sn-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-meta { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-edit { position: absolute; top: 5px; right: 5px; padding: 1px 6px; border-radius: 6px; background: var(--panel-2); color: var(--ink-dim); font-size: 11px; opacity: 0; transition: opacity .12s ease; }
.sn-item:hover .sn-edit, .sn-item:focus-visible .sn-edit { opacity: 1; }
.sn-edit:hover { color: var(--accent-ink); }
.sn-item.sn-dragging { opacity: .4; }
.sn-item.sn-before { box-shadow: 0 -3px 0 -1px var(--accent); }
.sn-item.sn-after { box-shadow: 0 3px 0 -1px var(--accent); }
.sn-item.sn-drop { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); color: var(--ink); }
/* folded: just the covers, each row as tall as when open (the add button's height is set for that) */
.sb-collapsed:not(.sb-peek) .sn-head { justify-content: center; padding: 12px 0 8px; }
.sb-collapsed:not(.sb-peek) :is(.sn-label, .sn-title, .sn-count, .sn-text, .sn-edit) { display: none; }
.sb-collapsed:not(.sb-peek) .sn-add { padding: 4px 8px; font-size: 0; }
.sb-collapsed:not(.sb-peek) .sn-add::before { content: "＋"; font-size: 13px; }
.sb-collapsed:not(.sb-peek) .sn-list { padding: 0 8px 12px; }
.sb-collapsed:not(.sb-peek) .sn-item { justify-content: center; padding: 10px 4px; }
.sb-collapsed:not(.sb-peek) .sn-thumb { width: 50px; height: 38px; }

/* Library, All scenes: a group per scene */
.lib-group + .lib-group { margin-top: 26px; }
.lib-group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.lib-group-head b { font-size: 15px; font-weight: 800; }
.lib-group-head span { flex: 1; font-size: 12px; color: var(--ink-faint); }
.lib-open-scene { padding: 4px 10px; font-size: 11.5px; }

/* the Tune page: the gems on the left, the open one's direction beside them */
.tune-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 60px; }
.tune-body { display: grid; grid-template-columns: var(--tune-nav-w, 260px) minmax(0, 1fr); gap: 22px; align-items: start; }
.tune-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 4px; }
.tune-gem { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink-dim); text-align: left; cursor: pointer; }
.tune-gem:hover { background: var(--panel); color: var(--ink); }
.tune-gem.active { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--ink); }
.tune-gem-name { display: flex; align-items: center; gap: 8px; }
.tune-gem b { font-size: 13.5px; }
.tune-gem small { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; }
.tune-set { padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal-ink); font-family: var(--mono); font-size: 9.5px; line-height: 16px; letter-spacing: .05em; text-transform: uppercase; }
.tune-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tune-editor .gem-body { padding: 18px 20px 20px; }
/* the new / edit scene form */
.np-field textarea { min-height: 104px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.5; outline: none; resize: vertical; }
.np-field textarea:focus { border-color: var(--accent); }
.modal-btn.danger { margin-right: auto; background: none; color: var(--danger-ink); border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); }
.modal-btn.danger:hover { background: var(--danger); color: #fff; }
/* the scene an image is in, on its card: click to move it */
.card-scene {
  position: absolute; right: 8px; bottom: 8px; z-index: 3; max-width: calc(100% - 130px); padding: 2px 8px; border: 0; border-radius: 6px;
  background: rgba(0,0,0,.68); color: #fff; font-family: var(--mono); font-size: 9.5px; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; opacity: 0; transition: opacity .15s ease, background .12s ease;
}
.img-card:hover .card-scene, .card-scene:focus-visible { opacity: 1; }
.card-scene:hover { background: var(--accent); color: #1a1206; }
.scene-menu { position: fixed; z-index: 320; min-width: 190px; max-width: 290px; max-height: 320px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: var(--shadow); }
.sm-head { padding: 4px 8px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.scene-menu button { width: 100%; display: flex; align-items: center; gap: 6px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-family: var(--body); font-size: 12.5px; text-align: left; cursor: pointer; }
.scene-menu button span:first-child { width: 12px; flex-shrink: 0; color: var(--accent-ink); }
.scene-menu button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-menu button:hover { background: var(--panel); }
.scene-menu button.on { color: var(--accent-ink); }
/* A right-click on a video (frame-menu.js): the frame it stopped on, 📁 Make as asset, and what the
   browser's own menu gave (🖼 Save frame as image, ⧉ Copy frame, ⬇ Download video) */
.scene-menu.frame-menu { width: 240px; max-width: none; max-height: none; overflow: visible; }
.frame-menu .fm-pic { display: grid; place-items: center; height: 136px; margin-bottom: 8px; border-radius: 8px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.frame-menu .fm-pic canvas { display: block; max-width: 100%; max-height: 136px; }
.frame-menu .fm-pic .fm-why { padding: 0 14px; text-align: center; }
.frame-menu .fm-t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 8px 4px; font-size: 12px; color: var(--ink-dim); }
.frame-menu .fm-t b { color: var(--ink); font-weight: 600; }
.frame-menu .fm-t small { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.frame-menu button { gap: 8px; }
.frame-menu button span:first-child { width: 18px; text-align: center; }   /* (📁 🖼 ⧉ ⬇ are wider than a menu's usual 12 px mark; one width, so the words line up) */
.frame-menu button:disabled { opacity: .45; cursor: default; background: none; }
.frame-menu .fm-why { margin: 0; padding: 2px 8px 6px; font-size: 11.5px; line-height: 1.45; color: var(--ink-dim); }
.frame-menu .fm-tip { margin: 4px 0 0; padding: 6px 8px 2px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--ink-faint); }
.lib-head, .lib-actions { flex-wrap: wrap; }
.lib-scene { width: auto; max-width: 260px; padding: 7px 10px; font-size: 12.5px; border-radius: 8px; }

/* ── NB Frames: references → prompts → results (app.js · refboard.js) ──────────── */
.nbw { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
/* the three steps, with what each holds */
.nbw-steps { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 28px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.nbs-step { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 9px 16px; color: var(--ink-faint); }
.nbs-step + .nbs-step { border-left: 1px solid var(--line); }
.nbs-n { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-family: var(--mono); font-size: 11.5px; }
.nbs-text { min-width: 0; display: flex; flex-direction: column; }
.nbs-text b { font-size: 13px; color: var(--ink-dim); }
.nbs-text small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbs-step.done .nbs-n { border-color: color-mix(in srgb, var(--teal) 60%, var(--line)); color: var(--teal-ink); }
.nbs-step.active { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 -2px 0 var(--accent); }
.nbs-step.active .nbs-n { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 700; }
.nbs-step.active b { color: var(--ink); }
.nbw-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--nbw-refs-w, 340px) var(--nbw-prompts-w, minmax(320px, 420px)) minmax(0, 1fr); margin-top: 12px; border-top: 1px solid var(--line); }
/* folded references leave the prompts and the results the room */
.nbw-cols:has(.rb-collapsed) { grid-template-columns: 48px var(--nbw-prompts-w, minmax(340px, 460px)) minmax(0, 1fr); }
.nbw-refs { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-2); }
.nbw-refs:has(.rb-collapsed) .nbw-direction { display: none; }
.nbw-direction { position: relative; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.nbw-dir-head { display: flex; align-items: baseline; justify-content: space-between; }
.nbw-dir-head .field-label { margin: 0; }
.nbw-dir-count { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.nbw-direction textarea { width: 100%; min-height: 84px; max-height: 240px; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13.5px; line-height: 1.5; outline: none; }
.nbw-direction textarea:focus { border-color: var(--accent); }
.nbw-direction .composer-attach { margin: 0; }
.nbw-direction .composer-attach:empty { display: none; }
.nbw-direction .fav-picker { left: 10px; right: 10px; }
.nbw-dir-row { display: flex; align-items: center; gap: 6px; }
.nbw-dir-row .attach-btn { width: 40px; height: 42px; border-radius: 10px; font-size: 15px; }
.nbw-write { flex: 1; padding: 12px; font-size: 14px; }
/* who NB Frames writes the prompts for: Nano Banana or Seedream */
.nbw-target-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.nbw-target-row .field-label { margin: 0; }
.nbw-target-row .seg { padding: 5px 11px; font-size: 11.5px; }

/* the references: a card per role */
.rb { --rb-c: var(--accent-ink); position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.rb.rb-collapsed { flex: 1; }
.rb-rail { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; border: 0; background: none; color: var(--ink-faint); cursor: pointer; }
.rb-rail:hover { color: var(--ink); background: var(--panel); }
.rb-rail-ico { font-size: 16px; }
.rb-rail-label { writing-mode: vertical-rl; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.rb-rail-n { min-width: 20px; padding: 1px 5px; border-radius: 999px; background: var(--accent); color: #1a1206; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.rb-head { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 16px; }
.rb-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rb-title b { font-family: var(--display); font-weight: 500; font-size: 19px; }
.rb-count { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.rb-btn { padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink-faint); font-family: var(--body); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.rb-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
/* A grid that is its own height-limited scroller needs max-content rows: with auto rows, a long list
   squeezes every row into the visible height and the images pile on top of each other. */
.rb-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 10px; padding: 2px 14px 10px; }
.rb-card { --rb-c: var(--accent-ink); position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); outline: none; transition: border-color .12s ease, box-shadow .12s ease; }
.rb-card[data-kind="composition"] { --rb-c: var(--violet-ink); }
.rb-card[data-kind="location"] { --rb-c: var(--teal-ink); }
.rb-card[data-kind="prop"] { --rb-c: var(--accent-2-ink); }
.rb-card.rb-active { border-color: color-mix(in srgb, var(--rb-c) 60%, var(--line)); }
.rb-card.rb-target { box-shadow: 0 0 0 2px var(--rb-c); }
.rb-card-img { position: relative; aspect-ratio: 4 / 3; border-radius: 11px 11px 0 0; overflow: hidden; background: var(--bg); transition: box-shadow .12s ease; }
.rb-card-img.drag, .rb-views.drag { box-shadow: inset 0 0 0 2px var(--rb-c); background: color-mix(in srgb, var(--rb-c) 12%, var(--bg)); }
.rb-empty .rb-card-img { margin: 6px 6px 0; border: 1px dashed color-mix(in srgb, var(--rb-c) 45%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--rb-c) 4%, transparent); }
.rb-empty-zone { position: absolute; inset: 0 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; text-align: center; font-size: 11px; line-height: 1.3; color: var(--ink-faint); }
.rb-empty-ico { font-size: 18px; opacity: .8; }
.rb-empty-zone small { font-family: var(--mono); font-size: 9.5px; opacity: .8; }
.rb-thumb { position: relative; flex-shrink: 0; width: 44px; height: 44px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: grab; }
.rb-thumb.rb-main { width: 100%; height: 100%; border: 0; border-radius: 0; }
.rb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-thumb.rb-dragging { opacity: .4; }
.rb-n { position: absolute; left: 3px; bottom: 3px; min-width: 16px; padding: 0 4px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; font-family: var(--mono); font-size: 10px; line-height: 15px; text-align: center; }
.rb-main .rb-n { left: 6px; bottom: 6px; min-width: 22px; font-size: 12px; line-height: 20px; border-radius: 6px; }
.rb-x { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 1; cursor: pointer; }
.rb-x:hover { background: var(--danger); }
.rb-thumb .rb-x { position: absolute; top: 3px; right: 3px; opacity: 0; transition: opacity .12s ease; }
.rb-thumb:hover .rb-x, .rb-thumb:focus-within .rb-x { opacity: 1; }
.rb-card-acts { position: absolute; right: 6px; bottom: 6px; z-index: 2; display: flex; gap: 4px; transition: opacity .12s ease; }
.rb-card:not(.rb-empty) .rb-card-acts { opacity: 0; }
.rb-card:hover .rb-card-acts, .rb-card:focus-within .rb-card-acts { opacity: 1; }
.rb-add { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: rgba(12,11,16,.82); color: var(--ink-dim); font-size: 12px; cursor: pointer; }
.rb-add:hover { color: var(--rb-c); border-color: var(--rb-c); }
.rb-views { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 8px 0; }
.rb-card-meta { display: flex; flex-direction: column; gap: 5px; padding: 8px 9px 9px; }
.rb-card-role { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.rb-card-role b { font-size: 12.5px; font-weight: 800; color: var(--rb-c); }
.rb-card-role span { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); white-space: nowrap; }
.rb-name, .rb-note { min-width: 0; width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12px; outline: none; }
.rb-name { font-weight: 700; }
.rb-note { font-size: 11px; color: var(--ink-dim); }
.rb-name:focus, .rb-note:focus { border-color: var(--rb-c); }
/* a note shows once it's written, or while its card is being worked on */
.rb-card:not(.rb-active) .rb-note:placeholder-shown { display: none; }
.rb-adds { flex-shrink: 0; display: flex; gap: 6px; padding: 0 14px 12px; }
.rb-more { padding: 5px 10px; border: 1px dashed var(--line); border-radius: 8px; background: none; color: var(--ink-faint); font-family: var(--body); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.rb-more:hover { color: var(--accent-ink); border-color: var(--accent); }

/* the prompts: one open, the rest a line each; generate from the dock under them */
.nbw-prompts { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.nbp-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.nbp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.nbp-head h3 { font-family: var(--display); font-weight: 500; font-size: 19px; }
.nbp-head-r { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
/* the title, and under it what the set was written for (in one piece) */
.nbp-title { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.nbp-target { padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--violet) 55%, var(--line)); border-radius: 6px; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: var(--violet-ink); }
/* the sets the gem wrote here, one at a time: a pager that reads as one */
.nbp-turns { display: inline-flex; align-items: stretch; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); overflow: hidden; }
.nbp-turns button { width: 30px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; transition: color .12s ease, background .12s ease; }
.nbp-turns button:hover:not(:disabled) { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nbp-turns button:disabled { opacity: .3; cursor: default; }
.nbp-turns span { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.nbp-turns b { margin-right: 4px; color: var(--ink); font-weight: 700; }
.nbp-for { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg-2); }
.nbp-for p { font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nbp-for-refs { display: flex; gap: 6px; flex-wrap: wrap; }
.nbp-for-refs .chat-att-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.nbp-cards { display: flex; flex-direction: column; gap: 8px; }
.nbp-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .12s ease; }
.nbp-card:hover { border-color: var(--ink-faint); }
.nbp-card.open { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.nbp-pick { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px 6px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.nbp-radio { flex-shrink: 0; width: 15px; height: 15px; border: 1.5px solid var(--ink-faint); border-radius: 50%; }
.nbp-card.open .nbp-radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--panel); }
.nbp-n { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.nbp-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbp-edited { font-family: var(--mono); font-size: 9.5px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }
.nbp-chips { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 12px 6px 37px; }
.nbp-chip { padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); }
.nbp-excerpt { padding: 0 12px 11px 37px; font-size: 12px; line-height: 1.45; color: var(--ink-faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nbp-body { padding: 4px 12px 12px; }
.nbp-text { font-size: 13px; line-height: 1.62; color: var(--ink); white-space: pre-wrap; }
.nbp-editbox { width: 100%; min-height: 160px; resize: none; padding: 10px; border: 1px solid var(--accent); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.6; outline: none; }
.nbp-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.nbp-acts .mini-btn { padding: 5px 10px; font-size: 11.5px; }
.nbp-notes { font-size: 12px; color: var(--ink-faint); }
.nbp-notes summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; }
.nbp-notes-body { margin-top: 6px; line-height: 1.55; color: var(--ink-dim); }
.nbp-writing { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.nbp-empty { padding: 26px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 13px; line-height: 1.55; color: var(--ink-faint); text-align: center; }
.nbp-empty b { color: var(--ink-dim); }
.nbp-latest { align-self: flex-start; }
.nbp-dock { flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--bg-2); }
.nbp-settings { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 8px; }
.nbp-settings label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nbp-settings span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.nbp-settings select { padding: 8px 9px; font-size: 12.5px; border-radius: 8px; }
.nbp-go-row { display: flex; gap: 8px; }
.nbp-go { flex: 1; padding: 12px; font-size: 14px; }
.nbp-one { flex-shrink: 0; }
.nbp-follow { display: flex; gap: 8px; align-items: flex-end; }
.nbp-follow textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.45; outline: none; }
.nbp-follow textarea:focus { border-color: var(--ink-faint); }
.nbp-follow .send-btn { height: 42px; padding: 0 16px; font-size: 13px; }

/* the results: big, at their own shape */
.nbw-results { min-width: 0; min-height: 0; overflow-y: auto; padding: 14px 22px 26px; }
.nbr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.nbr-head h3 { font-family: var(--display); font-weight: 500; font-size: 19px; }
.nbr-size .seg { padding: 5px 10px; font-size: 13px; }
.nbr-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.nbr-grid.large { grid-template-columns: minmax(0, 1fr); }
.nbr-grid .img-card .imgwrap { aspect-ratio: auto; }
.nbr-grid .img-card .imgwrap img { height: auto; }
.nbr-grid .gen-skel { aspect-ratio: 16 / 10; }
.nbr-empty { padding: 60px 30px; border: 1px dashed var(--line); border-radius: 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-faint); text-align: center; }
.card-advisor { width: calc(100% - 22px); margin: 0 11px 11px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink-dim); font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer; }
.card-advisor:hover { color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 1500px) {
  .nbw-cols { grid-template-columns: var(--nbw-refs-w, 300px) var(--nbw-prompts-w, minmax(300px, 380px)) minmax(0, 1fr); }
  .nbr-grid { grid-template-columns: minmax(0, 1fr); }
}
/* picking from the project opens over the sections */
.rb-picker { position: absolute; inset: 56px 8px 8px; z-index: 6; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: var(--shadow); }
.rb-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
/* chips that wrap, as in Create Video's drawer: five sources and their counts in a narrow column */
.rb-picker-tabs { display: flex; flex-wrap: wrap; gap: 4px; border: 0; background: none; overflow: visible; }
.rb-picker-tabs .seg, .rb-picker-tabs .seg + .seg { flex: 1 0 auto; padding: 5px 7px; font-size: 11px; white-space: nowrap; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.rb-picker-tabs .seg.active { background: var(--accent); border-color: var(--accent); }
.rb-picker-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: max-content; align-content: start; gap: 6px; }
.rb-pick { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); aspect-ratio: 1; cursor: pointer; }
.rb-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-pick span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; background: rgba(0,0,0,.72); color: #fff; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-pick:hover { border-color: var(--accent); }
.rb-pick[disabled] { opacity: .5; cursor: progress; }

/* a reference's number (and its board role) on its thumbnail, wherever it travels */
.ref-n { position: absolute; left: 2px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; font-family: var(--mono); font-size: 9.5px; line-height: 14px; white-space: nowrap; }
.chat-att, .ref-cellx { position: relative; display: inline-block; line-height: 0; }
.chat-att .chat-att-thumb { display: block; cursor: grab; }
.sa-ref .ref-n { left: 4px; bottom: 4px; font-size: 10.5px; line-height: 16px; }

/* ── Video tab: one brief, three models (seedance.js) ─────────────────────────────── */
[data-kind="start"] { --sd-c: var(--teal-ink); }
[data-kind="end"] { --sd-c: var(--accent-2-ink); }
.sd-gen { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sd-gen-hint { flex: 1; min-width: 220px; font-size: 12.5px; line-height: 1.45; color: var(--ink-faint); }
.sd-req { padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--sd-c) 14%, transparent); color: var(--sd-c); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; white-space: nowrap; }
.sd-opt { padding: 0 6px; border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--sd-c) 45%, var(--line)); color: var(--ink-dim); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; white-space: nowrap; }
.sd-add-btn.sd-gem, .mini-btn.sd-gem { color: var(--violet-ink); border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.sd-add-btn.sd-gem:hover, .mini-btn.sd-gem:hover { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--ink); }
.sd-block-title { flex: 1; font-size: 13px; font-weight: 800; }
.sd-chip.sd-chip-empty { opacity: .55; font-style: italic; }
.sd-frame-blocks { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.sd-frame-blocks .sd-drop { min-height: 150px; }
.sd-frame-blocks .sd-thumb { width: 168px; height: 112px; }
.sd-move { display: flex; flex-direction: column; max-width: 320px; }
.sd-move input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; outline: none; }
.sd-move input:focus { border-color: var(--accent); }
/* the model toggle, right before the button that writes the prompt */
.sd-launch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.sd-launch .field-label { margin: 0; }
.sd-models .seg { padding: 8px 14px; font-size: 12.5px; }
.sd-model-note { flex: 1; min-width: 200px; font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); }
/* the 1 · 2 · 3 beside the Write button: how many different prompts the brief gets */
.sd-count { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sd-count .field-label { margin: 0; }
.sd-counts .seg { min-width: 36px; padding: 8px 10px; font-size: 13px; font-weight: 700; }
.sd-rail .sd-warn .mini-btn { margin-top: 6px; }

/* under each video prompt: the files to upload with it, in order */
.up-order { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.up-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.up-dl { padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.up-dl:hover { color: var(--accent-ink); border-color: var(--accent); }
.up-dl[disabled] { opacity: .5; cursor: progress; }
.up-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.up-list li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--panel); }
.up-list .ref-thumb { width: 40px; height: 40px; flex-shrink: 0; }
.up-list span { display: flex; flex-direction: column; min-width: 0; }
.up-list b { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.up-list small { font-size: 11px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-vthumb { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); font-size: 18px; text-decoration: none; transition: border-color .15s; }
.up-vthumb[href] { cursor: pointer; }
.up-vthumb[href]:hover { border-color: var(--accent); }
.up-vthumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* ── Advisor & Tweaks: "Try it here" and its options ───────────────────────────────── */
.bubble .try-here { padding: 6px 12px; border: 1px solid color-mix(in srgb, var(--teal) 55%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal-ink); font-family: var(--body); font-size: 12px; font-weight: 800; cursor: pointer; }
.bubble .try-here:hover, .bubble .try-here.on { background: var(--teal); color: #0c1a17; }
.try-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 14px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.try-engine { font-family: var(--mono); font-size: 11px; color: var(--teal-ink); }
.try-model .seg { padding: 5px 10px; font-size: 11.5px; }
.try-n-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-dim); }
.try-n-label select { padding: 5px 8px; }
.try-go { padding: 7px 14px; border: 0; border-radius: 8px; background: var(--teal); color: #0c1a17; font-family: var(--body); font-size: 12.5px; font-weight: 800; cursor: pointer; }
.try-go:hover { filter: brightness(1.08); }
.try-cancel { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink-faint); font-family: var(--body); font-size: 12px; cursor: pointer; }
.cand { margin-top: 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line)); border-radius: 12px; background: var(--bg-2); outline: none; }
.cand:focus-visible { box-shadow: 0 0 0 2px var(--teal); }
.cand-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.cand-head span { font-size: 11.5px; color: var(--ink-faint); }
.cand-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px; align-items: start; }
.cand-view.no-src { grid-template-columns: minmax(0, 1fr); }
.cand-view figure { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.cand-view img { width: 100%; max-height: 420px; object-fit: contain; display: block; }
.cand-view figcaption { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; }
.cand-src { opacity: .92; }
.cand-src figcaption { background: var(--accent); color: #1a1206; font-weight: 700; }
.cand-main.flipped { border-color: var(--accent); }
.cand-main.flipped figcaption { background: var(--accent); color: #1a1206; }
.cand-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.cand-nav:hover { background: var(--teal); color: #0c1a17; }
.cand-nav.prev { left: 8px; }
.cand-nav.next { right: 8px; }
.cand-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cand-thumb { position: relative; width: 58px; height: 58px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; }
.cand-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cand-thumb span { position: absolute; left: 2px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; font-family: var(--mono); font-size: 9.5px; line-height: 14px; }
.cand-thumb.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.cand-thumb.kept span { background: var(--teal); color: #0c1a17; }
.cand-skel { display: grid; place-items: center; cursor: default; }
.cand-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cand-keep { padding: 8px 16px; border: 0; border-radius: 8px; background: var(--teal); color: #0c1a17; font-family: var(--body); font-size: 13px; font-weight: 800; cursor: pointer; }
.cand-keep[disabled] { background: none; border: 1px solid var(--teal); color: var(--teal-ink); cursor: default; }
.cand-flip, .cand-full { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer; }
.cand-flip:hover, .cand-full:hover { color: var(--ink); border-color: var(--ink-faint); }
.cand-flip.on { color: var(--accent-ink); border-color: var(--accent); }
.cand-meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
@media (max-width: 900px) { .cand-view { grid-template-columns: minmax(0, 1fr); } }
.msg.msg-flash .bubble { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s ease; }

/* ── Advisor & Tweaks: the source and its options, large (app.js · renderAdvisor) ──── */
.adv { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--adv-side-w, 380px) minmax(0, 1fr); }
.adv-side { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-2); }
.adv-side-head { flex-shrink: 0; display: flex; justify-content: flex-end; padding: 10px 16px 0; }
.adv-side-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 16px 18px; }
.adv-side .field-label { margin-bottom: 6px; }
.adv-intro h3 { font-family: var(--display); font-weight: 500; font-size: 20px; }
.adv-intro p { margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--ink-dim); }
.adv-instr { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.adv-instr-refs { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
.adv-instr-refs img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); cursor: zoom-in; }
.adv-instr p { font-size: 13.5px; line-height: 1.5; }
.adv-sec { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.adv-sec summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.adv-prompt { max-height: 300px; overflow-y: auto; margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.adv-sec .nbp-editbox { margin-top: 8px; }
.adv-why { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--ink-dim); }
/* Try it here stays in view however long the prompt is */
.adv-try { position: sticky; bottom: -18px; z-index: 2; display: flex; flex-direction: column; gap: 8px; margin: 0 -16px; padding: 12px 16px 14px; border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.adv-try-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* its engine switch (NB2 · NB2.1 · Pro · GPT) stays one piece: in a narrow column it moves under
   Options whole, never split over two lines (docs/gpt-image.md) */
.adv-side .adv-try .adv-try-row > .mode-toggle { flex-wrap: nowrap; }
.adv-try-n { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-dim); }
.adv-try-n select { width: auto; padding: 6px 8px; font-size: 12.5px; }
.adv-go { flex: 1; padding: 11px; font-size: 14px; }
.adv-history { display: flex; flex-direction: column; gap: 4px; }
.adv-hist { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--ink-dim); text-align: left; cursor: pointer; }
.adv-hist:hover { background: var(--panel); color: var(--ink); }
.adv-hist img, .adv-hist-ph { flex-shrink: 0; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.adv-hist-ph { display: grid; place-items: center; background: var(--panel); }
.adv-hist-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adv-hist-text span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adv-hist-text small { font-size: 11px; color: var(--ink-faint); }
.adv-history .mini-btn { align-self: flex-start; margin-top: 4px; }
.adv-compose { position: relative; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.adv-compose .field-label { margin: 0; }
.adv-compose textarea { width: 100%; min-height: 52px; max-height: 160px; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13.5px; line-height: 1.5; outline: none; }
.adv-compose textarea:focus { border-color: var(--accent); }
.adv-compose .composer-attach { margin: 0; }
.adv-compose .composer-attach:empty { display: none; }
.adv-compose .composer-attach .thumb { width: 64px; height: 64px; }
.adv-compose .fav-picker { left: 10px; right: 10px; }
.adv-compose-row { display: flex; align-items: center; gap: 6px; }
.adv-compose-row .attach-btn { width: 40px; height: 42px; border-radius: 10px; font-size: 15px; }
.adv-write { flex: 1; padding: 12px; font-size: 14px; }
/* the stage: the source and the option at the same size */
.adv-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 22px; outline: none; }
.adv-stage-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adv-stage-head h3 { font-family: var(--display); font-weight: 500; font-size: 20px; }
.adv-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.adv-compare { flex: 0 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.adv-compare.single { grid-template-columns: minmax(0, 1fr); }
.adv-compare.single .adv-fig { justify-self: center; }
.adv-fig { position: relative; min-height: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
/* the image at its own shape, as large as the screen allows — both sides at the same size */
.adv-fig img { width: 100%; height: auto; max-height: calc(100vh - 440px); object-fit: contain; display: block; cursor: zoom-in; }
.adv-compare.single .adv-fig img { width: auto; max-width: 100%; }
.adv-fig figcaption { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; }
.adv-fig.src figcaption { background: var(--accent); color: #1a1206; font-weight: 700; }
.adv-fig.main.flipped { border-color: var(--accent); }
.adv-pending { display: grid; place-items: center; aspect-ratio: 16 / 9; }
.adv-strip { flex-shrink: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.adv-strip .cand-thumb { width: 104px; height: 66px; }
.adv-strip .cand-thumb.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.adv-bar { flex-shrink: 0; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); font-size: 13px; color: var(--ink-dim); }
.adv-bar small { margin-left: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.adv-keep { padding: 11px 22px; font-size: 14px; }
/* Keep, and Keep & like (liking keeps it) — under the option, and in its full-size view */
.adv-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.adv-keeplike { padding: 11px 18px; border: 1px solid color-mix(in srgb, var(--like) 60%, var(--line)); border-radius: 12px; background: none; color: var(--like-ink); font-family: var(--body); font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: all .12s ease; }
.adv-keeplike:hover { border-color: var(--like); background: color-mix(in srgb, var(--like) 10%, transparent); }
.adv-keeplike.on { background: var(--like); border-color: var(--like); color: #1a0710; }
.adv-keeplike:disabled { opacity: .6; cursor: default; }
.cand-like { width: 34px; height: 34px; font-size: 15px; }
.adv-keep:disabled { background: none; border: 1px solid var(--teal); color: var(--teal-ink); box-shadow: none; opacity: 1; }
.adv-hint { flex-shrink: 0; font-size: 13px; color: var(--ink-faint); text-align: center; }
.adv-hint b { color: var(--ink-dim); }
.adv-empty { margin: auto; max-width: 520px; display: flex; flex-direction: column; gap: 8px; padding: 40px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; font-size: 13.5px; line-height: 1.6; color: var(--ink-faint); }
.adv-empty b { color: var(--ink-dim); }
@media (max-width: 1400px) { .adv { grid-template-columns: var(--adv-side-w, 330px) minmax(0, 1fr); } }

/* ── Recipes: an image's ⓘ ─────────────────────────────────────────────────────────── */
.img-card .card-foot .recipe-open { padding: 0; border: 0; background: none; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); cursor: pointer; white-space: nowrap; }
.img-card .card-foot .recipe-open:hover { color: var(--accent-ink); }
.modal-card.recipe-card { max-width: 760px; }
.rc-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; margin: 6px 0 14px; }
.rc-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.rc-facts { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rc-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 12.5px; }
.rc-row span { color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
.rc-row b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rc-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.rc-prompt, .rc-tune { max-height: 220px; overflow-y: auto; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-dim); font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; }
/* what was asked for the prompt (its chat's turns), above it */
.rc-ask { max-height: 180px; overflow-y: auto; margin: 4px 0 12px; }
.rc-ask p { margin: 0 0 6px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); color: var(--ink); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-ask p + p { border-inline-start: 2px solid var(--accent); }
.rc-ask b { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-faint); }
.rc-more { margin-bottom: 12px; font-size: 12px; color: var(--ink-faint); }
.rc-more summary { cursor: pointer; }
.rc-refs { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-ref { width: 110px; margin: 0; }
.rc-ref img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.rc-ref figcaption { margin-top: 3px; font-size: 10.5px; line-height: 1.35; color: var(--ink-faint); }
@media (max-width: 640px) { .rc-top { grid-template-columns: minmax(0, 1fr); } }

/* ── Footage: the Video tab's prompts rendered into videos (footage.js) ── */
/* the render buttons under a prompt in Video prompt → Output */
.bubble .ft-render {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--teal-ink); background: var(--panel);
  border: 1px solid rgba(95,214,194,.45); border-radius: 7px; padding: 6px 11px;
}
.bubble .ft-render:hover { border-color: var(--teal); background: rgba(95,214,194,.1); }
.bubble .ft-render.primary { color: #06201b; background: var(--teal); border-color: var(--teal); font-size: 14px; padding: 10px 18px; border-radius: 9px; box-shadow: 0 4px 14px rgba(95,214,194,.25); }
.bubble .ft-render.primary:hover { filter: brightness(1.08); }
.bubble .ft-render.off { opacity: .5; }
.bubble .ft-render.busy { opacity: .6; cursor: progress; }
/* "Send all" above a reply of 2 or 3 prompts — Create Video's 1 · 2 · 3, More like this, Kling's archetypes */
.bubble .ft-all { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 2px; padding: 10px 12px; border: 1px solid rgba(95,214,194,.35); border-radius: 10px; background: rgba(95,214,194,.06); }
.bubble .ft-all.pe-wait { opacity: .35; pointer-events: none; }
.bubble .ft-render-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--body); font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--teal-ink); background: var(--panel);
  border: 1px solid rgba(95,214,194,.45); border-radius: 7px; padding: 6px 11px;
}
.bubble .ft-render-all:hover { border-color: var(--teal); background: rgba(95,214,194,.1); }
.bubble .ft-render-all.primary { color: #06201b; background: var(--teal); border-color: var(--teal); font-size: 14px; padding: 10px 18px; border-radius: 9px; box-shadow: 0 4px 14px rgba(95,214,194,.25); }
.bubble .ft-render-all.primary:hover { filter: brightness(1.08); }
.bubble .ft-render-all.off { opacity: .5; }
.bubble .ft-render-all.busy { opacity: .6; cursor: progress; }
.bubble .ft-render-all:disabled { cursor: progress; }
/* which of a reply's prompts a render came from, on its Footage card: "2/3 · מצלמה ודינמיקה" */
.ft-angle { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); padding: 1px 7px; border-radius: 6px; border: 1px solid rgba(232,176,75,.4); }
/* Sound or no sound, for every render (beside the render buttons) */
.bubble .ft-sound { display: inline-flex; align-items: center; gap: 5px; font-family: var(--body); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink-faint); background: none; border: 1px dashed var(--line); border-radius: 7px; padding: 6px 10px; }
.bubble .ft-sound.on { color: var(--ink-dim); border-style: solid; }
.bubble .ft-sound:hover { color: var(--ink); border-color: var(--ink-faint); }
.bubble .ft-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.bubble .ft-chips:empty { display: none; }
.ft-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-dim); font-family: var(--body); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.ft-chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.ft-chip.done { color: var(--teal-ink); border-color: rgba(95,214,194,.45); }
.ft-chip.failed { color: var(--danger-ink); border-color: rgba(226,104,95,.45); }
.ft-chip.wait { color: var(--accent-ink); border-color: rgba(232,176,75,.4); }
.ft-elapsed { font-family: var(--mono); font-size: 11px; font-weight: 400; }

/* the tab */
.footage { flex: 1; min-width: 0; padding: 24px 30px 40px; overflow-y: auto; }
.ft-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.ft-title h2 { font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: -.015em; line-height: 1.15; }
.ft-spend { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; color: var(--ink-faint); }
.ft-spend b { color: var(--ink); font-size: 16px; font-weight: 800; }
.ft-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.ft-scene { width: auto; max-width: 260px; padding: 7px 10px; font-size: 12.5px; border-radius: 8px; }
.ft-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.ft-n { margin-left: 2px; font-family: var(--mono); font-size: 10.5px; font-weight: 400; opacity: .7; }
/* the search by file name (footage.js renderTab): the bar's last item, at its end; while it holds
   words the scene and the filters wait, disabled, since it looks through every clip */
.ft-bar-main { display: contents; }
.ft-search { margin-left: auto; width: 240px; max-width: 100%; }
.ft-filters .mini-btn:disabled, .ft-scene:disabled { opacity: .45; cursor: not-allowed; }
/* a clip's number (#017), its file name's: the whole name on hover, copied on a click */
.ft-no { padding: 0; border: 0; background: none; font: inherit; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--ink-dim); cursor: copy; }
.ft-no:hover, .ft-no:focus-visible { color: var(--accent-ink); }
.ft-engines { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ft-eng { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; }
.ft-eng.on { color: var(--teal-ink); border-color: rgba(95,214,194,.4); }
.ft-eng.fake { color: var(--violet-ink); border-color: rgba(154,134,255,.4); }
/* the user's word for the whole project: a click takes it back */
button.ft-cast { background: none; font-family: inherit; cursor: pointer; }
button.ft-cast:hover { border-color: var(--teal-ink); }
.ft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.ft-card { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ft-card.failed { border-color: rgba(226,104,95,.35); }
.ft-card.ft-flash { animation: ft-flash 1.6s ease; }
@keyframes ft-flash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ft-media { position: relative; width: 100%; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* a clip keeps its own shape (a start frame can set it), up to a tall-enough cap */
.ft-media video { width: 100%; max-height: 460px; object-fit: contain; display: block; background: #000; }
.ft-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px; text-align: center; color: var(--ink-dim); }
.ft-state b { font-size: 14px; color: var(--ink); }
.ft-state small { font-size: 12px; line-height: 1.45; color: var(--ink-faint); max-width: 300px; overflow-wrap: anywhere; }
.ft-state.failed b { color: var(--danger-ink); }
.ft-word { margin-top: 6px; }
.ft-word-project { display: flex; align-items: flex-start; gap: 7px; max-width: 300px; font-size: 11px; line-height: 1.45; color: var(--ink-faint); text-align: start; cursor: pointer; }
.ft-word-project input { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.ft-spin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(232,176,75,.25); border-top-color: var(--accent); animation: ft-spin .9s linear infinite; }
@keyframes ft-spin { to { transform: rotate(360deg); } }
.ft-like { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(12,11,16,.6); color: rgba(255,255,255,.7); font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.ft-card:hover .ft-like, .ft-like.on { opacity: 1; }
.ft-like.on { color: var(--like-ink); border-color: var(--like); }
.ft-meta { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px 0; font-size: 12px; color: var(--ink-dim); }
.ft-info { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 22px; }
.ft-kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink); }
.ft-kind.draft { color: var(--accent-ink); border-color: rgba(232,176,75,.45); }
.ft-kind.final { color: var(--teal-ink); border-color: rgba(95,214,194,.45); }
.ft-cost { font-weight: 800; color: var(--ink); }
.ft-from { background: none; border: 0; padding: 0; color: var(--violet-ink); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* ⋯ on a card, at the end of its info row (never a row of its own): Move to scene + Delete */
.ft-more { margin-inline-start: auto; width: 28px; height: 22px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px;
  background: none; color: var(--ink-dim); font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer; }
.ft-more:hover, .ft-more[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-faint); }
.sm-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.scene-menu button.sm-danger:hover { color: var(--danger-ink); }
.ft-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; margin-top: auto; }
.ft-actions a.mini-btn { text-decoration: none; display: inline-flex; align-items: center; }
/* a card's less frequent actions, a click away: ⧉ Prompt, ✦ More like this */
.ft-more-acts > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.ft-more-acts > summary::-webkit-details-marker { display: none; }
.ft-more-acts > summary::before { content: "▸"; font-size: 11px; transition: transform .12s ease; }
.ft-more-acts[open] > summary::before { transform: rotate(90deg); }
.ft-more-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* the head's tools: Select, Client links — and Connections, the engines that render here, in a disclosure */
.ft-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ft-share { display: flex; gap: 6px; }
.ft-conn { position: relative; }
.ft-conn > summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; }
.ft-conn > summary::-webkit-details-marker { display: none; }
.ft-conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.ft-conn-dot.off { background: var(--danger); }
.ft-conn > .ft-engines { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: max-content; max-width: 340px; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); }
.ft-clear { margin-top: 12px; }
.ft-chip.earlier { border-style: dashed; opacity: .85; }
/* a clip, opened (footage.js openDetail): its REFERENCES on the left, the player in the middle with
   what it is and its actions, and its chat on the right — WHAT YOU ASKED, PROMPT, the turns asked
   from it, and the box to ask for a change */
.ft-detail-overlay { padding: 20px; z-index: 190; }   /* under any window it opens (who's in the images, the lightbox) */
.ft-detail { display: flex; width: min(1320px, 100%); height: min(820px, calc(100vh - 40px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 70px rgba(0,0,0,.5); outline: none; }
.ft-detail.with-chat { width: min(1560px, 100%); height: min(900px, calc(100vh - 40px)); }
/* the middle: the player (full screen from its controls), then what it is and what to do with it */
.ft-dt-mid { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ft-dt-media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.ft-dt-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.ft-dt-under { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; border-top: 1px solid var(--line-soft); }
.ft-dt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ft-dt-chip { padding: 2px 7px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-soft); font-size: 11px; font-weight: 600; color: var(--ink-dim); }
.ft-dt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ft-dt-actions .generate-btn { width: auto; margin: 0; padding: 8px 16px; font-size: 13px; }
.ft-dt-actions .mini-btn { padding: 7px 12px; font-size: 12.5px; }
.ft-dt-actions .ft-dt-reuse { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.ft-dt-actions .ft-dt-reuse:hover { filter: brightness(1.1); color: var(--bg); }
/* 📸 Grab frame, a frame back / on beside it — and the frame grabbed, with what to do with it */
.ft-grab { display: inline-flex; gap: 2px; margin-left: auto; }
.ft-dt-actions .ft-grab .mini-btn[data-ft-step] { padding: 7px 10px; font-weight: 800; }
.ft-grabbed { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: var(--bg-2); }
.ft-grabbed img { flex: none; width: 132px; max-height: 96px; object-fit: contain; border-radius: 8px; background: #000; }
.ft-grabbed-b { flex: 1; min-width: 0; display: grid; gap: 8px; }
.ft-grabbed-t { display: flex; align-items: baseline; gap: 8px; }
.ft-grabbed-t b { font-size: 13px; }
.ft-grabbed-t small { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.ft-grabbed-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ft-grabbed-acts .mini-btn { padding: 6px 10px; font-size: 12px; }
.ft-grabbed-acts .mini-btn:disabled { opacity: .5; cursor: progress; }
/* the right: its chat */
.ft-dt-side { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); min-height: 0; }
.ft-detail.with-chat .ft-dt-side { width: 480px; }
.ft-dt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line-soft); }
.ft-dt-head b { font-size: 14px; }
.ft-dt-icons { display: flex; gap: 4px; }
.ft-dt-ico { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-dim); font-size: 14px; cursor: pointer; text-decoration: none; }
.ft-dt-ico:hover { background: var(--panel-2); color: var(--ink); }
.ft-dt-ico.on { color: var(--like-ink); }
.ft-dt-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 18px 14px; }
.ft-dt-sec { padding: 12px 0; }
.ft-dt-sec + .ft-dt-sec { border-top: 1px solid var(--line-soft); }
.ft-dt-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-faint); }
.ft-dt-title small { font-family: var(--body); letter-spacing: 0; font-size: 11px; }
.ft-dt-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.ft-dt-tool { font-family: var(--body); font-size: 11.5px; letter-spacing: 0; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: none; color: var(--ink-dim); cursor: pointer; }
.ft-dt-tool:hover, .ft-dt-tool.on { color: var(--accent-ink); border-color: var(--accent); }
.ft-dt-prompt, .ft-dt-shot p { font-size: 13px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ft-dt-shot { padding: 10px 12px; margin-bottom: 6px; border-radius: 8px; background: var(--bg-2); }
/* "What you asked", above the prompt: the brief's words and each follow-up after it */
.ft-dt-ask-head { margin: -2px 0 8px; font-size: 11.5px; color: var(--ink-faint); }
.ft-dt-ask-p { margin: 0 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); font-size: 12.5px; line-height: 1.55; color: var(--ink-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.ft-dt-ask-p b { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink-faint); }
.ft-dt-ask-then { border-inline-start: 2px solid var(--accent); }
.ft-dt-shot-n { display: block; margin: 6px 0 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.ft-dt-edit { display: flex; flex-direction: column; }
.ft-dt-box { width: 100%; min-height: 120px; resize: vertical; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.6; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ft-dt-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ft-dt-row .generate-btn { flex: 1 1 100%; width: auto; margin: 0; justify-content: center; }
.ft-dt-row .mini-btn { flex: 1; justify-content: center; padding: 8px 10px; }
.ft-dt-go.busy { opacity: .6; cursor: progress; }
.ft-dt-note { font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.ft-dt-promptsec .ml-form { margin: 10px 0 0; }
/* its chat's turns, as Create Video's Output draws them — in a narrower column */
.ft-dt-thread { display: flex; flex-direction: column; gap: 14px; }
.ft-dt-thread:not(:empty) { padding: 14px 0 6px; border-top: 1px solid var(--line-soft); }
.ft-dt-thread:not(:empty)::before { content: 'ASKED FROM HERE'; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-faint); }
.ft-dt-thread .msg { max-width: 100%; min-width: 0; }
.ft-dt-thread .msg.user { max-width: 90%; }
.ft-dt-thread .msg.user .bubble { padding: 9px 12px; font-size: 13px; }
.ft-dt-thread .msg.assistant .bubble { padding: 12px; font-size: 13px; }
.ft-dt-thread .bubble pre { font-size: 12px; padding: 10px 12px; }
.ft-dt-thread .bubble .pc-actions { padding: 0 10px 10px; }
.ft-dt-thread .bubble .ml-form { margin: 0 10px 10px; }
.ft-dt-thread .msg.ft-this .bubble { border-color: var(--teal); }
.ft-dt-thread .msg.ft-this .role-tag::after { content: '  ·  ▶ THIS CLIP'; color: var(--teal); }
/* the box under it all: a change asked, a new prompt back */
.ft-ask { flex: none; padding: 10px 14px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.ft-ask-box { display: block; width: 100%; min-height: 58px; max-height: 220px; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.5; outline: none; }
.ft-ask-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ft-ask-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ft-ask-row small { font-size: 11px; line-height: 1.4; color: var(--ink-faint); }
.ft-ask-go { flex: none; width: auto; margin: 0; padding: 7px 18px; font-size: 13px; }
.ft-ask-go.busy { opacity: .75; cursor: progress; }
/* the left: its references, as what's asked next takes them */
.ft-dt-refcol { width: 250px; flex-shrink: 0; min-height: 0; overflow-y: auto; padding: 14px 14px 16px; border-right: 1px solid var(--line); background: var(--bg-2); }
.ft-dt-refcol.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.ft-rf-list { display: flex; flex-direction: column; gap: 8px; }
.ft-rf { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); }
.ft-rf-thumb { position: relative; flex: none; width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; cursor: zoom-in; }
.ft-rf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ft-rf-thumb b { position: absolute; left: 3px; bottom: 3px; padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; font-family: var(--mono); font-size: 9.5px; font-weight: 400; }
.ft-rf-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ft-rf-top { display: flex; gap: 4px; align-items: center; }
.ft-rf-role { flex: 1; min-width: 0; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12px; font-weight: 600; }
.ft-rf-del { flex: none; width: 26px; height: 26px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink-faint); cursor: pointer; }
.ft-rf-del:hover { color: var(--danger-ink); border-color: var(--danger); }
.ft-rf-in { width: 100%; height: 26px; padding: 0 7px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12px; outline: none; }
.ft-rf-in:focus { border-color: var(--accent); }
.ft-rf-empty { margin: 4px 0; font-size: 12px; color: var(--ink-faint); }
.ft-rf-add { display: flex; gap: 6px; margin-top: 10px; }
.ft-rf-add .mini-btn { flex: 1; justify-content: center; padding: 7px 6px; font-size: 12px; }
.ft-rf-add .mini-btn:disabled { opacity: .45; cursor: not-allowed; }
.ft-rf-picker { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.ft-rf-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ft-rf-tabs .ft-dt-tool { padding: 2px 6px; font-size: 11px; }
.ft-rf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; max-height: 260px; overflow-y: auto; }
.ft-rf-cand { padding: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; cursor: copy; }
.ft-rf-cand img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ft-rf-cand:hover { border-color: var(--accent); }
.ft-rf-cand:disabled { opacity: .5; cursor: progress; }
.ft-rf-foot { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); }
.ft-rf-foot.changed { color: var(--accent-ink); }
.ft-rf-foot .ft-dt-tool { display: inline-block; margin-top: 6px; }
@media (max-width: 1280px) { .ft-dt-refcol { width: 214px; } .ft-detail.with-chat .ft-dt-side { width: 400px; } }
/* narrow: one column that scrolls — the references, the player, then the chat */
@media (max-width: 980px) {
  .ft-detail, .ft-detail.with-chat { flex-direction: column; height: calc(100vh - 40px); overflow-y: auto; }
  .ft-dt-refcol { width: auto; flex: none; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ft-dt-mid { flex: none; }
  .ft-dt-media { flex: none; height: 40vh; }
  .ft-dt-side, .ft-detail.with-chat .ft-dt-side { width: auto; flex: none; height: 80vh; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) { .footage { padding: 16px; } .ft-grid { grid-template-columns: minmax(0, 1fr); } .ft-engines { margin-left: 0; } .ft-spend { align-items: flex-start; } }

/* ── Storyboard (storyboard.js): a script to a video board, six stages over one board ─────────── */
.sbd { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sbd-modes .seg { padding: 6px 11px; }
.sbd-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--ink-faint); font-size: 13px; }
/* the six stages, each with what it holds — reachable ones click back to */
.sbd-rail { flex-shrink: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 12px 28px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.sbd-step { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 0; background: none; color: var(--ink-faint); font: inherit; text-align: left; cursor: pointer; transition: background .12s ease; }
.sbd-step + .sbd-step { border-left: 1px solid var(--line); }
.sbd-step:hover:not(:disabled):not(.active) { background: var(--panel); }
.sbd-step:disabled { cursor: default; opacity: .42; }
.sbd-step-n { flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-family: var(--mono); font-size: 11px; }
.sbd-step-t { min-width: 0; display: flex; flex-direction: column; }
.sbd-step-t b { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
.sbd-step-t small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbd-step.done .sbd-step-n { border-color: color-mix(in srgb, var(--teal) 60%, var(--line)); color: var(--teal-ink); }
.sbd-step.active { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 -2px 0 var(--accent); }
.sbd-step.active .sbd-step-n { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 700; }
.sbd-step.active b { color: var(--ink); }
.sbd-body { flex: 1; min-height: 0; display: flex; margin-top: 12px; border-top: 1px solid var(--line); }
.sbd-scroll { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; }
/* the gate: where the stage stands, and the one thing to do next */
.sbd-gate { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.sbd-gate-status { min-width: 0; font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbd-gate-acts { flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.sbd-gate-go { padding: 11px 22px; font-size: 14px; }
.sbd-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sbd-list-head h3 { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.sbd-list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sbd-lead { max-width: 780px; margin: -2px 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); }
.sbd-empty { font-size: 13px; color: var(--ink-faint); }
.sbd-n { flex-shrink: 0; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.sbd-dur { flex-shrink: 0; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.sbd-mono, textarea.sbd-mono { font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.sbd .spinner { border-color: rgba(255,255,255,.15); border-top-color: var(--accent); }
.sbd-engine { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.sbd-engine select { width: auto; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; }

/* ① the script */
.sbd-script-wrap { max-width: 880px; margin: 0 auto; padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.sbd-hero h2 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -.02em; }
.sbd-hero p { max-width: 700px; margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--ink-dim); }
/* the Style screen, before the script: the five looks offered (public/storyboard-styles.js), each
   shown by its whole collage, and the card that uploads a reference of your own — three to a row,
   in two rows; under them, half the size, the project's uploaded styles. It fits the window without
   scrolling: the scroll box is a size container, and the cards are as large as lets their rows fit
   its height (--sb-img: a card picture's height when they and the rest of the screen fill it; the
   pictures are 2:1, and 3 of them with 2 gaps make the width). */
.sbd-style-scroll { container: sbstyle / size; }
.sbd-style-wrap { --sb-gap: 12px; --sb-img: max(84px, calc((100cqh - 236px) / 2));
  max-width: min(1500px, calc(var(--sb-img) * 6 + 2 * var(--sb-gap) + 48px));
  margin: 0 auto; padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
/* with the project's own under the six, room for that row too (its pictures are about half as tall) */
.sbd-style-wrap.with-more { --sb-img: max(84px, calc((100cqh - 292px) / 2.56)); }
/* 🎨 Change the look (a board whose frames are written): room for its line under the head too */
.sbd-style-wrap.changing { --sb-img: max(84px, calc((100cqh - 284px) / 2)); }
.sbd-style-wrap.with-more.changing { --sb-img: max(84px, calc((100cqh - 340px) / 2.56)); }
.sbd-style-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.sbd-style-head h2 { font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.sbd-style-head p { font-size: 13px; color: var(--ink-dim); }
.sbd-style-head .sbd-style-own { margin-left: auto; align-self: center; }
.sbd-style-group { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sbd-style-label { height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sbd-style-label .field-label { margin: 0; }
.sbd-style-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sb-gap); }
.sbd-style-grid.sbd-style-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sbd-style-main .sbd-style-img { aspect-ratio: 2 / 1; }
.sbd-style { container-type: inline-size; min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 0 0 9px; overflow: hidden; text-align: left; cursor: pointer; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; font: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
.sbd-style:hover { border-color: var(--accent); transform: translateY(-2px); }
.sbd-style.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sbd-style-img { display: block; aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; }
.sbd-style-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* a look's card shows its whole collage, every panel of it, on white as the sheet came */
.sbd-style.sheet .sbd-style-img { background: #fff; }
.sbd-style.sheet .sbd-style-img img { object-fit: contain; padding: 4px; }
.sbd-style-t { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px; }
/* (a name a little smaller on a narrow card, so the catalog's fit; an uploaded one's long name ends in …, whole in its tooltip) */
.sbd-style-t b { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--display); font-weight: 500; font-size: clamp(12.5px, 8.4cqi, 15px); line-height: 19px; }
.sbd-style-check { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #1a1206; font-size: 10.5px; font-weight: 800; }
.sbd-style-warn { padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 10px; font-size: 12.5px; color: var(--ink-dim); }
.sbd-style-warn b { color: var(--ink); font-weight: 600; }
.sbd-style-own { padding: 3px 10px; font-size: 12px; }
.sbd-style-own.on { border-color: var(--accent); color: var(--accent-ink); }
/* 🎨 Change the look: the look picked to change to has the ring and says New; the one the board is in
   now keeps its ✓, its outline dashed */
.sbd-style-wrap.changing .sbd-style.on { box-shadow: none; border-style: dashed; }
.sbd-style.to { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sbd-style-new { flex-shrink: 0; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #1a1206; font-size: 10.5px; font-weight: 800; line-height: 17px; }
.sbd-style-own.to { border-color: var(--accent); color: var(--accent-ink); }
/* "Your own": the card that uploads a style, and the project's uploaded ones (✕ stops offering one) */
.sbd-own { position: relative; display: flex; min-width: 0; }
.sbd-own > .sbd-style { flex: 1; }
.sbd-own-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(10, 10, 11, .62); color: #f4f1ea; font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.sbd-own:hover .sbd-own-x, .sbd-own-x:focus-visible { opacity: 1; }
.sbd-style-add { border-style: dashed; }
.sbd-style-add.busy { cursor: progress; transform: none; }
.sbd-add-img { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-dim); font-size: 12px; }
.sbd-add-img b { font-size: 28px; font-weight: 300; line-height: 1; color: var(--accent-ink); }
/* a narrow window: two looks to a row (it scrolls then), and one on a phone */
@container sbstyle (max-width: 980px) {
  .sbd-style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sbd-style-grid.sbd-style-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container sbstyle (max-width: 560px) {
  .sbd-style-wrap { padding: 14px 14px 18px; }
  .sbd-style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sbd-style-grid.sbd-style-main { grid-template-columns: minmax(0, 1fr); }
  .sbd-style-t b { white-space: normal; }
}
.sbd-scriptbox { display: flex; flex-direction: column; gap: 8px; }
.sbd-scripthead { display: flex; align-items: center; gap: 10px; }
.sbd-scripthead .field-label { margin: 0; }
.sbd-meta { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.sbd-file { cursor: pointer; }
#sbdScript { width: 100%; min-height: 300px; max-height: 52vh; resize: vertical; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.65; outline: none; }
#sbdScript:focus { border-color: var(--accent); }
#sbdScript.drag { border-color: var(--accent); border-style: dashed; background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.sbd-settings { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.sbd-set { display: flex; flex-direction: column; }
.sbd-set-note { margin-top: 6px; font-size: 11.5px; color: var(--ink-faint); }
.sbd-notes { display: flex; flex-direction: column; }
.sbd-notes input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13.5px; outline: none; }
.sbd-notes input:focus { border-color: var(--accent); }

/* ② the shots, with the director beside them */
.sbd-shots-cols { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--sbd-dir-w, 340px); grid-template-rows: minmax(0, 1fr); }
.sbd-shotlist { padding: 18px 28px 40px; }
.sbd-shotlist-in { max-width: 1000px; margin: 0 auto; }
.sbd-shot-list { display: flex; flex-direction: column; gap: 12px; }
.sbd-shot { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color .12s ease; }
.sbd-shot:hover { border-color: color-mix(in srgb, var(--ink-faint) 55%, var(--line)); }
.sbd-shot.new { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.sbd-shot.changed { border-color: color-mix(in srgb, var(--violet) 70%, var(--line)); }
.sbd-shot.live { animation: sbdIn .35s ease; }
@keyframes sbdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sbd-shot-skel { flex-direction: row; align-items: center; gap: 12px; padding: 22px 18px; border-style: dashed; color: var(--ink-faint); font-size: 13px; }
.sbd-shot-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* a Hebrew title reads right to left but sits by its number, as the board reads */
.sbd-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbd-badge { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.sbd-badge.new { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink); }
.sbd-badge.changed { border: 1px solid color-mix(in srgb, var(--violet) 45%, transparent); background: color-mix(in srgb, var(--violet) 16%, transparent); color: var(--violet-ink); }
.sbd-shot-acts { flex-shrink: 0; display: flex; gap: 4px; opacity: .5; transition: opacity .12s ease; }
.sbd-shot:hover .sbd-shot-acts, .sbd-shot:focus-within .sbd-shot-acts { opacity: 1; }
.sbd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sbd-chip { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); font-size: 11.5px; font-weight: 600; color: var(--ink-dim); white-space: nowrap; }
.sbd-chip.size { color: var(--ink); }
.sbd-chip.move { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); color: var(--teal-ink); }
.sbd-wws .field-label { margin-bottom: 4px; }
.sbd-wws p { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.sbd-cast-row, .sbd-cast-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sbd-castchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.sbd-castchip.k-character { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.sbd-castchip.k-location { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); }
.sbd-castchip.k-prop { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
button.sbd-castchip { cursor: pointer; opacity: .5; }
button.sbd-castchip:hover { opacity: .8; }
button.sbd-castchip.on { opacity: 1; background: var(--panel-2); color: var(--ink); }
.sbd-prompt { padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.sbd-prompt-head { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.sbd-prompt-head .field-label { margin: 0; }
.sbd-caret { font-size: 10px; color: var(--ink-faint); }
.sbd-prompt-text { margin-top: 6px; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--ink-faint); white-space: pre-wrap; overflow-wrap: anywhere; }
.sbd-prompt.open .sbd-prompt-text { color: var(--ink-dim); }
.sbd-beat summary { width: fit-content; font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); cursor: pointer; }
.sbd-beat p { margin-top: 6px; padding: 6px 12px; border-left: 2px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--ink-dim); white-space: pre-wrap; }
.sbd-shot-busy, .sbd-inline-busy { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent-ink); }
/* the ⋯ on a shot: ask about it, and the rest */
.sbd-menu { position: absolute; top: 44px; right: 12px; z-index: 20; width: 300px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: var(--shadow); }
.sbd-menu > button { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-family: var(--body); font-size: 12.5px; text-align: left; cursor: pointer; }
.sbd-menu > button:hover:not(:disabled) { background: var(--panel); }
.sbd-menu > button:disabled { opacity: .4; cursor: default; }
.sbd-menu > button span { width: 16px; color: var(--accent-ink); }
.sbd-menu > button.danger:hover { color: var(--danger-ink); }
.sbd-ask { display: flex; gap: 6px; margin-bottom: 4px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); }
.sbd-ask input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12.5px; outline: none; }
.sbd-ask input:focus { border-color: var(--accent); }
/* a shot being edited */
.sbd-shot.editing { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 3%, var(--panel)); }
.sbd-in { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; outline: none; }
.sbd-shot .sbd-in:focus, .sbd-shot select:focus, .sbd-shot textarea:focus, .sbd-mrow textarea:focus, .sbd-ent textarea:focus, .sbd-frame textarea:focus { border-color: var(--accent); }
.sbd-in-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.sbd-in-dur, .sbd-secs { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.sbd-in-dur input, .sbd-secs input { width: 56px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 12px; outline: none; }
.sbd-edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sbd-edit-grid label, .sbd-edit-wide { display: flex; flex-direction: column; }
.sbd-shot select { padding: 7px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; }
.sbd-shot textarea, .sbd-frame textarea, .sbd-mrow textarea, .sbd-ent textarea { width: 100%; resize: vertical; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13.5px; line-height: 1.55; outline: none; }
.sbd-shot textarea.sbd-mono, .sbd-frame textarea.sbd-mono, .sbd-mrow textarea.sbd-mono { font-family: var(--mono); font-size: 12px; }
.sbd-cast-new { display: inline-flex; align-items: center; gap: 4px; }
.sbd-cast-new input { width: 200px; padding: 5px 10px; border: 1px dashed var(--line); border-radius: 999px; background: none; color: var(--ink); font-family: var(--body); font-size: 12px; outline: none; }
.sbd-cast-new select { width: auto; padding: 4px 6px; font-size: 12px; }
.sbd-edit-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sbd-edit-acts .generate-btn, .sbd-prop-acts .generate-btn { padding: 9px 18px; font-size: 13.5px; }
/* the director's proposal, and its writing */
.sbd-proposal { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--violet) 55%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--violet) 8%, var(--panel)); }
.sbd-proposal.writing { flex-direction: row; align-items: center; gap: 10px; border-style: dashed; font-size: 13px; color: var(--ink-dim); }
.sbd-prop-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sbd-prop-head b { font-size: 14px; }
.sbd-prop-head span { font-family: var(--mono); font-size: 11.5px; color: var(--violet-ink); }
.sbd-proposal p { font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); }
.sbd-proposal p.sbd-prop-removed { font-size: 12.5px; color: var(--ink-faint); }
.sbd-prop-removed span { text-decoration: line-through; }
.sbd-prop-acts { display: flex; gap: 8px; }
.sbd-director { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg-2); }
.sbd-dir-head { display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 10px; }
.sbd-dir-head b { font-family: var(--display); font-weight: 500; font-size: 20px; }
.sbd-dir-head small { font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.sbd-dir-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.sbd-dchip { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .12s ease; }
.sbd-dchip:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.sbd-dchip:disabled { opacity: .45; cursor: default; }
.sbd-dir-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.sbd-dir-empty { font-size: 12.5px; line-height: 1.55; color: var(--ink-faint); }
.sbd-msg > span { display: block; margin-bottom: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.sbd-msg p { padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.sbd-msg.you p { border: 1px solid var(--line); background: var(--panel-2); }
.sbd-msg.director p { border: 1px solid color-mix(in srgb, var(--violet) 30%, var(--line)); background: color-mix(in srgb, var(--violet) 9%, var(--panel)); }
.sbd-dir-compose { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.sbd-dir-compose textarea { flex: 1; min-width: 0; resize: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.45; outline: none; }
.sbd-dir-compose textarea:focus { border-color: var(--accent); }
.sbd-dir-compose .send-btn { height: auto; min-height: 44px; border-radius: 10px; padding: 0 16px; }

/* ③ the cast */
.sbd-stage-wrap { max-width: 1200px; margin: 0 auto; padding: 18px 28px 40px; }
.sbd-stage-wrap.wide { max-width: 1520px; }
.sbd-cast-group { margin-bottom: 24px; }
.sbd-cast-group h4 { margin-bottom: 10px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.sbd-cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.sbd-ent { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sbd-ent.ready { border-color: color-mix(in srgb, var(--teal) 30%, var(--line)); }
.sbd-ent-img { position: relative; aspect-ratio: 16 / 9; background: var(--bg); }
.sbd-ent-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sbd-ent-skel, .sbd-ent-none, .sbd-frame-skel, .sbd-frame-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; font-size: 12.5px; line-height: 1.45; color: var(--ink-faint); }
.sbd-ent-skel, .sbd-frame-skel { background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sbd-ent-none b, .sbd-frame-empty b { font-size: 13px; color: var(--ink-dim); }
.sbd-ent-none small, .sbd-frame-empty small { font-size: 11.5px; }
.sbd-frame-empty div { display: flex; gap: 6px; }
.sbd-ent-tag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.7); color: var(--teal); font-family: var(--mono); font-size: 10px; }
.sbd-pager { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.sbd-pager button { width: 24px; height: 22px; border: 0; border-radius: 999px; background: none; color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.sbd-pager button:hover:not(:disabled) { background: rgba(255,255,255,.15); }
.sbd-pager button:disabled { opacity: .3; cursor: default; }
.sbd-pager span { padding: 0 4px; }
.sbd-pager.inline { position: static; width: fit-content; transform: none; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-dim); }
.sbd-pager.inline button { color: var(--ink); }
.sbd-ent-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
.sbd-ent-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sbd-ent-name b { font-size: 15px; }
.sbd-ent-name .asset-chip { margin-left: 0; }
.sbd-ent-in { font-family: var(--mono); font-size: 10.5px; line-height: 1.45; color: var(--ink-faint); }
.sbd-ent-about { margin-top: -4px; font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
.sbd-ent-look { display: flex; flex-direction: column; }
.sbd-ent-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sbd-ent-acts .mini-btn { padding: 6px 10px; font-size: 11.5px; }
.sbd-ent-acts label.mini-btn { cursor: pointer; }
.sbd-picker { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.sbd-picker-grid { max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); grid-auto-rows: max-content; gap: 8px; }
.sbd-pick { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 11px; text-align: left; cursor: pointer; }
.sbd-pick:hover { border-color: var(--accent); color: var(--ink); }
.sbd-pick img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; }
.sbd-pick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbd-picker > .mini-btn { align-self: flex-end; }

/* ④ the frames: the board itself */
.sbd-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sbd-frames.sbd-ar-9x16 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sbd-frames.sbd-ar-1x1, .sbd-frames.sbd-ar-4x5 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sbd-frame { display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sbd-frame.stale { border-color: color-mix(in srgb, var(--accent-2) 60%, var(--line)); }
.sbd-frame.failed { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.sbd-frame-pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: var(--bg); }
.sbd-ar-9x16 .sbd-frame-pic { aspect-ratio: 9 / 16; }
.sbd-ar-1x1 .sbd-frame-pic { aspect-ratio: 1; }
.sbd-ar-4x5 .sbd-frame-pic { aspect-ratio: 4 / 5; }
.sbd-frame-pic img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.sbd-frame-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(8,6,12,.55); }
.sbd-frame-over .gen-load-label { color: #f4efe6; }
.sbd-frame-change { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11.5px; line-height: 1.4; color: var(--ink-faint); }
.sbd-frame-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sbd-frame-meta b { flex: 1; min-width: 0; font-size: 13.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbd-frame-sum { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.sbd-stale { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent-2) 12%, transparent); color: #f2c3a6; font-size: 12px; line-height: 1.4; }
.sbd-stale.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: #ffd9d5; }
.sbd-stale .mini-btn { flex-shrink: 0; padding: 5px 9px; font-size: 11.5px; }
.sbd-frame-edit { display: flex; flex-direction: column; gap: 8px; }
/* ✎ Texts: the frame's title and words, in fields in place of the lines they show as */
.sbd-frame .sbd-in:focus { border-color: var(--accent); }
.sbd-texts-edit { padding: 10px 0 2px; border-top: 1px dashed var(--line); }
.sbd-frame-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.sbd-frame-acts .mini-btn { padding: 6px 10px; font-size: 11.5px; }
.sbd-frame-refs { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }

/* ⑤ the motion */
.sbd-motion-list { display: flex; flex-direction: column; gap: 12px; }
.sbd-mrow { display: grid; grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sbd-mrow.stale { border-color: color-mix(in srgb, var(--accent-2) 60%, var(--line)); }
.sbd-mrow-pic { position: relative; align-self: start; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: var(--bg); }
.sbd-mrow-pic img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.sbd-mrow-pic .sbd-n { position: absolute; top: 6px; left: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,.72); }
.sbd-mrow-mid, .sbd-mrow-prompt { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sbd-mrow-mid label { display: flex; flex-direction: column; }
.sbd-mrow-mid label.sbd-secs { flex-direction: row; }
.sbd-mrow-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sbd-mrow-head b { font-size: 14px; }
.sbd-mrow-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sbd-styles .seg { padding: 6px 10px; font-size: 11.5px; }
.sbd-mrow-prompt .field-label { margin: 0; }
.sbd-mrow-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sbd-stale-tag { margin-right: auto; font-size: 11.5px; color: #f2c3a6; }

/* ⑥ the video board: the screen, the timeline, the shot's panel */
.sbd-vb { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); }
.sbd-vb-main { min-width: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 24px 28px; }
/* the screen keeps the board's shape, as large as leaves the timeline in view */
.sbd-screen { position: relative; flex-shrink: 0; width: min(100%, calc(46vh * 16 / 9)); aspect-ratio: 16 / 9; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #000; }
.sbd-screen.sbd-ar-9x16 { width: min(100%, calc(46vh * 9 / 16)); aspect-ratio: 9 / 16; }
.sbd-screen.sbd-ar-1x1 { width: min(100%, 46vh); aspect-ratio: 1; }
.sbd-screen.sbd-ar-4x5 { width: min(100%, calc(46vh * 4 / 5)); aspect-ratio: 4 / 5; }
.sbd-screen img, .sbd-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s ease; }
.sbd-screen .on { opacity: 1; }
.sbd-still.kb { animation: sbdKen linear forwards; }
@keyframes sbdKen { from { transform: scale(1); } to { transform: scale(1.06); } }
.sbd-screen-cap { position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px; background: rgba(0,0,0,.66); color: #fff; font-size: 12.5px; }
.sbd-screen-cap b { font-family: var(--mono); color: var(--accent-ink); }
.sbd-screen-cap em { margin-left: 6px; font-family: var(--mono); font-size: 10px; font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.sbd-transport { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sbd-play { min-width: 130px; padding: 9px 20px; font-size: 14px; }
.sbd-time { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.sbd-time b { font-weight: 400; color: var(--ink); }
.sbd-track { position: relative; flex-shrink: 0; display: flex; gap: 3px; height: 74px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.sbd-block { position: relative; flex-basis: 0; min-width: 34px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; }
.sbd-block img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.sbd-block.st-done img { opacity: .95; }
.sbd-block.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.sbd-block.now { box-shadow: inset 0 -3px 0 var(--accent); }
.sbd-block-n { position: absolute; top: 4px; left: 5px; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.7); color: #fff; font-family: var(--mono); font-size: 10px; }
.sbd-block-st { position: absolute; right: 5px; bottom: 4px; display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; }
.sbd-block-st .spinner { width: 10px; height: 10px; margin: 0; }
.sbd-block-st em { font-family: var(--mono); font-size: 10px; font-style: normal; }
.sbd-block.st-done .sbd-block-st { color: var(--teal-ink); }
.sbd-block.st-failed .sbd-block-st { color: var(--danger-ink); }
.sbd-block.st-stale .sbd-block-st { color: var(--accent-2-ink); }
.sbd-playhead { position: absolute; top: 2px; bottom: 2px; left: 0; width: 2px; margin-left: 3px; background: var(--accent); box-shadow: 0 0 8px var(--accent); pointer-events: none; }
.sbd-track-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-faint); }
.sbd-inspector { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: var(--bg-2); }
.sbd-insp { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.sbd-insp .field-label { margin: 4px 0 0; }
.sbd-insp-head { display: flex; align-items: center; gap: 8px; }
.sbd-insp-head b { flex: 1; min-width: 0; font-size: 15px; text-align: left; }
.sbd-insp-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
.sbd-insp-status em { font-family: var(--mono); font-style: normal; }
.sbd-insp-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sbd-insp-acts a.mini-btn { display: inline-flex; align-items: center; text-decoration: none; }

@media (max-width: 1360px) {
  .sbd-step-t small { display: none; }
  .sbd-mrow { grid-template-columns: 220px minmax(0, 1fr); }
  .sbd-mrow-prompt { grid-column: 1 / -1; }
  .sbd-vb { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1000px) {
  .sbd-rail { margin: 10px 16px 0; }
  .sbd-gate { padding: 10px 16px; }
  .sbd-shots-cols { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; overflow-y: auto; }
  .sbd-director { border-left: 0; border-top: 1px solid var(--line); }
  .sbd-vb { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; overflow-y: auto; }
  .sbd-edit-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── A reply on its way (app.js: liveCardHtml, paintLive) ─────────────────────────────────────────── */
/* the card where it will land: what it's doing, for how long, then the words as they come */
.msg.assistant .live-bubble { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--panel)), var(--panel) 70%); }
.live-bubble::before { content: ''; position: absolute; top: 0; left: -40%; width: 40%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: liveSweep 1.6s linear infinite; }
@keyframes liveSweep { to { left: 100%; } }
.live-head { display: flex; align-items: center; gap: 10px; }
.live-head b { font-size: 14px; color: var(--ink); }
.live-time { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.live-dots { display: inline-flex; gap: 4px; }
.live-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: liveDot 1.2s ease-in-out infinite; }
.live-dots i:nth-child(2) { animation-delay: .16s; }
.live-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes liveDot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.live-phase { margin-top: 6px; font-size: 13px; color: var(--ink-dim); }
.live-skel { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.live-skel span { height: 10px; border-radius: 5px; background: linear-gradient(100deg, var(--panel-2) 30%, color-mix(in srgb, var(--accent) 18%, var(--panel-2)) 50%, var(--panel-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.live-skel span:nth-child(2) { width: 86%; }
.live-skel span:nth-child(3) { width: 62%; }
.live-text { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--ink-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.live-caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: liveBlink 1s steps(1) infinite; }
@keyframes liveBlink { 50% { opacity: 0; } }
.live-note { margin-top: 12px; font-size: 11.5px; color: var(--ink-faint); }
/* the tool's tab: a dot that breathes while a reply is written, and stays lit until it's seen */
.tab.is-writing::after, .tab.has-new::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.tab.is-writing::after { animation: liveDot 1.2s ease-in-out infinite; }
.tab.has-new::after { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
/* the Video tab's ③ Output: writing (a ring turns round the number), or a new prompt waiting */
.nbs-step.writing .nbs-n { position: relative; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent-ink); }
.nbs-step.writing .nbs-n::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin .9s linear infinite; }
.nbs-step.writing small, .nbs-step.fresh small { color: var(--accent-ink); }
.nbs-step.writing:not(.active) { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.nbs-step.fresh .nbs-n { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.sd-elapsed { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sd-generate.is-writing:disabled { opacity: .9; }
/* a toast with a way to what it's about */
.toast.has-act { display: flex; align-items: center; gap: 14px; }
.toast-act { border: 1px solid var(--accent); background: none; color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 12.5px; padding: 4px 12px; border-radius: 8px; cursor: pointer; }
.toast-act:hover { background: var(--accent); color: #1a1206; }
@media (prefers-reduced-motion: reduce) { .live-bubble::before, .live-dots i, .live-caret, .live-skel span, .tab.is-writing::after, .nbs-step.writing .nbs-n::after { animation: none; } }

/* ── Staging: a ribbon on every screen, the sign-in too (APP_ENV=staging — markEnv in app.js) ── */
body.env-staging::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--accent-2); z-index: 10000; pointer-events: none; }
.env-ribbon { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 10000; pointer-events: none; padding: 3px 14px 4px; border-radius: 0 0 9px 9px; background: var(--accent-2); color: #1a1206; font: 700 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 18px -6px rgba(0,0,0,.6); }

/* ── Storyboard: the director at work, the proposal in view, models before the gates, asset tweaks ── */
/* the proposal (and the director writing it) stays at the top of the list while it scrolls; it flashes as it comes in */
.sbd-proposal { position: sticky; top: 0; z-index: 3; box-shadow: 0 10px 24px -14px var(--drop); }
.sbd-proposal.flash { animation: sbdFlash 1.6s ease-out 1; }
@keyframes sbdFlash { 0%, 35% { box-shadow: 0 0 0 3px var(--violet), 0 10px 24px -14px var(--drop); } 100% { box-shadow: 0 10px 24px -14px var(--drop); } }
/* the director's working line, in its chat: dots, what it's doing, how long */
.sbd-msg.live p { display: flex; align-items: center; gap: 9px; border-style: dashed; }
.sbd-dots { display: inline-flex; gap: 3px; flex-shrink: 0; }
.sbd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); animation: liveDot 1.2s ease-in-out infinite; }
.sbd-dots i:nth-child(2) { animation-delay: .16s; }
.sbd-dots i:nth-child(3) { animation-delay: .32s; }
.sbd-since { margin-left: auto; font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--violet-ink); font-variant-numeric: tabular-nums; }
/* the proposal, in the chat where it was asked for */
.sbd-dir-prop { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--violet); border-radius: 10px; background: color-mix(in srgb, var(--violet) 12%, var(--panel)); animation: sbdFlash 1.6s ease-out 1; }
.sbd-dir-prop-head { display: flex; flex-direction: column; gap: 2px; }
.sbd-dir-prop-head b { font-size: 13.5px; }
.sbd-dir-prop-head span { font-family: var(--mono); font-size: 11px; color: var(--violet-ink); }
.sbd-dir-prop-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sbd-dir-prop-acts .generate-btn { padding: 7px 14px; font-size: 12.5px; }
.sbd-dir-prop-acts .mini-btn { padding: 6px 10px; font-size: 11.5px; }
/* the model a gate is about to draw on, picked beside it */
.sbd-gate-pick { display: inline-flex; align-items: center; padding-right: 4px; }
.sbd-gate-pick .sbd-engine { color: var(--ink-dim); }
/* 🎨 Change the look: how the frames go into it */
.sbd-gate-pick .sbd-restyle-mode .seg { padding: 6px 11px; font-size: 12px; }
.sbd-stale-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sbd-ent-old { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px; border: 1px dashed color-mix(in srgb, var(--accent-2) 55%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--accent-2) 8%, transparent); }
.sbd-ent-old small { font-size: 11.5px; line-height: 1.4; color: var(--ink-dim); }
.sbd-ent-old small b { color: var(--ink); }
/* an asset's card: an image dropped on it, a changed description, a tweak */
.sbd-ent.drag { outline: 2px dashed var(--accent); outline-offset: -2px; }
.sbd-ent.drag .sbd-ent-img::after { content: 'Drop to use it as the reference'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12,11,16,.72); color: var(--accent); font-size: 13px; font-weight: 700; }
.sbd-ent-changed { margin-top: -4px; font-size: 11.5px; line-height: 1.45; color: var(--accent-ink); }
.sbd-tweak { display: flex; gap: 6px; }
.sbd-tweak input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--bg-2); color: var(--ink); font: inherit; font-size: 12.5px; }
.sbd-tweak .mini-btn { padding: 6px 10px; font-size: 11.5px; }
.sbd-tweak-note { margin-top: -4px; font-size: 11px; line-height: 1.45; color: var(--ink-faint); }
/* one person at several ages or in several looks: the main version and the others, one block */
.sbd-person { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 14px; border: 1px solid color-mix(in srgb, var(--violet) 40%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--violet) 5%, transparent); }
.sbd-person.off { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.sbd-person-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sbd-person-title { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.sbd-person-title b { font-size: 14px; }
.sbd-person-title span { font-size: 12.5px; color: var(--ink-dim); }
.sbd-person-title small { flex-basis: 100%; font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); }
.sbd-person.off .sbd-person-title small { color: var(--accent-ink); }
.sbd-person-head .mini-btn { padding: 6px 12px; font-size: 12px; }
.sbd-ent-star { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.7); color: var(--accent); font-family: var(--mono); font-size: 10px; }
.sbd-same { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sbd-same select { max-width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); color: var(--ink); font: inherit; font-size: 12px; }
.sbd-ent.version .sbd-same select { border-color: color-mix(in srgb, var(--violet) 50%, var(--line)); }
.sbd-same .mini-btn { padding: 4px 8px; font-size: 11px; }
small.sbd-same.main { font-size: 11.5px; line-height: 1.45; color: var(--accent-ink); }
.sbd-same-ok { margin-top: -4px; font-size: 11px; line-height: 1.45; color: var(--teal-ink); }
.sbd-same-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border: 1px dashed color-mix(in srgb, var(--violet) 55%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--violet) 8%, var(--panel)); font-size: 13px; line-height: 1.5; color: var(--ink-dim); }
.sbd-same-hint b { color: var(--ink); }
.sbd-same-hint-acts { display: inline-flex; gap: 6px; }
.sbd-same-hint-acts .mini-btn { padding: 6px 10px; font-size: 11.5px; }
@media (prefers-reduced-motion: reduce) { .sbd-dots i, .sbd-proposal.flash, .sbd-dir-prop { animation: none; } }
/* ⇄ Swap a place or a prop's new picture into the frames drawn with its old one */
.sbd-swap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
.sbd-swap b { color: var(--ink); }
.sbd-swap .mini-btn { padding: 6px 10px; font-size: 11.5px; }
.sbd-swap small { font-size: 11px; color: var(--ink-faint); }
.sbd-swap.busy { flex-direction: row; align-items: center; gap: 8px; border-style: dashed; }
.sbd-stale { flex-wrap: wrap; }
/* Export as… (the Generate stage): a PDF or a PowerPoint of the board */
.sbd-export { position: relative; display: inline-flex; }
.sbd-export-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; min-width: 250px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); }
.sbd-export-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sbd-export-menu button:hover { background: var(--panel); }
.sbd-export-menu b { font-size: 13px; }
.sbd-export-menu small { font-size: 11.5px; color: var(--ink-faint); }
.sbd-export-brand { padding: 8px 11px 6px; font-size: 11.5px; color: var(--accent-ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sbd-brand-btn.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent-ink); }
/* 🏷 The client's brand (brand-ui.js): the logos in, the reading checked, a preview of the deck */
.modal-card.bk-card { max-width: 640px; }
.modal-card.bk-card.wide { max-width: 1080px; }
.bk-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 16px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--panel-2); color: var(--ink-dim); cursor: pointer; text-align: center; }
.bk-drop b { color: var(--ink); font-size: 15px; }
.bk-drop small { font-size: 12px; color: var(--ink-faint); }
.bk-drop.over, .bk-drop:hover { border-color: var(--accent); }
.bk-drop.busy { cursor: progress; }
.bk-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.bk-logo { position: relative; display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.bk-logo.small { cursor: pointer; }
.bk-logo.small input { position: absolute; opacity: 0; pointer-events: none; }
.bk-logo.bk-main { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bk-card :is(input:not([type="color"]):not([type="radio"]):not([type="file"]), select) { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--ink); font-family: var(--body); font-size: 13px; outline: none; }
.bk-card :is(input, select):focus { border-color: var(--accent); }
.bk-known { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--ink-dim); }
.bk-known .mini-btn { padding: 3px 9px; font-size: 11.5px; }
/* a logo on a checker, so its white and its transparency both show */
.bk-logo-img { flex-shrink: 0; display: grid; place-items: center; width: 92px; height: 64px; border-radius: 8px;
  background: repeating-conic-gradient(#d9d6df 0 25%, #f4f2f7 0 50%) 0 0 / 14px 14px; }
.bk-logo-img img { max-width: 84px; max-height: 56px; object-fit: contain; }
.bk-logo-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bk-logo-t b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-logo-t small { font-size: 11px; color: var(--ink-faint); }
.bk-measured { display: flex; flex-wrap: wrap; gap: 4px; }
.bk-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 3px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); }
.bk-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); vertical-align: -2px; }
.bk-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--ink-faint); cursor: pointer; }
.bk-x:hover { background: var(--panel-2); color: var(--ink); }
.bk-more { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.bk-more-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-more-row label { cursor: pointer; }
.bk-file { position: relative; display: inline-flex; align-items: center; gap: 4px; padding-right: 28px; font-size: 12px; color: var(--ink-dim); }
.bk-extras { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-extra { position: relative; width: 96px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.bk-extra img { width: 100%; height: 100%; object-fit: cover; }
.bk-extra .bk-x { background: rgba(0, 0, 0, .55); color: #fff; }
.bk-note { display: block; font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }
.bk-review { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.bk-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-preview canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.bk-preview .bk-note { grid-column: 1 / -1; }
.bk-warn { padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--danger) 8%, transparent); font-size: 12.5px; }
.bk-warn ul { margin: 6px 0 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 3px; color: var(--ink-dim); }
.bk-f { display: flex; flex-direction: column; gap: 6px; }
.bk-f input { max-width: 420px; }
.bk-sec { display: flex; flex-direction: column; gap: 8px; }
.bk-colors { display: flex; flex-direction: column; gap: 6px; }
.bk-color { position: relative; display: grid; grid-template-columns: 34px 92px minmax(120px, 1fr) 120px minmax(150px, 1.2fr); gap: 8px; align-items: center; padding: 6px 34px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.bk-color.off { opacity: .6; }
.bk-color .bk-x { top: 50%; transform: translateY(-50%); }
.bk-sw-in { position: relative; display: block; width: 30px; height: 30px; cursor: pointer; }
.bk-sw-in .bk-sw { width: 30px; height: 30px; border-radius: 8px; }
.bk-sw-in input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bk-hex { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; }
.bk-from { font-size: 11px; color: var(--ink-faint); }
.bk-left summary { cursor: pointer; font-size: 12px; color: var(--ink-faint); margin: 2px 0 6px; }
.bk-read { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-dim); }
.bk-read b { color: var(--ink); }
.bk-read.small { font-size: 12px; }
.bk-sure { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.bk-sure.high { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok-ink, var(--ok)); }
.bk-sure.medium { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink); }
.bk-sure.low { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger-ink, var(--danger)); }
.bk-fonts, .bk-theme { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.bk-fonts label, .bk-set { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--ink-faint); }
.bk-fonts select { min-width: 150px; }
.bk-set select { min-width: 190px; }
.bk-seg .seg { white-space: nowrap; }
/* The client's website (docs/brand-site.md): its address, then what its reading found, to keep or drop */
.bk-site { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.bk-site-row { display: flex; gap: 8px; align-items: center; }
.bk-site-row input { flex: 1; min-width: 0; font-family: var(--mono); }
.bk-site-row .mini-btn { flex-shrink: 0; white-space: nowrap; }
.bk-found { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.bk-found-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.bk-found-head b { font-size: 13px; }
.bk-found-head small { font-size: 11.5px; color: var(--ink-faint); }
.bk-found-head .mini-btn { margin-inline-start: auto; padding: 3px 9px; font-size: 11.5px; }
.bk-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.bk-cand { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--ink); text-align: start; font: inherit; cursor: pointer; }
.bk-cand:hover { border-color: var(--accent); }
.bk-cand.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bk-cand.on .bk-logo-t b { color: var(--accent-ink); }
.bk-cand.off { opacity: .65; cursor: default; }
.bk-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-check { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.bk-check input { margin: 0; accent-color: var(--accent); }
.bk-check span { display: flex; flex-direction: column; min-width: 0; }
.bk-check b { font-size: 12.5px; }
.bk-check small { font-size: 11px; color: var(--ink-faint); }
.bk-check.sw b { font-family: var(--mono); font-size: 11.5px; }
.bk-words { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-dim); }
.bk-vibe textarea { width: 100%; max-width: 640px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.5; resize: vertical; outline: none; }
.bk-vibe textarea:focus { border-color: var(--accent); }
@media (max-width: 760px) {
  .bk-preview { grid-template-columns: 1fr; }
  .bk-color { grid-template-columns: 34px 1fr 1fr; }
  .bk-color .bk-from { grid-column: 1 / -1; }
  .bk-site-row { flex-direction: column; align-items: stretch; }
}
/* What we hear: the words spoken, read aloud or voiced over in a frame — under its title, everywhere */
.sbd-hear { margin: 2px 0 10px; padding: 8px 12px; border-inline-start: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.sbd-hear .field-label { display: block; margin-bottom: 3px; color: var(--accent-ink); }
.sbd-hear p { font-size: 14px; line-height: 1.55; font-style: italic; color: var(--ink); white-space: pre-wrap; }
.sbd-frame-hear { margin: 2px 0 4px; padding-inline-start: 9px; border-inline-start: 2px solid var(--accent); font-size: 12.5px; line-height: 1.45; font-style: italic; color: var(--ink); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* the story line: what happens in the frame and where the story is — the line under the title in the exports */
.sbd-story { margin: 2px 0 8px; padding: 8px 12px; border-inline-start: 3px solid var(--violet); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--violet) 7%, transparent); }
.sbd-story .field-label { display: block; margin-bottom: 3px; color: var(--violet-ink); }
.sbd-story p { font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }
.sbd-frame-story { margin: 2px 0 4px; font-size: 13px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* the enlarged view's head: the frame's title, what we see, what we hear — over the picture */
.lightbox-head { flex: none; display: none; flex-direction: column; align-items: center; gap: 4px; max-width: min(1100px, calc(100vw - 200px)); text-align: center; }
.lightbox.has-head .lightbox-head { display: flex; }
.lightbox-head b { font-size: 21px; color: var(--ink); }
.lightbox-head p { font-size: 14px; line-height: 1.5; color: var(--ink-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lightbox-head p span { margin-inline-end: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
/* a Hebrew board's labels (הסיפור, מה שומעים, מה רואים; storyboard.js textLabels): Hebrew has no capitals
   for the spacing an English label's get, so they're set close, a size up, in the text's own face */
.lightbox-head p span:dir(rtl), .sbd-story .field-label:dir(rtl), .sbd-hear .field-label:dir(rtl), .sbd-wws .field-label:dir(rtl) { font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0; }
.lightbox.has-head img { height: calc(100vh - 270px); }
.lightbox.has-head.has-acts img { height: calc(100vh - 330px); }
.lightbox.has-head .lightbox-caption { display: none; }
/* the model the board draws on, while it's fixed (MODEL_CHOICE off in storyboard.js): said, not picked */
.sbd-engine.fixed { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-dim); font-size: 12px; }

/* ── Media: the client's files, in folders (media.js) ─────────────────────────────────────────── */
.media-panel { flex: 1; padding: 24px 30px; overflow-y: auto; }
.media-panel.drag { outline: 2px dashed var(--accent); outline-offset: -8px; border-radius: 12px; }
.md-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.md-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.md-crumbs button { border: 0; background: none; padding: 4px 6px; border-radius: 6px; color: var(--ink-dim); font: inherit; font-size: 14px; cursor: pointer; }
.md-crumbs button:hover { background: var(--panel); color: var(--ink); }
.md-crumbs button[aria-current] { color: var(--ink); font-weight: 700; }
.md-sep { color: var(--ink-faint); }
.md-hint { font-size: 12px; color: var(--ink-faint); }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.md-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.md-card b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-card small { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
/* folders: a compact row of their own, above the files */
.md-folders { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 18px; }
.md-folder { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; padding: 11px 44px 11px 14px; }
.md-fname { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.md-card .md-fname b { text-align: left; }
.md-folder .md-more { top: 50%; transform: translateY(-50%); }
.md-folder .md-menu { top: calc(100% + 4px); }
.md-folder:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.md-icon { font-size: 26px; line-height: 1; }
.md-icon.big { font-size: 40px; }
.md-pic { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--bg-2); cursor: pointer; margin-bottom: 4px; }
.md-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* a client's video, playing in a window of its own (media.js playVideo): under any window it opens, as
   a clip's popup is (Save to Assets, from a right-click on a frame) */
.md-video-overlay { z-index: 190; }
.modal-card.md-video-card { display: flex; flex-direction: column; gap: 12px; width: auto; min-width: min(420px, 100%); max-width: min(1200px, 100%); max-height: calc(100vh - 40px); }
.md-video-card .modal-head { gap: 12px; }
.md-video-card .modal-head h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.md-video-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.md-video-acts a.mini-btn { display: inline-flex; align-items: center; text-decoration: none; }
.md-video-card video { display: block; max-width: 100%; max-height: calc(100vh - 190px); margin: 0 auto; border-radius: 10px; background: #000; }
.md-video-tip { margin: 0; font-size: 12px; color: var(--ink-faint); text-align: center; }
.md-more { position: absolute; top: 8px; right: 8px; width: 28px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: rgba(12,11,16,.75); color: var(--ink); cursor: pointer; font-size: 14px; line-height: 1; }
.md-file .md-more { top: 14px; right: 14px; }
.md-more:hover { border-color: var(--accent); color: var(--accent-ink); }
.md-menu { position: absolute; top: 40px; right: 8px; z-index: 20; display: flex; flex-direction: column; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); box-shadow: var(--shadow); }
.md-menu button, .md-menu .md-dl { display: block; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer; }
.md-menu button:hover, .md-menu .md-dl:hover { background: var(--panel); }
.md-menu .danger { color: var(--danger-ink); }
.md-move { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12px; color: var(--ink-dim); }
.md-move select { flex: 1; min-width: 0; padding: 4px 6px; border-radius: 6px; font-size: 12px; }
.md-name-in { width: 100%; padding: 6px 8px; border: 1px solid var(--accent); border-radius: 7px; background: var(--bg-2); color: var(--ink); font: inherit; font-size: 13px; }
.md-empty { padding: 60px 20px; text-align: center; color: var(--ink-faint); font-size: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.md-jobs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.md-jobs-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.md-jobs-head span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-dim); font-size: 12px; }
.md-bar-track { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.md-bar-track span { display: block; height: 100%; background: var(--accent); transition: width .2s ease; }
.md-fails { margin: 0; padding-left: 18px; font-size: 12px; color: #ffd9d5; }
/* the Storyboard's asset picker: the client's images under the project's assets */
.sbd-picker-sub { font-size: 11.5px; color: var(--ink-faint); }

/* ── Light mode ────────────────────────────────────────── */
/* the switch in the top bar (theme.js): a sun on the dark page, a moon on the light one */
.tb-theme {
  flex-shrink: 0; width: 32px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink-faint); cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}
.tb-theme:hover { color: var(--accent-ink); border-color: var(--accent); }
.tb-theme svg { width: 15px; height: 15px; display: block; }
.tb-theme .moon, :root[data-theme="light"] .tb-theme .sun { display: none; }
:root[data-theme="light"] .tb-theme .moon { display: block; }
.tb-theme-name { display: none; }   /* (Cinema says "Theme" in words) */
.tb-scenes, .tb-tools-btn { display: none; }   /* (Cinema's buttons for a narrow window: the sidebar as a drawer, the project's views as a menu) */
/* the Theme menu (theme.js): Cinema, Dark, Light — the one in use ticked */
.theme-pop { position: fixed; z-index: 270; width: 270px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: var(--shadow); }
.theme-pop button { width: 100%; display: grid; grid-template-columns: 1fr 18px; gap: 1px 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-family: var(--body); text-align: left; cursor: pointer; }
.theme-pop button:hover, .theme-pop button:focus-visible { background: var(--panel); outline: none; }
.theme-pop button:focus-visible { box-shadow: inset 0 0 0 2px var(--violet); }
.theme-pop b { font-size: 14px; }
.theme-pop span { grid-column: 1; font-size: 12px; line-height: 1.4; color: var(--ink-dim); }
.theme-pop [aria-checked="true"]::after { content: "✓"; grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent-ink); font-weight: 700; }

/* What the tokens alone don't carry. The parts that stay dark take their own text color, not the
   page's (a color is inherited already worked out). */
:root[data-theme="light"] :is(.lightbox, .sbd-screen, .sc-card) { color: var(--ink); }
/* text that was light on the dark page */
:root[data-theme="light"] .bubble pre { color: var(--ink); }
:root[data-theme="light"] :is(.sbd-stale, .sbd-stale-tag) { color: var(--accent-2-ink); }
:root[data-theme="light"] :is(.toast.err, .sbd-stale.err, .md-fails) { color: var(--danger-ink); }
/* Google's button, white as Google draws it on a light page */
:root[data-theme="light"] .auth-google { background: #fff; color: #1f1f1f; border-color: var(--line); }
/* lines, shadows and scrims drawn for the dark page */
:root[data-theme="light"] #app.sb-peek .sidebar { box-shadow: 18px 0 40px -16px rgba(40, 30, 10, .18); }
:root[data-theme="light"] .modal-overlay { background: rgba(30, 25, 15, .38); }
:root[data-theme="light"] .modal-card { box-shadow: 0 20px 60px rgba(40, 30, 10, .22); }
:root[data-theme="light"] :is(.exp-card.exp-hero, .crm-stat.is-due) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
:root[data-theme="light"] .swap-nokey { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
:root[data-theme="light"] .exp-table td { border-bottom-color: var(--line-soft); }
:root[data-theme="light"] .exp-table tbody tr:hover { background: rgba(0, 0, 0, .025); }
:root[data-theme="light"] .spinner-lg { border-color: rgba(0, 0, 0, .1); border-top-color: var(--accent); }
:root[data-theme="light"] .sbd .spinner { border-color: rgba(0, 0, 0, .12); border-top-color: var(--accent); }
/* hues picked for the dark page: the CRM's call and proposal stages, Create Video's opening frame */
:root[data-theme="light"] .st-call { --st: #2f6fd0; }
:root[data-theme="light"] .st-proposal { --st: #c4621f; }
:root[data-theme="light"] [data-kind="opening"] { --sd-c: #2f6fd0; }
:root[data-theme="light"] .crm-fields input[type="date"] { color-scheme: light; }
/* steps not open yet: still dimmed, but their names readable on white */
:root[data-theme="light"] .sbd-step:disabled { opacity: .62; }
:root[data-theme="light"] button.nbs-step:disabled { opacity: .7; }
/* small buttons that sat on dark glass */
:root[data-theme="light"] .rb-add { background: var(--panel); }
:root[data-theme="light"] .md-more { color: #f4f1ea; border-color: rgba(255, 255, 255, .22); }
/* the bars around a reference sheet */
:root[data-theme="light"] .char-ref { background: #e9e6df; }
/* ── Trust & safety (safety.js): the terms, a person's confirmation, Admin → Safety ── */
.terms-card { max-width: 560px; }
.terms-he { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.6; color: var(--ink-dim); }
/* the box and the button stay in view while the text above them scrolls */
.terms-foot { position: sticky; bottom: -22px; margin: 0 -22px -22px; padding: 12px 22px 22px; border-top: 1px solid var(--line); background: var(--panel); }
.terms-points { margin: 0 0 14px 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; line-height: 1.5; color: var(--ink-dim); }
.terms-link { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--accent); }
.terms-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; font-size: 13px; line-height: 1.5; color: var(--ink); cursor: pointer; }
.terms-check input { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }
.terms-err { margin-bottom: 10px; font-size: 12.5px; color: var(--danger); }
/* their own details, for the studio to verify (identityWindow) */
.id-card { max-width: 560px; }
.id-card .terms-check { margin-top: 16px; }
.id-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .id-row { grid-template-columns: 1fr; } }
/* the client agreement, signed on the owner's first sign-in (agreement.js): the document as paper */
.agr-card { max-width: 820px; }
.agr-steps { display: flex; gap: 14px; margin: 6px 0 4px; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-faint); }
.agr-steps li.on { color: var(--accent-ink); font-weight: 700; }
.agr-steps li.done { color: var(--ink-dim); }
.agr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.agr-paper { margin: 6px 0 14px; padding: 20px 22px; max-height: 56vh; overflow-y: auto; background: #fff; color: #0A0A0B; border-radius: 10px; border: 1px solid var(--line); }
.agr-prices { max-height: 40vh; }
.agr-card .terms-check { margin: 6px 0 8px; }
.agr-card .field-label { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
/* one screen: the details, what they agree to, the price list, the signature */
.agr-one { max-width: 880px; }
.agr-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.agr-sec h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.agr-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #1a1206; font-size: 13px; font-weight: 800; }
.agr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.agr-grid .np-field { margin-top: 8px; }
.agr-grid input[readonly] { opacity: .75; }
.agr-one .agr-paper { max-height: none; margin: 0; }
.agr-full { margin-top: 10px; }
.agr-full > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); padding: 6px 0; }
.agr-full .agr-paper { margin-top: 6px; max-height: 60vh; overflow-y: auto; }
.agr-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.agr-paper .agr-hint { color: #6E6D68; }
/* folded: the short version's first two topics, each price group's first two lines; Read more unfolds them */
.agr-fold:not(.open) [data-part="summary"] tr:nth-child(n+4), .agr-fold:not(.open) [data-part="summary"] > p { display: none; }
.agr-fold:not(.open) .agr-full { display: none; }
.agr-fold:not(.open) [data-part="prices"] .pt + .pt, .agr-fold:not(.open) [data-part="prices"] .pt tr:nth-child(n+3), .agr-fold:not(.open) [data-part="prices"] > p:last-child { display: none; }
.agr-fold:not(.open) .agr-paper { position: relative; }
.agr-fold:not(.open) .agr-paper::after { content: ""; position: absolute; inset: auto 0 0; height: 34px; border-radius: 0 0 10px 10px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; }
.agr-more { margin-top: 6px; padding: 4px 0; background: none; border: 0; font: 600 13.5px var(--body); color: var(--accent-ink); cursor: pointer; }
.agr-more::after { content: " ▾"; }
.agr-more[aria-expanded="true"]::after { content: " ▴"; }
.agr-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 640px) { .agr-grid { grid-template-columns: 1fr; } }
.agr-card .modal-btn { font-family: var(--body); }
.agr-frame { width: 100%; height: 66vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.acc-agr .mini-btn { margin-inline-start: 8px; }
@media (max-width: 640px) { .agr-row { grid-template-columns: 1fr; } .agr-paper { padding: 14px; } }
.consent-card { max-width: 640px; }
.consent-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.consent-img { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.consent-img.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.consent-img select { width: 100%; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12px; }
.consent-img img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.consent-img span { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); text-align: center; }
.consent-note { margin-bottom: 14px; padding: 9px 11px; border: 1px dashed var(--line); border-radius: 9px; font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.consent-img.settled { cursor: default; opacity: .85; }
.consent-st { font-size: 11px; line-height: 1.35; font-weight: 600; text-align: center; }
.consent-st.ok { color: var(--teal-ink); }
.consent-st.bad { color: var(--danger-ink); }
.consent-all { display: block; width: 100%; margin: 4px 0 6px; padding: 12px 18px; font-size: 14px; }
.consent-fine { margin: 0 0 12px; font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); }
.consent-project { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; }
.consent-video { display: block; width: 100%; max-height: 280px; margin-bottom: 14px; border-radius: 10px; background: #000; }
.consent-blocked { margin: 0 0 12px; font-size: 12.5px; color: var(--danger-ink); }
/* Real people (people.js): the 👤 window, and the badge on an asset's card */
.rp-card { max-width: 600px; max-height: calc(100vh - 40px); overflow-y: auto; }
.rp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-card input[type=date], .rp-card select { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; }
.rp-routes { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.rp-route { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-dim); cursor: pointer; }
.rp-route:has(input:checked) { border-color: var(--accent); color: var(--ink); }
.rp-route input { margin-top: 3px; accent-color: var(--accent); }
.rp-route.off { opacity: .55; cursor: default; }
.rp-step { margin-bottom: 10px; }
.rp-howto { margin: 0 0 12px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.rp-howto a, .rp-record a { color: var(--accent); }
.rp-note { margin: 0 0 10px; font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.rp-state { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; border: 1px solid var(--line); }
.rp-state.ok { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); background: color-mix(in srgb, var(--teal) 7%, transparent); color: var(--ink); }
.rp-state.wait { color: var(--ink-dim); }
.rp-state.bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger-ink); }
.rp-state code { font-family: var(--mono); font-size: 11.5px; }
.rp-link { margin: 0 0 14px; }
.rp-link-row { display: flex; gap: 8px; margin: 6px 0; }
.rp-link-row input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--accent); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 11.5px; }
.rp-record { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 13px; }
.rp-record dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); padding-top: 2px; }
.rp-record dd { margin: 0; color: var(--ink-dim); word-break: break-word; }
.rp-acts { flex-wrap: wrap; gap: 8px; }
.rp-acts-r { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.rp-badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: 2px 0; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; line-height: 1.5; color: var(--ink-dim); }
.rp-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-badge.ok { border-color: color-mix(in srgb, var(--teal) 50%, transparent); color: var(--teal-ink); }
.rp-badge.bad { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger-ink); }
.char-person.on { color: var(--teal-ink); border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }
@media (max-width: 560px) { .rp-dates { grid-template-columns: 1fr; } .rp-record { grid-template-columns: 1fr; } }
.sf-sec { margin: 0 0 28px; }
.sf-sec h2 { margin-bottom: 10px; font-family: var(--display); font-weight: 500; font-size: 19px; }
.sf-sec h2 small { margin-left: 8px; font-family: var(--body); font-size: 12px; color: var(--ink-faint); }
.sf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sf-table th { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.sf-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-dim); vertical-align: top; }
.sf-table a { color: var(--accent); }
.sf-det { max-width: 420px; word-break: break-word; }
.sf-tag { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.sf-bad { color: var(--danger); }
.sf-empty { font-size: 13px; color: var(--ink-faint); }
.sf-table small { color: var(--ink-faint); }
.sf-acts { white-space: nowrap; }
.sf-acts .mini-btn + .mini-btn { margin-left: 6px; }
#verifyModal select { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; }
.sf-filter { width: 280px; margin-bottom: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 12.5px; outline: none; }
.sf-filter:focus { border-color: var(--accent); }
#safetyView a { color: var(--accent); }

/* ── Spaces (spaces.js): home, MY PROJECTS, STORYBOARD, ASSETS ─────────────────────────────── */
/* each space shows its own parts of the shell (the address sets the class before the first paint) */
#app:not(.space-projects) .proj-only { display: none !important; }
#app:not(.space-storyboards) .sbs-only { display: none !important; }
#app:not(.space-assets) .assets-only { display: none !important; }
#app:not(.space-describe) .dsc-only { display: none !important; }
#app:not(.space-films) .fls-only { display: none !important; }
#app:not(.space-casting) .cst-only { display: none !important; }
#app.no-films .films-only { display: none !important; }   /* SCRIPT TO FOOTAGE: Yossi's and Liran's alone for now */
#app:is(.space-home, .space-assets, .space-describe, .space-films, .space-casting) .tb-share, #app.space-storyboards.sb-home-open .tb-share { display: none; }   /* (a board from before: shared with its project, from MY PROJECTS) */
/* home: no sidebar — the three cubes take the page, and the wordmark shows however the sidebar was left */
#app.space-home { grid-template-columns: minmax(0, 1fr); }
#app.space-home .sidebar, #app.space-home .sb-toggle { display: none; }
#app.space-home .tb-brand { width: auto; padding: 0 22px 0 20px; justify-content: flex-start; border-right: 0; }
#app.space-home .tb-logo { display: inline-flex; }
#app.space-home .tb-theme { margin-left: auto; }   /* (no crumbs there to push the controls right) */
/* the Storyboard space: no scene head, no tools — the board's own controls at the row's end */
#app.space-storyboards :is(.scene-head, .ws-tabs) { display: none; }
#app.space-storyboards .ws-header { padding-top: 6px; }
#app.space-storyboards .ws-toolrow { justify-content: flex-end; margin-top: 0; min-height: 40px; }
#app.space-storyboards #gemTuneBtn { display: none; }   /* (its Single panels: the Style lives with a project) */
/* ASSETS: the shelf is the space itself — no way "back to" a tool */
#app.space-assets .pv-backbar { display: none; }

/* the spaces, at the top of the sidebar: icon-sized buttons (names on hover); folded, the open one's icon (the rest open with it) */
.space-nav { flex: 0 0 auto; align-self: flex-start; display: flex; gap: 2px; margin: 10px 12px 0; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.spn { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-faint); text-decoration: none; transition: color .12s ease, background .12s ease; }
.spn svg { width: 17px; height: 17px; }
.spn .sb-label { display: none; }
.spn:hover { color: var(--ink); background: var(--panel); }
.spn.active { color: var(--accent-ink); background: var(--panel-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent); }
.spn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sb-collapsed:not(.sb-peek) .space-nav { align-self: center; margin: 10px 0 0; }
.sb-collapsed:not(.sb-peek) .spn:not(.active) { display: none; }

/* ── Home: the three cubes (home.js) ───────────────────────────────────────── */
.space-view { flex: 1; min-height: 0; overflow-y: auto; }
.home-cinema { display: none; }   /* (Cinema's home: the hero and the four cards, in the Cinema block) */
.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 44px; padding: 40px 28px 64px;
  background: radial-gradient(60% 50% at 50% 36%, var(--glow-a), transparent 70%), radial-gradient(40% 40% at 82% 92%, var(--glow-b), transparent 70%); }
.home-hello { text-align: center; display: grid; gap: 8px; }
.home-hello small { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .28em; color: var(--ink-faint); }
.home-hello h1 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.02em; text-wrap: balance; }
.home-cubes { width: min(1320px, 100%); display: grid; grid-template-columns: 1fr 1.15fr 1fr 1fr; gap: clamp(16px, 2.4vw, 34px); align-items: center; }
.cube {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(18px, 2vw, 28px);
  border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(160deg, var(--panel-2), var(--panel)); color: var(--ink); text-decoration: none;
  box-shadow: 0 10px 0 -1px color-mix(in srgb, var(--line) 55%, var(--bg)), 0 10px 0 0 var(--line), 0 36px 54px -32px var(--drop);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cube:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cube:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.cube.main { border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 10px 0 -1px color-mix(in srgb, var(--accent) 22%, var(--bg)), 0 10px 0 0 color-mix(in srgb, var(--accent) 50%, var(--line)), 0 40px 60px -32px color-mix(in srgb, var(--accent) 30%, transparent); }
.cube-t { position: relative; display: flex; flex-direction: column; gap: 6px; }
.cube-t b { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 1.9vw, 27px); letter-spacing: .07em; line-height: 1; }
.cube.main .cube-t b { color: var(--accent-ink); font-size: clamp(22px, 2.2vw, 32px); }
.cube-t span { color: var(--ink-dim); font-size: 13.5px; line-height: 1.4; }
.cube-t em { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cube-art { position: absolute; inset: clamp(18px, 2vw, 26px) clamp(18px, 2vw, 26px) auto; height: 46%; pointer-events: none; }
/* MY PROJECTS: its latest projects, a stack of cards */
.art-proj .ap-card { position: absolute; inset-inline: 7%; height: 30%; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); font-size: 13px; font-weight: 700; overflow: hidden; }
.art-proj .ap-card i { flex-shrink: 0; width: 26px; height: 17px; border-radius: 4px; background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 55%, var(--bg)), color-mix(in srgb, var(--accent) 55%, var(--bg))); }
.art-proj .ap-card b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-proj .ap-card:nth-child(1) { top: 4%; transform: scale(.84); opacity: .45; }
.art-proj .ap-card:nth-child(2) { top: 27%; transform: scale(.92); opacity: .72; }
.art-proj .ap-card:nth-child(1) b, .art-proj .ap-card:nth-child(2) b { opacity: .7; }
.art-proj .ap-card.front { top: 52%; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
/* STORYBOARD: four panels — its latest stills, or sketches */
.art-sb { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 7px; }
.as-panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2); }
.as-panel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.as-panel.sketch { background: repeating-linear-gradient(-40deg, color-mix(in srgb, var(--ink) 6%, transparent) 0 2px, transparent 2px 8px), var(--bg-2); }
.as-panel em { position: absolute; left: 7px; top: 5px; font-family: var(--mono); font-style: normal; font-size: 10px; color: var(--ink-faint); }
/* ASSETS: a character, a place and a prop */
.art-as { display: flex; align-items: center; justify-content: center; gap: 12%; }
.aa { width: 26%; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-2); color: var(--ink-dim); }
.aa svg { width: 46%; height: 46%; }
.aa-char { width: 32%; border-color: color-mix(in srgb, var(--violet) 55%, var(--line)); color: var(--violet-ink); }
/* DESCRIBE: a picture, and the lines of words it gives back */
.art-dsc { display: flex; align-items: center; justify-content: center; gap: 9%; }
.ad-frame { width: 38%; aspect-ratio: 4 / 3; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--teal) 50%, var(--line)); border-radius: 9px; background: var(--bg-2); color: var(--teal-ink); }
.ad-frame svg { width: 50%; height: 50%; }
.ad-lines { width: 36%; display: grid; gap: 9px; }
.ad-lines i { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.ad-lines i:nth-child(2) { width: 82%; } .ad-lines i:nth-child(3) { width: 92%; } .ad-lines i:nth-child(4) { width: 58%; }
@media (max-width: 1180px) and (min-width: 901px) { .home-cubes { grid-template-columns: 1fr 1fr; width: min(780px, 100%); } }
@media (max-width: 900px) {
  .home-cubes { grid-template-columns: minmax(0, 420px); justify-content: center; }
  .cube, .cube.main { aspect-ratio: auto; min-height: 260px; }
  .cube-art { height: 42%; }
}
@media (prefers-reduced-motion: reduce) { .cube { transition: none; } .cube:hover { transform: none; } }

/* ── The Storyboard space (boards-ui.js) ───────────────────────────────────── */
/* the open storyboard and the projects it's linked to, in the top bar */
.crumb-space { flex-shrink: 0; padding: 4px 6px; color: var(--accent-ink); font-size: 13.5px; font-weight: 700; text-decoration: none; }
a.crumb-space:hover { text-decoration: underline; }
.tb-sblinks { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.sb-chip { flex-shrink: 1; min-width: 0; display: inline-flex; align-items: center; border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line)); border-radius: 99px; background: color-mix(in srgb, var(--teal) 9%, transparent); color: var(--teal-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
/* (in-home, not home: .home is the home space's own page) */
.sb-chip.in-home { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); background: color-mix(in srgb, var(--accent-2) 9%, transparent); color: var(--accent-2-ink); }
.sb-chip > button { min-width: 0; padding: 4px 10px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.sb-chip .sb-chip-x { padding: 4px 9px 4px 2px; opacity: .7; }
.sb-chip .sb-chip-x:hover, .sb-chip .sb-chip-go:hover { opacity: 1; text-decoration: underline; }
button.sb-chip.add { flex-shrink: 0; padding: 4px 11px; border-style: dashed; border-color: var(--line); background: none; color: var(--ink-dim); font-family: var(--body); cursor: pointer; }
button.sb-chip.add:hover { color: var(--teal-ink); border-color: var(--teal); }
button.sb-chip.add.sb-move:hover { color: var(--accent-2-ink); border-color: var(--accent-2); }
/* moving a storyboard into a project: what it brings, and what holds it back */
.mv-card { width: min(520px, calc(100vw - 32px)); }
.mv-card .modal-sub b { color: var(--ink); }
.mv-list { margin: -6px 0 14px; padding-left: 20px; color: var(--ink); font-size: 13.5px; line-height: 1.65; }
.mv-none { margin-top: -6px; }
.mv-note { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--teal) 9%, transparent); color: var(--ink-dim); font-size: 12.5px; line-height: 1.5; }
.mv-held { margin: 0 0 4px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-radius: 10px; color: var(--danger-ink); font-size: 12.5px; line-height: 1.5; }
.mv-held p { margin: 0; }
.mv-held p + p { margin-top: 4px; }
/* a new storyboard for a project: made inside it, or linked to it */
.nb-where { gap: 6px; }
.nb-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.nb-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nb-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.nb-opt span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb-opt b { font-size: 13.5px; }
.nb-opt small { color: var(--ink-faint); font-size: 12px; line-height: 1.4; }
/* the sidebar's list: every storyboard, like a project's scenes */
.bn-tools { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; padding: 0 12px 10px; }
.bn-search { width: 100%; }
.bn-who { display: flex; }
.bn-who .seg { flex: 1; }
.bn-item { cursor: pointer; }
.bn-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bn-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-linked { color: var(--teal-ink); }
.bn-from { color: var(--accent-2-ink); }
.bn-in { color: var(--accent-2-ink); font-weight: 600; }
.bn-free { color: var(--ink-faint); }
.bn-acts { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; opacity: 0; transition: opacity .12s ease; }
.bn-item:hover .bn-acts, .bn-item:focus-within .bn-acts { opacity: 1; }
.bn-acts button { padding: 1px 6px; border: 0; border-radius: 6px; background: var(--panel-2); color: var(--ink-dim); font-size: 11px; cursor: pointer; }
.bn-acts button:hover { color: var(--accent-ink); }
.sb-collapsed:not(.sb-peek) :is(.bn-tools, .bn-acts) { display: none; }
/* a list to pick from (link a storyboard, add an asset to a project) */
.bn-pop { width: 330px; }
.bn-pop-list { max-height: min(420px, calc(100vh - 220px)); overflow-y: auto; }
.bn-pop-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--ink); font-family: var(--body); text-align: left; cursor: pointer; }
.bn-pop-item img { flex-shrink: 0; width: 48px; height: 30px; border-radius: 5px; object-fit: cover; }
.bn-pop-item > span { min-width: 0; display: flex; flex-direction: column; }
.bn-pop-item small { color: var(--ink-faint); font-size: 11.5px; }

/* ── A project's Storyboards (boards-ui.js) ────────────────────────────────── */
.sbv-panel { flex: 1; height: 100%; overflow-y: auto; padding: 24px 30px 60px; }
.sbv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.sbv-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.sbv-card.own { border-style: dashed; }
.sbv-cover { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; aspect-ratio: 16 / 6; padding: 0; border: 0; background: var(--line); cursor: pointer; }
.sbv-cover img, .sbv-cover i { width: 100%; height: 100%; min-height: 0; object-fit: cover; display: block; background: linear-gradient(135deg, var(--panel-2), var(--bg)); }
.sbv-tx { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 12px; }
.sbv-tx b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbv-tx small { color: var(--ink-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.sbv-acts { display: flex; gap: 6px; }
/* a storyboard opened in the project: its head, then the board as in its space */
.sbv-embed { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sbv-embed-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 10px 24px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.sbv-embed-head .pv-back { padding: 7px 13px; font-size: 13px; box-shadow: none; }
.sbv-embed-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.sbv-bar { margin-left: auto; padding-bottom: 0; }
.sbv-board { flex: 1; min-height: 0; display: flex; }

/* ── Every asset (asset-library.js): under the shelf, and a project's linked storyboards' ──── */
.al-wrap, .sbl-wrap:not(:empty) { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.al-head { margin-bottom: 12px; }
.al-head h3 { font-family: var(--display); font-weight: 500; font-size: 22px; }
.al-groups { margin-top: 16px; }
.al-group + .al-group { margin-top: 24px; }
.al-group .lib-group-head h4 { font-size: 14px; font-weight: 700; }
.al-group .lib-group-head .mini-btn { margin-left: auto; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.al-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.al-pic { aspect-ratio: 1; padding: 0; border: 0; background: var(--bg); cursor: zoom-in; }
.al-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.al-tx b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-tx small { color: var(--ink-faint); font-size: 11.5px; }
.al-acts { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.al-act { padding: 0; border: 0; background: none; color: var(--accent-ink); font-family: var(--body); font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.al-act:hover { text-decoration: underline; }
.al-act:disabled { opacity: .5; cursor: default; }
.al-done { margin-top: 4px; color: var(--teal-ink); font-size: 12px; font-weight: 700; }
.al-solo { padding: 24px 30px 60px; }
/* ── DESCRIBE (describe.js, docs/describe.md) ─────────────────────────────────── */
.dsc-item .sn-text b { font-size: 13px; font-weight: 700; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsc-item .sn-text small { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsc-item .sn-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dsc-play { position: absolute; right: 4px; bottom: 3px; font-style: normal; font-size: 9px; color: #fff; text-shadow: 0 0 4px rgba(0, 0, 0, .8); }
.dsc-del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: var(--panel-2); color: var(--ink-faint); font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
.dsc-item:hover .dsc-del, .dsc-del:focus-visible { opacity: 1; }
.dsc-del:hover { color: var(--danger-ink); border-color: var(--danger); }
.dsc-none { padding: 6px 8px; font-size: 12.5px; color: var(--ink-faint); }
.sb-collapsed:not(.sb-peek) :is(.dsc-del, .dsc-none) { display: none; }
.dsc { padding: 28px 32px 60px; }
.dsc-head h2 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -.01em; }
.dsc-sub { margin-top: 6px; color: var(--ink-dim); font-size: 14px; }
.dsc-new { max-width: 760px; margin: 0 auto; display: grid; gap: 22px; }
.dsc-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 230px; padding: 24px; border: 1.5px dashed var(--line); border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 60%, transparent); color: var(--ink-dim); text-align: center; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.dsc-drop:hover, .dsc-drop.over { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 7%, var(--panel)); }
.dsc-drop.busy { cursor: default; }
.dsc-drop b { font-size: 16px; color: var(--ink); }
.dsc-drop small { font-size: 12.5px; color: var(--ink-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsc-drop-ico { font-size: 30px; line-height: 1; color: var(--teal-ink); }
.dsc-ask { display: grid; gap: 8px; }
.dsc-label { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.dsc-ask textarea { width: 100%; resize: vertical; min-height: 74px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13.5px; line-height: 1.5; outline: none; }
.dsc-ask textarea:focus { border-color: var(--accent); }
.dsc-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.dsc-open { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, 1fr); gap: 28px; align-items: start; }
.dsc-media { position: sticky; top: 0; display: grid; gap: 10px; }
.dsc-media :is(img, video) { width: 100%; max-height: calc(100vh - 190px); object-fit: contain; border-radius: 14px; background: #000; display: block; }
.dsc-file { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.dsc-file b { min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsc-file small { flex-shrink: 0; font-size: 12px; color: var(--ink-faint); }
.dsc-side { display: grid; gap: 14px; min-width: 0; }
.dsc-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dsc-go .ft-spin { width: 16px; height: 16px; }
.dsc-results { display: grid; gap: 12px; }
.dsc-res { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.dsc-res-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.dsc-res-ask { flex: 1; min-width: 120px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dsc-res-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.dsc-res-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
/* ✎ Edit: a description changed in words — the box, and an edit's added and taken-out words */
.dsc-res.edited { border-color: color-mix(in srgb, var(--violet) 40%, var(--line)); }
.dsc-edit { display: grid; gap: 8px; margin-bottom: 12px; }
.dsc-edit textarea { width: 100%; resize: vertical; min-height: 56px; padding: 9px 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.5; outline: none; }
.dsc-edit-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--ink-dim); }
.dsc-edit-acts small { font-size: 11px; color: var(--ink-faint); }
.dsc-w-ins { padding: 0 1px; border-radius: 3px; background: color-mix(in srgb, var(--teal) 28%, transparent); color: var(--ink); }
.dsc-w-del { margin-inline-end: .25em; color: var(--ink-faint); text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); }
@media (max-width: 1000px) { .dsc-open { grid-template-columns: minmax(0, 1fr); } .dsc-media { position: static; } }
@media (max-width: 600px) { .dsc { padding: 20px 16px 48px; } }
/* ── Footage → client links (footage.js openLinks, server/client-links.js) ─────── */
.ft-share { display: flex; gap: 6px; }
.ft-selbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: -6px 0 16px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.ft-selbar b { font-size: 13px; }
.ft-selbar-go { margin-left: auto; display: flex; gap: 6px; }
.ft-pick { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; display: none; place-items: center; border: 1.5px solid rgba(255,255,255,.75); border-radius: 8px; background: rgba(12,11,16,.55); cursor: pointer; }
.ft-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ft-pick span { color: #1a1206; font-size: 15px; font-weight: 900; opacity: 0; }
.ft-pick:has(input:checked) { background: var(--accent); border-color: var(--accent); }
.ft-pick:has(input:checked) span { opacity: 1; }
.ft-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#ftGrid.ft-picking .ft-pick { display: grid; }
#ftGrid.ft-picking .ft-card:has(.ft-pick input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.modal-card.ft-links-card { max-width: 560px; }
.ft-lk-new { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ft-lk-f { display: grid; gap: 6px; }
.ft-lk-f span { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.ft-lk-f :is(input, select) { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 14px; outline: none; }
.ft-lk-f :is(input, select):focus { border-color: var(--accent); }
.ft-lk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-dim); }
.ft-lk-made { display: grid; gap: 8px; padding: 14px; border: 1px solid color-mix(in srgb, var(--teal) 50%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--teal) 7%, var(--panel)); }
.ft-lk-made b { color: var(--teal-ink); font-size: 14px; }
.ft-lk-made small { font-size: 12px; color: var(--ink-faint); }
.ft-lk-made a { color: var(--accent-ink); }
.ft-lk-url { display: flex; gap: 8px; }
.ft-lk-url input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 12px; }
.ft-lk-list { display: grid; gap: 6px; margin-top: 14px; }
.ft-lk-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ft-lk-item.off { opacity: .6; }
.ft-lk-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ft-lk-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-lk-t small { font-size: 12px; color: var(--ink-faint); }
/* the picked clips into a link already sent (under a new one's form, or on its own) */
.ft-lk-add { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.ft-lk-add-h { margin-bottom: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
.ft-lk-add .ft-lk-item { background: var(--bg); }
.ft-lk-add .mini-btn:disabled { opacity: .5; cursor: default; }
/* a storyboard's frames or clips, ticked into the link (client-links.js open's items): only the ticked go in */
.modal-card.ft-links-card:has(.ft-lk-pick) { max-width: 760px; }
.ft-lk-pick { display: grid; gap: 8px; margin-bottom: 12px; }
.ft-lk-pick-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-dim); }
.ft-lk-pick-h b { color: var(--ink); }
.ft-lk-pick-tools { display: flex; gap: 6px; }
.ft-lk-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: min(46vh, 430px); overflow-y: auto; padding: 2px; }
.ft-lk-pick-grid.tall { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.ft-lk-pk { min-width: 0; display: grid; gap: 4px; align-content: start; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-faint); font: inherit; text-align: start; cursor: pointer; user-select: none; }
.ft-lk-pk.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }
.ft-lk-pk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ft-lk-pk-img { position: relative; display: block; aspect-ratio: var(--ar, 16 / 9); border-radius: 7px; overflow: hidden; background: var(--panel); }
.ft-lk-pk-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .12s, filter .12s; }
.ft-lk-pk:not(.on) .ft-lk-pk-img img { opacity: .35; filter: grayscale(.7); }
.ft-lk-pk-no { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; opacity: .5; }
.ft-lk-pk-c { position: absolute; top: 5px; inset-inline-end: 5px; width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 6px; background: rgba(0, 0, 0, .35); color: transparent; font-size: 12px; font-weight: 900; }
.ft-lk-pk.on .ft-lk-pk-c { border-color: var(--accent); background: var(--accent); color: #1a1206; }
.ft-lk-pk-t { min-width: 0; font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-lk-pk-t b { margin-inline-end: 2px; font-family: var(--mono); }
/* a clip the client approved through a client link: take it to 1080p */
.ft-approved { padding: 1px 8px; border-radius: 6px; background: color-mix(in srgb, var(--teal) 18%, transparent); color: var(--teal-ink); font-weight: 800; font-size: 11.5px; white-space: nowrap; }
.ft-card:has(.ft-approved) { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }

/* ── ✎ Tweak on an asset (asset-tweak.js) ─────────────────────────────────── */
.char-actions .char-tweak { margin-right: auto; }
.modal-card.at-card { max-width: 1040px; width: min(1040px, calc(100vw - 32px)); }
.at-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.at-left, .at-right { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.at-pic { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.at-pic img { width: 100%; max-height: 52vh; object-fit: contain; display: block; }
.at-cap { font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; }
.at-made { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-faint); }
.at-made img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.at-takes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.at-take { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-faint); cursor: pointer; font-family: var(--body); }
.at-take img { width: 92px; height: 52px; object-fit: cover; border-radius: 7px; display: block; }
.at-take small { font-size: 10.5px; }
.at-take.on { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); }
.at-take:hover { border-color: var(--accent); }
.at-take-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.at-take-acts .mini-btn:disabled { opacity: .45; cursor: default; }
.at-note { margin: 0; font-size: 12px; color: var(--ink-faint); line-height: 1.45; }
.at-field { margin-top: 0; }
.at-field textarea { min-height: 84px; }
.at-refs { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.at-ref { position: relative; width: 118px; display: flex; flex-direction: column; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.at-ref img { width: 100%; height: 64px; object-fit: cover; border-radius: 7px; display: block; }
.at-ref b { font-size: 10.5px; color: var(--ink-faint); font-family: var(--mono); }
.at-ref .char-text { padding: 5px 7px; font-size: 11.5px; border-radius: 7px; }
.at-ref .rm { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 5px; width: 18px; height: 18px; font-size: 11px; cursor: pointer; line-height: 1; }
.at-add { width: 64px; height: auto; min-height: 64px; align-self: stretch; }
.at-ref-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.at-hint { font-size: 11.5px; color: var(--ink-faint); }
.at-pick { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); max-height: 260px; overflow-y: auto; }
.at-right.drag-over { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 10px; }
.at-go { margin-top: 4px; }
#atEngine { display: flex; width: 100%; }
#atEngine .seg { flex: 1 1 0; min-width: 0; padding: 7px 6px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 820px) { .at-body { grid-template-columns: 1fr; } }

/* Create Video's ✂ Edit video: the video it edits (@video1), its card first among the references */
[data-kind="source"] { --sd-c: #ff8a5c; }
.sd-source .sd-card-img { aspect-ratio: 16 / 9; background: #000; }
.sd-source .sd-card-img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.sd-source-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 12px; }
.sd-source-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-source-meta small { font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); }
.sd-source-note { font-size: 11px; line-height: 1.45; color: var(--ink-faint); }
.sd-upload-bar { position: relative; height: 22px; overflow: hidden; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.sd-upload-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--sd-c) 35%, transparent); transition: width .2s; }
.sd-upload-bar span { position: relative; display: block; padding: 0 8px; font-size: 11px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-vgrid { grid-template-columns: repeat(2, 1fr); }
.sd-vpick { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; text-align: left; color: var(--ink); }
.sd-vpick:hover:not([disabled]) { border-color: var(--accent); }
.sd-vpick[disabled] { opacity: .45; cursor: not-allowed; }
.sd-vpick video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; background: #000; pointer-events: none; }
.sd-vpick span { font-size: 11px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-order li[data-kind="source"] .sd-vthumb, .sd-rail-item[data-kind="source"] .sd-vthumb { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 6px; background: #000; font-size: 18px; }
.sd-order li[data-kind="source"] .sd-vthumb { width: 44px; height: 44px; }
.sd-rail-item[data-kind="source"] .sd-vthumb { grid-row: span 2; }
.sd-edit-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sd-edit-chips .field-label { margin: 0 4px 0 0; }
.ft-edit { padding: 1px 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, #ff8a5c 50%, var(--line)); color: #ff8a5c; font-weight: 800; font-size: 11.5px; white-space: nowrap; }

/* Video Edits: its clip in the project (the tray's line), the project's videos to pick it from, and a
   render of its reply in Footage (no chat there: back to Video Edits) */
.clip-chip { flex-basis: 100%; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 12px; line-height: 1.4; color: var(--ink-dim); }
.clip-chip.ok { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); color: var(--ink); }
.clip-chip.up { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.clip-chip.off { color: var(--ink-faint); border-style: dashed; }
.modal-card.clip-pick-card { max-width: 720px; }
.clip-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.clip-pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.clip-pick { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; text-align: left; color: var(--ink); font-family: var(--body); }
.clip-pick:hover:not([disabled]) { border-color: var(--accent); }
.clip-pick[disabled] { opacity: .45; cursor: not-allowed; }
.clip-pick video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; background: #000; pointer-events: none; }
.clip-pick span { font-size: 11.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .clip-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.msg.flash .bubble { animation: msgFlash 1.6s ease-out 1; }
@keyframes msgFlash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.ft-dt-v2v { margin-top: 12px; }

/* Assets → 📂 Unkept edits: ✎ Tweak's takes no one kept, each a card of its own (dashed: not an asset) */
#assetFilter .unkept-seg .pv-count { margin-left: 5px; }
.char-card.take-card { border-style: dashed; }
.take-card .take-of { font-family: var(--body); font-size: 12.5px; color: var(--ink-faint); }
.take-when { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.take-card .char-actions .mini-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ☑ Select → Copy to another project (copy-to.js): while picking, a click on a card picks it — a ring
   on each card, gold with a ✓ once picked — and a bar at the foot copies them; then the projects to pick */
.copy-picking :is(#libGrid .img-card, #charsGallery .char-card:not(.take-card), .md-file.md-pick) { position: relative; cursor: pointer; }
.copy-picking :is(#libGrid .img-card, #charsGallery .char-card:not(.take-card), .md-file.md-pick) * { cursor: pointer !important; }
.copy-picking #libGrid .img-card:hover { transform: none; }
.copy-picking :is(#libGrid .img-card, #charsGallery .char-card:not(.take-card), .md-file.md-pick)::before {
  content: ''; position: absolute; top: 9px; left: 9px; z-index: 4; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92); background: rgba(0,0,0,.38); box-shadow: 0 1px 5px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; color: #1b1407; font-size: 13px; font-weight: 800; line-height: 1;
}
.copy-picking :is(#libGrid .img-card, #charsGallery .char-card:not(.take-card), .md-file.md-pick).copy-picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.copy-picking :is(#libGrid .img-card, #charsGallery .char-card:not(.take-card), .md-file.md-pick).copy-picked::before { content: '✓'; background: var(--accent); border-color: var(--accent); }
/* ☑ Select in Cast and Locations: an option, or a place's angle, picked by a click (copy-to.js, kind 'cast') */
.copy-picking :is(.cs-opt[data-id], .cs-ang[data-id]) { position: relative; cursor: pointer; }
.copy-picking :is(.cs-opt[data-id], .cs-ang[data-id]) * { cursor: pointer !important; }
.copy-picking .cs-opt[data-id] .cs-acts { opacity: .4; pointer-events: none; }
.copy-picking :is(.cs-opt[data-id], .cs-ang[data-id])::before {
  content: ''; position: absolute; top: 8px; left: 8px; z-index: 4; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92); background: rgba(0,0,0,.38); box-shadow: 0 1px 5px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; color: #1b1407; font-size: 13px; font-weight: 800; line-height: 1;
}
.copy-picking .cs-ang[data-id]::before { top: 3px; left: 3px; width: 16px; height: 16px; font-size: 10px; }
.copy-picking :is(.cs-opt[data-id], .cs-ang[data-id]).copy-picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.copy-picking :is(.cs-opt[data-id], .cs-ang[data-id]).copy-picked::before { content: '✓'; background: var(--accent); border-color: var(--accent); }
/* Client Files (media.js): its images are picked; a video, a PDF or a HEIC stays a file, faded */
.copy-picking .md-file.md-pick .md-more { opacity: .35; }
.copy-picking .md-file:not(.md-pick) { opacity: .45; }
.copy-picking .md-file:not(.md-pick) * { cursor: not-allowed !important; }
.copy-picking #charsGallery .char-card:not(.take-card).copy-locked { opacity: .5; cursor: not-allowed; }   /* a real person (👤): stays in its project */
.copy-picking #charsGallery .char-card:not(.take-card).copy-locked * { cursor: not-allowed !important; }
.copy-picking #charsGallery .char-card:not(.take-card).copy-locked::before { content: '👤'; font-size: 11px; border-style: dashed; background: rgba(0,0,0,.6); }
.copy-picking #libGrid .img-card .approved-badge { left: 40px; }
.copy-picking #libGrid .img-card:not(.favorited) .fav-badge { display: none; }
.copy-sel-btn.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.copy-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 150; max-width: calc(100vw - 32px);
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px 10px 18px;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 14px 40px -10px var(--drop);
}
.copy-bar-n { margin-right: 6px; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
body:has(#copyBar) .toast { bottom: 86px; }   /* (over the bar, not on it) */
.copy-bar .copy-go:not([disabled]) { border-color: var(--accent); color: var(--accent-ink); }
.copy-bar .copy-go:not([disabled]):hover { background: var(--accent); color: #1b1407; }
/* The asset sheets a batch is drawing (bulk-sheets.js): a bar at the foot, on the right, over the
   picking bar when that one shows too */
.sheets-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 150; width: min(460px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px 16px;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 14px 40px -10px var(--drop);
}
.sheets-bar-top { display: flex; align-items: center; gap: 8px; }
.sheets-bar-top > button { flex: none; }
.sheets-bar-n { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.35; font-weight: 700; color: var(--ink); }
.sheets-bar-track { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sheets-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.sheets-bar-sub { font-size: 12px; line-height: 1.45; color: var(--ink-dim); }
.sheets-bar-sub.bad { color: var(--danger-ink); }
.sheets-bar .copy-go:not([disabled]) { border-color: var(--accent); color: var(--accent-ink); }
.sheets-bar .copy-go:not([disabled]):hover { background: var(--accent); color: #1b1407; }
body:has(#copyBar) .sheets-bar { bottom: 86px; }
@media (max-width: 1100px) { body:has(#sheetsBar) .toast { bottom: 128px; } }
@media (max-width: 720px) { .sheets-bar { left: 16px; right: 16px; width: auto; } }
/* a sheet on its way, in Assets: its name under the shimmer */
.sheet-skel .char-meta { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.sheet-skel small { font-size: 12px; color: var(--ink-dim); }
.modal-card.copy-to-card { max-width: 520px; }
.copy-to-q { width: 100%; margin-bottom: 10px; }
.copy-to-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.copy-to-list.busy { opacity: .55; pointer-events: none; }
.copy-to-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; cursor: pointer;
}
.copy-to-row:hover:not([disabled]) { border-color: var(--accent); }
.copy-to-name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-to-client { flex-shrink: 0; color: var(--ink-faint); font-size: 12px; white-space: nowrap; }

/* ── 📝 Texts: a project's saved words (texts.js) ─────────────────────────────── */
.texts-view { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.texts-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.texts-sub { flex: 1; min-width: 220px; color: var(--ink-faint); font-size: 12.5px; line-height: 1.5; }
.texts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; align-items: start; }
.text-card { min-width: 0; display: flex; flex-direction: column; gap: 9px; padding: 13px 15px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.text-card-head { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.text-card-name { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.text-card-from { font-size: 11.5px; color: var(--ink-faint); overflow-wrap: anywhere; }
.text-card-body { max-height: calc(1.55em * 8); overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; color: var(--ink-dim); }
.text-card.open .text-card-body { max-height: none; }
.text-card-more { align-self: flex-start; padding: 0; background: none; border: none; color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.text-card-more[hidden] { display: none; }
.text-ed-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.text-ed-count { font-size: 11.5px; color: var(--ink-faint); }
.text-card.text-editing { border-color: var(--accent); }
.texts-view > .text-editing { max-width: 760px; }
.text-ed-body { min-height: 180px; }
/* 📝 by a prompt box: the texts to pick from */
.text-pop { position: fixed; z-index: 260; width: min(380px, calc(100vw - 16px)); max-height: min(440px, 70vh); display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.text-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.text-pop-head b { font-size: 13.5px; color: var(--ink); }
.text-pop-head small { font-size: 11.5px; color: var(--ink-faint); }
.text-pop-q { width: 100%; }
.text-pop-list { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.text-pop-row { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; text-align: start; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); }
.text-pop-row:hover, .text-pop-row:focus-visible { border-color: var(--accent); }
.text-pop-row b { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.text-pop-row small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.45; color: var(--ink-dim); }
.text-pop-none { margin: 4px 2px; font-size: 12.5px; line-height: 1.5; color: var(--ink-faint); }
.text-pop-all { align-self: flex-start; }
.text-pick-mini { margin-inline-start: 8px; padding: 2px 8px; font-family: var(--body); font-size: 11.5px; letter-spacing: 0; text-transform: none; vertical-align: middle; }
.sd-text-btn { flex-shrink: 0; }
/* Describe's 📝 Save as text window */
.save-text-name { margin: 6px 0 14px; }
.save-text-to { margin-bottom: 6px; }
.save-text-last { color: var(--accent-ink); font-weight: 600; font-size: 11.5px; }

/* ── 💬 GPT brief: Create Video's ✨ Creative brief built with GPT (scene-brief.js) ───────────────
   The popup has three columns: the image to read, the conversation, and the whole brief with its
   actions. */
.sd-gpt-btn { flex-shrink: 0; }
.sb-overlay { z-index: 190; }   /* under any window it opens (the lightbox, a confirm) */
.sb-pop { display: flex; flex-direction: column; width: min(1360px, 100%); height: min(860px, calc(100vh - 40px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 70px rgba(0,0,0,.5); outline: none; }
.sb-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sb-title { font-family: var(--display); font-size: 18px; font-weight: 600; white-space: nowrap; }
.sb-sub { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-set { font-family: var(--mono); font-size: 11.5px; color: var(--accent-ink); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.sb-x { background: none; border: 0; color: var(--ink-dim); font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.sb-x:hover { color: var(--ink); background: var(--panel-2); }
.sb-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) minmax(0, 1.15fr); }
.sb-ref, .sb-chat, .sb-brief { min-height: 0; display: flex; flex-direction: column; }
.sb-ref { gap: 10px; padding: 14px; border-inline-end: 1px solid var(--line); overflow-y: auto; }
.sb-ref-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.sb-ref-img { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.sb-ref-img img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.sb-ref-img.empty { border-style: dashed; padding: 18px; text-align: center; }
.sb-ref-img.empty p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-faint); }
.sb-ref-role { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-dim); }
.sb-ref-new { margin: 0; font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.sb-ref-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-upload { cursor: pointer; }
.sb-ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 6px; }
.sb-ref-cand { padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--bg-2); cursor: pointer; overflow: hidden; aspect-ratio: 1; }
.sb-ref-cand img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-ref-cand:hover { border-color: var(--line); }
.sb-ref-cand.on { border-color: var(--accent); }
.sb-chat { border-inline-end: 1px solid var(--line); }
.sb-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sb-turn { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--line); }
.sb-turn p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sb-me { align-self: flex-end; background: var(--panel-2); }
.sb-gpt { align-self: flex-start; background: var(--bg-2); }
.sb-live p:empty::before { content: '…'; color: var(--ink-faint); }
.sb-turn-img { display: block; max-width: 140px; max-height: 110px; border-radius: 8px; margin-bottom: 6px; object-fit: cover; }
.sb-tag { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.sb-empty { margin: auto 0; padding: 4px 6px; color: var(--ink-dim); font-size: 13px; line-height: 1.55; }
.sb-empty p { margin: 0 0 8px; }
.sb-ask { padding: 10px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.sb-ask-text, .sb-brief-text { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--ink); font-family: var(--body); font-size: 13.5px; line-height: 1.55; outline: none; }
.sb-ask-text:focus, .sb-brief-text:focus { border-color: var(--accent); }
.sb-ask-text { width: 100%; resize: vertical; min-height: 64px; max-height: 220px; }
.sb-ask-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sb-status { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.sb-send { width: auto; padding-inline: 22px; }
.sb-brief { padding: 14px; gap: 10px; }
.sb-brief-head { display: flex; align-items: baseline; gap: 10px; }
.sb-brief-head b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.sb-brief-state { font-size: 12px; color: var(--ink-dim); }
.sb-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 12.5px; color: var(--ink-dim); }
.sb-bar.hidden, .sb-checks.hidden, .sb-notes.hidden, .sb-mine.hidden { display: none; }
.sb-brief-text { flex: 1; min-height: 160px; width: 100%; resize: none; line-height: 1.6; }
.sb-brief-text.writing { opacity: .75; }
.sb-checks { padding: 8px 10px; border: 1px solid var(--accent-2); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5; color: var(--ink); max-height: 120px; overflow-y: auto; }
.sb-checks b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2-ink); margin-bottom: 2px; }
.sb-notes { border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12.5px; }
.sb-notes summary { cursor: pointer; padding: 7px 10px; color: var(--ink-dim); }
.sb-notes > div { max-height: 220px; overflow-y: auto; padding: 0 10px 8px; }
.sb-note { margin-top: 8px; line-height: 1.5; }
.sb-note b { display: block; font-size: 10.5px; letter-spacing: .08em; color: var(--ink-faint); }
.sb-brief-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sb-put { width: auto; padding-inline: 18px; }
.sb-over { margin-inline-start: auto; }
@media (max-width: 900px) {
  .sb-overlay { padding: 0; }
  .sb-pop { height: 100vh; border-radius: 0; }
  .sb-sub { display: none; }
  .sb-cols { display: flex; flex-direction: column; overflow-y: auto; }
  .sb-ref, .sb-chat { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .sb-ref-img img { max-height: 220px; }
  .sb-thread { max-height: 50vh; min-height: 160px; }
  .sb-brief-text { min-height: 260px; }
}

/* ── 🎬 Script to shots (script-shots.js): the script on the left, its shots on the right; in 📝 Texts
   and the 📝 list, a script's shots kept together under its name ──────────────────────────────── */
.texts-script-btn { flex-shrink: 0; }
.texts-group { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); min-width: 0; }
.texts-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.texts-group-name { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.texts-group-count { font-size: 12px; color: var(--ink-faint); }
.texts-group-acts { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.text-pop-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.text-pop-group { display: flex; flex-direction: column; gap: 6px; }
.text-pop-gname { padding: 4px 2px 0; font-size: 12px; font-weight: 700; color: var(--ink-dim); overflow-wrap: anywhere; }
.text-pop-gname small { font-weight: 400; color: var(--ink-faint); }
.text-pop-row.in-group { margin-inline-start: 10px; }
.text-pop-row.picked { border-color: var(--accent); }
.text-pop-row.picked b::after { content: ' ✓'; color: var(--accent-ink); }

.ss-overlay { z-index: 190; }   /* under any window it opens (a confirm, the 📝 list) */
.ss-pop { display: flex; flex-direction: column; width: min(1360px, 100%); height: min(900px, calc(100vh - 40px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 70px rgba(0,0,0,.5); outline: none; }
.ss-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ss-title { font-family: var(--display); font-size: 18px; font-weight: 600; white-space: nowrap; }
.ss-sub { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-x { background: none; border: 0; color: var(--ink-dim); font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ss-x:hover { color: var(--ink); background: var(--panel-2); }
.ss-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.3fr); }
.ss-left, .ss-right { min-height: 0; display: flex; flex-direction: column; }
.ss-left { padding: 14px; border-inline-end: 1px solid var(--line); overflow-y: auto; }
.ss-left .field-label { margin: 12px 0 6px; }
.ss-left-head { display: flex; gap: 8px; align-items: center; }
.ss-pick { flex: 1; min-width: 0; padding: 7px 10px; font-size: 12.5px; }
.ss-script, .ss-notes { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--ink); font-family: var(--body); font-size: 13.5px; line-height: 1.55; outline: none; }
.ss-script { flex: 1; min-height: 240px; resize: none; }
.ss-notes { resize: vertical; min-height: 54px; }
.ss-script:focus, .ss-notes:focus, .ss-shot-text:focus { border-color: var(--accent); }
.ss-go-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.ss-status { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ss-go { width: auto; padding-inline: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ss-right { padding: 14px 14px 0; gap: 10px; }
.ss-right-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ss-right-head > b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.ss-sum { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.ss-right-acts { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.ss-save-all { width: auto; padding: 10px 18px; font-size: 13.5px; }
.ss-note { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.ss-note[hidden] { display: none; }
.ss-note p { margin: 0; }
.ss-note p + p { margin-top: 4px; }
.ss-cut { color: var(--accent-2-ink); font-weight: 600; }
.ss-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }
.ss-empty { margin: auto 0; padding: 4px 6px; max-width: 560px; color: var(--ink-dim); font-size: 13px; line-height: 1.55; }
.ss-empty p { margin: 0 0 8px; }
.ss-shot { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.ss-shot-head { display: flex; align-items: center; gap: 10px; }
.ss-num { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--accent-ink); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.ss-shot-title { flex: 1; min-width: 0; padding: 6px 10px; font-size: 13.5px; font-weight: 600; }
.ss-state { flex-shrink: 0; font-size: 11.5px; white-space: nowrap; color: var(--ink-faint); }
.ss-state.saved { color: var(--accent-ink); }
.ss-state.changed { color: var(--accent-2-ink); font-weight: 600; }
.ss-shot-text { width: 100%; min-height: 112px; max-height: 420px; resize: vertical; field-sizing: content; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-family: var(--body); font-size: 13px; line-height: 1.55; outline: none; }
.ss-shot-acts { display: flex; gap: 8px; align-items: center; }
.ss-drop { margin-inline-start: auto; }
@media (max-width: 900px) {
  .ss-overlay { padding: 0; }
  .ss-pop { height: 100vh; border-radius: 0; }
  .ss-sub { display: none; }
  .ss-cols { display: flex; flex-direction: column; overflow-y: auto; }
  .ss-left { border-inline-end: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .ss-script { min-height: 200px; flex: none; }
  .ss-list { overflow: visible; }
}

/* ── An asset's pictures (docs/asset-pictures.md): its others under the main one on its card, the 🖼
   window that manages them, the Save to Assets switch, and the count on a picker's tile ───────── */
.char-ref { position: relative; }
.pics-n { position: absolute; right: 8px; bottom: 8px; font: 700 11px/1 var(--mono); color: #fff; background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: 4px 8px; pointer-events: none; }
button.pics-n { pointer-events: auto; cursor: pointer; padding: 6px 10px; font-size: 12px; }
button.pics-n:hover, button.pics-n:focus-visible { background: rgba(0,0,0,.85); border-color: var(--accent); }
.pics-add-chip { opacity: 0; transition: opacity .12s; }
.char-card:hover .pics-add-chip, .pics-add-chip:focus-visible { opacity: 1; }
@media (hover: none) { .pics-add-chip { opacity: .85; } }
.char-pics { display: flex; gap: 5px; padding: 6px 8px 0; flex-wrap: nowrap; overflow: hidden; }
.char-pic { flex: 0 0 auto; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #000; cursor: zoom-in; }
.char-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.char-pic:hover { border-color: var(--accent); }
.char-pic-more { display: flex; align-items: center; justify-content: center; font: 700 12px/1 var(--mono); color: var(--ink-dim); background: var(--panel-2); cursor: pointer; }
.modal-card.pics-card { max-width: 760px; }
.pics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 6px; border-radius: 12px; }
.pics-grid.drag-over { outline: 2px dashed var(--accent); outline-offset: 4px; }
.pic { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); display: flex; flex-direction: column; }
.pic.main { border-color: var(--accent); }
.pic-img { display: block; padding: 0; border: 0; aspect-ratio: 4 / 3; background: #000; cursor: zoom-in; line-height: 0; }
.pic-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pic figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 7px; font-size: 12px; color: var(--ink-dim); min-height: 40px; }
.pic figcaption b { color: var(--accent-ink); font-size: 12px; }
.pic-acts { display: flex; gap: 4px; align-items: center; }
.pic-acts .mini-btn { min-height: 28px; padding: 4px 7px; font-size: 12px; }
.pic-acts .icon-btn { width: 28px; height: 28px; font-size: 12px; }
.pic-add { min-height: 150px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--ink-dim); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; }
.pic-add b { color: var(--ink); font-size: 14px; }
.pic-add small { font-size: 11.5px; }
.pic-add:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.pic-add:disabled { opacity: .55; cursor: not-allowed; }
.sta-modes { margin: 6px 0 2px; flex-wrap: wrap; }
.sta-modes .seg { padding: 7px 11px; font-size: 12.5px; }
#staSub:empty, .np-field[hidden] { display: none; }
/* Several saved as assets of their own: a row for each picture with its name, ✕ to leave one out,
   and a tick for an asset sheet of each (app.js saveToAssets, public/asset-names.js) */
.modal-card.sta-many { max-width: 620px; }
.sta-thumbs[hidden], .sta-list[hidden], .sta-why[hidden] { display: none; }
.sta-list { margin-top: 4px; }
.sta-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sta-list-head .field-label { margin: 0; }
.sta-rows { display: flex; flex-direction: column; gap: 6px; max-height: min(40vh, 380px); overflow-y: auto; padding: 2px 6px 2px 0; }
.sta-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.sta-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.sta-row-name {
  width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 14px; outline: none;
}
.sta-row-name:focus { border-color: var(--accent); }
.sta-row.ai .sta-row-name { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sta-row.out img, .sta-row.out .sta-row-name { opacity: .38; }
.sta-row.out .sta-row-name { text-decoration: line-through; }
.sta-sheet { margin-top: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.sta-tick { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; }
.sta-tick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: inherit; }
.sta-tick.off { color: var(--ink-dim); cursor: not-allowed; }
.sta-why { margin: 6px 0 0 25px; font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); }
.sta-sheet .np-field { margin-top: 10px; }
.sta-sheet .np-field textarea { min-height: 64px; }
.rb-pick, .sd-pick, .fav-thumb { position: relative; }
.rb-pick .pics-n, .sd-pick .pics-n, .fav-thumb .pics-n { right: 4px; top: 4px; bottom: auto; padding: 3px 6px; font-size: 10px; }   /* (the tile's name runs along its foot) */
.import-cell .kept-thumb { position: relative; }
.import-cell .pics-n { right: 6px; bottom: 6px; }

/* ══ Cinema (docs/cinema.md) ══════════════════════════════════════════════════════════════════
   The studio's default look: graphite surfaces, the work in the light, one gold for the action that
   moves it on. Its tokens are at the top of this file; everything here is scoped to
   :root[data-theme="cinema"], so dark and light stay as they were. A rule that sets only a size uses
   :where(), so a view's own size for that control still holds. */

/* the page: no glow, the type at the spec's scale */
:root[data-theme="cinema"] body { background: var(--bg); }
:root[data-theme="cinema"] ::selection { background: color-mix(in srgb, var(--accent) 36%, transparent); }
:root[data-theme="cinema"] .cn-off { display: none !important; }

/* focus: a violet ring outside the control */
:root[data-theme="cinema"] :is(a, button, select, input, textarea, summary, [tabindex], [contenteditable="true"]):focus-visible { outline: 2px solid var(--cn-focus); outline-offset: 3px; }
:root[data-theme="cinema"] :is(input, textarea, select):focus-visible { outline-offset: 1px; }

/* ── Controls ──────────────────────────────────────────────────────────────────────────────── */
/* secondary: a plain verb on graphite */
:root[data-theme="cinema"] :is(.mini-btn, .icon-btn, .rb-btn, .tb-admin, .sn-add, .attach-btn, .lib-open-scene, .card-advisor, .modal-btn.ghost, .toast-act, .ref-add) {
  background: var(--cn-btn); border: 1px solid var(--cn-btn-line); color: var(--ink); border-radius: 8px; font-family: var(--body); text-shadow: none; }
:root[data-theme="cinema"] :is(.mini-btn, .icon-btn, .rb-btn, .tb-admin, .sn-add, .attach-btn, .lib-open-scene, .card-advisor, .modal-btn.ghost, .toast-act, .ref-add):hover:not(:disabled) {
  background: var(--cn-btn-hover); border-color: var(--cn-btn-line); color: var(--ink); }
:root[data-theme="cinema"] :is(.mini-btn, .icon-btn, .modal-btn):disabled { opacity: .5; cursor: not-allowed; }
:where(:root[data-theme="cinema"]) .mini-btn { min-height: 34px; padding: 7px 10px; font-size: 14px; line-height: 1.2; }
:where(:root[data-theme="cinema"]) .icon-btn { width: 34px; height: 34px; font-size: 14px; }
/* picked (a filter that's on, a view that's open): the selection's amber, and bold — not colour alone */
:root[data-theme="cinema"] :is(.mini-btn.on, .mode-toggle .seg.active, .seg.active) { background: var(--cn-sel); border-color: var(--cn-sel-line); color: #fff0d8; font-weight: 700; }
:root[data-theme="cinema"] .mini-btn.ghost { color: var(--ink-dim); }
:root[data-theme="cinema"] .mini-btn.ghost:hover:not(:disabled) { color: var(--danger-ink); }
/* primary: gold, the one action that moves the work on */
:root[data-theme="cinema"] :is(.generate-btn, .send-btn, .new-project-btn, .gen-all, .mini-btn.primary, .modal-btn.accent, .auth-submit, .tb-share) {
  background: var(--cn-primary); color: var(--cn-primary-ink); border: 1px solid var(--cn-primary-line); border-radius: 8px;
  box-shadow: 0 2px 0 #8e612c, inset 0 1px #ffe2a3; font-family: var(--body); font-weight: 700; text-shadow: none; filter: none; transform: none; }
:root[data-theme="cinema"] :is(.generate-btn, .send-btn, .new-project-btn, .gen-all, .mini-btn.primary, .modal-btn.accent, .auth-submit, .tb-share):hover:not(:disabled) {
  background: #ffd383; color: var(--cn-primary-ink); border-color: var(--cn-primary-line); filter: none; transform: none; box-shadow: 0 2px 0 #8e612c, inset 0 1px #ffe2a3; }
:root[data-theme="cinema"] :is(.generate-btn, .send-btn, .new-project-btn, .gen-all, .mini-btn.primary, .modal-btn.accent, .auth-submit, .tb-share):active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #8e612c, inset 0 1px #ffe2a3; }
:root[data-theme="cinema"] :is(.generate-btn, .send-btn, .new-project-btn, .gen-all, .modal-btn.accent, .auth-submit):disabled { opacity: .55; transform: none; filter: none; }
:where(:root[data-theme="cinema"]) :is(.generate-btn, .new-project-btn, .gen-all, .modal-btn) { min-height: 34px; padding: 7px 12px; font-size: 14px; }
:root[data-theme="cinema"] .modal-btn { font-family: var(--body); border-radius: 8px; }
:root[data-theme="cinema"] .modal-btn.danger { background: transparent; color: var(--danger-ink); border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--cn-btn-line)); }
:root[data-theme="cinema"] .modal-btn.danger:hover { background: var(--cn-err-fill); color: var(--danger-ink); }
/* segmented toggles: one switch (Yossi, 2026-11-04), a sunken track with the picked part in the
   selection's amber; a part a mode can't take stays in its place, off */
:root[data-theme="cinema"] .mode-toggle { gap: 2px; padding: 2px; flex-wrap: wrap; background: var(--cn-field); border: 1px solid var(--cn-btn-line); border-radius: 9px; overflow: visible; }
:root[data-theme="cinema"] .mode-toggle .seg { background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--ink); font-family: var(--body); }
:root[data-theme="cinema"] .mode-toggle .seg + .seg { border-left: 1px solid transparent; }
:root[data-theme="cinema"] .mode-toggle .seg:hover:not(:disabled):not(.active) { background: var(--cn-btn-hover); color: var(--ink); }
:root[data-theme="cinema"] .mode-toggle .seg.active { border-color: var(--cn-sel-line); }
:root[data-theme="cinema"] .mode-toggle .seg:disabled { color: var(--ink-faint); opacity: .5; cursor: not-allowed; }
:where(:root[data-theme="cinema"]) .mode-toggle .seg { min-height: 30px; padding: 5px 10px; font-size: 14px; font-weight: 400; }

/* fields: sunken, a clear edge, a label over them */
:root[data-theme="cinema"] :is(textarea, input:is([type="text"], [type="search"], [type="email"], [type="password"], [type="number"], [type="url"], [type="tel"], [type="date"], :not([type]))):not(:is(.crumb-client, .crumb-project, .crumb-space, [readonly].plain)) {
  background-color: var(--cn-field); border-color: var(--cn-field-line); color: var(--ink); }
:root[data-theme="cinema"] :is(textarea, input)::placeholder { color: #8f949c; }
:root[data-theme="cinema"] :is(textarea, input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"])):not(:is(.crumb-client, .crumb-project, .crumb-space)):focus { border-color: var(--cn-focus); }
:root[data-theme="cinema"] select { background-color: var(--cn-btn); border-color: var(--cn-btn-line); color: var(--ink); border-radius: 8px; font-family: var(--body); }
:root[data-theme="cinema"] select:hover { background-color: var(--cn-btn-hover); }
:root[data-theme="cinema"] select:focus { border-color: var(--cn-focus); }
:where(:root[data-theme="cinema"]) select { min-height: 34px; padding: 7px 10px; font-size: 14px; }
:root[data-theme="cinema"] input[type="checkbox"], :root[data-theme="cinema"] input[type="radio"] { accent-color: var(--accent); }
/* a field's name: in the body's type, as people read it — not a code */
:root[data-theme="cinema"] .field-label { font-family: var(--body); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: #e4e6eb; margin-bottom: 4px; line-height: 1.45; }
/* a count beside a title: a small mono tally */
:root[data-theme="cinema"] .pv-count { font: 700 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cn-mono); margin-left: 8px; }

/* menus, windows, toasts */
:root[data-theme="cinema"] :is(.scene-menu, .user-pop, .ps-pop, .theme-pop) { background: var(--panel-2); border-color: var(--cn-btn-line); border-radius: 10px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); }
:root[data-theme="cinema"] :is(.scene-menu, .user-pop) button { font-size: 14px; }
:root[data-theme="cinema"] :is(.scene-menu, .user-pop, .theme-pop) button:hover { background: var(--cn-btn-hover); }
:root[data-theme="cinema"] .modal-overlay { background: rgba(5, 6, 7, .72); }
:root[data-theme="cinema"] .modal-card { background: var(--panel); border-color: var(--cn-card-line); border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, .7); }
:root[data-theme="cinema"] .modal-head h3, :root[data-theme="cinema"] .modal-card h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.025em; }
:root[data-theme="cinema"] .modal-sub { font-size: 14px; }
:root[data-theme="cinema"] .toast { background: var(--panel-2); border-color: var(--cn-btn-line); border-radius: 8px; font-size: 14px; }
:root[data-theme="cinema"] .toast.err { background: var(--cn-err-fill); border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger-ink); }

/* ── The top bar: 58px, the logo, the client and project, the project's views ─────────────────── */
:root[data-theme="cinema"] #app { grid-template-rows: 58px minmax(0, 1fr); }
:root[data-theme="cinema"] #app, :root[data-theme="cinema"] #app.sb-collapsed { --sb-w: 185px; }
:root[data-theme="cinema"] .topbar { gap: 14px; padding-right: 20px; background: var(--cn-header); border-bottom-color: #303236; }
:root[data-theme="cinema"] #app .tb-brand { width: auto; padding: 0 0 0 20px; gap: 12px; border-right: 0; justify-content: flex-start; }
:root[data-theme="cinema"] #app .tb-logo { display: inline-flex; }
:root[data-theme="cinema"] .tb-wordmark { width: 105px; height: auto; }
:root[data-theme="cinema"] #app .sb-toggle { display: none; }
:root[data-theme="cinema"] .tb-crumbs { gap: 4px; }
:root[data-theme="cinema"] :is(.crumb-client, .crumb-project) { font-size: 13px; font-weight: 700; color: var(--ink); padding: 4px 5px; border-radius: 6px; }
:root[data-theme="cinema"] .crumb-client::placeholder { color: var(--ink-faint); font-weight: 400; }
:root[data-theme="cinema"] :is(.crumb-client, .crumb-project):hover { border-color: var(--cn-btn-line); }
:root[data-theme="cinema"] :is(.crumb-client, .crumb-project):focus { background: var(--cn-field); border-color: var(--cn-focus); }
:root[data-theme="cinema"] .crumb-sep { color: var(--ink-faint); font-size: 13px; }
:root[data-theme="cinema"] :is(.crumb-space, .crumb-admin) { font-size: 13px; font-weight: 700; color: var(--ink); }
:root[data-theme="cinema"] .tb-views { gap: 0; }
:root[data-theme="cinema"] .tb-view { padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: #c1c4c9; font-size: 13px; font-weight: 400; }
:root[data-theme="cinema"] .tb-view:hover { background: #292c31; color: var(--ink); }
:root[data-theme="cinema"] .tb-view.active { background: none; color: var(--accent-ink); font-weight: 700; border-radius: 0; box-shadow: inset 0 -2px var(--accent); }
:root[data-theme="cinema"] .tb-share { height: auto; min-height: 34px; padding: 7px 10px; font-size: 14px; }
:root[data-theme="cinema"] .tb-theme { width: auto; height: auto; min-height: 34px; padding: 7px 10px; border: 1px solid var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); color: var(--ink); font-family: var(--body); font-size: 14px; }
:root[data-theme="cinema"] .tb-theme:hover, :root[data-theme="cinema"] .tb-theme[aria-expanded="true"] { background: var(--cn-btn-hover); border-color: var(--cn-btn-line); color: var(--ink); }
:root[data-theme="cinema"] .tb-theme svg { display: none; }
:root[data-theme="cinema"] .tb-theme .tb-theme-name { display: inline; }
:root[data-theme="cinema"] .tb-admin { min-height: 34px; padding: 7px 10px; font-size: 14px; font-weight: 400; display: inline-flex; align-items: center; }
:root[data-theme="cinema"] .tb-user { width: 34px; height: 34px; border-radius: 8px; background: var(--cn-btn); border-color: var(--cn-btn-line); color: var(--ink); font-size: 14px; font-weight: 400; }
:root[data-theme="cinema"] .tb-user:hover, :root[data-theme="cinema"] .tb-user[aria-expanded="true"] { background: var(--cn-btn-hover); border-color: var(--cn-btn-line); color: var(--ink); }
:root[data-theme="cinema"] .user-pop { top: 58px; }
:root[data-theme="cinema"] .tb-viewonly { font-size: 12px; }

/* ── The scene rail: 185px (148 under 1430), always open ─────────────────────────────────────── */
:root[data-theme="cinema"] .sidebar, :root[data-theme="cinema"] #app.sb-peek .sidebar { width: var(--sb-w); box-shadow: none; background: var(--cn-rail); border-right-color: #303236; }
/* the spaces: icon buttons in one row */
:root[data-theme="cinema"] #app .space-nav { align-self: flex-start; margin: 12px 10px 0; padding: 2px; gap: 2px; background: var(--cn-field); border-color: #303236; border-radius: 8px; }
:root[data-theme="cinema"] #app .spn, :root[data-theme="cinema"] #app .spn:not(.active) { display: grid; width: 30px; height: 30px; border-radius: 6px; color: var(--ink-dim); }
:root[data-theme="cinema"] #app .spn:hover { color: var(--ink); background: var(--cn-btn); }
:root[data-theme="cinema"] #app .spn.active { color: var(--accent-ink); background: var(--cn-sel); box-shadow: inset 0 0 0 1px var(--cn-sel-line); }
:root[data-theme="cinema"] #app .spn:focus-visible { outline: 2px solid var(--cn-focus); outline-offset: 2px; }
/* the project: its client over its name, a menu of the rest */
:root[data-theme="cinema"] #app .proj-switch { padding: 10px 10px 2px; }
:root[data-theme="cinema"] #app .ps-btn { justify-content: flex-start; gap: 8px; padding: 6px 9px; border-color: var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); }
:root[data-theme="cinema"] #app .ps-btn:hover, :root[data-theme="cinema"] #app .ps-btn[aria-expanded="true"] { background: var(--cn-btn-hover); border-color: var(--cn-btn-line); }
:root[data-theme="cinema"] #app .ps-text { flex: 1; width: auto; visibility: visible; }
:root[data-theme="cinema"] #app .ps-text small { font-family: var(--body); font-size: 14px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--accent-ink); }
:root[data-theme="cinema"] #app .ps-text b { font-size: 12.5px; font-weight: 600; color: var(--ink-dim); }
:root[data-theme="cinema"] .ps-pop { width: 320px; }
/* the scenes: "Scenes  + Scene", General, then each scene's cover, number and name */
:root[data-theme="cinema"] #app .sn-head { justify-content: flex-start; gap: 10px; padding: 14px 10px 4px; }
:root[data-theme="cinema"] #app :is(.sn-label, .sn-title) { display: inline; font-family: var(--body); font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
:root[data-theme="cinema"] #app #sceneNav .sn-count { display: none; }
:root[data-theme="cinema"] #app .sn-add { height: auto; min-height: 34px; padding: 7px 10px; font-size: 14px; font-weight: 400; line-height: 1.2; }
:root[data-theme="cinema"] #app .sn-add::before { content: none; }
:root[data-theme="cinema"] #app .sn-list { gap: 0; padding: 4px 10px 12px; }
:root[data-theme="cinema"] #app .sn-item { justify-content: flex-start; gap: 8px; margin: 3px 0; padding: 7px 4px; border-radius: 7px; color: #d6d8db; line-height: 1.25; }
:root[data-theme="cinema"] #app .sn-item:hover { background: #1f2226; color: var(--ink); }
:root[data-theme="cinema"] #app .sn-item.active { background: var(--cn-sel); border-color: var(--cn-sel-line); color: var(--ink); }
:root[data-theme="cinema"] #app .sn-item[data-scene="general"] { padding: 6px 4px; }
:root[data-theme="cinema"] #app .sn-item[data-scene="general"] .sn-thumb { display: none; }
:root[data-theme="cinema"] #app .sn-thumb { width: 43px; height: 33px; border-radius: 4px; box-shadow: none; background: var(--cn-field); }
:root[data-theme="cinema"] #app .sn-text { display: flex; gap: 0; }
:root[data-theme="cinema"] #app .sn-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; font-weight: 400; line-height: 1.25; }
:root[data-theme="cinema"] #app .sn-n { margin-right: 4px; font-family: var(--body); font-size: 12px; font-weight: 400; color: var(--accent-ink); }
:root[data-theme="cinema"] #app .sn-t { white-space: normal; overflow: visible; }
:root[data-theme="cinema"] #app #sceneNav .sn-meta { display: none; }
:root[data-theme="cinema"] #app .sn-meta { font-size: 12px; color: var(--ink-dim); white-space: normal; }
:root[data-theme="cinema"] #app .sn-edit { display: block; top: 3px; right: 3px; background: var(--cn-btn); border: 1px solid var(--cn-btn-line); }
/* /admin's pages, in the same rail */
:root[data-theme="cinema"] #app .admin-nav { padding: 14px 10px; gap: 2px; }
:root[data-theme="cinema"] #app .an-item { justify-content: flex-start; gap: 8px; padding: 8px 8px; border-radius: 7px; color: #d6d8db; font-size: 14px; font-weight: 400; }
:root[data-theme="cinema"] #app .an-item .sb-label { display: inline; }
:root[data-theme="cinema"] #app .an-item:hover { background: #1f2226; color: var(--ink); }
:root[data-theme="cinema"] #app .an-item.active { background: var(--cn-sel); border-color: var(--cn-sel-line); color: var(--ink); font-weight: 700; }

/* ── The scene's head: SCENE 04, its name, its brief, the tools in two groups ─────────────────── */
:root[data-theme="cinema"] .ws-header { padding: 16px 20px 0; background: var(--cn-head); border-bottom-color: #32363c; }
:root[data-theme="cinema"] .sh-eyebrow { font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--accent-ink); }
:root[data-theme="cinema"] .sh-row { gap: 10px; margin-top: 4px; }
:root[data-theme="cinema"] .sh-title { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.13; letter-spacing: -.035em; }
:root[data-theme="cinema"] .sh-edit { font-family: var(--display); font-weight: 700; font-size: 13px; }
:root[data-theme="cinema"] .sh-brief { margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--ink-dim); }
:root[data-theme="cinema"] .ws-toolrow { margin-top: 12px; gap: 16px; }
:root[data-theme="cinema"] .tab-group + .tab-group { margin-left: 18px; padding-left: 0; border-left: 0; }
:root[data-theme="cinema"] .tab-group-label { padding: 0 10px 2px; font-family: var(--body); font-size: 12px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-dim); }
:root[data-theme="cinema"] .tab-row { gap: 0; }
:root[data-theme="cinema"] .tab { padding: 7px 10px 9px; border-bottom: 2px solid transparent; color: #bec1c7; font-family: var(--body); font-size: 14px; font-weight: 400; }
:root[data-theme="cinema"] .tab-row .tab { padding-top: 7px; }
:root[data-theme="cinema"] .tab:hover { color: var(--ink); background: #292c31; }
:root[data-theme="cinema"] .tab.active { color: var(--accent-ink); font-weight: 700; border-bottom-color: var(--accent); background: none; }
:root[data-theme="cinema"] .tool-actions { padding-bottom: 6px; }
/* a project view's head (Library, Assets, Style…): the way back, then its name */
:root[data-theme="cinema"] .pv-title h2 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.13; letter-spacing: -.035em; }
:root[data-theme="cinema"] .pv-sub { font-size: 14px; color: var(--ink-dim); }
:root[data-theme="cinema"] .pv-back { border-color: var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); color: var(--ink); font-size: 14px; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .8); }
:root[data-theme="cinema"] .pv-back:hover { background: var(--cn-btn-hover); color: var(--ink); }

/* ── Steps: three of the same width, the one open in the selection's amber ─────────────────── */
:root[data-theme="cinema"] .nbw-steps { gap: 8px; margin: 0; padding: 10px 20px; border: 0; border-bottom: 1px solid #34383d; border-radius: 0; background: var(--cn-rail); overflow: visible; }
:root[data-theme="cinema"] .nbs-step, :root[data-theme="cinema"] button.nbs-step { min-height: 38px; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbs-step + .nbs-step { border-left: 1px solid var(--line); }
:root[data-theme="cinema"] button.nbs-step:hover:not(:disabled):not(.active) { background: #1f2226; }
:root[data-theme="cinema"] .nbs-n { width: auto; height: auto; border: 0; border-radius: 0; background: none; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; color: var(--cn-mono); }
:root[data-theme="cinema"] .nbs-text { flex-direction: row; align-items: baseline; gap: 8px; }
:root[data-theme="cinema"] .nbs-text b { flex-shrink: 0; font-size: 14px; font-weight: 400; color: inherit; }
:root[data-theme="cinema"] .nbs-text small { min-width: 0; font-size: 12px; color: var(--ink-faint); }
:root[data-theme="cinema"] .nbs-step.done .nbs-n { border: 0; color: var(--teal-ink); }
:root[data-theme="cinema"] .nbs-step.active { background: var(--cn-sel); border-color: var(--cn-step-line); color: #fff0d8; box-shadow: none; }
:root[data-theme="cinema"] .nbs-step.active .nbs-n { background: none; border: 0; color: var(--accent-ink); font-weight: 700; }
:root[data-theme="cinema"] .nbs-step.active b { color: #fff0d8; font-weight: 700; }
:root[data-theme="cinema"] .nbs-step.active small { color: #d9c7a8; }

/* ── Images: the generator beside the scene's takes ───────────────────────────────────────── */
:root[data-theme="cinema"] .gen-panel { grid-template-columns: var(--gen-left-w, 300px) minmax(0, 1fr); }
:root[data-theme="cinema"] .gen-left { gap: 12px; padding: 16px 20px; border-right-color: #303236; background: linear-gradient(155deg, #202327, #181a1e 46%); }
:root[data-theme="cinema"] .gen-head { flex-direction: column; align-items: stretch; gap: 0; }
:root[data-theme="cinema"] .gen-head::before { content: "Image generation"; margin-top: 4px; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--cn-mono); }
:root[data-theme="cinema"] .gen-left h3, :root[data-theme="cinema"] .gen-head h3 { margin: 6px 0 10px; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
:root[data-theme="cinema"] .gen-model-label { display: block; margin: 0 0 6px; font-size: 14px; color: #e4e6eb; }
/* a switch that wraps in a narrow column (Images' five engines, Create Video's four) fills its rows evenly */
:root[data-theme="cinema"] :is(#nbModelToggle, .sd-models) .seg { flex: 1 1 auto; }
:root[data-theme="cinema"] .gen-prompt-label { display: flex; align-items: center; gap: 8px; }
:root[data-theme="cinema"] .gen-prompt-label .text-pick-mini { min-height: 28px; padding: 3px 8px; font-size: 13px; }
:root[data-theme="cinema"] .gen-left textarea { min-height: 100px; padding: 9px 10px; border-radius: 8px; font-size: 14px; line-height: 1.45; }
:root[data-theme="cinema"] .gen-title { margin-top: 8px; padding: 7px 10px; min-height: 34px; border-radius: 8px; font-size: 14px; }
:root[data-theme="cinema"] .ref-row { gap: 6px; }
:root[data-theme="cinema"] .ref-add { width: 44px; height: 34px; font-size: 16px; border-style: solid; }
:root[data-theme="cinema"] .gen-controls { gap: 8px; }
:root[data-theme="cinema"] #genBtn { align-self: flex-start; margin-top: 2px; }
:root[data-theme="cinema"] .gen-hint { font-size: 13px; line-height: 1.45; color: var(--ink-dim); }
:root[data-theme="cinema"] .gen-hint b { color: var(--ink); }
:root[data-theme="cinema"] .gen-right { padding: 16px 20px; }
:root[data-theme="cinema"] .gen-right .section-head { margin-bottom: 12px; align-items: center; }
:root[data-theme="cinema"] .gen-right .section-head h3, :root[data-theme="cinema"] .gen-right .gen-results-head h3 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.45; letter-spacing: -.025em; }
:root[data-theme="cinema"] .gen-results-tools { gap: 6px; }
:root[data-theme="cinema"] .lib-filter { gap: 6px; }
:root[data-theme="cinema"] .gen-right .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
:root[data-theme="cinema"] .gen-right .img-card .imgwrap { aspect-ratio: 16 / 9; }
:root[data-theme="cinema"] .gen-right .img-card .imgwrap img { height: 100%; object-fit: contain; }
:root[data-theme="cinema"] .gen-skel { border-radius: 9px; background: var(--cn-card); border: 1px solid var(--cn-card-line); }
:root[data-theme="cinema"] .gen-empty { font-size: 14px; color: var(--ink-dim); }

/* a take: the picture at the card's width, a bar of what to do under it */
:root[data-theme="cinema"] .img-card { background: var(--cn-card); border: 1px solid var(--cn-card-line); border-radius: 9px; box-shadow: var(--cn-card-shadow); }
:root[data-theme="cinema"] .img-card:hover { transform: none; border-color: #4b5058; }
:root[data-theme="cinema"] .img-card.approved { border-color: var(--cn-ok-card); }
:root[data-theme="cinema"] .img-card .imgwrap { background: var(--cn-player); }
:root[data-theme="cinema"] .img-card .card-foot { min-height: 46px; padding: 6px 8px; border-top: 1px solid #36393f; }
:root[data-theme="cinema"] .img-card .card-foot .when, :root[data-theme="cinema"] .img-card .card-foot .recipe-open { font-family: var(--body); font-size: 13px; color: #d4d7de; }
:root[data-theme="cinema"] .img-card .card-foot .recipe-open:hover { color: var(--accent-ink); }
:root[data-theme="cinema"] .card-title { font-size: 13px; }
:root[data-theme="cinema"] .card-actions { gap: 6px; }
:root[data-theme="cinema"] .card-actions .icon-btn { width: 34px; height: 34px; font-size: 14px; }
:root[data-theme="cinema"] .icon-btn.fav.on { color: var(--like-ink); background: var(--cn-like-fill); border-color: #7b4a64; text-shadow: none; }
:root[data-theme="cinema"] .icon-btn.fav:hover:not(.on) { color: var(--like-ink); }
:root[data-theme="cinema"] .icon-btn.appr.on { color: var(--cn-ok-ink); background: var(--cn-ok-fill); border-color: var(--cn-ok-badge); }
:root[data-theme="cinema"] .icon-btn.appr:hover:not(.on) { color: var(--cn-ok-ink); }
:root[data-theme="cinema"] .approved-badge { padding: 3px 7px; border: 1px solid var(--cn-ok-badge); border-radius: 5px; background: var(--cn-ok-fill); color: var(--cn-ok-ink); font: 700 10px/1.2 var(--mono); letter-spacing: .08em; }
:root[data-theme="cinema"] .fav-badge { width: 26px; height: 26px; background: rgba(16, 17, 19, .78); color: var(--like-ink); }
:root[data-theme="cinema"] .card-scene { font-family: var(--body); font-size: 12px; }
:root[data-theme="cinema"] .card-advisor { width: auto; margin: 0 8px 8px; padding: 7px 10px; font-size: 14px; font-weight: 400; }
:root[data-theme="cinema"] .results-grid { gap: 14px; }

@media (min-width: 1200px) and (max-width: 1450px) { :root[data-theme="cinema"] .gen-right .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1430px) {
  :root[data-theme="cinema"] #app, :root[data-theme="cinema"] #app.sb-collapsed { --sb-w: 148px; }
  :root[data-theme="cinema"] .gen-panel { grid-template-columns: var(--gen-left-w, 268px) minmax(0, 1fr); }
  :root[data-theme="cinema"] #app .space-nav { margin: 10px 8px 0; padding: 1px; gap: 0; }
  :root[data-theme="cinema"] #app .spn, :root[data-theme="cinema"] #app .spn:not(.active) { width: 26px; height: 28px; }
  :root[data-theme="cinema"] #app .spn svg { width: 15px; height: 15px; }
  :root[data-theme="cinema"] #app :is(.sn-head, .admin-nav) { padding-inline: 8px; }
  :root[data-theme="cinema"] #app .sn-list { padding-inline: 8px; }
  :root[data-theme="cinema"] #app :is(.sn-label, .sn-title) { font-size: 13px; }
}
@media (max-width: 1199px) { :root[data-theme="cinema"] .gen-right .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { :root[data-theme="cinema"] .gen-right .results-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Create Frame: References → Prompts → Results ─────────────────────────────────────────── */
:root[data-theme="cinema"] .nbw-cols { margin-top: 0; border-top: 0; grid-template-columns: var(--nbw-refs-w, 340px) var(--nbw-prompts-w, 340px) minmax(0, 1fr); }
:root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed) { grid-template-columns: 48px var(--nbw-prompts-w, 340px) minmax(0, 1fr); }
/* folded, with the strip and its Edit references in the prompts: no rail — the prompts and the takes get the room */
:root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed):has(.nbp-edit-refs) { grid-template-columns: var(--nbw-prompts-w, 340px) minmax(0, 1fr); }
:root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed):has(.nbp-edit-refs) .nbw-refs { display: none; }
:root[data-theme="cinema"] .nbw-refs { background: var(--cn-rail); border-right-color: #303236; }
:root[data-theme="cinema"] .rb-head { padding: 16px 12px 10px 20px; }
:root[data-theme="cinema"] .rb-title b { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; }
:root[data-theme="cinema"] .rb-count { font-family: var(--body); font-size: 12px; color: var(--ink-dim); }
:root[data-theme="cinema"] .rb-btn { min-height: 30px; padding: 5px 9px; font-size: 13px; font-weight: 400; }
:root[data-theme="cinema"] .rb-grid { gap: 10px; padding: 2px 12px 10px 20px; }
:root[data-theme="cinema"] .rb-card { background: var(--cn-card); border-color: var(--cn-card-line); border-radius: 10px; box-shadow: var(--cn-card-shadow); }
:root[data-theme="cinema"] .rb-card.rb-active { border-color: var(--cn-sel-line); }
:root[data-theme="cinema"] .rb-card-img { border-radius: 9px 9px 0 0; }
:root[data-theme="cinema"] .rb-card-role b { font-size: 14px; font-weight: 700; color: var(--ink); }
:root[data-theme="cinema"] .rb-card-role span { font-family: var(--mono); font-size: 11px; color: var(--cn-ref); }
:root[data-theme="cinema"] :is(.rb-name, .rb-note) { background: var(--cn-field); border-color: var(--cn-field-line); border-radius: 6px; font-size: 13px; }
:root[data-theme="cinema"] .rb-name { font-weight: 700; }
:root[data-theme="cinema"] .rb-add { background: rgba(16, 17, 19, .86); border-color: var(--cn-btn-line); color: var(--ink); }
:root[data-theme="cinema"] .rb-adds { padding: 0 12px 12px 20px; }
:root[data-theme="cinema"] .rb-more { min-height: 30px; padding: 5px 10px; border-color: var(--cn-btn-line); color: var(--ink-dim); font-size: 13px; font-weight: 400; }
:root[data-theme="cinema"] .rb-more:hover { color: var(--ink); border-color: var(--ink-faint); }
:root[data-theme="cinema"] .rb-rail { color: var(--ink-dim); }
:root[data-theme="cinema"] .rb-rail:hover { background: #1f2226; color: var(--ink); }
:root[data-theme="cinema"] .rb-rail-n { background: var(--accent); color: var(--cn-primary-ink); }
:root[data-theme="cinema"] .nbw-direction { gap: 8px; padding: 12px 12px 14px 20px; border-top-color: #303236; }
:root[data-theme="cinema"] .nbw-direction textarea { border-radius: 8px; font-size: 14px; line-height: 1.45; }
:root[data-theme="cinema"] .nbw-dir-count { font-size: 11px; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbw-target-row .seg { min-height: 30px; padding: 5px 10px; font-size: 13px; }
:root[data-theme="cinema"] .nbw-dir-row { gap: 6px; }
:root[data-theme="cinema"] .nbw-dir-row .attach-btn { width: 34px; height: 34px; border-radius: 8px; font-size: 14px; }
:root[data-theme="cinema"] .nbw-write { flex: 1; min-height: 34px; padding: 7px 10px; font-size: 14px; }
/* the prompts: what they were written from, the one picked open, the rest a line each */
:root[data-theme="cinema"] .nbw-prompts { border-right-color: #303236; background: linear-gradient(155deg, #202327, #181a1e 46%); }
:root[data-theme="cinema"] .nbp-scroll { gap: 12px; padding: 16px 20px; }
:root[data-theme="cinema"] .nbp-head h3 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; }
:root[data-theme="cinema"] .nbp-turns { height: 34px; border-color: var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); }
:root[data-theme="cinema"] .nbp-turns span { font-family: var(--body); font-size: 13px; }
:root[data-theme="cinema"] .nbp-target { border-color: color-mix(in srgb, var(--cn-ref) 50%, var(--line)); color: var(--cn-ref); }
:root[data-theme="cinema"] .nbp-for { gap: 6px; padding: 0; border: 0; background: none; }
:root[data-theme="cinema"] .nbp-for::before { content: "Scene references"; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--cn-mono); }
:root[data-theme="cinema"] .nbp-for-refs { align-items: center; gap: 5px; }
:root[data-theme="cinema"] .nbp-for-refs .chat-att-thumb { width: 38px; height: 33px; border: 0; border-radius: 4px; }
:root[data-theme="cinema"] .nbp-for-refs .nbp-edit-refs { margin-left: 2px; padding-inline: 8px; }
:root[data-theme="cinema"] .nbp-for p { font-size: 13px; line-height: 1.45; color: var(--ink-dim); -webkit-line-clamp: 2; }
:root[data-theme="cinema"] .nbp-cards { gap: 2px; }
:root[data-theme="cinema"] .nbp-card, :root[data-theme="cinema"] .nbp-card:hover, :root[data-theme="cinema"] .nbp-card.open { border: 0; border-radius: 0; background: none; box-shadow: none; }
:root[data-theme="cinema"] .nbp-pick { gap: 6px; padding: 5px 0; color: var(--ink); }
:root[data-theme="cinema"] .nbp-radio { display: none; }
:root[data-theme="cinema"] .nbp-card:not(.open) .nbp-pick::before { content: "▸"; width: 12px; font-size: 12px; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbp-n { font-family: var(--body); font-size: 14px; color: var(--ink); }
:root[data-theme="cinema"] .nbp-n::after { content: " ·"; }
:root[data-theme="cinema"] .nbp-title { font-size: 14px; font-weight: 400; }
:root[data-theme="cinema"] .nbp-card.open :is(.nbp-n, .nbp-title) { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.45; }
:root[data-theme="cinema"] .nbp-card:not(.open) :is(.nbp-chips, .nbp-excerpt) { display: none; }
:root[data-theme="cinema"] .nbp-chips { padding: 0 0 6px; }
:root[data-theme="cinema"] .nbp-chip { border-color: var(--line); border-radius: 5px; font-size: 11px; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbp-body { padding: 2px 0 10px; }
:root[data-theme="cinema"] .nbp-text { font-size: 14px; line-height: 1.45; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbp-editbox { background: var(--cn-field); border-color: var(--cn-focus); border-radius: 8px; font-size: 14px; }
:root[data-theme="cinema"] .nbp-acts { gap: 6px; }
:root[data-theme="cinema"] .nbp-acts .mini-btn { min-height: 34px; padding: 7px 10px; font-size: 14px; }
:root[data-theme="cinema"] .nbp-notes summary { font-family: var(--body); font-size: 13px; letter-spacing: 0; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbp-writing { border-color: var(--line); font-family: var(--mono); color: var(--ink-dim); }
:root[data-theme="cinema"] .nbp-empty { border-color: var(--line); font-size: 14px; color: var(--ink-dim); }
:root[data-theme="cinema"] .nbp-dock { gap: 10px; padding: 12px 20px 16px; border-top-color: #303236; background: #181a1e; }
:root[data-theme="cinema"] .nbp-settings { grid-template-columns: 1fr 1fr; gap: 8px; }
:root[data-theme="cinema"] .nbp-settings label:first-child { grid-column: 1 / -1; }
:root[data-theme="cinema"] .nbp-settings span { font-family: var(--body); font-size: 14px; letter-spacing: 0; text-transform: none; color: #e4e6eb; }
:root[data-theme="cinema"] .nbp-settings select { min-height: 34px; padding: 7px 10px; font-size: 14px; border-radius: 8px; }
:root[data-theme="cinema"] .nbp-go-row { gap: 6px; }
:root[data-theme="cinema"] .nbp-go { flex: 0 1 auto; min-height: 34px; padding: 7px 12px; font-size: 14px; }
:root[data-theme="cinema"] .nbp-follow { gap: 6px; }
:root[data-theme="cinema"] .nbp-follow textarea { min-height: 34px; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
/* asking for a change is a second action here: a plain button beside the gold one above */
:root[data-theme="cinema"] .nbp-follow .send-btn { height: auto; min-height: 34px; padding: 7px 12px; background: var(--cn-btn); border: 1px solid var(--cn-btn-line); color: var(--ink); box-shadow: none; font-weight: 400; }
:root[data-theme="cinema"] .nbp-follow .send-btn:hover:not(:disabled) { background: var(--cn-btn-hover); box-shadow: none; }
/* the takes */
:root[data-theme="cinema"] .nbw-results { padding: 16px 20px 26px; }
:root[data-theme="cinema"] .nbr-head h3 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; }
:root[data-theme="cinema"] .nbr-size .seg { min-height: 34px; padding: 7px 10px; font-size: 14px; }
:root[data-theme="cinema"] .nbr-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
:root[data-theme="cinema"] .nbr-grid:not(.large) .img-card .imgwrap { aspect-ratio: 16 / 9; }
:root[data-theme="cinema"] .nbr-grid:not(.large) .img-card .imgwrap img { height: 100%; object-fit: contain; }
:root[data-theme="cinema"] .nbr-empty { border-color: var(--line); font-size: 14px; color: var(--ink-dim); }

/* ── Footage: every clip at one height, what to do with each under it ─────────────────────── */
:root[data-theme="cinema"] .footage { padding: 16px 20px 40px; }
:root[data-theme="cinema"] .ft-head { align-items: center; gap: 8px 16px; margin-bottom: 12px; }
:root[data-theme="cinema"] .ft-title h2 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.45; letter-spacing: -.025em; }
:root[data-theme="cinema"] .ft-title .pv-sub { display: none; }
:root[data-theme="cinema"] .ft-tools { gap: 6px; }
:root[data-theme="cinema"] .ft-spend { font-size: 12px; color: var(--ink-dim); }
:root[data-theme="cinema"] .ft-spend b { font-size: 13px; }
:root[data-theme="cinema"] .ft-conn-dot { background: var(--teal-ink); }
:root[data-theme="cinema"] .ft-conn-dot.off { background: var(--danger-ink); }
:root[data-theme="cinema"] .ft-conn > .ft-engines { background: var(--panel-2); border-color: var(--cn-btn-line); border-radius: 10px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); }
:root[data-theme="cinema"] .ft-eng { font-size: 12px; font-weight: 400; border-color: var(--line); }
:root[data-theme="cinema"] .ft-eng.on { color: var(--teal-ink); border-color: color-mix(in srgb, var(--teal) 55%, transparent); }
:root[data-theme="cinema"] .ft-eng.fake { color: var(--cn-ref); border-color: color-mix(in srgb, var(--cn-ref) 45%, transparent); }
:root[data-theme="cinema"] .ft-bar { gap: 8px; margin-bottom: 14px; padding-bottom: 0; border-bottom: 0; }
:root[data-theme="cinema"] .ft-scene { width: 164px; max-width: 100%; }
:root[data-theme="cinema"] .ft-filters { gap: 6px; }
:root[data-theme="cinema"] .ft-n { margin-left: 3px; font-family: var(--body); font-size: 14px; font-weight: inherit; opacity: 1; }
:root[data-theme="cinema"] .ft-no { font-family: var(--body); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink-dim); }
:root[data-theme="cinema"] .ft-no:hover, :root[data-theme="cinema"] .ft-no:focus-visible { color: var(--accent-ink); }
:root[data-theme="cinema"] .ft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
:root[data-theme="cinema"] .ft-card { background: var(--cn-card); border-color: var(--cn-card-line); border-radius: 9px; box-shadow: var(--cn-card-shadow); }
:root[data-theme="cinema"] .ft-card.failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--cn-card-line)); }
:root[data-theme="cinema"] .ft-media { aspect-ratio: 16 / 9 !important; background: var(--cn-player); }
:root[data-theme="cinema"] .ft-media video { height: 100%; max-height: none; background: var(--cn-player); }
:root[data-theme="cinema"] .ft-state { padding: 12px; }
:root[data-theme="cinema"] .ft-state small { color: var(--ink-dim); }
:root[data-theme="cinema"] .ft-like { width: 34px; height: 34px; background: rgba(16, 17, 19, .78); border-color: rgba(255, 255, 255, .22); color: #fff; }
:root[data-theme="cinema"] .ft-like.on { color: var(--like-ink); background: var(--cn-like-fill); border-color: #7b4a64; }
:root[data-theme="cinema"] .ft-meta { align-items: center; gap: 8px; padding: 8px 8px 0 10px; font-size: 13px; color: #d4d7de; }
:root[data-theme="cinema"] .ft-info { gap: 2px 0; }
:root[data-theme="cinema"] .ft-info > :is(span, bdi, button) + :is(span, bdi, button)::before { content: "·"; margin: 0 7px; color: var(--ink-faint); }
:root[data-theme="cinema"] .ft-kind, :root[data-theme="cinema"] .ft-kind.draft, :root[data-theme="cinema"] .ft-kind.final { padding: 0; border: 0; font-family: var(--body); font-size: 13px; letter-spacing: 0; text-transform: none; }
:root[data-theme="cinema"] .ft-kind { color: #d4d7de; }
:root[data-theme="cinema"] .ft-kind.draft { color: var(--accent-ink); }
:root[data-theme="cinema"] .ft-kind.final { color: var(--teal-ink); }
:root[data-theme="cinema"] .ft-approved { padding: 2px 7px; border: 1px solid var(--cn-ok-badge); border-radius: 5px; background: var(--cn-ok-fill); color: var(--cn-ok-ink); }
:root[data-theme="cinema"] .ft-more { width: 34px; height: 34px; border-color: var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); color: var(--ink); font-size: 14px; font-weight: 400; }
:root[data-theme="cinema"] .ft-more:hover, :root[data-theme="cinema"] .ft-more[aria-expanded="true"] { background: var(--cn-btn-hover); border-color: var(--cn-btn-line); color: var(--ink); }
:root[data-theme="cinema"] .ft-actions { gap: 6px; padding: 8px 8px 10px; }
:root[data-theme="cinema"] .ft-more-acts > summary.mini-btn { padding-inline: 4px; border-color: transparent; background: none; }
:root[data-theme="cinema"] .ft-more-acts > summary.mini-btn:hover { background: #292c31; }
:root[data-theme="cinema"] .ft-from { color: var(--cn-ref); font-size: 13px; }

/* ── Create Video: References → Prompt → Output ───────────────────────────────────────────── */
:root[data-theme="cinema"] .sd-steps-wrap { gap: 0; padding: 0; }
:root[data-theme="cinema"] .sd-steps-wrap .nbw-steps { flex: 1; }
:root[data-theme="cinema"] .sd-body { margin-top: 0; border-top: 0; }
/* the roles share one card: no colour per role — the @image token says which image it is */
:root[data-theme="cinema"] :is(.sd-sec, .sd-rail-item, [data-kind]) { --sd-c: var(--cn-ref); }
:root[data-theme="cinema"] .sd-assets { grid-template-columns: minmax(0, 1fr) var(--sd-side-w, 205px); }
:root[data-theme="cinema"] .sd-board { gap: 12px; padding: 16px 14px 20px 20px; }
:root[data-theme="cinema"] .sd-board-head { gap: 6px; }
:root[data-theme="cinema"] .sd-board-title { display: block; margin-right: auto; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.45; letter-spacing: -.025em; }
:root[data-theme="cinema"] .sd-board-head .sd-gen-hint { order: 9; flex-basis: 100%; font-size: 13px; line-height: 1.45; color: var(--ink-dim); }
:root[data-theme="cinema"] .sd-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
:root[data-theme="cinema"] .sd-cards-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:root[data-theme="cinema"] .sd-block { background: var(--cn-card); border-color: var(--cn-card-line); border-radius: 10px; }
:root[data-theme="cinema"] .sd-block.sd-card, :root[data-theme="cinema"] .sd-block.sd-card.sd-active { gap: 8px; padding: 14px; border: 1px solid var(--cn-card-line); border-radius: 10px; background: var(--cn-card); box-shadow: var(--cn-card-shadow); }
:root[data-theme="cinema"] .sd-block.sd-card.sd-active { border-color: var(--cn-sel-line); }
:root[data-theme="cinema"] .sd-card-head b { font-size: 15px; font-weight: 700; }
:root[data-theme="cinema"] .sd-chip { padding: 0; border: 0; background: none; color: var(--cn-ref); font-family: var(--mono); font-size: 12px; }
:root[data-theme="cinema"] button.sd-chip:hover { background: none; text-decoration: underline; }
:root[data-theme="cinema"] .sd-drop.sd-card-img { aspect-ratio: 16 / 9; border-radius: 6px; }
:root[data-theme="cinema"] .sd-empty .sd-card-img { background: #14161a; border: 1px dashed #77727d; }
:root[data-theme="cinema"] .sd-empty-zone { font-size: 13px; color: var(--ink-dim); }
:root[data-theme="cinema"] .sd-main-img .sd-n { background: rgba(16, 17, 19, .82); }
:root[data-theme="cinema"] :is(.sd-name, .sd-note) { background: var(--cn-field); border-color: var(--cn-field-line); border-radius: 8px; color: var(--ink); font-size: 14px; }
:root[data-theme="cinema"] .sd-name { font-weight: 400; }
:root[data-theme="cinema"] .sd-add-btn { min-height: 34px; padding: 7px 10px; border-color: var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); color: var(--ink); font-size: 14px; font-weight: 400; text-align: center; }
:root[data-theme="cinema"] .sd-add-btn:hover { background: var(--cn-btn-hover); border-color: var(--cn-btn-line); color: var(--ink); }
:root[data-theme="cinema"] .sd-plus { width: 26px; height: 26px; border-color: var(--cn-btn-line); background: var(--cn-btn); color: var(--ink); }
:root[data-theme="cinema"] .sd-side { gap: 10px; margin: 16px 20px 16px 0; padding: 14px; border-color: var(--cn-card-line); border-radius: 10px; background: var(--cn-card); box-shadow: var(--cn-card-shadow); }
:root[data-theme="cinema"] .sd-side::before { content: "Model input"; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--cn-mono); }
:root[data-theme="cinema"] .sd-side-head { flex-wrap: wrap; }
:root[data-theme="cinema"] .sd-side-head b { font-family: var(--display); font-weight: 700; font-size: 16px; }
:root[data-theme="cinema"] .sd-side-head .mini-btn { min-height: 28px; padding: 4px 8px; font-size: 12px; }
:root[data-theme="cinema"] .sd-order { gap: 4px; }
:root[data-theme="cinema"] .sd-order li { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; padding: 4px 2px; border: 0; border-radius: 6px; background: none; }
:root[data-theme="cinema"] .sd-order-n { display: none; }
:root[data-theme="cinema"] .sd-order img { width: 30px; height: 30px; border-radius: 4px; }
:root[data-theme="cinema"] .sd-order-meta b { font-size: 13px; font-weight: 400; line-height: 1.3; color: var(--cn-ref); }
:root[data-theme="cinema"] .sd-order-meta small { font-size: 13px; line-height: 1.3; color: var(--ink); white-space: normal; }
:root[data-theme="cinema"] .sd-side-note { font-size: 12px; color: var(--ink-dim); }
:root[data-theme="cinema"] .sd-footbar, :root[data-theme="cinema"] .sd-launchbar { padding: 12px 20px; border-top-color: var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); }
:root[data-theme="cinema"] .sd-ready b { font-size: 14px; }
:root[data-theme="cinema"] .sd-ready span { font-size: 13px; color: var(--ink-dim); }
:root[data-theme="cinema"] :is(.sd-footbar .sd-next, .sd-launchbar .sd-generate) { min-height: 34px; padding: 7px 14px; font-size: 14px; }

@media (min-width: 1200px) and (max-width: 1450px) { :root[data-theme="cinema"] .nbr-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
@media (max-width: 1430px) { :root[data-theme="cinema"] .sd-assets { grid-template-columns: minmax(0, 1fr) var(--sd-side-w, 180px); } }
@media (max-width: 1450px) { :root[data-theme="cinema"] .ft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1199px) {
  :root[data-theme="cinema"] .nbw-cols, :root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed) { grid-template-columns: 48px minmax(300px, 340px) minmax(0, 1fr); }
  :root[data-theme="cinema"] .sd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) { :root[data-theme="cinema"] .sd-assets { grid-template-columns: minmax(0, 1fr); } :root[data-theme="cinema"] .sd-side { position: static; max-height: none; margin: 0 20px 16px; } }
@media (max-width: 720px) { :root[data-theme="cinema"] :is(.ft-grid, .sd-cards, .sd-cards-frames) { grid-template-columns: minmax(0, 1fr); } }

/* ── Home: the last project in a still, the way back into it, the four spaces under it ─────── */
:root[data-theme="cinema"] .space-view .home { display: none; }
:root[data-theme="cinema"] .home-cinema { display: block; padding: 22px; }
:root[data-theme="cinema"] .hc-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 420px; overflow: hidden; border: 1px solid var(--cn-btn-line); border-radius: 12px;
  background: linear-gradient(90deg, #101216 4%, #101216ee 28%, #10121642 70%, #10121600 100%), linear-gradient(0deg, #090a0cdd, transparent 37%), var(--still) center 44% / cover no-repeat, #15171a; }
:root[data-theme="cinema"] .hc-hero.no-still { background: radial-gradient(70% 90% at 82% 30%, #2a2620, transparent 70%), linear-gradient(0deg, #090a0cdd, transparent 37%), #15171a; }
:root[data-theme="cinema"] .hc-copy { padding: 35px 5% 62px; }
:root[data-theme="cinema"] .hc-eyebrow { display: flex; align-items: center; margin: 0; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--cn-mono); }
:root[data-theme="cinema"] .hc-eyebrow i { width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--accent); }
:root[data-theme="cinema"] .hc-eyebrow span { margin: 0 10px; opacity: .5; }
:root[data-theme="cinema"] .hc-hero h1 { margin: 23px 0 15px; font: 700 clamp(62px, 7.3vw, 113px) / .90 var(--display); letter-spacing: -.085em; color: var(--ink); }
:root[data-theme="cinema"] .hc-lead { margin: 0 0 21px; font-size: 16px; line-height: 1.45; color: #d8dae0; }
:root[data-theme="cinema"] .hc-lead strong { color: var(--ink); }
:root[data-theme="cinema"] .hc-go { display: inline-flex; align-items: center; gap: 23px; min-height: 34px; padding: 11px 17px; border: 1px solid var(--cn-primary-line); border-radius: 8px; background: var(--cn-primary);
  box-shadow: 0 2px 0 #8e612c, inset 0 1px #ffe2a3; color: var(--cn-primary-ink); font-size: 14px; font-weight: 700; text-decoration: none; }
:root[data-theme="cinema"] .hc-go span { font-size: 17px; line-height: 1; }
:root[data-theme="cinema"] .hc-go:hover { background: #ffd383; }
:root[data-theme="cinema"] .hc-caption { position: absolute; inset-inline: 0; bottom: 0; display: flex; justify-content: space-between; gap: 16px; padding: 15px 22px; border-top: 1px solid #ffffff30;
  background: #10121580; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--cn-mono); }
:root[data-theme="cinema"] .hc-caption span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="cinema"] .hc-tools { padding: 20px 0 2px; }
:root[data-theme="cinema"] .hc-tools-head { display: flex; align-items: center; justify-content: space-between; }
:root[data-theme="cinema"] .hc-tools-head h2, :root[data-theme="cinema"] .hc-tools-head span { margin: 0; font: 700 11px/1.2 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--cn-mono); }
:root[data-theme="cinema"] .hc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
:root[data-theme="cinema"] .hc-card { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid #363a40; border-radius: 10px; background: linear-gradient(150deg, #25282d, #181a1e 75%); color: var(--ink); text-decoration: none; transition: border-color .12s ease; }
:root[data-theme="cinema"] .hc-card:hover { border-color: var(--cn-sel-line); }
:root[data-theme="cinema"] .hc-card-top { display: flex; align-items: center; justify-content: space-between; }
:root[data-theme="cinema"] .hc-ico { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #605038; border-radius: 8px; background: #373027; color: var(--accent-ink); }
:root[data-theme="cinema"] .hc-ico svg { width: 18px; height: 18px; }
:root[data-theme="cinema"] .hc-n { font: 700 10px/1 var(--mono); letter-spacing: .08em; color: var(--cn-mono); }
:root[data-theme="cinema"] .hc-card h3 { margin: 12px 0 2px; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.45; letter-spacing: -.025em; }
:root[data-theme="cinema"] .hc-card p { flex: 1; margin: 0 0 11px; font-size: 14px; line-height: 1.45; color: var(--ink-dim); }
:root[data-theme="cinema"] .hc-meta { color: var(--ink-faint); white-space: nowrap; }
:root[data-theme="cinema"] .hc-link { font-size: 14px; color: var(--accent-ink); }
:root[data-theme="cinema"] .hc-card:hover .hc-link { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1050px) { :root[data-theme="cinema"] .hc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  :root[data-theme="cinema"] .home-cinema { padding: 12px; }
  :root[data-theme="cinema"] .hc-hero { min-height: 360px; }
  :root[data-theme="cinema"] .hc-hero h1 { font-size: 57px; }
  :root[data-theme="cinema"] .hc-copy { padding-left: 20px; }
  :root[data-theme="cinema"] .hc-caption { font-size: 9px; }
  :root[data-theme="cinema"] .hc-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Narrow windows ──────────────────────────────────────────────────────────────────────── */
/* the buttons only a narrow window shows (app.js wireNarrow): ☰ the sidebar, the project's views as a menu */
:root[data-theme="cinema"] .tb-scenes { width: 34px; height: 34px; flex-shrink: 0; place-items: center; padding: 0; border: 1px solid var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); color: var(--ink); cursor: pointer; }
:root[data-theme="cinema"] .tb-scenes:hover, :root[data-theme="cinema"] .tb-scenes[aria-expanded="true"] { background: var(--cn-btn-hover); }
:root[data-theme="cinema"] .tb-scenes svg { width: 18px; height: 18px; }
:root[data-theme="cinema"] .tb-tools-btn { flex-shrink: 0; align-items: center; gap: 6px; min-height: 34px; padding: 7px 10px; border: 1px solid var(--cn-btn-line); border-radius: 8px; background: var(--cn-btn); color: var(--ink); font-family: var(--body); font-size: 14px; cursor: pointer; }
:root[data-theme="cinema"] .tb-tools-btn::after { content: "▾"; font-size: 11px; }
:root[data-theme="cinema"] .tb-tools-btn:hover, :root[data-theme="cinema"] .tb-tools-btn[aria-expanded="true"] { background: var(--cn-btn-hover); }
/* 1051–1199: the takes in two columns, Create Frame's three columns narrower */
@media (max-width: 1199px) {
  :root[data-theme="cinema"] .nbw-cols { grid-template-columns: var(--nbw-refs-w, 300px) var(--nbw-prompts-w, 300px) minmax(0, 1fr); }
  :root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed) { grid-template-columns: 48px var(--nbw-prompts-w, 320px) minmax(0, 1fr); }
  :root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed):has(.nbp-edit-refs) { grid-template-columns: var(--nbw-prompts-w, 320px) minmax(0, 1fr); }
  :root[data-theme="cinema"] .nbs-text small { display: none; }
}
@media (max-width: 1100px) {
  :root[data-theme="cinema"] #app .tb-tools-btn { display: inline-flex; margin-left: auto; }
  :root[data-theme="cinema"] #app .tb-views { display: none; }
  :root[data-theme="cinema"] #app .tb-views.open { position: fixed; z-index: 270; display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 210px; padding: 6px;
    border: 1px solid var(--cn-btn-line); border-radius: 10px; background: var(--panel-2); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); }
  :root[data-theme="cinema"] #app .tb-views.open .tb-view { padding: 9px 10px; border-radius: 6px; font-size: 14px; text-align: left; }
  :root[data-theme="cinema"] #app .tb-views.open .tb-view.active { box-shadow: inset 3px 0 var(--accent); }
}
/* a phone: the sidebar a drawer over the page, the tools in rows, every screen one column */
@media (max-width: 720px) {
  :root[data-theme="cinema"] #app { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme="cinema"] .topbar { gap: 6px; padding-right: 10px; }
  :root[data-theme="cinema"] #app .tb-brand { gap: 8px; padding-left: 10px; }
  :root[data-theme="cinema"] #app:not(.space-home, .admin-mode) .tb-scenes, :root[data-theme="cinema"] #app.admin-mode .tb-scenes { display: grid; }
  :root[data-theme="cinema"] .tb-wordmark { width: 80px; }
  :root[data-theme="cinema"] :is(.crumb-client, .tb-crumbs > .crumb-sep) { display: none; }
  :root[data-theme="cinema"] .crumb-project { max-width: 30vw; font-size: 12px; }
  :root[data-theme="cinema"] .tb-tools-btn { font-size: 0; gap: 0; }
  :root[data-theme="cinema"] .tb-tools-btn::before { content: "Tools"; font-size: 14px; }
  :root[data-theme="cinema"] .tb-tools-btn::after { margin-left: 5px; }
  :root[data-theme="cinema"] .tb-share { padding-inline: 8px; }
  :root[data-theme="cinema"] .tb-theme { width: 34px; padding: 0; justify-content: center; }
  :root[data-theme="cinema"] .tb-theme .tb-theme-name { display: none; }
  :root[data-theme="cinema"] .tb-theme .sun { display: block; }
  :root[data-theme="cinema"] #app .tb-admin.studio-only { display: none; }
  :root[data-theme="cinema"] #app .sidebar, :root[data-theme="cinema"] #app.sb-peek .sidebar { position: fixed; top: 58px; bottom: 0; left: 0; z-index: 90; width: min(300px, 86vw); visibility: hidden; transform: translateX(-105%); transition: transform .2s ease, visibility .2s; }
  :root[data-theme="cinema"] #app.sb-drawer .sidebar { visibility: visible; transform: none; box-shadow: 18px 0 40px -12px rgba(0, 0, 0, .85); }
  :root[data-theme="cinema"] .ws-header { padding: 12px 12px 0; }
  :root[data-theme="cinema"] .sh-title { font-size: 24px; }
  :root[data-theme="cinema"] .sh-brief { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  :root[data-theme="cinema"] .ws-toolrow { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  :root[data-theme="cinema"] .ws-tabs { flex-wrap: wrap; row-gap: 4px; overflow: visible; }
  :root[data-theme="cinema"] .tab-group + .tab-group { margin-left: 0; }
  :root[data-theme="cinema"] .tab-row { flex-wrap: wrap; }
  :root[data-theme="cinema"] .tab { padding: 6px 8px 8px; }
  :root[data-theme="cinema"] .nbw-steps { gap: 6px; padding: 8px 12px; }
  :root[data-theme="cinema"] .nbs-step, :root[data-theme="cinema"] button.nbs-step { padding: 6px 8px; }
  :root[data-theme="cinema"] .nbs-text b { font-size: 13px; }
  /* the page scrolls as one: each screen's columns under each other */
  :root[data-theme="cinema"] .ws-body { display: block; overflow-y: auto; }
  :root[data-theme="cinema"] .gen-panel { display: flex; flex-direction: column; height: auto; overflow: visible; }
  :root[data-theme="cinema"] :is(.gen-left, .gen-right) { overflow: visible; border-right: 0; padding: 14px 12px; }
  :root[data-theme="cinema"] #genBtn { align-self: stretch; }
  :root[data-theme="cinema"] .nbw { display: block; }
  :root[data-theme="cinema"] .nbw-cols, :root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed), :root[data-theme="cinema"] .nbw-cols:has(.rb-collapsed):has(.nbp-edit-refs) { display: flex; flex-direction: column; }
  :root[data-theme="cinema"] :is(.nbw-refs, .nbw-prompts, .nbw-results, .nbp-scroll) { min-height: 0; overflow: visible; border-right: 0; }
  :root[data-theme="cinema"] .nbw-refs:has(.rb-collapsed) .rb-rail { flex-direction: row; justify-content: center; padding: 10px; }
  :root[data-theme="cinema"] .nbw-refs:has(.rb-collapsed) .rb-rail-label { writing-mode: horizontal-tb; }
  :root[data-theme="cinema"] .rb-grid { overflow: visible; }
  :root[data-theme="cinema"] .nbr-grid { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme="cinema"] .footage { padding: 14px 12px 32px; overflow: visible; }
  :root[data-theme="cinema"] .ft-tools { margin-left: 0; }
  :root[data-theme="cinema"] .sd-body { display: block; }
  :root[data-theme="cinema"] .sd-main { overflow: visible; }
  :root[data-theme="cinema"] .sd-board { padding: 14px 12px 18px; }
  :root[data-theme="cinema"] .sd-side { margin: 0 12px 14px; }
  :root[data-theme="cinema"] .sd-footbar, :root[data-theme="cinema"] .sd-launchbar { padding: 10px 12px; flex-wrap: wrap; }
  :root[data-theme="cinema"] .sd-out, :root[data-theme="cinema"] .sd-body.step-output .sd-out { width: auto; min-width: 0; max-width: none; border-left: 0; }
  :root[data-theme="cinema"] .pv-title h2 { font-size: 24px; }
}

:root[data-theme="cinema"] .fl-more { display: none; }
@media (max-width: 720px) { :root[data-theme="cinema"] #app.space-projects #tbCrumbs { display: none; } :root[data-theme="cinema"] #app .tb-tools-btn { margin-left: auto; } }
/* ══ end of Cinema ══ */

/* ── SCRIPT TO FOOTAGE (films.js, docs/films.md) ───────────────────────────────────────────── */
/* home: a fifth cube, for the two who have it (and in Cinema a fifth card, in the same row) */
@media (min-width: 1051px) { :root[data-theme="cinema"] .hc-grid:has(> .hc-card:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.home-cubes:has(> .cube:nth-child(5)) { grid-template-columns: 1fr 1.15fr 1fr 1fr 1fr; width: min(1560px, 100%); }
@media (max-width: 1380px) and (min-width: 901px) { .home-cubes:has(> .cube:nth-child(5)) { grid-template-columns: 1fr 1fr 1fr; width: min(1100px, 100%); } }
.art-fl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12%; }
.af-strip { width: 78%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6%; padding: 6% 5%; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 9px; background: var(--bg-2); }
.af-strip i { aspect-ratio: 16 / 10; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.af-lines { width: 62%; display: grid; gap: 7px; }
.af-lines i { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.af-lines i:nth-child(2) { width: 84%; } .af-lines i:nth-child(3) { width: 56%; }
/* the sidebar: every film */
.fl-snav { display: flex; flex-direction: column; min-height: 0; }
.fl-nav { overflow: auto; padding: 0 10px 14px; display: grid; gap: 4px; }
.fl-nav-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; color: var(--ink-dim); cursor: pointer; text-decoration: none; }
.fl-nav-item:hover, .fl-nav-item:focus-visible { background: var(--panel); color: var(--ink); outline: none; }
.fl-nav-item.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.fl-nav-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fl-nav-t b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-nav-t small { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-nav-item .fl-x { opacity: 0; }
.fl-nav-item:hover .fl-x, .fl-nav-item.active .fl-x { opacity: .7; }
.sb-collapsed:not(.sb-peek) .fl-nav { display: none; }
/* Cinema keeps its sidebar wide even when folded: the films and the castings stay listed in it, as
   Describe's files and the scenes do */
:root[data-theme="cinema"] #app .fl-nav { display: grid; }
/* the page */
.fl { max-width: 1180px; margin: 0 auto; padding: 18px 28px 80px; display: grid; gap: 18px; }
.fl-loading { padding: 40px; color: var(--ink-dim); }
.fl-stages { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.fl-stage { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-dim); font-family: var(--body); font-size: 13px; font-weight: 700; cursor: pointer; }
.fl-stage b { color: var(--ink-faint); margin-right: 3px; }
.fl-stage.on { border-color: var(--accent); color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.fl-stage.on b { color: var(--accent-ink); }
.fl-stage:disabled { opacity: .45; cursor: default; }
.fl-sum { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.fl-body { display: grid; gap: 18px; }
.fl-sec { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.fl-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.fl-sec-head h3 { margin: 0; font-family: var(--body); font-size: 15px; font-weight: 800; color: var(--ink); }
.fl-hint { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; }
.fl-empty { margin: 0; font-size: 13px; color: var(--ink-faint); }
.fl-warn { margin: 0; font-size: 12.5px; color: var(--danger-ink); }
.fl-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fl-count { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.fl textarea, .fl input:not([type="file"]):not([type="checkbox"]), .fl select {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 13.5px; line-height: 1.5; outline: none; resize: vertical; }
.fl textarea:focus, .fl input:focus, .fl select:focus { border-color: var(--accent); }
.fl-script { min-height: 200px; }
.fl-x { flex-shrink: 0; width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-faint); font-size: 12px; cursor: pointer; }
.fl-x:hover { color: var(--danger-ink); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.fl-x:disabled { opacity: .3; cursor: default; }
/* ① the style picture */
.fl-look { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 16px; align-items: start; }
.fl-drop { position: relative; }
.fl-drop.over { outline: 2px dashed var(--accent); outline-offset: 3px; }
.fl-look-pic { aspect-ratio: 16 / 10; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg); color: var(--ink-dim); cursor: pointer; overflow: hidden; text-align: center; }
.fl-look-pic.has { border-style: solid; cursor: default; }
.fl-look-pic img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.fl-look-pic span { display: grid; gap: 4px; font-weight: 700; }
.fl-look-pic small { font-weight: 500; color: var(--ink-faint); }
.fl-pic-busy { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); font-size: 12.5px; }
.fl-look-side { display: grid; gap: 10px; min-width: 0; }
.fl-style summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--teal-ink); }
.fl-style pre { max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--bg); color: var(--ink-dim); font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; }
/* ① what the team brings */
.fl-bring { display: grid; gap: 8px; }
.fl-row { display: grid; grid-template-columns: 28px minmax(120px, 200px) minmax(140px, auto) 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--bg-2); }
.fl-row .rp-badge { margin: 0; }
.fl-kind { font-size: 18px; text-align: center; }
.fl-pics { display: flex; align-items: center; gap: 5px; min-height: 44px; }
.fl-pics img { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; cursor: zoom-in; }
.fl-pic-add { width: 44px; height: 44px; border: 1px dashed var(--line); border-radius: 7px; background: none; color: var(--ink-dim); cursor: pointer; font-size: 16px; }
.fl-pic-add:hover { border-color: var(--accent); color: var(--accent-ink); }
.fl-pick { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); display: grid; gap: 10px; max-height: 420px; overflow: auto; }
.fl-pick-head { display: flex; align-items: center; justify-content: space-between; }
.fl-pick-g { display: grid; gap: 6px; }
.fl-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-pick-a { width: 96px; display: grid; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink-dim); font-size: 11px; cursor: pointer; text-align: center; }
.fl-pick-a:hover { border-color: var(--accent); color: var(--ink); }
.fl-pick-a img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.fl-pick-a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-settings { grid-template-columns: auto auto 1fr; align-items: end; gap: 14px 22px; }
.fl-set { display: grid; gap: 6px; }
.fl-set .field-label { margin: 0; }
.fl-num { width: 110px !important; }
.fl-notes { grid-column: 1 / -1; }
.fl-gate { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: 0 -10px 30px -18px var(--drop); }
.fl-go { padding: 12px 22px; font-size: 14px; }
.fl-gate .fl-hint { flex: 1; min-width: 240px; }
/* ② the plan */
.fl-plan-head { display: grid; gap: 10px; }
.fl-live { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--panel)); color: var(--ink); font-size: 13.5px; }
.fl-live .spinner, .fl-pill .spinner, .fl-pic-busy .spinner, .fl-pics .spinner { border-color: color-mix(in srgb, var(--ink) 25%, transparent); border-top-color: var(--accent); }
.fl-clock { font-family: var(--mono); color: var(--ink-dim); }
.fl-live .mini-btn { margin-left: auto; }
.fl-strategy { padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--panel); }
.fl-strategy b { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); }
.fl-strategy p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.fl-cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fl-chipcard { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 6px 8px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--bg-2); }
.fl-chipcard b { font-size: 13.5px; }
.fl-chipcard .fl-role, .fl-chipcard textarea, .fl-chipcard .fl-in { grid-column: 1 / -1; }
.fl-use { padding: 2px 8px; border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); color: var(--ink-faint); }
.fl-use.team { border-color: color-mix(in srgb, var(--teal) 50%, var(--line)); color: var(--teal-ink); }
.fl-use.new { border-color: color-mix(in srgb, var(--violet) 50%, var(--line)); color: var(--violet-ink); }
.fl-role { margin: 0; font-size: 12.5px; color: var(--ink-dim); }
.fl-in { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.fl-planclips { display: grid; gap: 10px; }
.fl-pc { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg-2); }
.fl-pc.off { opacity: .5; }
.fl-pc header, .fl-ch { display: flex; align-items: center; gap: 10px; }
.fl-n { font-family: var(--mono); font-size: 13px; color: var(--accent-ink); }
.fl-t { flex: 1; min-width: 0; font-size: 14.5px; }
.fl-len { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); }
.fl-see { margin: 0; font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.fl-story { margin: 0; font-size: 12.5px; color: var(--ink-dim); }
.fl-hear { margin: 0; font-size: 13px; font-style: italic; color: var(--ink); }
.fl-sound { margin: 0; font-size: 12.5px; color: var(--ink-dim); }
.fl-shots { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-dim); }
.fl-cam { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.fl-names { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fl-names span { padding: 2px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-dim); }
/* ③ the assets */
.fl-acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.fl-acard { position: relative; display: grid; align-content: start; gap: 8px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg-2); }
.fl-acard > img, .fl-apic { width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--bg); }
.fl-acard > img { object-fit: cover; cursor: zoom-in; }
.fl-apic { position: relative; display: grid; place-items: center; }
.fl-apic img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.fl-pic-none { font-size: 12.5px; color: var(--ink-faint); padding: 0 12px; text-align: center; }
.fl-ahead { display: flex; align-items: center; gap: 8px; }
.fl-ahead b { flex: 1; min-width: 0; font-size: 14px; }
.fl-from { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-faint); }
.fl-from img { width: 30px; height: 30px; object-fit: cover; border-radius: 5px; cursor: zoom-in; }
.fl-real { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fl-real .rp-badge { margin: 0; }
.fl-acard .mini-btn { padding: 6px 10px; font-size: 11.5px; }
/* ④ the clips */
.fl-bar { position: sticky; top: 52px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.fl-bar > b { margin-right: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }
.fl-player { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #000; display: grid; gap: 8px; }
.fl-player video { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }
.fl-play-head { display: flex; align-items: center; justify-content: space-between; color: #eee; font-size: 13px; }
.fl-clips { display: grid; gap: 14px; }
.fl-clip { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.fl-ch .fl-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.fl-stepper { flex-shrink: 0; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.fl-stepper button { width: 30px; height: 32px; border: 0; background: var(--bg); color: var(--ink); font-size: 15px; cursor: pointer; }
.fl-stepper button:disabled { opacity: .35; cursor: default; }
.fl-stepper b { min-width: 44px; text-align: center; font-family: var(--mono); font-size: 13px; }
.fl-pill { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--ink-faint); white-space: nowrap; }
.fl-pill.ok { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); color: var(--teal-ink); }
.fl-pill.stale { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent-ink); }
.fl-pill.busy { color: var(--ink); }
.fl-field { display: grid; gap: 5px; }
.fl-field > span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.fl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fl-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fl-refs .field-label { margin: 0 4px 0 0; }
.fl-ref { display: inline-flex; align-items: center; gap: 5px; padding: 4px 4px 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); font-size: 12.5px; }
.fl-ref small { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.fl-ref:not(:has(.fl-x)) { padding-right: 10px; }
.fl-ref.none { border-style: dashed; color: var(--ink-dim); }
.fl-addref select { width: auto !important; padding: 5px 9px !important; font-size: 12px !important; border-radius: 999px !important; }
.fl-shotbox summary, .fl-promptbox summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-dim); }
.fl-shot { display: grid; grid-template-columns: 18px 64px 74px minmax(90px, 130px) minmax(120px, 1fr) 2fr 24px; align-items: start; gap: 6px; margin-top: 8px; }
.fl-shot > b { padding-top: 9px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.fl-shot input, .fl-shot textarea { padding: 7px 8px !important; font-size: 12.5px !important; }
.fl-shotbox .mini-btn { margin-top: 8px; }
.fl-prompt { margin: 0; max-height: 420px; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--bg); color: var(--ink-dim); font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.fl-promptbox .fl-prompt { margin-top: 8px; }
.fl-prompt.live { border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--line)); max-height: 220px; }
.fl-render { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fl-render .ft-render.primary { color: #06201b; background: var(--teal); border-color: var(--teal); font-weight: 800; }
.fl-renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fl-renders:empty { display: none; }
.fl-rv { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg-2); font-size: 12px; color: var(--ink-dim); }
.fl-rv.failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.fl-rv video { width: 100%; max-height: 320px; object-fit: contain; border-radius: 7px; background: #000; }
.fl-rv .mini-btn { padding: 5px 9px; font-size: 11.5px; text-decoration: none; }
@media (max-width: 900px) {
  .fl { padding: 12px 12px 70px; }
  .fl-look, .fl-two, .fl-settings { grid-template-columns: 1fr; }
  .fl-row { grid-template-columns: 28px 1fr auto; }
  .fl-row .fl-pics, .fl-row .fl-notes-in { grid-column: 1 / -1; }
  .fl-shot { grid-template-columns: 18px 1fr 1fr 24px; }
  .fl-shot textarea, .fl-shot input[data-f="shot-move"] { grid-column: 2 / -1; }
  .fl-bar { top: 46px; }
}

/* ✎ Mark (public/markup.js, docs/markup.md): an attached picture in Edits marked up, where the change
   goes and how big. Its ✎ on the thumb, the marked copy badged, and the window it's drawn in. */
.thumb .mk-open { position: absolute; right: 2px; bottom: 2px; min-width: 20px; height: 20px; padding: 0 5px; border: none; border-radius: 5px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; line-height: 20px; cursor: pointer; }
.thumb .mk-open:hover, .thumb .mk-open:focus-visible { background: var(--accent); }
.thumb .thumb-mk { position: absolute; left: 2px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 8.5px; line-height: 14px; white-space: nowrap; pointer-events: none; }
.thumb.marked { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb.marked .mk-open { bottom: auto; top: 22px; }
.adv-instr-refs .chat-att-thumb.marked { outline: 2px solid var(--accent); outline-offset: 1px; }
/* …and wherever pictures are made (2026-11-15): Create Frame's board, the ✎ Tweak windows (Assets, a
   storyboard's frames, Cast & Locations) and Swap Character. A marked picture shows its marks, badged. */
.rb-mk-on, .sbd-mk-on, .cs-mk-on, .swap-mk-on { position: absolute; left: 6px; top: 6px; z-index: 1; padding: 0 6px; border-radius: 5px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 10px; line-height: 17px; white-space: nowrap; pointer-events: none; }
.rb-thumb:not(.rb-main) .rb-mk-on { left: 2px; top: 2px; padding: 0 3px; font-size: 8px; line-height: 12px; }
.rb-thumb.rb-marked { outline: 2px solid var(--accent); outline-offset: -2px; }
.rb-mk { position: absolute; z-index: 1; height: 18px; padding: 0 5px; border: 0; border-radius: 5px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 18px; white-space: nowrap; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
.rb-thumb .rb-mk { right: 2px; bottom: 2px; }
.rb-thumb.rb-main .rb-mk { right: 24px; top: 3px; bottom: auto; }
.rb-thumb:hover .rb-mk, .rb-thumb:focus-within .rb-mk, .rb-thumb.rb-main.rb-marked .rb-mk { opacity: 1; }
.rb-mk:hover, .rb-mk:focus-visible { background: var(--accent); }
.at-pic.at-marked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.at-mark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sbd-tweak { flex-wrap: wrap; }
.sbd-tweak input { flex: 1 1 100%; }
.sbd-tweak-note .sbd-unmark { margin-left: 6px; padding: 2px 8px; font-size: 11px; }
.cs-pic { position: relative; }
.swap-slot.marked .swap-slot-inner { border: 2px solid var(--accent); }
.swap-slot-inner .swap-mk-on { padding: 0 6px; color: #fff; font-size: 10px; text-align: left; }
.swap-mark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.modal-overlay.mk-overlay { z-index: 260; padding: 14px; }
.mk { display: flex; flex-direction: column; gap: 10px; width: min(1440px, 100%); height: min(960px, 100%); padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.5); color: var(--ink); }
.mk-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.mk-head h3 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 500; }
.mk-sub { color: var(--ink-dim); font-size: 12.5px; line-height: 1.45; }
.mk-bar, .mk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mk-gap { flex: 1; }
.mk-tools .seg { white-space: nowrap; }
.mk-colors { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; }
.mk-sw { width: 22px; height: 22px; padding: 0; border: 2px solid rgba(0,0,0,.35); border-radius: 50%; background: var(--sw); cursor: pointer; }
.mk-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.mk-widths .seg { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; }
.mk-widths .seg i { display: block; width: 20px; height: var(--lw); border-radius: 3px; background: currentColor; }
.mk-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; background: #0d0e10; }
.mk-canvas { display: block; max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; user-select: none; }
.mk-canvas.text { cursor: text; }
.mk-text { position: absolute; min-width: 4ch; margin: 0; padding: 0 4px; border: 1px dashed rgba(255,255,255,.75); border-radius: 3px; background: rgba(0,0,0,.28); font-family: "Nimbus Sans", "Helvetica Neue", Arial, sans-serif; font-weight: 700; line-height: 1.15; text-shadow: 0 0 3px #000, 0 0 2px #000; outline: none; }
.mk-text.hidden { display: none; }
.mk-count { color: var(--ink-dim); font-size: 12.5px; }
@media (max-width: 720px) {
  .modal-overlay.mk-overlay { padding: 6px; }
  .mk { padding: 10px; gap: 8px; }
  .mk-sub { display: none; }
  .mk-tools .seg { padding-left: 7px; padding-right: 7px; }
}

/* ── CAST & LOCATIONS (casting.js, docs/casting.md) ──────────────────────────────────────────── */
/* the page, a project's Cast or Locations tab (or a casting of its own, at /casting): the workspace
   body scrolls it (a tool's body doesn't scroll, its panels do), its rows as tall as they are */
.ws-body:has(> .cs) { display: block; overflow-y: auto; }
.cs { max-width: 1240px; margin: 0 auto; padding: 18px 28px 80px; display: grid; align-content: start; gap: 16px; }
/* a project's tab: its head is a project view's (the way back floats over the page, as in Library) */
.cs.in-project > .pv-backbar { justify-self: start; margin-bottom: -4px; }
.cs.in-project > .pv-head { margin-bottom: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cs.in-project .pv-sub { max-width: 820px; }
.cs-head { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.cs-mode .seg { font-size: 13px; padding: 8px 14px; }
.cs-mode .seg small { margin-left: 4px; font-family: var(--mono); font-size: 10.5px; opacity: .75; }
.cs-for { font-size: 12.5px; color: var(--ink-faint); }
.cs-for b { color: var(--ink-dim); }
.cs-sp { flex: 1; }
.cs .mini-btn.accent { border-color: var(--accent); background: var(--accent); color: #1a1206; }
.cs .mini-btn.accent:hover { filter: brightness(1.07); }
.cs .mini-btn:disabled, .cs .modal-btn:disabled { opacity: .45; cursor: default; filter: none; }
.cs .mini-btn.ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
.cs .mini-btn.ghost[data-del]:hover { color: var(--danger-ink); border-color: var(--danger); }
.cs-lead { margin: 0; max-width: 820px; font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); }
.cs-done { margin: 0; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-done[hidden] { display: none; }
.cs-empty { margin: 0; font-size: 13px; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }
/* the form: a person or a place, a relative, a brief changed */
.cs-form { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.cs-form-h { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding-right: 34px; }
.cs-form-h b { font-size: 15px; font-weight: 800; color: var(--ink); }
.cs-form-h small { font-size: 12.5px; color: var(--ink-faint); }
/* its ✕, in sight at its top (Esc too): closed, nothing kept */
.cs-form-x { position: absolute; top: -6px; right: -6px; width: 32px; height: 32px; border-radius: 8px; line-height: 1; }
.cs-form-x:hover { background: var(--panel-2); }
/* the producer's own words first, the fields folded under them, optional */
.cs-free textarea { min-height: 76px; font-size: 14px; line-height: 1.5; }
.cs-more { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.cs-more > summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 700; color: var(--ink-dim); list-style-position: inside; }
.cs-more > summary small { margin-left: 6px; font-weight: 400; color: var(--ink-faint); }
.cs-more[open] > summary { border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.cs-more[open] { padding-bottom: 12px; }
/* an option's ✎ Tweak: what to change, in words, and its take on the way */
.cs-tweak { display: grid; gap: 6px; margin: 0 10px; padding: 8px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--radius-sm); background: var(--panel); }
.cs-tweak textarea { width: 100%; min-height: 54px; resize: vertical; font-size: 13px; }
.cs-tweak-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cs-tweak-foot small { font-size: 11.5px; color: var(--ink-faint); }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.cs-f { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.cs-f > span small { font-weight: 400; color: var(--ink-faint); }
.cs-f.wide { grid-column: 1 / -1; }
.cs-f.off { opacity: .5; }
.cs-f input, .cs-f select, .cs-f textarea { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13px; }
.cs-f textarea { resize: vertical; line-height: 1.5; }
.cs-f input:focus, .cs-f select:focus, .cs-f textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -1px; }
.cs-f select:disabled { cursor: not-allowed; }
.cs-fam { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 12px; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.cs-from { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-from-pic { width: 96px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: var(--panel-2); cursor: pointer; }
.cs-from-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-from-pic.on { border-color: var(--accent); }
.cs-none { font-weight: 400; color: var(--ink-faint); }
.cs-drop { display: grid; gap: 8px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-faint); font-weight: 400; }
.cs-drop.over, .cs-drop:focus-visible { border-color: var(--accent); outline: none; color: var(--ink-dim); }
.cs-drop-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cs-drop-row input { flex: 1 1 220px; }
.cs-refs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cs-ref { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.cs-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-ref-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; cursor: pointer; }
.cs-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 4px; }
.cs-k { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.cs-seg .seg:disabled { opacity: .45; cursor: not-allowed; }
/* a role: its head, then its options */
.cs-roles { display: grid; gap: 18px; }
.cs-role { display: grid; gap: 12px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-left: calc(var(--depth, 0) * 28px); }
.cs-role.kin { border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--line)); }
.cs-role-h { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 14px; }
.cs-role-t { display: grid; gap: 3px; min-width: 0; }
.cs-role-t h3 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--ink); }
.cs-role-t small { font-size: 12.5px; color: var(--ink-dim); }
.cs-role-t .cs-eng { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.cs-kin { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.cs-role-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-role .cs-form { background: var(--panel-2); }
.cs-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.cs-opt { margin: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.cs-opt.approved { border-color: var(--ok, #3fbf8f); box-shadow: 0 0 0 1px var(--ok, #3fbf8f); }
.cs-pic { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: var(--panel-2); cursor: zoom-in; }
.cs-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-opt figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 0 10px; font-size: 12.5px; color: var(--ink-dim); }
.cs-opt figcaption b { color: var(--ink); font-size: 13px; }
.cs-tag { color: var(--ink-faint); }
.cs-b { padding: 2px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.cs-b.ok { background: color-mix(in srgb, var(--ok, #3fbf8f) 18%, transparent); color: var(--ok-ink, #5fd6a8); }
.cs-b.note { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); }
.cs-notes { display: grid; gap: 6px; padding: 0 10px; }
.cs-note { margin: 0; display: grid; gap: 2px; padding: 7px 9px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.cs-note span { white-space: pre-line; overflow-wrap: anywhere; }
.cs-note small { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.cs-angles { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.cs-angles:empty { display: none; }
.cs-ang { width: 76px; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; display: inline-flex; align-items: center; justify-content: center; }
.cs-ang img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.cs-acts .mini-btn { padding: 6px 10px; text-decoration: none; }
.cs-acts .mini-btn.on { color: var(--ok-ink, #5fd6a8); border-color: var(--ok, #3fbf8f); }
.cs-in { margin: 0; padding: 0 10px; font-size: 12px; color: var(--ink-faint); }
.cs-link { padding: 0; border: 0; background: none; color: var(--accent-ink); font: inherit; text-decoration: underline; cursor: pointer; }
.cs-skel { min-height: 180px; align-items: center; justify-content: center; gap: 10px; padding: 12px; color: var(--ink-faint); font-size: 12px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.cs-ang.cs-skel { min-height: 0; padding: 0; }
/* ⤓ into a project: the window */
.modal-card.cs-conn { max-width: 620px; display: grid; gap: 12px; }
.cs-conn .modal-head h3 { font-size: 18px; }
.cs-conn-top { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.cs-conn-top img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.cs-conn-top .modal-sub { margin: 0; }
.cs-conn-as { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.cs-conn-as small { flex-basis: 100%; font-size: 12px; color: var(--ink-faint); line-height: 1.45; }
.cs-conn-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cs-conn-h input { flex: 0 1 220px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font-size: 13px; }
.cs-conn-list { display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; padding: 2px; }
.cs-conn-p { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; color: var(--ink); cursor: pointer; }
.cs-conn-p small { color: var(--ink-faint); }
.cs-conn-p em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-faint); }
.cs-conn-p.there { opacity: .6; cursor: default; }
.cs-conn .modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.cs-working { margin-right: auto; font-size: 12.5px; color: var(--ink-dim); }
@media (max-width: 900px) {
  .cs { padding: 12px 12px 70px; }
  .cs-head { top: 46px; }
  .cs-fam { grid-template-columns: 1fr; }
  .cs-role { margin-left: calc(var(--depth, 0) * 12px); }
  .cs-conn-top { grid-template-columns: 1fr; }
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── STYLE's pictures (app.js paintStyleRefs, fillToAll; docs/style.md → Fill to all) ──────────── */
/* a picture seen large with a click, a picture dropped on the row, and ✨ Fill to all's window */
.style-thumb { cursor: zoom-in; }
.style-thumb:hover { border-color: var(--accent); }
.bf-analyze.drop-on { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.fa-card { max-width: 560px; }
.fa-top { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.fa-top .modal-sub { margin: 0; }
.fa-pic { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; }
.fa-pic img { display: block; width: 100%; height: auto; max-height: 132px; object-fit: cover; }
.fa-list { display: grid; gap: 8px; margin-top: 14px; }
.fa-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.fa-row.on { border-color: var(--accent); }
.fa-row input { margin-top: 3px; flex: none; }
.fa-row span { display: grid; gap: 2px; min-width: 0; }
.fa-row b { font-size: 14px; color: var(--ink); }
.fa-row small { font-size: 12.5px; color: var(--ink-faint); }
.fa-note { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-faint); }
@media (max-width: 560px) {
  .fa-top { grid-template-columns: 1fr; }
  .fa-pic img { max-height: 220px; }
}

/* ── Storyboard ③ Assets: ＋ Build an asset from a picture (storyboard.js buildHtml; docs/storyboard.md) ── */
/* the builder over the cards: the pictures on the left, what they're for and ✨ Create asset on the right */
.sbd-build { margin: 0 0 22px; padding: 16px 18px 18px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius); background: var(--panel); animation: sbdIn .2s ease-out; }
.sbd-build-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sbd-build-head b { font-size: 15px; color: var(--ink); }
.sbd-build-head small { display: block; max-width: 760px; margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.sbd-build-head > .mini-btn { margin-left: auto; flex: none; }
.sbd-build-cols { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.25fr); gap: 18px; align-items: start; }
.sbd-build-drop { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--bg); transition: border-color .15s; }
.sbd-build-drop.empty { min-height: 230px; }
.sbd-build-drop.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.sbd-build-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--ink-faint); }
.sbd-build-empty b { font-size: 14px; color: var(--ink-dim); }
.sbd-build-empty label.mini-btn { margin-top: 4px; cursor: pointer; }
.sbd-build-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sbd-build-pic { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.sbd-build-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sbd-build-pic button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: rgba(0,0,0,.66); color: #fff; font-size: 12px; line-height: 24px; cursor: pointer; }
.sbd-build-pic button:hover { background: var(--danger); }
.sbd-build-add { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1.5px dashed var(--line); border-radius: 8px; color: var(--ink-faint); font-size: 22px; cursor: pointer; }
.sbd-build-add:hover { border-color: var(--accent); color: var(--accent-ink); }
.sbd-build-say { font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); }
.sbd-build-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sbd-build-row { display: flex; flex-direction: column; min-width: 0; }
.sbd-build-row .field-label { margin-bottom: 6px; }
.sbd-build-row select, .sbd-build-row input, .sbd-build-row textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 13.5px; outline: none; }
.sbd-build-row textarea { resize: vertical; line-height: 1.5; }
.sbd-build-row select:focus, .sbd-build-row input:focus, .sbd-build-row textarea:focus { border-color: var(--accent); }
.sbd-build-row input:disabled { color: var(--ink-dim); opacity: .8; cursor: not-allowed; }
.sbd-build-row .mode-toggle { align-self: flex-start; flex-wrap: wrap; }
.sbd-build-row .mode-toggle .seg { padding: 6px 11px; font-size: 12px; }
.sbd-build-row > .sbd-build-say { margin-top: 6px; }
.sbd-build-go-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.sbd-build-go-row .generate-btn { width: auto; flex: none; padding: 10px 18px; }
.sbd-build-go-row .generate-btn:disabled { opacity: .5; cursor: not-allowed; }
.sbd-build-hint { flex: 1; min-width: 200px; font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
/* the frames a member is in: one chip a frame (the builder's, and a card's ✎ Frames) */
.sbd-frame-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sbd-fchip { min-width: 34px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink-faint); font-family: var(--mono); font-size: 11px; cursor: pointer; }
.sbd-fchip:hover:not(:disabled) { border-color: var(--ink-faint); color: var(--ink); }
.sbd-fchip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent-ink); }
.sbd-fchip:disabled { cursor: default; opacity: .75; }
.sbd-ent-in-row { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.sbd-ent-link { padding: 0; border: 0; background: none; color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; cursor: pointer; }
.sbd-ent-link:hover:not(:disabled), .sbd-ent-link.on { color: var(--accent-ink); }
.sbd-ent-link.off:hover:not(:disabled) { color: var(--danger-ink); }
.sbd-ent-link:disabled { opacity: .5; cursor: not-allowed; }
.sbd-ent.flash { animation: sbdFlash 1.6s ease-out 1; }
@media (max-width: 860px) {
  .sbd-build-cols { grid-template-columns: 1fr; }
  .sbd-build-drop.empty { min-height: 160px; }
  .sbd-build-pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ══ SHYOW Storyboard (docs/storyboard-product.md) ═════════════════════════════════════════════
   The Storyboard space as a product of its own, in plnty.app's language (Yossi, 2026-11-17): a near
   white page, a tight grotesk (Inter Tight; Inter for text; Heebo for Hebrew and the ₪ sign), pills
   for every control, black for the action that moves the work on, white cards that float. It rides on
   the light theme (index.html puts data-theme="light" with data-product="storyboard") and changes
   nothing a button does: only how it looks, its brand, and which spaces the product shows. Every
   rule is scoped to :root[data-product="storyboard"], so the studio's three themes stay as they were
   (test/storyboard-product.test.mjs checks that). */
@font-face { font-family: 'Inter Tight'; src: url('/fonts/InterTight-var.woff2?v=1') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-var.woff2?v=1') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Heebo'; src: url('/fonts/Heebo-Hebrew-var.woff2?v=1') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
/* the product's own pieces, out of sight anywhere else */
.tb-logo-sb, .empty-mark-sb, .auth-sb, .auth-sub-sb { display: none !important; }

:root[data-product="storyboard"] {
  color-scheme: light;
  --bg: #f7f7f5;
  --bg-2: #f7f7f5;
  --panel: #ffffff;
  --panel-2: #f0eee9;
  --line: #e3e0d9;
  --line-soft: #ece9e3;
  --ink: #1a1a19;
  --ink-dim: #45433e;
  --ink-faint: #6c6962;
  --accent: #1a1a19;        /* the action that moves the work on, and what's picked: black, as plnty's */
  --accent-2: #6c46f0;
  --gold: #f2c230;
  --like: #f2477a;
  --violet: #ab96ff;
  --teal: #3fbf8f;
  --danger: #e5483d;
  --accent-ink: #1a1a19;
  --accent-2-ink: #5232d6;
  --gold-ink: #6b5200;
  --like-ink: #c42358;
  --violet-ink: #5232d6;
  --teal-ink: #0c6b43;
  --danger-ink: #b42318;
  --glow-a: transparent;
  --glow-b: transparent;
  --drop: rgba(26, 26, 25, .22);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 22px 44px -22px rgba(26, 26, 25, .32), 0 2px 6px rgba(26, 26, 25, .05);
  --mono: 'Inter Tight', 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Inter Tight', 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* the product's own */
  --sp-pill: #e8e5de;
  --sp-pill-hover: #d8d2c5;
  --sp-lilac: #ab96ff;
  --sp-lilac-ink: #2c0c5c;
  --sp-lilac-deep: #6c46f0;
  --sp-lilac-wash: #ece6ff;
  --sp-sun: #f6d04e;
  --sp-mint: #a6e3c4;
  --sp-mint-ink: #0c3322;
  --sp-card: 0 1px 0 rgba(26, 26, 25, .04), 0 16px 34px -26px rgba(26, 26, 25, .5);
  --sp-card-hover: 0 1px 0 rgba(26, 26, 25, .04), 0 22px 40px -24px rgba(26, 26, 25, .55);
}
/* the lightbox, the full-screen board and a scene card stay dark (the picture in the light), in the
   product's type */
:root[data-product="storyboard"] :is(.lightbox, .sbd-screen, .sc-card) {
  --mono: 'Inter Tight', 'Heebo', system-ui, sans-serif;
  --display: 'Inter Tight', 'Heebo', system-ui, sans-serif;
  --body: 'Inter', 'Heebo', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 11px;
}
:root[data-product="storyboard"] body { background: var(--bg); letter-spacing: -.005em; }
:root[data-product="storyboard"] ::selection { background: var(--sp-lilac-wash); color: var(--ink); }
:root[data-product="storyboard"] :focus-visible { outline: 2px solid var(--sp-lilac-deep); outline-offset: 2px; }
:root[data-product="storyboard"] * { scrollbar-width: thin; scrollbar-color: #d3cfc6 transparent; }

/* ── the top bar: the product's mark and name, pills on the right ── */
:root[data-product="storyboard"] #app { grid-template-rows: 58px minmax(0, 1fr); }
:root[data-product="storyboard"] .topbar { gap: 14px; padding-right: 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
:root[data-product="storyboard"] .tb-brand { width: auto; min-width: var(--sb-w); gap: 12px; padding: 0 14px 0 18px; border-right: 0; justify-content: flex-start; }
:root[data-product="storyboard"] .tb-logo:not(.tb-logo-sb) { display: none !important; }
:root[data-product="storyboard"] .tb-logo-sb { display: inline-flex !important; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
:root[data-product="storyboard"] .tb-sbmark { width: 24px; height: 24px; flex: none; }
:root[data-product="storyboard"] .tb-sbname { font: 500 16.5px/1 var(--display); letter-spacing: -.03em; white-space: nowrap; }
:root[data-product="storyboard"] .tb-sbname b { font-weight: 700; }
:root[data-product="storyboard"] .sb-toggle { margin-left: 0; width: 28px; height: 28px; border: 0; border-radius: 9px; background: var(--sp-pill); color: var(--ink); }
:root[data-product="storyboard"] .sb-toggle:hover { background: var(--sp-pill-hover); color: var(--ink); }
:root[data-product="storyboard"] .sb-collapsed .tb-brand { padding: 0 14px 0 18px; justify-content: flex-start; }
:root[data-product="storyboard"] .crumb-space { color: var(--ink-faint); font: 500 13.5px/1 var(--display); letter-spacing: -.01em; text-decoration: none; }
:root[data-product="storyboard"] .crumb-space:hover { color: var(--ink); }
:root[data-product="storyboard"] .crumb-sep { color: #c9c4b8; }
:root[data-product="storyboard"] .crumb-project { font: 600 15px/1.2 var(--display); letter-spacing: -.02em; border-radius: 9px; }
:root[data-product="storyboard"] .crumb-project:hover { border-color: transparent; background: var(--sp-pill); }
:root[data-product="storyboard"] .crumb-project:focus { border-color: var(--sp-lilac-deep); background: #fff; }
:root[data-product="storyboard"] :is(.tb-share, .tb-admin) { height: 30px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--sp-pill); color: var(--ink); font: 500 13px/1 var(--display); letter-spacing: -.01em; }
:root[data-product="storyboard"] :is(.tb-share, .tb-admin):hover { background: var(--sp-pill-hover); color: var(--ink); }
/* (Admin is the studio's: the product has no way into the studio, the team's included, Yossi 2026-11-17) */
:root[data-product="storyboard"] .tb-admin { display: none !important; }
:root[data-product="storyboard"] .tb-theme, :root[data-product="storyboard"] .theme-pop { display: none !important; }
:root[data-product="storyboard"] .tb-user { width: 32px; height: 32px; border: 0; background: var(--ink); color: #f7f7f5; font: 600 13px/1 var(--display); }
:root[data-product="storyboard"] .tb-user:hover, :root[data-product="storyboard"] .tb-user[aria-expanded="true"] { background: #000; color: #fff; }
:root[data-product="storyboard"] .user-pop { border: 0; border-radius: 16px; box-shadow: var(--shadow); }
/* a storyboard's projects belong to the studio, and the product has no way into it: Link to a project and
   Move into a project are on the same storyboard in app.shyow.io, not here */
:root[data-product="storyboard"] #sbLinks { display: none; }

/* ── the sidebar: the storyboards, as cards ── */
:root[data-product="storyboard"] .sidebar { background: var(--bg); border-right: 1px solid var(--line); }
:root[data-product="storyboard"] #app.sb-peek .sidebar { box-shadow: 18px 0 40px -18px rgba(26, 26, 25, .22); }
:root[data-product="storyboard"] .space-nav { margin: 12px 12px 2px; padding: 3px; gap: 2px; border: 0; border-radius: 12px; background: var(--sp-pill); }
:root[data-product="storyboard"] .spn { width: 32px; height: 30px; border-radius: 9px; color: var(--ink-faint); }
:root[data-product="storyboard"] .spn:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
:root[data-product="storyboard"] .spn.active { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(26, 26, 25, .12); }
:root[data-product="storyboard"] .spn:not([data-space="storyboards"]):not([data-space="assets"]) { display: none !important; }
:root[data-product="storyboard"] .sn-head { padding: 14px 14px 10px 18px; }
:root[data-product="storyboard"] .sn-label { font: 600 15px/1 var(--display); letter-spacing: -.025em; text-transform: none; color: var(--ink); }
:root[data-product="storyboard"] .sn-count { font: 500 12px/1 var(--display); color: var(--ink-faint); }
:root[data-product="storyboard"] .sn-add { height: 28px; padding: 0 11px; border: 0; border-radius: 9px; background: var(--ink); color: #f7f7f5; font: 500 12.5px/1 var(--display); letter-spacing: -.01em; }
:root[data-product="storyboard"] .sn-add:hover { background: #000; color: #fff; border-color: transparent; }
:root[data-product="storyboard"] .sb-collapsed:not(.sb-peek) .sn-add { width: 32px; height: 32px; padding: 0; justify-content: center; font-size: 0; }
:root[data-product="storyboard"] .sb-collapsed:not(.sb-peek) .sn-add::before { font-size: 15px; }
:root[data-product="storyboard"] .sn-list { gap: 6px; padding: 2px 10px 14px; }
:root[data-product="storyboard"] .sn-item { border: 0; border-radius: 14px; background: transparent; }
:root[data-product="storyboard"] .sn-item:hover { background: rgba(26, 26, 25, .045); }
:root[data-product="storyboard"] .sn-item.active { background: #fff; box-shadow: var(--sp-card); }
:root[data-product="storyboard"] .sn-thumb { border-radius: 9px; background: var(--panel-2); box-shadow: none; }
:root[data-product="storyboard"] .sn-title, :root[data-product="storyboard"] .sn-name { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
:root[data-product="storyboard"] .bn-sub:has(.bn-free) { display: none; }
:root[data-product="storyboard"] :is(.pl-empty, .bn-search) { font-family: var(--body); }

/* ── controls: pills ── */
:root[data-product="storyboard"] .mini-btn { border: 0; border-radius: 10px; background: var(--sp-pill); color: var(--ink); font-family: var(--display); font-weight: 500; letter-spacing: -.01em; transition: background-color .15s ease, color .15s ease; }
:root[data-product="storyboard"] .mini-btn:hover:not(:disabled) { background: var(--sp-pill-hover); color: var(--ink); border-color: transparent; }
:root[data-product="storyboard"] .mini-btn.on { background: var(--ink); color: #f7f7f5; }
:root[data-product="storyboard"] .mini-btn.primary { background: var(--ink); color: #f7f7f5; }
:root[data-product="storyboard"] .mini-btn.primary:hover:not(:disabled) { background: #000; color: #fff; }
:root[data-product="storyboard"] .mini-btn.ghost { background: transparent; color: var(--ink-faint); }
:root[data-product="storyboard"] .mini-btn.ghost:hover:not(:disabled) { background: var(--sp-pill); color: var(--danger-ink); }
:root[data-product="storyboard"] .mode-toggle { padding: 3px; gap: 2px; border: 0; border-radius: 12px; background: var(--sp-pill); }
:root[data-product="storyboard"] .mode-toggle .seg { border: 0; border-radius: 9px; background: transparent; color: var(--ink-dim); font-family: var(--display); font-weight: 500; letter-spacing: -.01em; }
:root[data-product="storyboard"] .mode-toggle .seg + .seg { border-left: 0; }
:root[data-product="storyboard"] .mode-toggle .seg:hover { color: var(--ink); }
:root[data-product="storyboard"] .mode-toggle .seg.active { background: var(--ink); color: #f7f7f5; }
:root[data-product="storyboard"] :is(.generate-btn, .new-project-btn, .auth-submit) { background: var(--ink); color: #f7f7f5; box-shadow: none; border-radius: 14px; font-family: var(--body); font-weight: 500; letter-spacing: -.012em; }
:root[data-product="storyboard"] :is(.generate-btn, .new-project-btn, .auth-submit):hover:not(:disabled) { background: #000; transform: none; filter: none; }
:root[data-product="storyboard"] .tool-actions { gap: 6px; }
:root[data-product="storyboard"] .ws-header { border-bottom: 0; }

/* ── the six stages: a row of pills, the one open in black ── */
:root[data-product="storyboard"] .sbd-rail { gap: 6px; margin: 14px 28px 0; border: 0; border-radius: 0; background: none; overflow: visible; }
:root[data-product="storyboard"] .sbd-step { gap: 9px; padding: 9px 12px; border-radius: 14px; background: var(--panel-2); color: var(--ink-faint); transition: background-color .15s ease, color .15s ease; }
:root[data-product="storyboard"] .sbd-step + .sbd-step { border-left: 0; }
:root[data-product="storyboard"] .sbd-step:hover:not(:disabled):not(.active) { background: var(--sp-pill); }
:root[data-product="storyboard"] .sbd-step-t b { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
:root[data-product="storyboard"] .sbd-step-t small { font-family: var(--display); }
:root[data-product="storyboard"] .sbd-step-n { border: 0; background: rgba(26, 26, 25, .08); color: var(--ink-dim); font-family: var(--display); font-weight: 600; }
:root[data-product="storyboard"] .sbd-step.done { background: #fff; color: var(--ink-dim); box-shadow: var(--sp-card); }
:root[data-product="storyboard"] .sbd-step.done .sbd-step-n { background: var(--sp-mint); color: var(--sp-mint-ink); border-color: transparent; }
:root[data-product="storyboard"] .sbd-step.active { background: var(--ink); color: rgba(247, 247, 245, .72); box-shadow: none; }
:root[data-product="storyboard"] .sbd-step.active b { color: #f7f7f5; }
:root[data-product="storyboard"] .sbd-step.active .sbd-step-n { background: rgba(255, 255, 255, .16); border-color: transparent; color: #fff; }
:root[data-product="storyboard"] .sbd-step:disabled { opacity: .5; }
:root[data-product="storyboard"] .sbd-body { border-top: 0; }

/* ── the gate: what's done, and the black button that moves it on ── */
:root[data-product="storyboard"] .sbd-gate { padding: 12px 28px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
:root[data-product="storyboard"] .sbd-gate-status { font-family: var(--display); font-size: 14px; color: var(--ink-dim); letter-spacing: -.01em; }
:root[data-product="storyboard"] .sbd-gate-go { padding: 13px 20px; border-radius: 14px; font-size: 15px; }

/* ── headings ── */
:root[data-product="storyboard"] .sbd :is(h2, h3, h4) { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; }
:root[data-product="storyboard"] :is(.sbd-list-head h3, .sbd-hero h2) { font-family: var(--display); font-weight: 600; letter-spacing: -.035em; }
:root[data-product="storyboard"] .sbd-style-head h2 { font-size: 30px; line-height: 1.05; letter-spacing: -.04em; }
:root[data-product="storyboard"] .sbd-style-head p { font-size: 14px; color: var(--ink-faint); }
:root[data-product="storyboard"] .sbd-style-t b { font-weight: 600; letter-spacing: -.02em; }
:root[data-product="storyboard"] .sbd-list-head h3 { font-size: 26px; }
:root[data-product="storyboard"] .sbd-hero h2 { font-size: 34px; line-height: 1.02; }
:root[data-product="storyboard"] .sbd-hero p { font-size: 15px; color: var(--ink-faint); }
:root[data-product="storyboard"] .pv-count { font-family: var(--display); font-size: 13px; font-weight: 500; letter-spacing: -.01em; }
:root[data-product="storyboard"] .sbd-engine { font-family: var(--display); font-size: 12.5px; }
:root[data-product="storyboard"] .sbd-engine.fixed { padding: 6px 10px; border-radius: 10px; background: var(--panel-2); color: var(--ink-dim); }
:root[data-product="storyboard"] .empty-state h1 { font-family: var(--display); font-weight: 600; font-size: 46px; letter-spacing: -.045em; line-height: 1; }
:root[data-product="storyboard"] .empty-state p { color: var(--ink-faint); font-size: 16px; margin-top: 10px; }
:root[data-product="storyboard"] .empty-mark:not(.empty-mark-sb) { display: none; }
:root[data-product="storyboard"] .empty-mark-sb { display: block !important; width: 56px; height: 56px; margin-bottom: 18px; }
:root[data-product="storyboard"] .new-project-btn.big { margin-top: 22px; padding: 14px 22px; font-size: 16px; }

/* ── cards: white, floating, no frame line ── */
:root[data-product="storyboard"] :is(.sbd-frame, .sbd-ent, .sbd-style, .sbd-shot, .sbd-mrow, .sbd-block) { border-color: transparent; background: #fff; box-shadow: var(--sp-card); }
:root[data-product="storyboard"] :is(.sbd-frame, .sbd-ent, .sbd-shot, .sbd-mrow, .sbd-block) { border-radius: 18px; }
:root[data-product="storyboard"] .sbd-frame { padding: 8px 8px 12px; }
:root[data-product="storyboard"] .sbd-frame-pic { border-radius: 12px; }
:root[data-product="storyboard"] .sbd-frame-meta { padding: 2px 4px 0; }
:root[data-product="storyboard"] .sbd-frame-meta b { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
:root[data-product="storyboard"] :is(.sbd-frame-story, .sbd-frame-hear, .sbd-frame-sum, .sbd-frame-change, .sbd-frame-acts, .sbd-frame-edit) { margin-inline: 4px; }
:root[data-product="storyboard"] .sbd-frame-hear { border-inline-start-color: var(--sp-lilac); }
:root[data-product="storyboard"] .sbd-n { display: inline-grid; place-items: center; min-width: 26px; height: 21px; padding: 0 5px; border-radius: 7px; background: var(--ink); color: #f7f7f5; font-family: var(--display); font-size: 11.5px; font-weight: 600; }
:root[data-product="storyboard"] .sbd-dur { border: 0; background: var(--panel-2); font-family: var(--display); font-weight: 500; }
:root[data-product="storyboard"] .sbd-frame-refs { font-family: var(--display); }
:root[data-product="storyboard"] .sbd-shot:hover { border-color: transparent; box-shadow: var(--sp-card-hover); }
:root[data-product="storyboard"] .sbd-shot.new { border-color: var(--ink); }
:root[data-product="storyboard"] .sbd-shot.changed { border-color: var(--sp-lilac); }
:root[data-product="storyboard"] .sbd-shot.editing { border-color: var(--sp-lilac-deep); background: #fff; }
:root[data-product="storyboard"] .sbd-title { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-size: 15.5px; }
:root[data-product="storyboard"] .sbd-style { border-radius: 16px; }
:root[data-product="storyboard"] .sbd-style:hover { border-color: transparent; box-shadow: var(--sp-card-hover); }
:root[data-product="storyboard"] :is(.sbd-style.on, .sbd-style.to) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink), var(--sp-card); }
:root[data-product="storyboard"] .sbd-style-t, :root[data-product="storyboard"] .sbd-style-label { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
:root[data-product="storyboard"] :is(.sbd-chip, .sbd-fchip, .sbd-castchip) { border: 0; background: var(--panel-2); font-family: var(--display); font-weight: 500; letter-spacing: -.005em; }
:root[data-product="storyboard"] .sbd-chip.move { background: color-mix(in srgb, var(--teal) 16%, #fff); }
:root[data-product="storyboard"] .sbd-badge { border: 0; font-family: var(--display); letter-spacing: 0; }
:root[data-product="storyboard"] .sbd-badge.new { background: var(--ink); color: #f7f7f5; }
:root[data-product="storyboard"] .sbd-badge.changed { background: var(--sp-lilac-wash); color: var(--sp-lilac-ink); }

/* ── fields ── */
:root[data-product="storyboard"] .sbd :is(textarea, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])) { border-radius: 12px; border-color: var(--line); }
:root[data-product="storyboard"] .sbd :is(textarea, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])):focus { border-color: var(--sp-lilac-deep); box-shadow: 0 0 0 3px var(--sp-lilac-wash); }
:root[data-product="storyboard"] .auth-input:focus { border-color: var(--sp-lilac-deep); }

/* ── the director: its chat and what it proposes ── */
:root[data-product="storyboard"] .sbd-director { background: var(--bg); border-left: 1px solid var(--line); }
:root[data-product="storyboard"] .sbd-msg > span { font-family: var(--display); font-size: 11.5px; letter-spacing: -.005em; text-transform: none; font-weight: 600; }
:root[data-product="storyboard"] .sbd-msg p { border-radius: 14px; font-size: 13.5px; }
:root[data-product="storyboard"] .sbd-msg.you p { border: 0; background: var(--sp-pill); }
:root[data-product="storyboard"] .sbd-msg.director p { border: 0; background: #fff; box-shadow: var(--sp-card); }
:root[data-product="storyboard"] .sbd-proposal { border: 0; border-radius: 18px; background: var(--sp-lilac-wash); box-shadow: 0 14px 28px -20px rgba(44, 12, 92, .45); }
:root[data-product="storyboard"] .sbd-proposal.writing { border: 1.5px dashed var(--sp-lilac); background: #fff; }
:root[data-product="storyboard"] :is(.sbd-dchip, .sbd-ask) { border-radius: 10px; }

/* ── windows over the page ── */
:root[data-product="storyboard"] .modal-overlay { background: rgba(20, 20, 19, .4); backdrop-filter: blur(3px); }
:root[data-product="storyboard"] .modal-card { border: 0; border-radius: 24px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .45); }
:root[data-product="storyboard"] .modal-card h2, :root[data-product="storyboard"] .modal-card h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; }
:root[data-product="storyboard"] .modal-btn { border-radius: 12px; font-family: var(--body); font-weight: 500; font-size: 14px; letter-spacing: -.01em; }
:root[data-product="storyboard"] .modal-btn.accent { background: var(--ink); color: #f7f7f5; }
:root[data-product="storyboard"] .modal-btn.accent:hover { background: #000; filter: none; }
:root[data-product="storyboard"] .modal-btn.ghost { border: 0; background: var(--sp-pill); color: var(--ink); }
:root[data-product="storyboard"] .modal-btn.ghost:hover { background: var(--sp-pill-hover); }
:root[data-product="storyboard"] .toast { border: 0; border-radius: 14px; background: var(--ink); color: #f7f7f5; font-family: var(--display); font-size: 14px; letter-spacing: -.01em; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); }
:root[data-product="storyboard"] .toast.err { background: #fff1ef; color: var(--danger-ink); box-shadow: 0 0 0 1px #f4c7c1, 0 18px 40px -16px rgba(0, 0, 0, .35); }
:root[data-product="storyboard"] .toast .toast-act { border-radius: 9px; }

/* ── signing in ── */
:root[data-product="storyboard"] .auth-overlay { background: var(--bg); }
:root[data-product="storyboard"] .auth-card { border: 0; border-radius: 26px; background: #fff; box-shadow: 0 30px 70px -34px rgba(26, 26, 25, .45); }
:root[data-product="storyboard"] .auth-wordmark, :root[data-product="storyboard"] #authOverlay .auth-sub:not(.auth-sub-sb) { display: none; }
/* the invitation's page (invite.html) on storyboard.shyow.io: its line says where the invitation stands */
:root[data-product="storyboard"] #invite .auth-sub { margin-top: 10px; font: 400 14.5px/1.5 var(--body); letter-spacing: -.005em; color: var(--ink-faint); }
:root[data-product="storyboard"] .auth-sb { display: inline-flex !important; align-items: center; gap: 10px; margin: 4px auto 6px; color: var(--ink); font: 500 21px/1 var(--display); letter-spacing: -.035em; }
:root[data-product="storyboard"] .auth-sb b { font-weight: 700; }
:root[data-product="storyboard"] .auth-sb svg { width: 30px; height: 30px; }
:root[data-product="storyboard"] .auth-sub-sb { display: block !important; margin-top: 10px; font: 400 14.5px/1.5 var(--body); letter-spacing: -.005em; color: var(--ink-faint); }
:root[data-product="storyboard"] .auth-sub-sb a { color: var(--ink); }
:root[data-product="storyboard"] .auth-input { border-radius: 12px; background: var(--bg); }
:root[data-product="storyboard"] :is(.auth-status, .auth-signout, .auth-or) { font-family: var(--display); letter-spacing: 0; }

/* ── labels in sentence case, in the grotesk (no small capitals spaced out) ── */
:root[data-product="storyboard"] :is(.field-label, .sbd-beat summary, .sbd-cast-group h4, .gen-load-label, .ref-label, .swap-slot-label, .sm-head, .sbd-screen-cap em, .up-who small, .auth-or, .nbp-settings span, .rc-row span) { text-transform: none; letter-spacing: -.005em; font-family: var(--display); font-weight: 600; }
:root[data-product="storyboard"] .field-label { font-size: 12.5px; color: var(--ink-faint); }
:root[data-product="storyboard"] .sbd-cast-group h4 { font-size: 15px; color: var(--ink); }

/* ── menus that open over the page: white, floating ── */
:root[data-product="storyboard"] :is(.sbd-export-menu, .sbd-menu, .user-pop, .ps-pop, .frame-menu) { border: 0; border-radius: 16px; background: #fff; box-shadow: 0 1px 0 rgba(26, 26, 25, .05), 0 24px 48px -20px rgba(26, 26, 25, .38); }
:root[data-product="storyboard"] :is(.sbd-export-menu button, .sbd-menu > button, .user-pop button) { border-radius: 10px; }
:root[data-product="storyboard"] :is(.sbd-export-menu button, .sbd-menu > button, .user-pop button):hover:not(:disabled) { background: var(--panel-2); }
:root[data-product="storyboard"] .sbd-export-menu b { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; }
:root[data-product="storyboard"] .sbd-menu > button span { color: var(--ink); }

/* ── the last buttons that wore the studio's gold ── */
:root[data-product="storyboard"] :is(.send-btn, .bubble .gen-link) { background: var(--ink); color: #f7f7f5; box-shadow: none; filter: none; }
:root[data-product="storyboard"] :is(.send-btn, .bubble .gen-link):hover:not(:disabled) { background: #000; }

/* ── a narrow window, a phone: the mark alone, the stages and the board's tools scroll sideways,
   the gate's button takes the width ── */
@media (max-width: 760px) {
  :root[data-product="storyboard"] .topbar { gap: 8px; padding-right: 12px; }
  :root[data-product="storyboard"] .tb-brand { min-width: 0; gap: 8px; padding: 0 6px 0 14px; }
  :root[data-product="storyboard"] .tb-sbname { display: none; }
  :root[data-product="storyboard"] .tb-crumbs { min-width: 0; }
  :root[data-product="storyboard"] :is(.tb-crumbs .crumb-space, .tb-crumbs > .crumb-sep) { display: none; }
  :root[data-product="storyboard"] .ws-header { padding: 10px 14px 0; }
  :root[data-product="storyboard"] :is(.ws-toolrow, .tool-actions) { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  :root[data-product="storyboard"] .tool-actions { flex-wrap: nowrap; flex-shrink: 1; margin-left: 0; margin-right: auto; }
  :root[data-product="storyboard"] .tool-actions > * { flex-shrink: 0; }
  :root[data-product="storyboard"] .sbd-rail { display: flex; margin: 10px 14px 0; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
  :root[data-product="storyboard"] .sbd-step { flex: 0 0 auto; }
  :root[data-product="storyboard"] .sbd-gate { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  :root[data-product="storyboard"] .sbd-gate-status { flex: 1 1 100%; white-space: normal; font-size: 13px; }
  :root[data-product="storyboard"] .sbd-gate-acts { flex: 1 1 100%; display: flex; gap: 6px; }
  :root[data-product="storyboard"] .sbd-gate-go { flex: 1; padding: 12px 14px; font-size: 14px; white-space: normal; }
}
/* ══ end of SHYOW Storyboard ══ */
