/* ============================================================
   SCRIPT STUDIO 1.0 — "late-night studio" design tokens
   ============================================================ */
:root {
  --bg: #171310;
  --bg-deep: #100d0b;
  --panel: #241f1b;
  --panel-2: #2d2721;
  --panel-3: #38312a;
  --line: #3d352c;
  --line-soft: #2e2822;
  --ink: #EDE6D6;
  --ink-dim: #A89F8C;
  --ink-faint: #6e6657;
  --accent: #F5C56C;
  --accent-dim: rgba(245,197,108,.14);
  --accent-line: rgba(245,197,108,.38);
  --success: #B6C99A;
  --warning: #EFCF6E;
  --danger: #F2A89E;
  --info: #9EBED9;

  --cream:#F0E2C2; --mint:#B0D4C8; --coral:#EE9D92; --lavender:#C8B3E0;
  --lemon:#EFCF6E; --sage:#AEC18F; --sky:#9EBED9; --rose:#E29DA6;
  --paper:#E9E4D6; --shadow:#2A2622;

  --r-xs:4px; --r-sm:6px; --r-md:8px; --r-lg:12px; --r-xl:16px; --r-pill:999px;
  --m-instant:80ms; --m-fast:150ms; --m-smooth:240ms; --m-slow:400ms;
  --ease: cubic-bezier(.4,0,.2,1);
  --e2: 0 2px 6px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.28);
  --e3: 0 4px 14px rgba(0,0,0,.45), 0 10px 28px rgba(0,0,0,.35);
  --e4: 0 10px 28px rgba(0,0,0,.55), 0 20px 60px rgba(0,0,0,.5);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.45;
  overflow: hidden;
}
::selection { background: var(--accent-dim); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); }
input, textarea {
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 10px; width: 100%;
  transition: border-color var(--m-fast) var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent-line); }
textarea { resize: vertical; min-height: 64px; }
select {
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 8px;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App layout ---------- */
#app { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  height: 54px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0; z-index: 40;
}
.brand { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--accent); letter-spacing: .4px; white-space: nowrap; }
.brand small { color: var(--ink-faint); font-family: var(--mono); font-style: normal; font-size: 10px; margin-left: 6px; }
.proj-name {
  background: transparent; border: 1px solid transparent; color: var(--ink);
  font-size: 14px; font-weight: 600; width: 200px; padding: 5px 8px;
}
.proj-name:hover { border-color: var(--line); }
.proj-name:focus { border-color: var(--accent-line); background: var(--bg-deep); }
.spacer { flex: 1; }
.save-dot { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; transition: background var(--m-fast); }
.save-dot.dirty i { background: var(--warning); }

/* stage stepper */
.stepper { display: flex; gap: 2px; background: var(--bg-deep); border-radius: var(--r-pill); padding: 3px; }
.step {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--r-pill);
  color: var(--ink-dim); font-size: 12px; white-space: nowrap;
  transition: background var(--m-fast) var(--ease), color var(--m-fast) var(--ease);
}
.step b { font-family: var(--mono); font-size: 10px; opacity: .65; font-weight: 500; }
.step:hover { color: var(--ink); background: var(--panel-2); }
.step.active { background: var(--accent); color: #241a06; font-weight: 600; }
.step.done b { color: var(--success); }
.step.active b { color: #241a06; opacity: .8; }

/* ---------- main areas ---------- */
.main { display: flex; flex: 1; min-height: 0; }
.side {
  width: 292px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line-soft); display: flex; flex-direction: column;
  transition: margin var(--m-smooth) var(--ease);
}
.side.collapsed { margin-left: -292px; }
.center { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.drawer {
  width: 384px; flex-shrink: 0; background: var(--panel);
  border-left: 1px solid var(--line-soft); display: flex; flex-direction: column;
  transition: margin var(--m-smooth) var(--ease);
}
.drawer.collapsed { margin-right: -384px; }

.panel-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px;
  font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink);
  flex-shrink: 0;
}
.panel-head .sub { font-family: var(--mono); font-style: normal; font-size: 10px; color: var(--ink-faint); }
.panel-body { flex: 1; overflow-y: auto; padding: 0 14px 20px; }

