/* ==========================================================================
   Frameboard — "the cutting room"
   Warm charcoal chrome, coral accents, a paper storyboard sheet on the bench.
   ========================================================================== */

:root {
  --bg: #17161a;
  --bg-2: #1e1d22;
  --bg-3: #27262c;
  --bg-4: #312f36;
  --line: #2e2d34;
  --line-2: #3f3e46;
  --ink: #ede9e1;
  --ink-2: #aca8a0;
  --ink-3: #7a766f;
  --accent: #e6503e;
  --accent-2: #f0806e;
  --accent-dim: rgba(230, 80, 62, .16);
  --ochre: #d9a441;
  --ochre-dim: rgba(217, 164, 65, .35);
  --ok: #7cc48c;

  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --paper-line: rgba(42, 38, 36, .16);
  --paper-ink: #2a2624;
  --paper-ink-2: #6f6a62;
  --paper-ink-3: #a29c92;

  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Charis SIL", Georgia, serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 312px;
  --timeline-h: 148px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(230, 80, 62, .06), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(217, 164, 65, .05), transparent 60%),
    var(--bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.dim { color: var(--ink-3); }

.offscreen {
  position: fixed; width: 2px; height: 2px; left: -10px; top: -10px;
  opacity: .01; pointer-events: none;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: rgba(23, 22, 26, .85);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.top-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--bg-4); overflow: hidden; }
.top-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ochre), var(--accent)); transition: width .2s linear; box-shadow: 0 0 10px rgba(230, 80, 62, .6); }
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-mark {
  width: 18px; height: 14px; border: 2px solid var(--accent); border-radius: 3px;
  position: relative; top: 1px; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 3px; background: var(--accent); border-radius: 50%;
  transform: scale(.55);
}
.brand h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 26px;
  letter-spacing: -.01em;
  line-height: 1;
}
.tagline { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.views {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
}
.view-tab {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 16px; border-radius: 999px; font-weight: 500; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.view-tab:hover { color: var(--ink); }
.view-tab.is-active { background: var(--bg-4); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.view-tab .count {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent-2);
}
.topbar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.topbar .status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin-right: 6px; white-space: nowrap; }
.local-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-3);
}
.local-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(124, 196, 140, .18); }

/* --------------------------------------------------------------------------
   Buttons & fields
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--ink);
  font-weight: 500; font-size: 13px; line-height: 1;
  transition: background .15s, border-color .15s, transform .15s var(--ease), opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--bg-4); border-color: #56555e; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn .mono { color: var(--ink-3); font-size: 12px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #ef5f4d; border-color: #ef5f4d; }
.btn-primary .mono { color: rgba(255, 255, 255, .7); }
.btn-ghost { background: transparent; }
.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-large { padding: 13px 22px; font-size: 15px; border-radius: 8px; }
.btn svg { flex: none; }
.btn-accent { color: var(--accent-2); border-color: rgba(230, 80, 62, .4); background: var(--accent-dim); }
.btn-accent:hover:not(:disabled) { background: rgba(230, 80, 62, .26); border-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
}
.field-label output { color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 12px; }
.field-row { display: flex; gap: 12px; }
input[type="number"], input[type="url"], select {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink);
  outline: none; transition: border-color .15s;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button { opacity: .5; }
input:focus-visible, select:focus-visible { border-color: var(--accent); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23aca8a0' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.input-unit { position: relative; display: block; }
.input-unit em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); font-family: var(--font-mono); font-size: 12px; pointer-events: none; }
.input-unit input { padding-right: 26px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--ochre-dim), var(--accent)); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; margin-top: -6.5px;
  background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-2);
  transition: transform .15s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 3px; background: linear-gradient(90deg, var(--ochre-dim), var(--accent)); border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--bg); }

/* --------------------------------------------------------------------------
   Workspace: sidebar + stage
   -------------------------------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}
.workspace.is-empty { grid-template-columns: 1fr; }
.sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.sidebar > * { flex-shrink: 0; }
.sidebar { background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 30%); }
.panel {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  animation: rise .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 500;
}
.panel-video { padding: 0; overflow: hidden; }
.preview-wrap { background: #000; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.preview-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.video-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-specs { font-size: 11.5px; color: var(--ink-3); }

.mode-switch { display: flex; flex-direction: column; gap: 4px; }
.mode { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-2); transition: background .15s, color .15s; }
.mode:hover { background: var(--bg-3); color: var(--ink); }
.mode input { appearance: none; width: 14px; height: 14px; margin: 0; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--bg); position: relative; transition: border-color .15s; flex: none; }
.mode input::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .18s var(--ease); }
.mode input:checked { border-color: var(--accent); }
.mode input:checked::after { transform: scale(1); }
.mode:has(input:checked) { color: var(--ink); background: var(--bg-3); }
.mode-opts { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; border-top: 1px dashed var(--line-2); }

.panel-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.sidebar-foot { margin-top: auto; padding: 8px 4px 0; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.kbd-hint { font-size: 11px; }
kbd { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-2); background: var(--bg-3); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; transition: background .2s; }
.status.is-busy .status-dot { background: var(--ochre); animation: pulse 1s ease-in-out infinite; }
.status.is-ok .status-dot { background: var(--ok); }
.status.is-err .status-dot { background: var(--accent); }
@keyframes pulse { 50% { opacity: .35; } }

/* --------------------------------------------------------------------------
   Stage
   -------------------------------------------------------------------------- */
