/* Redwell Studio · Frame.io v4 dark studio design system
   Canvas #0b0c10 · panels #151720 · cards #191c26 · accent #5b53ff · stage #000 */

:root {
  --bg: #0b0c10;
  --bg-2: #0f1117;
  --panel: #151720;
  --card: #191c26;
  --hover: #1f2330;
  --active: #252a3a;
  --input: #10121a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: #252936;
  --line-3: rgba(255, 255, 255, 0.14);

  --text: #eceef3;
  --text-2: #b8bccb;
  --text-3: #8b90a1;
  --text-4: #5e6374;

  --accent: #5b53ff;
  --accent-2: #736cff;
  --accent-3: #9a94ff;
  --accent-soft: rgba(99, 91, 255, 0.16);
  --accent-line: rgba(115, 108, 255, 0.5);

  --amber: #eab308;
  --amber-soft: rgba(234, 179, 8, 0.14);
  --amber-line: rgba(234, 179, 8, 0.35);

  --st-approved: #10b981;
  --st-review: #f59e0b;
  --st-changes: #ef4444;
  --st-gen: #3b82f6;
  --st-queued: #818cf8;
  --st-offline: #f97316;
  --st-failed: #ef4444;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --green-soft: rgba(16, 185, 129, 0.13);
  --blue-soft: rgba(59, 130, 246, 0.14);
  --orange-soft: rgba(245, 158, 11, 0.14);
  --indigo-soft: rgba(129, 140, 248, 0.14);
  --burnt-soft: rgba(249, 115, 22, 0.15);

  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --topbar-h: 52px;
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 13.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(115, 108, 255, 0.4); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: var(--r-sm); }

.mono { font-family: var(--mono); font-feature-settings: normal; }
.muted { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.grow { flex: 1; }
.spacer { flex: 1; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2b2f3d transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b2f3d; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- icons */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 13px; height: 13px; }
.ico-lg { width: 20px; height: 20px; }
.ico-fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: var(--r);
  background: var(--hover); border: 1px solid var(--line-2); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap; letter-spacing: -0.005em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover:not(:disabled) { background: var(--active); border-color: var(--line-3); }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-danger { background: var(--red); border-color: transparent; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #f05252; border-color: transparent; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: #f87171; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-soft); border-color: transparent; color: #fca5a5; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); gap: 6px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.btn-lg { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-picked { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-3); }

.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: var(--r-sm); color: var(--text-3);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent-3); background: var(--accent-soft); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.danger:hover { color: #f87171; background: var(--red-soft); }
.link-btn { color: var(--accent-3); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- form controls */
input:where(:not([type="checkbox"]):not([type="radio"])), select, textarea {
  width: 100%; min-width: 0;
  background: var(--input); border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--text); font-size: 13px; padding: 0 10px; height: 34px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { padding: 8px 10px; height: auto; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.18); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5' fill='none' stroke='%238b90a1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
select option { background: var(--card); color: var(--text); }
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none;
  border-radius: 4px; border: 1.5px solid rgba(255, 255, 255, 0.28); background: rgba(10, 11, 16, 0.55);
  display: inline-grid; place-items: center; cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
input[type="checkbox"]:hover { border-color: rgba(255, 255, 255, 0.5); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
input[type="checkbox"]:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:indeterminate::after { content: ""; width: 8px; height: 2px; background: #fff; border-radius: 2px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-4); }

/* ---------------------------------------------------------------- badges, pills, segs */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 99px; background: rgba(255, 255, 255, 0.06); color: var(--text-2);
  font-size: 11.5px; font-weight: 500; white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.badge.mono { font-size: 11px; }
.badge-accent { background: var(--accent-soft); color: var(--accent-3); }
.badge-green { background: var(--green-soft); color: #34d399; }
.badge-amber { background: var(--amber-soft); color: #facc15; }
.badge-red { background: var(--red-soft); color: #f87171; }
.badge-blue { background: var(--blue-soft); color: #60a5fa; }
.badge-violet { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; }
.badge-ink { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--text-4); flex: none; display: inline-block; }
.dot-approved, .dot-green { background: var(--st-approved); }
.dot-in_review { background: var(--st-review); }
.dot-needs_changes { background: var(--st-changes); }
.dot-generating { background: var(--st-gen); animation: dot-pulse 1.5s var(--ease) infinite; }
.dot-queued { background: var(--st-queued); }
.dot-offline { background: var(--st-offline); }
.dot-failed { background: var(--st-failed); }
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0); opacity: 0.6; }
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; transition: all 0.15s;
}
.pill:hover { border-color: var(--line-3); color: var(--text); background: var(--hover); }
.pill[aria-pressed="true"], .pill[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }
.pill .n { font: 500 11px var(--mono); color: var(--text-4); }
.pill[aria-pressed="true"] .n, .pill[aria-checked="true"] .n { color: var(--accent-3); }
.pill-ghost { border-style: dashed; background: transparent; color: var(--text-3); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--r-sm); background: var(--hover); border: 1px solid transparent;
  color: var(--text-2); font-size: 12px; font-weight: 500; transition: all 0.15s;
}
.chip:hover { color: var(--text); background: var(--active); }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: #fff; }
.chip-ghost { background: transparent; border: 1px dashed var(--line-3); color: var(--text-3); }

.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r); background: var(--input); border: 1px solid var(--line); }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 6px; color: var(--text-3); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: all 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--active); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.seg .n { font: 500 11px var(--mono); color: var(--text-4); }

.avatar {
  --h: 245;
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 99px;
  background: hsl(var(--h) 70% 62%); color: #0b0c10; font-size: 11.5px; font-weight: 700; letter-spacing: -0.02em;
}
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; border-radius: 12px; }

kbd {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel);
  font: 500 10.5px var(--mono); color: var(--text-4);
}

.spinner { width: 14px; height: 14px; border-radius: 99px; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-2); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 160px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--panel) 0%, var(--card) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: relative; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px; padding: 0 14px 0 16px;
  background: rgba(11, 12, 16, 0.92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(145deg, #ef4b51, #b8242a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.025em; }
.brand-name span { color: var(--text-3); font-weight: 500; }
.brand-pill { font: 600 10px var(--mono); letter-spacing: 0.06em; color: var(--text-3); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); }

.tabs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  border-radius: var(--r); color: var(--text-3); font-size: 13px; font-weight: 500; white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab[aria-selected="true"] { color: var(--text); background: var(--hover); }
.tab-count { font: 500 11px var(--mono); color: var(--text-4); min-width: 0; }
.tab-count:empty { display: none; }
.tab[aria-selected="true"] .tab-count { color: var(--accent-3); }

.topbar-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.tb-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--r); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.tb-btn:hover { background: var(--hover); color: var(--text); }
.tb-pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.tb-pill:hover { border-color: var(--line-3); color: var(--text); }
.tb-pill.is-on .dot { background: var(--st-approved); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.tb-pill.is-wait .dot { background: var(--st-review); }
.rasen-pill { cursor: default; font-variant-numeric: tabular-nums; }
.rasen-pill .dot { background: var(--text-4); }
.rasen-pill.is-on { border-color: rgba(16, 185, 129, 0.4); color: var(--text); }
.rasen-pill.is-on .dot { background: var(--st-approved); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.rasen-pill.is-busy { border-color: rgba(59, 130, 246, 0.5); }
.rasen-pill.is-busy .dot { background: var(--st-gen); animation: dot-pulse 1.3s var(--ease) infinite; }
.rasen-pill.is-off { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; background: var(--red-soft); }
.rasen-pill.is-off .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }
.author { position: relative; display: inline-flex; align-items: center; gap: 0; height: 30px; padding-left: 4px; border-radius: 99px; border: 1px solid var(--line-2); }
.author:hover { border-color: var(--line-3); }
.author select { height: 28px; border: 0; background-color: transparent; padding: 0 26px 0 7px; font-size: 12.5px; font-weight: 500; box-shadow: none; }
.author select:focus { box-shadow: none; }

/* ---------------------------------------------------------------- layout */
.main { height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); position: relative; }
.panel { height: 100%; overflow: auto; }
.panel-queue { overflow: hidden; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 28px 80px; }
.page-wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.lede { margin-top: 4px; color: var(--text-3); font-size: 13.5px; max-width: 720px; }
.page-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 56px 20px; color: var(--text-3); text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); grid-column: 1 / -1; }
.empty-state strong { color: var(--text); font-weight: 600; font-size: 14px; }
.empty-state .ico { width: 28px; height: 28px; color: var(--text-4); margin-bottom: 4px; }