/* ---------- stage guide (left) ---------- */
.next-action {
  margin: 8px 0 14px; padding: 11px 12px;
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  border-radius: var(--r-md); font-size: 13px; color: var(--ink);
}
.next-action b { display:block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.2px; color: var(--accent); margin-bottom: 4px; font-weight: 600; }
.stage-desc { color: var(--ink-dim); font-size: 12.5px; margin-bottom: 14px; }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px; border-radius: var(--r-sm); margin-bottom: 2px; transition: background var(--m-fast); }
.check:hover { background: var(--panel-2); }
.check .box {
  width: 15px; height: 15px; margin-top: 1px; border-radius: 4px; flex-shrink: 0;
  border: 1.5px solid var(--ink-faint); display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #241a06; transition: all var(--m-fast) var(--ease);
}
.check.done .box { background: var(--success); border-color: var(--success); }
.check.done .label { color: var(--ink-faint); text-decoration: line-through; }
.check .label { font-size: 12.5px; color: var(--ink-dim); }
.check.auto .label::after { content: " ·авто"; font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }

.concept-form label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1px; color: var(--ink-faint); margin: 12px 0 4px; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
  padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim);
  transition: all var(--m-fast) var(--ease); cursor: pointer;
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip.on { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.chip.more { border-style: dashed; }

/* ---------- toolbar over timeline ---------- */
.tl-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft); background: var(--bg); flex-shrink: 0;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); font-size: 12.5px; white-space: nowrap;
  transition: all var(--m-fast) var(--ease);
}
.btn:hover { border-color: var(--accent-line); background: var(--panel-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #241a06; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--ink); background: var(--panel-2); border-color: transparent; }
.btn.on { border-color: var(--accent-line); color: var(--accent); background: var(--accent-dim); }
.btn:disabled { opacity: .4; cursor: default; }
.tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.zoom-lbl { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); min-width: 52px; text-align: center; }

/* lane toggles */
.lane-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill); font-size: 11.5px; color: var(--ink-dim); border: 1px solid var(--line); transition: all var(--m-fast) var(--ease); }
.lane-toggle i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.lane-toggle.on { color: var(--ink); background: var(--panel-2); }
.lane-toggle:not(.on) { opacity: .5; }

/* ---------- timeline ---------- */
.tl-scroll { flex: 1; overflow: auto; position: relative; background: var(--bg-deep); }
.tl-canvas { position: relative; min-height: 100%; }
.ruler { position: sticky; top: 0; height: 26px; background: var(--bg); border-bottom: 1px solid var(--line-soft); z-index: 10; }
.ruler .tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-soft); padding: 5px 0 0 5px; font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }
.gridline { position: absolute; top: 26px; bottom: 0; border-left: 1px solid rgba(255,255,255,.028); pointer-events: none; }

.blocks-row { position: relative; height: 112px; margin-top: 10px; }
.blocks-row .row-label, .lane .row-label {
  position: sticky; left: 0; float: left; z-index: 9;
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.2px; color: var(--ink-faint);
  padding: 3px 8px; background: var(--bg-deep); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  text-transform: uppercase; pointer-events: none;
}
.block {
  position: absolute; top: 18px; height: 86px;
  border-radius: var(--r-md); padding: 8px 10px 6px; overflow: hidden;
  box-shadow: var(--e2); cursor: grab; user-select: none;
  transition: box-shadow var(--m-fast) var(--ease), opacity var(--m-smooth) var(--ease), filter var(--m-fast) var(--ease);
}
.block:hover { box-shadow: var(--e3); }
.block.selected { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: var(--e3); }
.block.dragging { cursor: grabbing; opacity: .85; z-index: 30; }
.block.dimmed { opacity: .18; pointer-events: none; }
.block .fn { font-family: var(--mono); font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; opacity: .75; display: flex; align-items: center; gap: 5px; }
.block .ttl { font-weight: 700; font-size: 12.5px; margin-top: 2px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.block .meta { position: absolute; bottom: 5px; left: 10px; right: 10px; display: flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 8.5px; opacity: .7; }
.block .lockicon { position: absolute; top: 6px; right: 7px; font-size: 10px; opacity: .8; }
.block .grip {
  position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.block .grip:hover { background: rgba(0,0,0,.22); }
.block .refdot { min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: rgba(0,0,0,.3); display:inline-flex; align-items:center; justify-content:center; font-size: 8px; }

/* anchor lanes */
.lane { position: relative; height: 46px; border-top: 1px dashed var(--line-soft); }
.lane.hidden { display: none; }
.lane-bg { position: absolute; inset: 0; }
.lane:hover .lane-bg { background: rgba(255,255,255,.015); cursor: copy; }
.anchor {
  position: absolute; top: 8px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; z-index: 5; user-select: none;
}
.anchor .pin {
  width: 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; box-shadow: var(--e2);
  border: 1px solid rgba(0,0,0,.25);
  transition: transform var(--m-fast) var(--ease);
}
.anchor:hover .pin { transform: scale(1.18); }
.anchor.selected .pin { outline: 2px solid var(--accent); }
.anchor .alabel {
  font-family: var(--mono); font-size: 8px; color: var(--ink-dim);
  max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(16,13,11,.8); padding: 0 4px; border-radius: 3px;
}

/* playhead-ish add cursor */
.ghost-line { position: absolute; top: 26px; bottom: 0; width: 1px; background: var(--accent-line); pointer-events: none; z-index: 8; display: none; }

/* empty state */
.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: var(--ink-faint);
  text-align: center; padding: 30px;
}
.empty h3 { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ink-dim); font-weight: 400; }