.stage { min-height: 0; overflow-y: auto; position: relative; }

/* Drop zone */
.dropzone {
  position: absolute; inset: 24px;
  border: 1.5px dashed var(--line-2);
  border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 40px;
  transition: border-color .2s, background .2s;
  animation: rise .6s var(--ease) both;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-dim); }
.filmstrip {
  display: flex; gap: 8px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--bg-3); border-radius: 8px;
  background-image:
    radial-gradient(circle at 50% 50%, var(--bg) 2px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, var(--bg) 2px, transparent 2.5px);
  background-size: 14px 6px, 14px 6px;
  background-position: 0 2px, 0 calc(100% - 2px);
  background-repeat: repeat-x;
}
.filmstrip span {
  width: 56px; height: 36px; border-radius: 3px; background: var(--bg-4);
  border: 1px solid var(--line-2);
  animation: flicker 3.2s ease-in-out infinite;
}
.filmstrip span:nth-child(1) { animation-delay: 0s; }
.filmstrip span:nth-child(2) { animation-delay: .45s; }
.filmstrip span:nth-child(3) { animation-delay: .9s; }
.filmstrip span:nth-child(4) { animation-delay: 1.35s; }
.filmstrip span:nth-child(5) { animation-delay: 1.8s; }
@keyframes flicker { 0%, 100% { background: var(--bg-4); } 12% { background: var(--accent); border-color: var(--accent); } 30% { background: var(--bg-4); } }
.dropzone.is-over .filmstrip span { animation-duration: .9s; }
.drop-title { font-family: var(--font-display); font-weight: 400; font-size: 40px; letter-spacing: -.01em; line-height: 1.05; }
.drop-title::first-letter { font-style: italic; }
.drop-sub { color: var(--ink-3); max-width: 46ch; }
.drop-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.url-form { display: flex; gap: 6px; }
.url-form input { width: 300px; }
.drop-err { color: var(--accent-2); font-size: 13px; max-width: 60ch; }
.drop-steps { list-style: none; margin: 22px 0 0; padding: 0; display: flex; gap: 28px; color: var(--ink-3); font-size: 13px; }
.drop-steps li { display: inline-flex; align-items: center; gap: 9px; }
.drop-steps b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 500; font-size: 11px; color: var(--ink); background: var(--bg-4); border: 1px solid var(--line-2); }
.drop-steps em { font-style: normal; color: var(--ink); }
.drop-title { font-size: 48px; }