.search { position: relative; display: flex; align-items: center; min-width: 240px; }
.search > .ico { position: absolute; left: 10px; color: var(--text-4); pointer-events: none; }
.search input { padding-left: 32px; padding-right: 34px; height: 32px; border-radius: var(--r); background: var(--input); }
.search kbd { position: absolute; right: 8px; }
.search input::-webkit-search-cancel-button { display: none; }

/* ================================================================ QUEUE */
.queue { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100%; }
.queue[data-mode="player"] { grid-template-columns: minmax(0, 1fr); }
.queue[data-mode="player"] .rail, .queue[data-mode="player"] .browser { display: none; }
.queue[data-mode="browser"] .player { display: none; }

/* ---- left directory rail */
.rail { background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 10px 24px; display: flex; flex-direction: column; gap: 14px; }
.rail-ws { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; border-bottom: 1px solid var(--line); }
.rail-ws-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(140deg, #7c74ff, #4f46e5 55%, #9d4edd); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -0.04em; flex: none; }
.rail-ws b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -0.015em; }
.rail-ws span { font-size: 11.5px; color: var(--text-4); }
.rail-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.rail-sec-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 4px 8px; height: 26px; }
.rail-sec-head .label { font-size: 10.5px; }
.rail-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px;
  border-radius: var(--r-sm); color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; position: relative;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.rail-item[aria-current="true"] { background: var(--hover); color: var(--text); }
.rail-item .ico { color: var(--text-4); }
.rail-item[aria-current="true"] .ico { color: var(--accent-3); }
.rail-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .n { font: 500 11px var(--mono); color: var(--text-4); }
.rail-group-opt .check { width: 14px; display: grid; place-items: center; color: var(--accent-3); }
.tree-row { display: flex; align-items: center; border-radius: var(--r-sm); position: relative; }
.tree-row:hover { background: rgba(255, 255, 255, 0.04); }
.tree-row[aria-current="true"] { background: var(--hover); }
.tree-row .tree-chev { width: 20px; height: 32px; display: grid; place-items: center; color: var(--text-4); flex: none; margin-left: 2px; }
.tree-row .tree-chev .ico { width: 12px; height: 12px; transition: transform 0.15s; }
.tree-row.is-open .tree-chev .ico { transform: rotate(90deg); }
.tree-row .tree-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 32px; padding-right: 4px; color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; }
.tree-row:hover .tree-main, .tree-row[aria-current="true"] .tree-main { color: var(--text); }
.tree-row .tree-main .ico { color: var(--text-4); }
.tree-row[aria-current="true"] .tree-main .ico { color: var(--accent-3); }
.tree-row .tree-main .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .tree-dots { display: inline-flex; gap: 3px; }
.tree-row .tree-dots .dot { width: 6px; height: 6px; }
.tree-row .n { font: 500 11px var(--mono); color: var(--text-4); min-width: 14px; text-align: right; }
.tree-row .tree-more { opacity: 0; width: 24px; height: 24px; margin-right: 4px; }
.tree-row:hover .tree-more, .tree-row .tree-more[aria-expanded="true"] { opacity: 1; }
.tree-row:hover .n { display: none; }
.tree-kids { display: grid; gap: 1px; padding: 2px 0 4px 30px; }
.tree-kid { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: var(--r-sm); color: var(--text-3); font-size: 12.5px; text-align: left; width: 100%; }
.tree-kid:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.tree-kid[aria-current="true"] { color: var(--text); background: var(--hover); }
.tree-kid .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-empty { padding: 8px 10px; font-size: 12px; color: var(--text-4); }