/* ---------- inspector (bottom sheet) ---------- */
.inspector {
  height: 0; overflow: hidden; flex-shrink: 0;
  background: var(--panel); border-top: 1px solid var(--line);
  transition: height var(--m-smooth) var(--ease);
  display: flex; flex-direction: column;
}
.inspector.open { height: 302px; }
.insp-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; flex-shrink: 0; }
.insp-head .fn-pick { display: flex; align-items: center; gap: 8px; }
.insp-title { flex: 1; font-weight: 700; font-size: 14px; background: transparent; border: 1px solid transparent; }
.insp-title:hover { border-color: var(--line); }
.insp-body { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; padding: 4px 16px 14px; min-height: 0; }
.insp-col { overflow-y: auto; min-height: 0; }
.insp-col h5 { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.2px; color: var(--ink-faint); text-transform: uppercase; margin: 8px 0 6px; }
.insp-col textarea { min-height: 120px; font-size: 13px; }
.ref-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 5px; font-size: 12px; cursor: pointer;
  transition: border-color var(--m-fast);
}
.ref-pill:hover { border-color: var(--accent-line); }
.ref-pill .x { margin-left: auto; color: var(--ink-faint); padding: 0 3px; }
.ref-pill .x:hover { color: var(--danger); }
.anchor-line { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: var(--r-sm); font-size: 12px; margin-bottom: 3px; cursor: pointer; }
.anchor-line:hover { background: var(--panel-2); }
.anchor-line .t { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); min-width: 42px; }

/* ---------- reference drawer ---------- */
.tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.tab {
  padding: 8px 12px 9px; font-size: 12.5px; color: var(--ink-dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--m-fast);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.search-row { padding: 10px 14px 6px; display: flex; gap: 6px; flex-shrink: 0; }
.cat-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 14px 8px; flex-shrink: 0; }

.g-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 11px; margin-bottom: 7px; cursor: pointer;
  transition: border-color var(--m-fast) var(--ease), transform var(--m-fast) var(--ease);
}
.g-card:hover { border-color: var(--accent-line); }
.g-card .nm { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.g-card .nm .abbr { font-family: var(--mono); font-size: 9px; color: var(--bg-deep); padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.g-card .one { color: var(--ink-dim); font-size: 11.5px; margin-top: 3px; }
.g-card .tagrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mini-tag { font-family: var(--mono); font-size: 8.5px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--bg-deep); color: var(--ink-faint); }
.count-note { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); padding: 2px 14px 8px; }

/* ---------- modal ---------- */
.modal-veil {
  position: fixed; inset: 0; background: rgba(10,8,6,.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity var(--m-smooth) var(--ease);
}
.modal-veil.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(680px, 92vw); max-height: 84vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--e4); padding: 22px 24px;
  transform: translateY(10px); transition: transform var(--m-smooth) var(--ease);
}
.modal-veil.open .modal { transform: none; }
.modal h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 21px; margin-bottom: 4px; }
.modal .subline { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-bottom: 14px; }
.modal .close { position: sticky; float: right; top: 0; color: var(--ink-faint); font-size: 18px; padding: 2px 8px; }
.modal .close:hover { color: var(--ink); }
.kv { margin-bottom: 12px; }
.kv h5 { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.2px; color: var(--accent); text-transform: uppercase; margin-bottom: 4px; }
.kv p, .kv li { font-size: 13px; color: var(--ink); }
.kv ul { padding-left: 18px; }
.kv .warn { color: var(--danger); }
.kv code {
  display: block; font-family: var(--mono); font-size: 11.5px; background: var(--bg-deep);
  padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-dim); white-space: pre-wrap;
}
.modal .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* export textarea */
.export-pre {
  width: 100%; height: 46vh; font-family: var(--mono); font-size: 11.5px;
  background: var(--bg-deep); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px; white-space: pre; overflow: auto;
}