/* Views */
.view { padding: 24px 28px 40px; animation: fade .3s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.view-title { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: -.01em; }
.view-sub { color: var(--ink-3); margin-top: 6px; font-size: 13px; }
.view-tools { display: flex; align-items: center; gap: 14px; }
.thumb-size { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.thumb-size input { width: 120px; }
.empty-note { color: var(--ink-3); padding: 40px 0; text-align: center; }

/* Frames grid */
.frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb, 280px), 1fr));
  gap: 14px;
}
.frame-card {
  position: relative; margin: 0; border-radius: 8px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
  cursor: zoom-in;
  animation: rise .4s var(--ease) both;
  animation-delay: calc(var(--n, 0) * 22ms);
  transition: transform .2s var(--ease), border-color .2s;
}
.frame-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.frame-card img { display: block; width: 100%; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; background: #000; }
.frame-card.is-thumb img { filter: saturate(.9); }
.frame-card .fc-idx {
  position: absolute; top: 8px; left: 8px; font-family: var(--font-display); font-style: italic;
  font-size: 20px; line-height: 1; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}
.frame-card .fc-tc {
  position: absolute; left: 8px; bottom: 8px; font-family: var(--font-mono); font-size: 11px;
  background: rgba(0, 0, 0, .65); color: #fff; padding: 3px 7px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 6px;
}
.frame-card .fc-tc::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.frame-card.is-manual .fc-tc::before { background: var(--ochre); }
.frame-card .fc-pending { position: absolute; right: 8px; bottom: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--ochre); background: rgba(0, 0, 0, .65); padding: 3px 6px; border-radius: 4px; letter-spacing: .06em; }
.frame-card .fc-actions {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 4px;
  opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s var(--ease);
}
.frame-card:hover .fc-actions { opacity: 1; transform: none; }
.fc-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 0;
  background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center;
  font-size: 14px; line-height: 1;
}
.fc-btn:hover { background: var(--accent); }

/* --------------------------------------------------------------------------
   Storyboard sheet (paper on the bench)
   -------------------------------------------------------------------------- */
.view-storyboard { padding: 28px; }
.sheet {
  --cols: 4;
  max-width: 1500px; margin: 0 auto;
  background: var(--paper); color: var(--paper-ink);
  border-radius: 4px;
  padding: 44px 48px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .06) inset;
  position: relative;
}
.sheet::before {
  /* paper grain */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1.5px solid var(--paper-ink); position: relative; }
.sheet-title {
  font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.05; letter-spacing: -.01em;
  outline: none; min-width: 200px;
}
.sheet-title:empty::before { content: attr(data-placeholder); color: var(--paper-ink-3); font-style: italic; }
.sheet-title:focus { box-shadow: 0 2px 0 var(--accent); }
.sheet-meta { margin-top: 10px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper-ink-2); }
.sheet-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--paper-ink-2); }
.sheet-brand-mark { width: 16px; height: 12px; border: 1.5px solid var(--accent); border-radius: 2px; position: relative; }
.sheet-brand-mark::after { content: ""; position: absolute; inset: 3px; background: var(--accent); border-radius: 50%; transform: scale(.6); }

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 28px 22px;
  position: relative;
}
.shot { display: flex; flex-direction: column; gap: 8px; min-width: 0; break-inside: avoid; page-break-inside: avoid; animation: rise .4s var(--ease) both; animation-delay: calc(var(--n, 0) * 25ms); }
.shot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.shot-num { font-family: var(--font-display); font-style: italic; font-size: 26px; line-height: 1; color: var(--paper-ink); }
.shot-tc { font-family: var(--font-mono); font-size: 11.5px; color: var(--paper-ink-2); }
.shot-img { position: relative; border: 1px solid var(--paper-line); background: #000; border-radius: 2px; overflow: hidden; }
.shot-img img { display: block; width: 100%; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; }
.shot-img .shot-remove {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 5px; border: 0;
  background: rgba(0, 0, 0, .7); color: #fff; opacity: 0; transition: opacity .15s; line-height: 1;
}
.shot:hover .shot-remove { opacity: 1; }
.shot-remove:hover { background: var(--accent); }
.shot-dur { font-family: var(--font-mono); font-size: 11px; color: var(--paper-ink-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; }
.shot-dur span { white-space: nowrap; }
.shot-dur .dur { color: var(--paper-ink-2); }
.shot-notes {
  min-height: 58px; padding: 4px 2px; outline: none;
  font-size: 13px; line-height: 20px; color: var(--paper-ink);
  background-image: repeating-linear-gradient(to bottom, transparent 0 19px, var(--paper-line) 19px 20px);
  background-position: 0 4px;
  border-bottom: 0; word-break: break-word;
}
.shot-notes:empty::before { content: "Notes…"; color: var(--paper-ink-3); font-style: italic; }
.shot-notes:focus { box-shadow: -6px 0 0 -4px var(--accent); }
.sheet-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--paper-line); display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper-ink-3); }

/* --------------------------------------------------------------------------
   Timeline (the seismograph)
   -------------------------------------------------------------------------- */