/* ---- browser */
.browser { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.menubar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 20px; min-height: 56px; border-bottom: 1px solid var(--line); background: var(--bg); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.015em; }
.crumbs button, .crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .crumb-link { color: var(--text-3); font-weight: 500; }
.crumbs .crumb-link:hover { color: var(--text); }
.crumbs .sep { color: var(--text-4); font-weight: 400; }
.crumbs .crumb-cur { max-width: 380px; }
.menubar .search { min-width: 220px; flex: 0 1 300px; }
.menubar-sep { width: 1px; height: 20px; background: var(--line-2); flex: none; }
.filter-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; border: 1px solid transparent;
}
.filter-chip:hover { background: var(--hover); color: var(--text); }
.filter-chip.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }
.filter-chip .val { color: var(--text-4); font-weight: 500; }
.filter-chip.is-on .val { color: var(--accent-3); }
.menubar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.browser-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.browser-content { padding: 18px 20px 120px; display: grid; gap: 26px; }
.sec-head { display: flex; align-items: center; gap: 10px; height: 30px; color: var(--text-3); font-size: 12.5px; }
.sec-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-weight: 500; }
.sec-toggle:hover { color: var(--text); }
.sec-toggle .ico { width: 12px; height: 12px; transition: transform 0.15s; }
.sec-toggle[aria-expanded="true"] .ico { transform: rotate(90deg); }
.group-head .sec-toggle { width: 20px; height: 24px; justify-content: center; }
.sec-head .meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-4); }
.sec-head .title { color: var(--text); font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.sec-head .sec-actions { margin-left: auto; display: flex; gap: 4px; }

/* folder cards */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.folder {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg);
  padding: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease);
}
.folder::before {
  content: ""; position: absolute; left: -1px; top: -9px; width: 42%; height: 10px; background: var(--panel);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 14px 0 0;
}
.folder:hover { background: var(--card); border-color: var(--line-3); }
.folder:hover::before { background: var(--card); border-color: var(--line-3); }
.folder.is-drop { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft); }
.folder-collage { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; }
.folder-collage > * { background: #0d0e13; overflow: hidden; position: relative; display: grid; place-items: center; color: var(--text-4); }
.folder-collage > :first-child { grid-row: span 2; }
.folder-collage img, .folder-collage video { width: 100%; height: 100%; object-fit: cover; }
.folder-collage .ico { width: 20px; height: 20px; opacity: 0.6; }
.folder-body { display: flex; align-items: flex-start; gap: 6px; padding: 10px 4px 2px 6px; }
.folder-body .t { flex: 1; min-width: 0; }
.folder-name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.folder-meta .stat { display: inline-flex; align-items: center; gap: 4px; font: 500 11px var(--mono); color: var(--text-3); }
.folder-meta .stat .dot { width: 6px; height: 6px; }
.folder-check { position: absolute; top: 14px; left: 14px; z-index: 2; opacity: 0; transition: opacity 0.12s; }
.folder:hover .folder-check { opacity: 1; }

/* group sections + asset cards */
.group { display: grid; gap: 12px; }
/* defer-rendering-heavy-content: the first group stays above the fold, the rest render on demand */
.group + .group { content-visibility: auto; contain-intrinsic-size: auto 420px; }
.group-head { display: flex; align-items: center; gap: 10px; min-height: 30px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.group-head .title { font-size: 14px; font-weight: 600; letter-spacing: -0.015em; display: inline-flex; align-items: center; gap: 8px; }
.group-head .title .ico { color: var(--text-4); }
.group-head .title button:hover { color: var(--accent-3); }
.group-head .meta { font: 500 11.5px var(--mono); color: var(--text-4); }
.group-head .sec-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.group-head label.selall { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); cursor: pointer; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 16px; }
.asset {
  position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: visible; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.asset:hover { border-color: var(--line-3); background: var(--card); }
.asset.is-selected { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), 0 0 0 4px var(--accent-soft); }
.asset-thumb {
  position: relative; aspect-ratio: 9 / 16; background: #000; border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  overflow: hidden; cursor: pointer; display: block; width: 100%;
}
.asset-thumb video, .asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-img { background: #07080b; }
.thumb-img.is-broken { visibility: hidden; }
.thumb-void, .has-void {
  background: radial-gradient(90% 60% at 50% 38%, rgba(129, 140, 248, 0.08), transparent 72%), linear-gradient(180deg, #0a0b10, #06070a);
}
.thumb-void { position: absolute; inset: 0; display: block; background-repeat: no-repeat; background-size: cover; background-position: center; }

/* Frame.io instant hover scrubbing: 8-frame WebP sprite (tile 8x1), zero video buffering */
.asset-scrub {
  position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none;
  background-repeat: no-repeat; background-size: 800% 100%; background-position: 0% 0%;
  transition: opacity 0.12s linear;
}
.asset-thumb.is-scrub .asset-scrub { opacity: 1; }
.asset-scrubbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 2px; background: rgba(255, 255, 255, 0.14); opacity: 0; transition: opacity 0.12s; pointer-events: none; }
.asset-scrubbar > i { display: block; width: 0; height: 100%; background: var(--accent-3, #818cf8); }
.asset-thumb.is-scrub .asset-scrubbar { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .asset-scrub, .asset-scrubbar { display: none; }
}
.asset-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 22%, transparent 70%, rgba(0, 0, 0, 0.5) 100%); pointer-events: none; opacity: 0.85; transition: opacity 0.15s; }
.asset:hover .asset-thumb::after { opacity: 1; }
.asset-check { position: absolute; top: 10px; left: 10px; z-index: 3; opacity: 0; transition: opacity 0.12s; }
.asset:hover .asset-check, .asset.is-selected .asset-check, .asset-grid.has-sel .asset-check { opacity: 1; }
.asset-status { position: absolute; top: 9px; right: 9px; z-index: 2; }
.asset-dur { position: absolute; right: 9px; bottom: 9px; z-index: 2; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.7); color: #fff; font: 500 11px var(--mono); letter-spacing: 0.02em; }
.asset-dur:empty { display: none; }
.asset-cmts { position: absolute; left: 9px; bottom: 9px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.7); color: #facc15; font: 500 11px var(--mono); }
.asset-play { position: absolute; inset: 0; margin: auto; z-index: 2; width: 46px; height: 46px; border-radius: 99px; display: grid; place-items: center; background: rgba(12, 12, 16, 0.6); color: #fff; backdrop-filter: blur(6px); opacity: 0; transform: scale(0.9); transition: opacity 0.15s, transform 0.15s var(--ease); pointer-events: none; }
.asset-play .ico { width: 18px; height: 18px; margin-left: 2px; }
.asset:hover .asset-play { opacity: 1; transform: scale(1); }
.asset.is-hoverplay .asset-play { opacity: 0; }
.asset-pending { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--text-3); font-size: 12px; background: radial-gradient(80% 60% at 50% 40%, rgba(59, 130, 246, 0.12), transparent 70%), #07080b; }

/* 9:16 placeholder: never show the competitor original as a Redwell preview */
.vcard-placeholder {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px;
  padding: 16px 14px; text-align: center; color: var(--text-3); font-size: 11.5px; line-height: 1.4;
  background: radial-gradient(90% 60% at 50% 38%, rgba(129, 140, 248, 0.1), transparent 72%), linear-gradient(180deg, #0a0b10, #07080b);
}
.vcard-placeholder b { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-2); }
.vcard-placeholder .vph-sub { display: block; max-width: 170px; color: var(--text-4); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.vcard-placeholder .vph-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--text-4); }
.vcard-placeholder .vph-ico .ico { width: 20px; height: 20px; }
.vcard-placeholder .vph-ico.warn { color: var(--st-offline); border-color: rgba(249, 115, 22, 0.3); background: var(--burnt-soft); }
.vcard-placeholder .vph-pulse { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 99px; background: var(--blue-soft); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); animation: vph-glow 1.8s var(--ease) infinite; }
.vcard-placeholder.st-generating b { color: #93c5fd; }
.vcard-placeholder.st-queued b { color: #c7d2fe; }
.vcard-placeholder.st-offline b, .vcard-placeholder.st-failed b { color: #fdba74; }
@keyframes vph-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); }
  60% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}
.asset-thumb.is-placeholder { cursor: pointer; }
.asset-thumb.is-placeholder::after { opacity: 0.35; }
.asset-body { display: grid; gap: 8px; padding: 10px 12px 12px; }
.asset-name-row { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.asset-name {
  flex: 1; min-width: 0; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; border-radius: 4px; cursor: text;
}
.asset-name:hover { color: #fff; background: rgba(255, 255, 255, 0.04); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); }
.asset-more { margin: -4px -6px 0 0; }
.inline-edit { width: 100%; height: 28px !important; font-size: 13px !important; font-weight: 600; padding: 0 7px !important; }
.asset-code { font: 500 10.5px/1.3 var(--mono); color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: copy; }
.asset-code:hover { color: var(--text-3); }
.asset-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); min-width: 0; }
.asset-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-meta .sep { color: var(--text-4); flex: none; }
.asset-fields { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* status pill (button opening a menu) */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 7px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; letter-spacing: -0.005em;
  background: rgba(255, 255, 255, 0.06); color: var(--text-2);
}
.status-pill .dot { width: 7px; height: 7px; }
.status-pill .ico { width: 11px; height: 11px; opacity: 0.7; margin-left: -1px; }
.status-pill.st-approved { background: var(--green-soft); color: #34d399; }
.status-pill.st-in_review { background: var(--orange-soft); color: #fbbf24; }
.status-pill.st-needs_changes { background: var(--red-soft); color: #f87171; }
.status-pill.st-generating { background: var(--blue-soft); color: #60a5fa; }
.status-pill.st-queued { background: var(--indigo-soft); color: #a5b4fc; }
.status-pill.st-offline { background: var(--burnt-soft); color: #fdba74; }
.status-pill.st-failed { background: var(--red-soft); color: #f87171; }
.status-pill.is-patch { background: var(--blue-soft); color: #60a5fa; }
.status-pill.is-patch .dot { background: var(--st-gen); animation: dot-pulse 1.3s var(--ease) infinite; }
.status-pill:hover { filter: brightness(1.15); }
.status-pill.solid { background: rgba(10, 11, 15, 0.78); backdrop-filter: blur(8px); border-color: rgba(255, 255, 255, 0.1); }
.status-pill.lg { height: 30px; padding: 0 11px 0 10px; font-size: 12.5px; }

.stars { display: inline-flex; align-items: center; gap: 1px; }
.stars button { width: 18px; height: 18px; display: grid; place-items: center; color: #3a3f50; transition: color 0.1s, transform 0.1s; }
.stars button .ico { width: 14px; height: 14px; }
.stars button.on { color: #facc15; }
.stars:hover button { color: #facc15; }
.stars button:hover ~ button { color: #3a3f50; }
.stars button:active { transform: scale(0.85); }
.stars.lg button { width: 22px; height: 22px; }
.stars.lg button .ico { width: 17px; height: 17px; }

/* bulk action bar */
.bulkbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; border-radius: 12px;
  background: rgba(27, 30, 41, 0.94); backdrop-filter: blur(16px); box-shadow: var(--shadow-pop);
  animation: rise 0.18s var(--ease);
}
.bulkbar .count { font-size: 13px; font-weight: 600; padding-right: 10px; margin-right: 4px; border-right: 1px solid var(--line-3); white-space: nowrap; }
.bulkbar .count b { color: var(--accent-3); font-family: var(--mono); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---- popover menu */
.menu {
  position: fixed; z-index: 1000; min-width: 210px; max-width: 320px; max-height: min(420px, 70vh); overflow-y: auto;
  padding: 5px; border-radius: 10px; background: #1b1e29; box-shadow: var(--shadow-pop); animation: pop 0.12s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-3px) scale(0.98); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 0 9px; border-radius: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--active); color: var(--text); outline: none; }
.menu-item .ico { color: var(--text-4); }
.menu-item:hover .ico { color: var(--text-2); }
.menu-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .hint { font: 500 11px var(--mono); color: var(--text-4); }
.menu-item .check { color: var(--accent-3); }
.menu-item.danger { color: #f87171; }
.menu-item.danger .ico { color: #f87171; }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu-head { padding: 6px 9px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-4); }
.menu-note { padding: 6px 9px; font-size: 12px; color: var(--text-3); line-height: 1.45; }

/* ================================================================ PLAYER (asset viewer) */
.player { display: flex; flex-direction: column; min-height: 0; height: 100%; background: #000; }
.player-head {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; flex: none;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.player-head .crumbs { flex: 1; min-width: 0; font-size: 13.5px; }
.player-head .crumb-cur { display: inline-flex; align-items: center; gap: 6px; max-width: 520px; border-radius: 6px; padding: 2px 6px; margin-left: -6px; color: var(--text); }
.player-head .crumb-cur:hover { background: var(--hover); }
.player-head .crumb-cur .ico { color: var(--text-4); }
.player-head .crumb-input { width: min(460px, 40vw); height: 30px !important; font-weight: 600; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 6px; border-radius: var(--r); color: var(--text-2); font-size: 13px; font-weight: 500; flex: none; }
.back-btn:hover { background: var(--hover); color: var(--text); }
.nav-counter { display: inline-flex; align-items: center; height: 30px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); flex: none; }
.nav-counter .icon-btn { width: 30px; height: 28px; }
.nav-counter span { font: 500 12px var(--mono); color: var(--text-2); padding: 0 6px; min-width: 62px; text-align: center; white-space: nowrap; }
.variant-pills { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.variant-pills button { height: 24px; padding: 0 10px; border-radius: 6px; font: 600 12px var(--sans); letter-spacing: -0.01em; color: var(--text-3); white-space: nowrap; }
.variant-pills button:hover { color: var(--text); }
.variant-pills button[aria-pressed="true"] { background: var(--active); color: var(--text); }
.toggle-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--r); color: var(--text-2); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); flex: none; }
.toggle-btn:hover { background: var(--hover); color: var(--text); }
.toggle-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }
.head-sep { width: 1px; height: 22px; background: var(--line-2); flex: none; }

.player-body { flex: 1; display: flex; min-height: 0; }
.filmstrip { width: 196px; flex: none; overflow-y: auto; background: var(--bg-2); border-right: 1px solid var(--line); padding: 10px 8px 20px; display: grid; align-content: start; gap: 4px; }
.filmstrip-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px 6px; }
.film { display: flex; align-items: center; gap: 9px; padding: 5px; border-radius: var(--r); text-align: left; width: 100%; border: 1px solid transparent; }
.film:hover { background: var(--hover); }
.film[aria-current="true"] { background: var(--active); border-color: var(--accent-line); }
.film-thumb { width: 38px; aspect-ratio: 9 / 16; border-radius: 5px; overflow: hidden; background: #000; flex: none; position: relative; }
.film-thumb video, .film-thumb img { width: 100%; height: 100%; object-fit: cover; }
.film-thumb .dot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6); }
.film-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-4); background: linear-gradient(180deg, #0a0b10, #07080b); }
.film-ph .ico { width: 13px; height: 13px; }
.film-txt { min-width: 0; display: grid; gap: 1px; }
.film-txt b { font-size: 12px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.film-txt span { font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.review { flex: 1; min-width: 0; display: flex; min-height: 0; }

/* ---- reviewer (shared by queue player + modal) */
.rv { flex: 1; display: flex; min-width: 0; min-height: 0; }
.rv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #000; position: relative; }
.rv-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; background: #000; }
.rv-stage.is-pin { cursor: crosshair; }
.rv-videos { position: absolute; inset: 14px 14px 8px; display: flex; gap: 14px; justify-content: center; align-items: stretch; }
.rv-frame, .rv-cmp { position: relative; margin: 0; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; }
.rv-frame video, .rv-cmp video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.rv-videos.is-cmp .rv-frame, .rv-videos.is-cmp .rv-cmp { max-width: 46%; }
.rv-cap { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 3px 9px; border-radius: 99px; background: rgba(10, 11, 15, 0.75); backdrop-filter: blur(8px); font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; white-space: nowrap; pointer-events: none; }
.rv-cap.accent { color: #fff; background: rgba(91, 83, 255, 0.85); }
.rv-pins { position: absolute; inset: 0; pointer-events: none; }
.rv-pin {
  position: absolute; z-index: 4; transform: translate(-50%, -100%); pointer-events: auto;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px 99px 99px 2px; transform-origin: bottom left;
  display: grid; place-items: center; background: var(--amber); color: #111; font: 700 11px var(--mono);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.45); rotate: -45deg; cursor: pointer;
  transition: transform 0.15s var(--ease);
}
.rv-pin > span { rotate: 45deg; }
.rv-pin.resolved { background: var(--st-approved); }
.rv-pin.draft { background: var(--accent); color: #fff; animation: pinpulse 1.6s infinite; }
.rv-pin.is-active { transform: translate(-50%, -100%) scale(1.18); box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(0, 0, 0, 0.45); }
.rv-pin.flash { animation: pinflash 0.9s 2; }
@keyframes pinpulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(91, 83, 255, 0.55); } 50% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 0 10px rgba(91, 83, 255, 0); } }
@keyframes pinflash { 50% { transform: translate(-50%, -100%) scale(1.35); } }
.rv-buffer {
  position: absolute; right: 14px; bottom: 14px; z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; border-radius: 99px;
  background: rgba(10, 11, 15, 0.78); backdrop-filter: blur(8px); color: var(--text-2);
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 6px 18px rgba(0, 0, 0, 0.4);
}
.rv-buffer[hidden] { display: none; }
.rv-buffer .spinner { width: 12px; height: 12px; border-width: 2px; }

/* Stream 720p / Master 1080p switch */
.quality-btn { gap: 6px; font: 500 12px var(--mono); }
.quality-btn .q-ico { font-size: 12px; line-height: 1; filter: saturate(1.1); }

.rv-bigplay {
  position: absolute; left: 50%; top: 50%; z-index: 5; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 99px;
  display: grid; place-items: center; color: #fff; background: rgba(14, 14, 18, 0.62); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.45); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.rv-bigplay .ico { width: 30px; height: 30px; margin-left: 4px; }
.rv-stage.is-playing .rv-bigplay { opacity: 0; transform: scale(0.85); }
.rv-flash {
  position: absolute; left: 50%; top: 50%; z-index: 6; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 99px;
  display: grid; place-items: center; color: #fff; background: rgba(14, 14, 18, 0.55); pointer-events: none; opacity: 0;
}
.rv-flash .ico { width: 26px; height: 26px; }
.rv-flash.go { animation: flash 0.5s var(--ease); }
@keyframes flash { 0% { opacity: 0.95; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.35); } }
.rv-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 7; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 99px; background: rgba(91, 83, 255, 0.92); color: #fff; font-size: 12.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); white-space: nowrap; pointer-events: none;
}
.rv-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--text-3); font-size: 13px; text-align: center; padding: 20px; cursor: default; }
.rv-empty .ico { width: 30px; height: 30px; color: var(--text-4); }
.rv-empty b { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
.rv-empty .muted { max-width: 340px; font-size: 12.5px; }
.rv-empty-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.rv-empty-ico .spinner { width: 22px; height: 22px; border-width: 2.5px; }
.rv-empty[data-mode="generating"] .rv-empty-ico { border-color: rgba(59, 130, 246, 0.35); background: var(--blue-soft); }
.rv-empty[data-mode="generating"] b { color: #93c5fd; }
.rv-empty[data-mode="queued"] .rv-empty-ico { border-color: rgba(129, 140, 248, 0.32); background: var(--indigo-soft); color: #a5b4fc; }
.rv-empty[data-mode="offline"] .rv-empty-ico, .rv-empty[data-mode="failed"] .rv-empty-ico { border-color: rgba(249, 115, 22, 0.32); background: var(--burnt-soft); }
.rv-empty[data-mode="offline"] .rv-empty-ico .ico, .rv-empty[data-mode="failed"] .rv-empty-ico .ico { color: var(--st-offline); }
.rv-empty[data-mode="offline"] b, .rv-empty[data-mode="failed"] b { color: #fdba74; }
.rv-empty-ref { margin-top: 2px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-4); font-size: 11.5px; font-weight: 500; }
.rv-empty-ref:hover { color: var(--text-2); border-color: var(--line-3); background: rgba(255, 255, 255, 0.04); }

.rv-timeline { position: relative; height: 22px; margin: 0 16px; flex: none; cursor: pointer; touch-action: none; }
.rv-track { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); transition: height 0.12s, top 0.12s; }
.rv-timeline:hover .rv-track { top: 8px; height: 6px; }
.rv-prog { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: #fff; }
.rv-head { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 99px; background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.12s; }
.rv-timeline:hover .rv-head, .rv-timeline.is-drag .rv-head { opacity: 1; }
.rv-marks { position: absolute; left: 0; right: 0; top: 0; height: 0; }
.rv-mark { position: absolute; top: -3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 99px; background: var(--amber); box-shadow: 0 0 0 2px #000; z-index: 2; transition: transform 0.12s; }
.rv-mark.resolved { background: var(--st-approved); }
.rv-mark.is-active { transform: scale(1.4); box-shadow: 0 0 0 2px #fff; }
.rv-mark:hover { transform: scale(1.35); }
.rv-hover { position: absolute; bottom: 22px; padding: 2px 6px; border-radius: 4px; background: #1b1e29; color: var(--text); font: 500 11px var(--mono); transform: translateX(-50%); pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity 0.1s; box-shadow: var(--shadow-pop); }
.rv-timeline:hover .rv-hover { opacity: 1; }

.rv-transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; height: 52px; padding: 0 10px 4px; flex: none; }
.rv-tgroup { display: flex; align-items: center; gap: 2px; }
.rv-tgroup.right { justify-content: flex-end; }
.rv-transport .icon-btn { width: 34px; height: 34px; color: var(--text-2); }
.rv-transport .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.rv-transport .icon-btn[aria-pressed="true"] { color: var(--accent-3); background: rgba(99, 91, 255, 0.14); }
.rv-transport .icon-btn .ico { width: 18px; height: 18px; }
.rv-speed { height: 30px; min-width: 46px; padding: 0 8px; border-radius: var(--r-sm); font: 600 12px var(--mono); color: var(--text-2); }
.rv-speed:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.rv-speed.is-fast { color: var(--accent-3); }
.rv-timecode { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r); background: #0d0e13; border: 1px solid rgba(255, 255, 255, 0.1); font: 500 13px var(--mono); color: var(--text); letter-spacing: 0.02em; white-space: nowrap; }
.rv-timecode .dur { color: var(--text-4); }

.rv-main:fullscreen { background: #000; }
.rv-main:fullscreen .rv-videos { inset: 20px; }

/* ---- side panel */
.rv-side { width: 372px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.rv-tabs { padding: 12px 14px 0; flex: none; }
.rv-tabs .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; padding: 3px; border-radius: 10px; background: var(--bg-2); }
.rv-tabs .seg button { height: 32px; font-size: 13px; border-radius: 8px; }
.rv-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rv-sub { display: flex; align-items: center; gap: 6px; padding: 10px 14px 8px; flex: none; }
.rv-sub select { height: 28px; width: auto; border-color: transparent; background-color: transparent; font-size: 12.5px; font-weight: 600; padding-left: 6px; color: var(--text); }
.rv-sub select:hover { background-color: var(--hover); }
.rv-sub select.light { font-weight: 500; color: var(--text-3); }
.rv-sub .spacer { flex: 1; }
.rv-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 12px; display: grid; align-content: start; gap: 2px; }
.rv-nocmt { display: grid; justify-items: center; gap: 10px; padding: 64px 24px; text-align: center; color: var(--text-3); font-size: 13px; }
.rv-nocmt .bubble { width: 64px; height: 50px; position: relative; }
.rv-nocmt .bubble::before, .rv-nocmt .bubble::after { content: ""; position: absolute; border-radius: 10px; }
.rv-nocmt .bubble::before { left: 0; top: 10px; width: 46px; height: 34px; background: #262a38; }
.rv-nocmt .bubble::after { right: 0; top: 0; width: 46px; height: 32px; background: #343949; }
.rv-nocmt small { color: var(--text-4); font-size: 12px; }

.cmt { position: relative; padding: 10px 10px 10px 10px; border-radius: 10px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 10px; border: 1px solid transparent; }
.cmt:hover { background: rgba(255, 255, 255, 0.03); }
.cmt.is-active { background: var(--card); border-color: var(--line-2); }
.cmt.is-resolved .cmt-text { color: var(--text-3); }
.cmt-head { display: flex; align-items: center; gap: 7px; min-width: 0; height: 22px; }
.cmt-head b { font-size: 12.5px; font-weight: 600; }
.cmt-head .time { font-size: 11.5px; color: var(--text-4); white-space: nowrap; }
.cmt-head .no { margin-left: auto; font: 500 10.5px var(--mono); color: var(--text-4); }
.ts-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 5px; flex: none;
  background: var(--amber-soft); color: var(--amber); font: 600 11px var(--mono); letter-spacing: 0.01em;
}
.ts-badge:hover { background: rgba(234, 179, 8, 0.24); }
.ts-badge .ico { width: 11px; height: 11px; }
.cmt-body { grid-column: 2; display: grid; gap: 6px; margin-top: 3px; }
.cmt-text { font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt-text .ts-badge { margin-right: 6px; vertical-align: 1px; }
.cmt-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cmt-tags .badge { height: 20px; font-size: 11px; }
.cmt-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 1px; padding: 2px; border-radius: 8px; background: #1b1e29; box-shadow: 0 0 0 1px var(--line-2), 0 6px 16px rgba(0, 0, 0, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.cmt:hover .cmt-actions, .cmt:focus-within .cmt-actions { opacity: 1; pointer-events: auto; }
.cmt-actions .icon-btn { width: 26px; height: 26px; }
.cmt-actions .icon-btn.on { color: var(--st-approved); }
.replies { display: grid; gap: 8px; padding: 6px 0 0 10px; border-left: 2px solid var(--line-2); margin-top: 2px; }
.reply { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
.reply b { font-size: 12px; font-weight: 600; }
.reply .time { font-size: 11px; color: var(--text-4); margin-left: 6px; }
.reply p { font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-form { display: flex; gap: 6px; margin-top: 4px; }
.reply-form input { height: 30px; font-size: 12.5px; }

/* composer (bottom anchored) */
.cmp { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.cmp-box { border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); transition: border-color 0.15s, box-shadow 0.15s; }
.cmp-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.14); }
.cmp-box.is-bot { border-color: rgba(59, 130, 246, 0.55); }
.cmp-reply { display: flex; align-items: center; gap: 6px; padding: 7px 10px 0; font-size: 11.5px; color: var(--text-3); }
.cmp-reply b { color: var(--text-2); }
.cmp-reply .icon-btn { width: 20px; height: 20px; margin-left: auto; }
.cmp-input-row { display: flex; align-items: flex-start; gap: 6px; padding: 9px 10px 2px; flex-wrap: wrap; }
.cmp-chips { display: contents; }
.cmp-chip { display: inline-flex; align-items: center; height: 24px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font: 600 12px var(--mono); flex: none; margin-top: 1px; }
.cmp-chip button { height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 7px; color: inherit; }
.cmp-chip button + button { padding: 0 5px 0 2px; opacity: 0.7; }
.cmp-chip button + button:hover { opacity: 1; }
.cmp-chip .ico { width: 11px; height: 11px; }
.cmp-chip.pin { background: var(--accent-soft); color: var(--accent-3); }
.cmp textarea {
  flex: 1 1 160px; min-height: 26px; max-height: 160px; height: 26px; padding: 3px 2px; border: 0; background: transparent; box-shadow: none !important;
  resize: none; font-size: 13.5px; line-height: 20px; overflow-y: auto;
}
.cmp textarea:focus { border: 0; }
.cmp-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px 6px; }
.cmp-tools .icon-btn { width: 30px; height: 30px; }
.cmp-tools .icon-btn .ico { width: 17px; height: 17px; }
.bot-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-3); font-size: 12px; font-weight: 500; margin-left: 4px; white-space: nowrap; transition: all 0.15s; }
.bot-chip:hover { color: var(--text); border-color: var(--line-3); }
.bot-chip[aria-pressed="true"] { background: var(--blue-soft); border-color: rgba(59, 130, 246, 0.55); color: #93c5fd; }
.bot-chip.is-ai { font-weight: 600; background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }
.bot-chip.is-ai .ico { color: var(--accent-3); }
.cmp-hint { font-size: 11.5px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 6px; }
.cmp-hint.ok { color: #34d399; }
.cmp-send { margin-left: auto; width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; transition: background 0.15s, opacity 0.15s; }
.cmp-send:hover:not(:disabled) { background: var(--accent-2); }
.cmp-send:disabled { opacity: 0.35; background: #3a3c55; }
.cmp-send .ico { width: 16px; height: 16px; }

/* fields pane */
.fields { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 24px; display: grid; align-content: start; gap: 10px; }
.f-hero { border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.f-hero-top { padding: 12px 14px; display: grid; gap: 6px; }
.f-hero-top input.f-name { height: auto !important; padding: 4px 6px !important; margin: -4px -6px; width: calc(100% + 12px); border-color: transparent; background: transparent; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.f-hero-top input.f-name:hover { background: var(--hover); }
.f-hero-top input.f-name:focus { background: var(--input); border-color: var(--accent-line); }
.f-sub { font-size: 12px; color: var(--text-3); }
.f-specs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.f-specs div { padding: 10px 8px; text-align: center; display: grid; gap: 2px; }
.f-specs div + div { border-left: 1px solid var(--line); }
.f-specs span { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-4); }
.f-specs b { font: 500 12.5px var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-card { border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); padding: 9px 10px; display: grid; gap: 6px; min-width: 0; }
.f-card.span-2 { grid-column: span 2; }
.f-card > .k { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.f-card > .k .ico { width: 13px; height: 13px; color: var(--text-4); }
.f-card select, .f-card input { height: 30px; font-size: 12.5px; background-color: var(--panel); }
.f-code { display: flex; align-items: center; gap: 6px; min-width: 0; }
.f-code code { flex: 1; min-width: 0; font: 500 11.5px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-links { display: grid; gap: 4px; }
.f-link { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 10px; border-radius: 8px; background: var(--panel); color: var(--text-2); font-size: 12.5px; min-width: 0; }
.f-link:hover { background: var(--hover); color: var(--text); }
.f-link .lbl { flex: none; font-weight: 500; }
.f-link .val { flex: 1; min-width: 0; text-align: right; font: 500 11px var(--mono); color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-link.drive .ico { color: #34d399; }
.f-link.disabled { opacity: 0.5; pointer-events: none; }
.f-log { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; }
.f-log-item { display: grid; gap: 2px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.f-log-item .m { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--text-4); flex-wrap: wrap; }
.f-log-item .m b { color: var(--text-2); font-weight: 600; }
.f-log-item p { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.f-danger { display: flex; justify-content: center; padding-top: 4px; }

/* ================================================================ MODALS */
dialog.modal {
  padding: 0; border: 0; border-radius: 14px; background: var(--panel); color: var(--text);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
dialog.modal[open] { animation: dlgin 0.16s var(--ease); }
@keyframes dlgin { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
dialog.modal::backdrop { background: rgba(4, 5, 8, 0.72); backdrop-filter: blur(3px); }
.modal-sm { width: min(440px, calc(100vw - 32px)) !important; }
.modal-wide { width: min(760px, calc(100vw - 32px)) !important; }
.modal-form { display: flex; flex-direction: column; max-height: inherit; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 14px 14px; }
.modal-note { font-size: 12.5px; color: var(--text-3); line-height: 1.5; padding: 10px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.confirm-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-body h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 4px; }
.confirm-body p { font-size: 13px; line-height: 1.5; }
.confirm-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--red-soft); color: #f87171; flex: none; }
.confirm-ico .ico { width: 18px; height: 18px; }
.prompt-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.prompt-sugg:empty { display: none; }

dialog.modal-review { width: min(1440px, calc(100vw - 28px)) !important; height: min(900px, calc(100vh - 28px)); max-height: none; background: #000; display: none; }
dialog.modal-review[open] { display: flex; flex-direction: column; }
.review-head { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 10px 0 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); flex: none; }
.review-head-text { flex: 1; min-width: 0; }
.review-head h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-head p { font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-dlg { flex: 1; min-height: 0; }

/* ---- toasts */
.toast-stack { position: fixed; inset: auto 0 0 auto; pointer-events: none; }
.toast {
  position: fixed; right: 20px; bottom: var(--y, 20px); left: auto; top: auto; margin: 0; z-index: 2000;
  display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 10px 14px 10px 10px; border: 0; border-radius: 10px;
  background: #1f2230; color: var(--text); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop);
  transition: bottom 0.2s var(--ease), opacity 0.2s, transform 0.2s var(--ease); pointer-events: auto; inset: auto 20px var(--y, 20px) auto;
}
.toast:not(:popover-open):not(.is-open) { display: none; }
.toast .ti { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--green-soft); color: #34d399; }
.toast.err .ti { background: var(--red-soft); color: #f87171; }
.toast.warn .ti { background: var(--amber-soft); color: var(--amber); }
.toast.info .ti { background: var(--accent-soft); color: var(--accent-3); }
.toast.leaving { opacity: 0; transform: translateX(10px); }

/* ================================================================ QUICK LINK (manual brief modal) */
.modal-ql { width: min(600px, calc(100vw - 32px)) !important; }
.ql-body { display: grid; gap: 16px; }
.field > label, .field-top label, .field-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-top .link-btn { font-size: 12px; }
.field .opt { color: var(--text-4); font-weight: 400; }
.seg-block { display: flex; width: 100%; }
.seg-block button { flex: 1; }
.links-ta { font-family: var(--mono); font-size: 12.5px; min-height: 84px; }
.ql-hint { font-size: 11.5px; color: var(--text-4); }
.ql-notes { min-height: 44px; max-height: 160px; resize: none; overflow: hidden; font-size: 13px; line-height: 1.45; }
.ql-batch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ql-batch.is-new { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ql-hooks { list-style: none; display: grid; gap: 6px; }
.ql-hooks li { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 8px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.ql-hooks .t { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-addhooks { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.ql-more { border-top: 1px solid var(--line); padding-top: 12px; }
.ql-more summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text-2); list-style: none; }
.ql-more summary::-webkit-details-marker { display: none; }
.ql-more summary .ico { transition: transform 0.15s; }
.ql-more[open] summary .ico { transform: rotate(90deg); }
.ql-more .form-grid { margin-top: 12px; }
.ql-foot { align-items: center; }
.ql-summary { margin-right: auto; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.base-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.base-pick .t { flex: 1; min-width: 0; }
.base-pick b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.base-pick span { font-size: 12px; color: var(--text-3); }
.toast-act { margin-left: 4px; height: 26px; padding: 0 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-3); font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.toast-act:hover { background: var(--accent); color: #fff; }

/* frame strips (hooks / scoper) */
.strip { position: relative; display: block; width: 100%; aspect-ratio: 1052 / 462; background: #000; overflow: hidden; cursor: pointer; }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease), opacity 0.2s; }
.strip:hover img { transform: scale(1.02); opacity: 0.85; }
.strip-ticks { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 6px 5px; pointer-events: none; }
.strip-ticks span { font: 500 10px var(--mono); color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.strip-dur { position: absolute; right: 7px; top: 7px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.72); color: #fff; font: 500 10.5px var(--mono); }
.strip-play { position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; border-radius: 99px; display: grid; place-items: center; background: rgba(12, 12, 16, 0.6); color: #fff; backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.15s; }
.strip-play .ico { margin-left: 2px; }
.strip:hover .strip-play { opacity: 1; }

/* ================================================================ DAILY INSPIRATION */
.page-inspo { padding-top: 22px; }
.inspo-head { flex-wrap: wrap; }

/* quiet plain-text counter: no boxes, no colored pills */
.inspo-stats { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font: 500 11.5px var(--mono); color: var(--text-4); white-space: nowrap; }
.inspo-stats b { font-weight: 600; color: var(--text-2); }
.inspo-stats .sep, .ins-meta-t .sep { color: var(--line-3); margin: 0 1px; }
.stat { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.stat b { color: var(--text); font-weight: 600; font-size: 12px; }
.stat i, .tier-dot { width: 6px; height: 6px; border-radius: 99px; flex: none; display: inline-block; }
.stat-rising i, .tier-rising { background: #f59e0b; }
.stat-ever i, .tier-evergreen { background: #10b981; }
.tb-pill-quiet { border-color: transparent; padding: 0 8px; color: var(--text-4); }
.tb-pill-quiet:hover { border-color: var(--line-2); }

/* one calm filter row */
.inspo-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.inspo-bar .seg-sm button { height: 24px; padding: 0 9px; gap: 5px; }
.inspo-bar .seg .n { color: var(--text-4); }
.inspo-bar .seg button[aria-pressed="true"] .n { color: var(--text-3); }
.inspo-reset { display: inline-flex; align-items: center; }
.inspo-reset .link-btn { font-size: 12.5px; }
.sel-sm { width: auto; min-width: 0; max-width: 190px; height: 30px; font-size: 12.5px; }
.search-sm { width: 210px; min-width: 0; }
.search-sm input { height: 30px; }

.inspo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.ins-skel { height: 320px; }
.ins-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color 0.15s, opacity 0.15s; }
.ins-card:hover { border-color: var(--line-3); }
.ins-card.is-queued { border-color: rgba(16, 185, 129, 0.3); }
.ins-card.is-hidden { opacity: 0.62; }
.ins-card.is-hidden:hover { opacity: 1; }
.ins-card.is-busy { opacity: 0.6; pointer-events: none; }

/* 1 scannable line: brand + tag on the left, mono metadata on the right */
.ins-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 10px 14px; }
.ins-id { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ins-brand { font-size: 13.5px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-tag { flex: none; font-size: 11.5px; color: var(--text-4); white-space: nowrap; }
.ins-meta { display: flex; align-items: center; gap: 5px; flex: none; }
.ins-meta-t { font: 500 11.5px var(--mono); color: var(--text-3); white-space: nowrap; }
.ins-top { padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text-2); }
.ins-dur { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: var(--text-2); font-size: 11px; }
.ins-ico { opacity: 0; transition: opacity 0.12s, color 0.12s, background-color 0.12s; }
.ins-card:hover .ins-ico, .ins-ico:focus-visible { opacity: 1; }
.ins-dismiss:hover { color: #f87171; background: var(--red-soft); }

.strip.ins-strip { aspect-ratio: 972 / 426; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ins-strip img { aspect-ratio: 972 / 426; height: auto; }
.ins-strip .strip-ticks { top: 0; bottom: auto; padding: 6px 8px 0; }
.ins-strip-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 22px 10px 8px; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0)); color: #fff; font-size: 11.5px; font-weight: 500; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.ins-strip:hover .ins-strip-bar, .ins-strip:focus-visible .ins-strip-bar { opacity: 1; }
.isb-play { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.isb-play .ico { width: 11px; height: 11px; }
.isb-fmt { min-width: 0; max-width: 55%; color: rgba(255, 255, 255, 0.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* dispatch: free-text note for Inari, then 3 compact pickers, then scope + CTA */
.ins-dispatch { display: grid; gap: 8px; padding: 11px 12px 12px; }
.ins-note {
  width: 100%; min-height: 44px; max-height: 160px; padding: 7px 9px; resize: none; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
  font-family: inherit; font-size: 12.5px; line-height: 1.45; color: var(--text);
}
.ins-note::placeholder { color: var(--text-4); }
.ins-note:focus { background: var(--input); border-color: var(--accent-line); }
.ins-selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 92px); gap: 6px; }
.ins-dispatch select { width: 100%; min-width: 0; height: 28px; font-size: 12px; }
.ins-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.seg-sm button { height: 24px; padding: 0 8px; font-size: 12px; }
.seg-sm .n { font-size: 11px; }
.ins-cta { flex: 1 1 110px; height: 28px; }
.ins-queued { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--r); background: var(--green-soft); border: 1px solid rgba(16, 185, 129, 0.26); }
.ins-queued .ok { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #34d399; }
.ins-queued .link-btn { font-size: 12px; }

/* ================================================================ VAULT */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.hook-card { overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s; }
.hook-card:hover { border-color: var(--line-3); }
.hook-card.is-picked { border-color: var(--accent-line); }
.hc-body { padding: 12px 14px; display: grid; gap: 10px; flex: 1; align-content: start; }
.hc-top { display: flex; flex-wrap: wrap; gap: 5px; }
.hc-title { font-size: 14px; font-weight: 600; letter-spacing: -0.015em; }
.hc-source { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.hc-quote { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.55; padding-left: 10px; border-left: 2px solid var(--amber-line); }
.blueprint summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--text-3); list-style: none; }
.blueprint summary::-webkit-details-marker { display: none; }
.blueprint summary .ico { width: 12px; height: 12px; transition: transform 0.15s; }
.blueprint[open] summary .ico { transform: rotate(90deg); }
.blueprint summary .layers { margin-left: auto; font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.bp-layers { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.bp-layers li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; }
.bp-layers .n { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--hover); font: 600 10.5px var(--mono); color: var(--text-3); }
.bp-layers .k { font-size: 11px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.05em; }
.bp-layers .v { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.hc-foot { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }

.sample-list { display: grid; gap: 8px; }
.sample-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.sample-row .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-row .m { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* ================================================================ BOTS */
.bots-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 20px; align-items: start; }
.roster { position: sticky; top: 0; display: grid; gap: 2px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.roster-group { padding: 10px 8px 4px; }
.roster-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r); text-align: left; width: 100%; }
.roster-item:hover { background: var(--hover); }
.roster-item[aria-current="true"] { background: var(--active); }
.ri-main { flex: 1; min-width: 0; display: grid; }
.ri-name { font-size: 13px; font-weight: 600; }
.ri-role { font-size: 11.5px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-n { font: 500 11px var(--mono); color: var(--text-4); }
.roster-arch .avatar { background: var(--accent-soft); color: var(--accent-3); }
.bot-detail { display: grid; gap: 14px; min-width: 0; }
.bot-head { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.bh-main { flex: 1; min-width: 0; }
.bh-name { display: flex; align-items: center; gap: 8px; }
.bh-name h3, .bh-main > h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.bh-role { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.bh-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rename-form { display: flex; gap: 6px; align-items: center; }
.rename-form input { max-width: 260px; }
.bot-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.file-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.file-head h4 { display: flex; align-items: center; gap: 8px; font: 600 12.5px var(--mono); color: var(--text-2); }
.file-head .path { font: 500 11px var(--mono); color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md { font-size: 13px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.md > * + * { margin-top: 8px; }
.md p.md-h1, .md p.md-h2 { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.015em; margin-top: 18px; }
.md p.md-h3 { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 14px; }
.md .krok { display: flex; gap: 8px; align-items: baseline; }
.md .krok .kn { font: 600 11px var(--mono); color: var(--accent-3); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; flex: none; }
.md ul, .md ol { padding-left: 20px; }
.md li + li { margin-top: 3px; }
.md li.task { list-style: none; margin-left: -18px; }
.md li.task::before { content: "☐ "; color: var(--text-4); }
.md li.task.done::before { content: "☑ "; color: var(--st-approved); }
.md code { font: 500 12px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--bg-2); color: #c4b5fd; }
.md pre { padding: 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); overflow-x: auto; }
.md pre code { padding: 0; background: none; color: var(--text-2); }
.md blockquote { margin: 8px 0; padding-left: 12px; border-left: 2px solid var(--accent-line); color: var(--text-3); }
.md table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.md th, .md td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { color: var(--text); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md strong { color: var(--text); }
.rule-form { display: grid; gap: 8px; margin-bottom: 14px; }
.rule-form .row { display: flex; gap: 8px; }
.rule-form .row select { width: 160px; }
.rules { list-style: none; display: grid; gap: 8px; }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.rule > div { flex: 1; min-width: 0; }
.rule .rm { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-4); }
.rule .rm b { color: var(--text-2); }
.rule .rt { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.rules-empty { font-size: 12.5px; color: var(--text-4); padding: 10px 0; }
.playbooks { display: grid; gap: 8px; }
.playbook { border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.playbook summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; }
.playbook summary::-webkit-details-marker { display: none; }
.playbook summary .ico { width: 12px; height: 12px; color: var(--text-4); transition: transform 0.15s; }
.playbook[open] summary .ico { transform: rotate(90deg); }
.pb-title { flex: 1; font-size: 13px; font-weight: 600; }
.pb-meta { display: flex; gap: 5px; }
.md-pb { padding: 0 14px 14px; }
.arch { display: grid; gap: 14px; }
.arch-summary { font-size: 13px; color: var(--text-2); line-height: 1.6; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.arch-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.arch-card { padding: 14px 16px; }
.arch-card h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.flow { padding-left: 18px; display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.principles { list-style: none; display: grid; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.principles li { display: flex; gap: 8px; }
.principles .ico { color: var(--st-approved); margin-top: 2px; }
.lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lane { padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.lane-top { display: flex; align-items: center; gap: 8px; }
.lane-top h4 { font-size: 13.5px; font-weight: 600; }
.lane-layer { font: 600 11px var(--mono); color: var(--accent-3); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }
.lane p { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.lane-risk { justify-self: start; }
.lane-list { display: grid; gap: 5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; margin: 0; }
.kv dt { color: var(--text-4); }
.kv dd { margin: 0; color: var(--text-2); }
.rules-list { padding-left: 18px; display: grid; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.rules-list b { display: block; color: var(--text); }
.settings { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.settings th, .settings td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--line); }
.settings th { color: var(--text-3); font-weight: 500; padding-right: 12px; }
.settings td { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* ================================================================ RESPONSIVE */
@media (max-width: 1280px) {
  .rv-side { width: 340px; }
  .filmstrip { width: 168px; }
}
@media (max-width: 1080px) {
  .tab { padding: 0 8px; }
  .tb-btn span { display: none; }
  .queue { grid-template-columns: 220px minmax(0, 1fr); }
  .filmstrip { display: none; }
  .player-head .variant-pills, .player-head .toggle-btn span { display: none; }
}
@media (max-width: 1180px) {
  .search-sm { flex: 1 1 180px; }
}
@media (max-width: 860px) {
  .inspo-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .inspo-bar .sel-sm { flex: 1 1 130px; max-width: none; }
  .search-sm { min-width: 0; flex: 1 1 100%; }
  .ins-selects { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .queue { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .rv { flex-direction: column; }
  .rv-main { min-height: 56vh; }
  .rv-side { width: auto; border-left: 0; border-top: 1px solid var(--line); min-height: 50vh; }
  .bots-layout, .arch-cols { grid-template-columns: 1fr; }
  .roster { position: static; }
  .brand-name span, .brand-pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