/* toast */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 60px);
  background: var(--panel-3); border: 1px solid var(--accent-line); color: var(--ink);
  padding: 9px 18px; border-radius: var(--r-pill); font-size: 12.5px; z-index: 200;
  box-shadow: var(--e3); transition: transform var(--m-smooth) var(--ease), opacity var(--m-smooth);
  opacity: 0; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* focus mode */
body.focus-mode .lane:not(.has-selection) { opacity: .35; }

kbd {
  font-family: var(--mono); font-size: 9.5px; background: var(--bg-deep);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px;
  color: var(--ink-dim);
}
.hint-row { color: var(--ink-faint); font-size: 11px; display: flex; gap: 12px; padding: 6px 14px; border-top: 1px solid var(--line-soft); flex-shrink: 0; flex-wrap: wrap; }

/* ============================================================
   v2.0 additions
   ============================================================ */
/* welcome overlay */
.welcome-veil { position: fixed; inset: 0; background: rgba(10,8,6,.82); z-index: 300; display: flex; align-items: center; justify-content: center; }
.welcome {
  width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--accent-line);
  border-radius: var(--r-xl); padding: 28px 30px; box-shadow: var(--e4);
}
.welcome h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 26px; color: var(--accent); margin-bottom: 4px; }
.welcome .wsub { color: var(--ink-dim); font-size: 13px; margin-bottom: 18px; }
.wstep { display: flex; gap: 13px; margin-bottom: 14px; align-items: flex-start; }
.wstep .wn { font-family: var(--mono); font-size: 11px; background: var(--accent); color: #241a06; min-width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.wstep .wt { font-weight: 600; font-size: 14px; }
.wstep .wd { font-size: 12.5px; color: var(--ink-dim); }

/* popover */
.pop-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--e4); padding: 10px; min-width: 240px; display: none;
}
.popover.open { display: block; }
.pop-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  text-align: left; padding: 8px 10px; border-radius: var(--r-sm); font-size: 12.5px;
  transition: background var(--m-fast);
}
.pop-item:hover { background: var(--panel-2); }
.pop-item .pi-d { font-size: 10.5px; color: var(--ink-faint); display: block; }
.pop-sep { height: 1px; background: var(--line-soft); margin: 7px 4px; }
.pop-label { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--ink-faint); text-transform: uppercase; padding: 4px 10px 2px; }

/* status bar */
.statusbar {
  display: flex; gap: 14px; align-items: center; padding: 5px 14px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  border-top: 1px solid var(--line-soft); background: var(--bg); flex-shrink: 0; flex-wrap: wrap;
}
.statusbar b { color: var(--ink-dim); font-weight: 500; }
.statusbar .sdot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 3px; vertical-align: -1px; }
.cov-bar { width: 90px; height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: 1px; }
.cov-bar i { display: block; height: 100%; background: var(--success); }

/* review (обход) */
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-prog { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.review-missing { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 4px; }
.miss-tag { font-size: 11px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(242,168,158,.12); border: 1px solid rgba(242,168,158,.4); color: var(--danger); }
.miss-tag.ok { background: rgba(182,201,154,.12); border-color: rgba(182,201,154,.4); color: var(--success); }

/* prompt builder */
.pb-part { margin-bottom: 10px; }
.pb-part h6 { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 3px; }
.pb-check { display: flex; gap: 8px; align-items: flex-start; padding: 5px 8px; border-radius: var(--r-sm); font-size: 12px; cursor: pointer; }
.pb-check:hover { background: var(--panel-2); }
.pb-check input { width: auto; margin-top: 2px; }

/* help */
.hk-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.hk-row:last-child { border-bottom: none; }

/* ============================================================
   v2.1 — аниматик: медиа-дорожка, плейхед, превью
   ============================================================ */
.playhead {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--danger); z-index: 25; pointer-events: none;
}
.playhead::before {
  content: ''; position: absolute; top: 0; left: -5px;
  border: 6px solid transparent; border-top-color: var(--danger);
}
.transport { display: inline-flex; align-items: center; gap: 8px; }
.transport .t-time { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); min-width: 86px; }
.btn.play-btn { width: 34px; justify-content: center; padding: 6px 0; font-size: 13px; }
.btn.play-btn.playing { background: var(--danger); border-color: var(--danger); color: #2a0f0a; }

/* media lane */
.lane.media-lane { height: 58px; border-top: none; border-bottom: 1px solid var(--line-soft); }
.media-item {
  position: absolute; top: 6px; height: 46px;
  border-radius: var(--r-sm); overflow: hidden; cursor: grab; user-select: none;
  background: var(--panel-3) center/cover no-repeat;
  border: 1.5px solid var(--line); box-shadow: var(--e2);
  transition: box-shadow var(--m-fast) var(--ease);
}
.media-item:hover { border-color: var(--accent-line); }
.media-item.selected { outline: 2px solid var(--accent); }
.media-item .mi-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--mono); font-size: 8px; padding: 1px 5px;
  background: rgba(16,13,11,.75); color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-item .mi-kind { position: absolute; top: 2px; left: 4px; font-size: 10px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)); }