.timeline-bar {
  height: var(--timeline-h);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column;
  animation: rise .5s var(--ease) both;
}
.timeline-head { display: flex; align-items: center; gap: 16px; padding: 8px 16px 4px; }
.timeline-tc { display: flex; gap: 8px; align-items: baseline; min-width: 190px; }
.timeline-tc .tc { font-size: 15px; color: var(--accent-2); }
.timeline-tc .dim { font-size: 12px; }
.timeline-legend { margin-left: auto; display: flex; gap: 18px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.lg-diff { background: var(--ochre-dim); }
.lg-thr { height: 0; border-top: 1.5px dashed var(--accent-2); }
.lg-cut { width: 2px; height: 10px; background: var(--accent); }
.timeline-wrap { position: relative; flex: 1; min-height: 0; padding: 0 16px 10px; }
#timeline { width: 100%; height: 100%; display: block; border-radius: 6px; background: var(--bg); cursor: crosshair; touch-action: none; }
#timeline.is-thr { cursor: ns-resize; }
.scrub-preview {
  position: absolute; bottom: calc(100% - 4px); transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5); pointer-events: none; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.scrub-preview img { width: auto; height: auto; max-width: 200px; max-height: 170px; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; border-radius: 4px; display: block; background: #000; }
.scrub-preview span { font-size: 11px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--timeline-h) + 18px); transform: translateX(-50%);
  background: var(--bg-3); color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 10px 16px 10px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); z-index: 40;
  animation: toast-in .35s var(--ease) both;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(124, 196, 140, .18); }
.toast.is-err::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 9, 12, .92); backdrop-filter: blur(6px);
  display: grid; grid-template-columns: 72px 1fr 72px; align-items: center;
  animation: fade .2s var(--ease) both;
}
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lb-fig img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.lb-cap { display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 13px; }
.lb-nav, .lb-close {
  border: 0; background: transparent; color: var(--ink-2); font-size: 42px; line-height: 1; height: 100%;
  transition: color .15s, background .15s;
}
.lb-nav:hover, .lb-close:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.lb-close { position: absolute; top: 12px; right: 16px; height: auto; font-size: 30px; padding: 6px 12px; border-radius: 8px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1320px) { body.has-video .tagline { display: none; } }
@media (max-width: 1080px) { .topbar .status { display: none; } .btn .mono { display: none; } }
@media (max-width: 960px) {
  body { height: auto; overflow: auto; grid-template-rows: auto auto auto; }
  .topbar { grid-template-columns: 1fr auto; height: auto; padding: 10px 14px; row-gap: 10px; }
  .topbar .views { grid-column: 1 / -1; justify-self: center; }
  .tagline { display: none; }
  .drop-steps { flex-direction: column; gap: 10px; align-items: flex-start; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { min-height: 70vh; }
  .dropzone { position: relative; inset: auto; margin: 16px; min-height: 60vh; }
  .timeline-bar { position: sticky; bottom: 0; }
  .timeline-legend { display: none; }
  .sheet { padding: 28px 20px; --cols: 2 !important; }
}

/* --------------------------------------------------------------------------
   Print: only the storyboard sheet
   -------------------------------------------------------------------------- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; display: block; }
  .topbar, .sidebar, .timeline-bar, .lightbox, .dropzone, .view-frames, .view-head, .offscreen, .toast { display: none !important; }
  .workspace { display: block; }
  .stage { overflow: visible; }
  .view-storyboard { display: block !important; padding: 0; }
  .sheet { max-width: none; box-shadow: none; border-radius: 0; padding: 0; background: #fff; color: #111; }
  .sheet::before { display: none; }
  .sheet-head { padding-bottom: 10px; margin-bottom: 14px; }
  .sheet-title { font-size: 34px; }
  .sheet-meta { margin-top: 6px; font-size: 10.5px; }
  .board { gap: 16px 12px; }
  .shot { gap: 5px; break-inside: avoid; page-break-inside: avoid; animation: none; }
  .shot-num { font-size: 20px; }
  .shot-remove { display: none; }
  .shot-notes { min-height: 44px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-foot { margin-top: 14px; padding-top: 8px; break-inside: avoid; }
  .shot-notes:empty::before { content: ""; }
  .sheet-title:empty::before { content: attr(data-placeholder); }
}