.media-item .grip { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.media-item .grip:hover { background: rgba(245,197,108,.3); }
.media-item.missing { border-style: dashed; opacity: .65; }

/* audio bar */
.lane.audio-lane { height: 30px; border-top: none; border-bottom: 1px solid var(--line-soft); }
.audio-bar {
  position: absolute; top: 5px; height: 20px; border-radius: var(--r-pill);
  background: repeating-linear-gradient(90deg, rgba(200,179,224,.35) 0 3px, rgba(200,179,224,.12) 3px 6px);
  border: 1px solid rgba(200,179,224,.5);
  font-family: var(--mono); font-size: 8.5px; color: var(--lavender);
  display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap;
}

/* preview panel */
.preview-panel {
  position: fixed; top: 64px; width: 324px; z-index: 80;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--e4); overflow: hidden; display: none;
}
.preview-panel.on { display: block; }
.pv-stage { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; display: flex; align-items: center; justify-content: center; }
.pv-stage img, .pv-stage video { width: 100%; height: 100%; object-fit: contain; display: none; }
.pv-fallback { position: absolute; inset: 0; padding: 14px 16px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(160deg, #1c1712, #0e0b09); }
.pv-fallback .pf-fn { font-family: var(--mono); font-size: 8.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
.pv-fallback .pf-title { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.25; }
.pv-fallback .pf-body { font-size: 11px; color: var(--ink-dim); overflow: hidden; flex: 1; line-height: 1.45; }
.pv-fallback .pf-anchors { display: flex; flex-direction: column; gap: 2px; }
.pv-fallback .pf-a { font-family: var(--mono); font-size: 9px; display: flex; gap: 6px; align-items: center; }
.pv-fallback .pf-a i { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.pv-fallback .pf-empty { color: var(--ink-faint); font-size: 12px; margin: auto; text-align: center; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); border-top: 1px solid var(--line-soft); }
.pv-bar .pv-close { margin-left: auto; cursor: pointer; padding: 0 5px; }
.pv-bar .pv-close:hover { color: var(--ink); }

/* drag&drop файлов на таймлайн */
.tl-scroll.drop-hover { outline: 2px dashed var(--accent); outline-offset: -3px; }
.drop-hint {
  position: sticky; top: 0; left: 0; height: 0; z-index: 45; display: none;
}
.drop-hint.on { display: block; }
.drop-hint .dh-box {
  position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
  background: var(--panel-3); border: 1.5px solid var(--accent); border-radius: var(--r-lg);
  padding: 12px 22px; text-align: center; font-size: 14px; box-shadow: var(--e4);
  pointer-events: none; white-space: nowrap;
}
.drop-hint .dh-box span { font-size: 11.5px; color: var(--ink-dim); }
.drop-hint .dh-box b { color: var(--accent); font-family: var(--mono); font-size: 11px; }

/* превью — перемещаемое окно */
.pv-bar { cursor: grab; user-select: none; touch-action: none; }
.pv-bar:active { cursor: grabbing; }
.pv-handle {
  position: absolute; right: 2px; bottom: 1px; z-index: 5;
  font-size: 11px; color: var(--ink-faint); cursor: nwse-resize;
  padding: 0 3px; user-select: none; touch-action: none;
}
.pv-handle:hover { color: var(--accent); }
