/* haus video — editor workspace, timeline, modals, queue (mock-derived, radii flattened) */

/* ---------- workspace ---------- */
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(560px, 1fr) 320px;
  gap: 1px;
  background: #111;
  min-height: 0;
}
.left-panel, .right-panel, .stage-area { background: var(--bg); min-height: 0; }
.left-panel { display: grid; grid-template-columns: 54px 1fr; border-right: 1px solid var(--line); }
.left-stack { overflow: auto; display: flex; flex-direction: column; }

/* tool palette */
.tool-palette {
  padding: 12px 8px;
  background: #1d1f21;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool {
  height: 38px;
  border: 1px solid var(--line);
  background: #292c30;
  color: #dfe5ec;
  padding: 0;
}
.tool.active { outline: 2px solid var(--accent); background: var(--accent-soft); }

/* media bin / layers */
.media-panel, .layers-panel { padding: 10px; }
.layers-panel { border-top: 1px solid var(--line); }
.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.asset { background: var(--panel-3); border: 1px solid #42464d; overflow: hidden; min-height: 100px; cursor: pointer; }
.asset img { width: 100%; height: 64px; object-fit: cover; display: block; }
.asset span { display: block; font-size: 12px; color: #c8cdd4; padding: 7px; }
.asset.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 127, 240, 0.25); }
.asset-card { display: grid; place-items: center; text-align: center; color: #aeb5bd; padding: 10px; }
.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line-soft);
  color: #d2d7de;
  font-size: 13px;
  cursor: pointer;
}
.layer-row:hover { background: var(--panel-2); }
.layer-row.selected { background: var(--accent-soft); border-color: var(--accent); }
.layer-row .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-row .layer-btns { display: flex; gap: 2px; }
.layer-row .layer-btns button { background: transparent; border: 0; padding: 3px; color: var(--text-dim); }
.layer-row .layer-btns button:hover { color: var(--text); background: var(--panel-3); }
.layer-row .layer-btns button.on { color: var(--accent-edge); }

/* tray tabs (reels) */
.tray-tabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.tray-tabs button { flex: 1; padding: 7px 0; font-size: 12px; }
.tray-tabs .active { background: #23406d; border-color: #3479df; }

/* ---------- stage / viewer ---------- */
.stage-area { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 28px; }
.viewer-toolbar {
  width: min(880px, 94%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b4bbc4;
  margin-bottom: 10px;
}
.viewer-frame {
  position: relative;
  width: min(880px, 94%);
  aspect-ratio: 16 / 9;
  background: var(--black);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}
.viewer-frame.tall { aspect-ratio: 9 / 16; height: min(58vh, 560px); width: auto; }
.viewer-frame.square { aspect-ratio: 1 / 1; height: min(56vh, 520px); width: auto; }
.viewer-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.safe-area { position: absolute; inset: 7%; border: 1px dashed rgba(255, 255, 255, 0.35); pointer-events: none; }
.caption-layer {
  position: absolute;
  left: 40px;
  bottom: 36px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px #000;
}
.transport { width: min(880px, 94%); display: flex; gap: 8px; align-items: center; margin-top: 13px; color: #cbd1d8; }
.transport .timecode { white-space: nowrap; }
.scrub { height: 6px; background: var(--panel-3); flex: 1; overflow: hidden; cursor: pointer; }
.scrub span { display: block; height: 100%; background: var(--accent); }

/* ---------- inspector ---------- */
.right-panel { border-left: 1px solid var(--line); padding: 12px; overflow: auto; }
.mini-stack { display: grid; gap: 6px; margin-top: 12px; }

/* ---------- timeline ---------- */
.timeline-wrap { background: #18191b; border-top: 1px solid var(--line); display: grid; grid-template-rows: 34px 1fr; min-height: 0; }
.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  background: #242629;
  border-bottom: 1px solid var(--line);
}
.timeline-toolbar > div { display: flex; gap: 6px; align-items: center; }
.timeline-title { color: #aeb5bd; font-size: 13px; }
.timeline-grid { display: grid; grid-template-columns: 165px 1fr; min-height: 0; overflow: auto; }
.track-labels { background: #151719; border-right: 1px solid var(--line); }
.ruler-spacer { height: 22px; border-bottom: 1px solid var(--line); }
.track-label {
  height: 30px;
  padding: 2px 8px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d2d7de;
}
.track-label .track-btns { display: flex; gap: 2px; color: var(--text-dim); }
.track-label .track-btns button { background: transparent; border: 0; padding: 2px; color: inherit; }
.track-label .track-btns button:hover { color: var(--text); }
.tracks {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 120px 100%, 100% 30px;
}
.ruler {
  height: 22px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  border-bottom: 1px solid var(--line);
  color: #8f98a3;
  font: 12px var(--mono);
}
.ruler span { padding-left: 7px; }
.track { position: relative; height: 30px; border-bottom: 1px solid var(--line-soft); }
.playhead { position: absolute; top: 0; bottom: 0; left: 28%; width: 2px; background: #ff5454; z-index: 9; pointer-events: none; }
.playhead::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid #ff5454;
}

.clip, .transition-clip {
  position: absolute;
  top: 2px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  display: flex;
  align-items: center;
  color: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  cursor: pointer;
}
.clip.selected, .transition-clip.selected { outline: 2px solid var(--gold); z-index: 5; }
.filmstrip { background: var(--clip-video); }
.filmstrip img { height: 100%; width: 52px; object-fit: cover; border-right: 1px solid rgba(255, 255, 255, 0.18); pointer-events: none; }
.filmstrip span { padding: 0 9px; white-space: nowrap; }
.transition-clip {
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-deep));
  justify-content: center;
  font-weight: 700;
  color: #1d1505;
}
.textclip { background: var(--purple); justify-content: center; }
.effectclip { background: var(--teal); justify-content: center; }
.audioclip { background: var(--audio-blue); color: var(--audio-ink); }
.audioclip svg { width: 100%; height: 100%; opacity: 0.85; }
.audioclip span { position: absolute; left: 14px; color: #d7e6f8; }

/* ---------- effects / transitions picker ---------- */
.picker-body { display: grid; grid-template-columns: 190px minmax(0, 1fr) 280px; min-height: 0; }
.picker-cats { border-right: 1px solid #3c4148; background: #1a1c1f; padding: 12px; display: grid; align-content: start; gap: 6px; overflow: auto; }
.picker-cats button { justify-content: flex-start; background: transparent; border-color: transparent; }
.picker-cats button:hover { background: var(--panel-3); }
.picker-cats button.active { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.picker-grid { padding: 16px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.fx-card { background: #292d32; border: 1px solid #424851; padding: 11px; cursor: pointer; }
.fx-card:hover { border-color: var(--line-strong); }
.fx-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 127, 240, 0.2); }
.fx-card .swatch { height: 54px; background: var(--inset); border: 1px solid var(--line); margin-bottom: 9px; display: grid; place-items: center; color: var(--text-dim); }
.fx-card b { display: block; font-size: 13px; }
/* direct children only — nested .fx-live/.tfx-* spans must keep their own display */
.fx-card > span { display: block; color: #9aa4af; font-size: 11px; margin-top: 3px; }
.picker-side { border-left: 1px solid #3c4148; background: #191b1e; padding: 16px; overflow: auto; }
.picker-preview { height: 140px; background: var(--black); border: 1px solid #434a54; margin-bottom: 14px; display: grid; place-items: center; color: var(--text-dim); position: relative; overflow: hidden; }
.picker-preview .demo { width: 56px; height: 56px; background: var(--accent); display: grid; place-items: center; font-weight: 800; }

/* ---------- render modal internals ---------- */
.render-body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 250px; min-height: 0; }
.render-presets { border-right: 1px solid #3c4148; background: #1a1c1f; padding: 16px; display: grid; align-content: start; gap: 10px; overflow: auto; }
.preset-card { background: #292d32; border: 1px solid #424851; padding: 13px; min-height: 74px; cursor: pointer; }
.preset-card.active { border-color: var(--accent); background: linear-gradient(135deg, #203c68, #2a3038); box-shadow: 0 0 0 2px rgba(47, 127, 240, 0.2); }
.preset-card b { display: block; font-size: 14px; }
.preset-card span { display: block; color: #9aa4af; font-size: 12px; margin-top: 4px; }
.render-settings { padding: 18px; overflow: auto; }
.top-summary { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; margin-bottom: 16px; }
.setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.setting-card { background: #262a2f; border: 1px solid #444b55; padding: 13px; cursor: pointer; }
.setting-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(216, 169, 74, 0.18); }
.select-large { font-size: 18px; font-weight: 800; margin-top: 4px; }
.select-large span { display: block; font-size: 12px; color: #98a2ad; font-weight: 600; margin-top: 2px; }
.codec-matrix { background: var(--inset); border: 1px solid #3f454e; overflow: hidden; }
.matrix-head { display: flex; justify-content: space-between; padding: 12px 14px; background: #24282d; border-bottom: 1px solid #3f454e; }
.matrix-head span { font-size: 12px; color: #909aa6; }
.codec-row { display: grid; grid-template-columns: 145px 1fr 90px; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #2d3238; cursor: pointer; }
.codec-row:last-child { border-bottom: 0; }
.codec-row span { font-weight: 800; }
.codec-row small { color: #99a3ae; }
.codec-row b { justify-self: end; color: #c9d1dc; font-size: 12px; background: #303640; border: 1px solid #49515c; padding: 4px 8px; }
.codec-row.active { background: rgba(47, 127, 240, 0.16); }
.codec-row.active b { background: #245390; border-color: #3d89ee; color: #fff; }
.resolution-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 16px; }
.resolution-strip .active { background: #3b3120; border-color: var(--gold); }
.render-summary { border-left: 1px solid #3c4148; background: #191b1e; padding: 16px; overflow: auto; }
.summary-preview { height: 132px; overflow: hidden; position: relative; border: 1px solid #434a54; background: var(--black); margin-bottom: 14px; }
.summary-preview img { width: 100%; height: 100%; object-fit: cover; }
.summary-stat { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #30353b; }
.summary-stat span { color: #9ba5b0; }
.summary-stat b { font-family: var(--mono); font-size: 13px; text-align: right; }
.render-progress { height: 8px; background: #0f1113; border: 1px solid #373d45; margin: 16px 0 10px; overflow: hidden; }
.render-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--green)); }
.render-note { display: block; color: #9aa4af; line-height: 1.45; font-size: 12px; }

/* ---------- queue page ---------- */
/* column flex fills the viewport: summary / pipeline / log are fixed rows,
   the jobs list takes the rest and scrolls internally */
.queue-main { overflow: hidden; padding: 12px 22px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.queue-main .section-title { margin: 2px 0 -2px; }
.queue-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.queue-summary > div { background: var(--panel); border: 1px solid var(--line); padding: 8px 12px; }
.queue-summary small { color: var(--text-soft); display: block; font-size: 11px; }
.queue-summary b { display: block; font-size: 18px; margin-top: 2px; font-family: var(--mono); }
.pipeline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stage { background: var(--panel); border: 1px solid var(--line); padding: 9px 12px; }
.stage.active { border-color: var(--green); }
.stage.waiting { border-color: #64718a; }
.stage.complete { border-color: var(--accent); }
.stage.complete .bar em { background: var(--accent); }
.stage.failed { border-color: var(--red); }
.stage.failed .bar em { background: var(--red); }
.stage.skipped { border-color: var(--line); opacity: 0.65; }
.stage.skipped .bar em { background: var(--line-strong); }
.stage-top { display: flex; justify-content: space-between; gap: 12px; }
.stage-top span { color: var(--text-soft); font-size: 13px; font-family: var(--mono); }
.bar { height: 8px; background: #293246; overflow: hidden; margin: 8px 0; }
.bar em { height: 100%; display: block; background: linear-gradient(90deg, var(--accent), #62e5aa); transition: width 0.5s linear; }
.stage-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--text-soft); font-size: 12px; }
.queue-layout { display: grid; grid-template-columns: 390px 1fr; gap: 12px; flex: 1; min-height: 0; }
.queue-layout > * { min-height: 0; }
.queue-list, .node-table, .log-panel { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; }
.queue-list { display: flex; flex-direction: column; }
.queue-list #job-list { flex: 1; min-height: 0; overflow: auto; }
.queue-list h2, .node-table h2, .log-panel h2 { margin: 0 0 12px; font-size: 14px; }
.log-panel { flex: none; }
.log-panel h2 { margin-bottom: 8px; }
/* no job selected (empty queue) → log collapses, jobs list fills the page */
.queue-main.no-selection .log-panel { display: none; }
.queue-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.queue-list-head h2 { margin: 0; }
.queue-list-head select { width: 150px; font-size: 12px; }
.queue-empty { color: var(--text-soft); padding: 26px 12px; text-align: center; border: 1px dashed var(--line); }
.log-job { color: var(--text-soft); font-weight: 600; font-size: 12px; margin-left: 8px; font-family: var(--mono); }
.job { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); margin-bottom: 6px; background: var(--inset); cursor: pointer; }
.job > div:first-child { flex: 1; min-width: 0; } /* pill + actions align right regardless of name width */
.job .pill { min-width: 80px; text-align: center; }
.job.selected { outline: 2px solid var(--accent); }
.job b { display: block; font-size: 13px; }
.job small { display: block; color: var(--text-soft); font-size: 12px; margin-top: 2px; }
.job .job-actions { display: flex; gap: 5px; }
.job .job-actions button { padding: 4px; }
.job .bar.job-bar { height: 4px; margin: 7px 0 0; }
.job .aspect-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 5px; background: #363145; color: #d2b2ff; border: 1px solid #4d4566; vertical-align: 1px; }
.job small a { color: var(--accent-edge); text-decoration: none; }
.job small a:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; border-bottom: 1px solid var(--line-soft); padding: 10px 8px; }
th { color: var(--text-soft); font-size: 12px; }
.mini { padding: 4px 8px; font-size: 11px; font-weight: 800; display: inline-block; }
.mini.live { background: #173d2f; color: #6ff0b0; }
.mini.wait { background: #363145; color: #d2b2ff; }
.mini.encode { background: #163d4b; color: #66e3ff; }
pre.log { margin: 0; background: #0b0d10; border: 1px solid var(--line-soft); padding: 10px 14px; color: #96e6b9; font-size: 12px; line-height: 1.55; white-space: pre-wrap; font-family: var(--mono); height: 168px; overflow: auto; overflow-wrap: anywhere; }

/* ---------- reels / slideshow editor pages ---------- */
.titlebar-fields { display: flex; align-items: center; gap: 7px; }
.titlebar-fields input { width: 220px; background: var(--inset); }
.titlebar-fields label { margin: 0; font-size: 12px; color: var(--text-dim); }

.reels-stage-wrap { position: relative; }
.reels-stage-frame {
  position: relative;
  aspect-ratio: 1080 / 1920;
  height: min(56vh, 540px);
  background: #101014;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  user-select: none;
}
.stage-empty { display: grid; place-items: center; height: 100%; color: var(--text-dim); font-size: 13px; }

/* selection handles (graphite-gold, ported from the classic editor) */
.sh { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--gold); pointer-events: auto; z-index: 10; }
.sh.tl { top: -4px; left: -4px; cursor: nwse-resize; } .sh.tr { top: -4px; right: -4px; cursor: nesw-resize; }
.sh.bl { bottom: -4px; left: -4px; cursor: nesw-resize; } .sh.br { bottom: -4px; right: -4px; cursor: nwse-resize; }

/* asset tray (left panel) */
.tray-tabs-cloud { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tray-tab { padding: 4px 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--panel-2); border: 1px solid var(--line); color: #cfd6de; }
.tray-tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.tray-body { flex: 1; min-height: 0; overflow-y: auto; }
.tray-loading, .tray-empty { font-size: 12px; color: var(--text-dim); padding: 8px 0; }
.tray-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin: 8px 0 5px; }
.asset-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* light grey cards, not panel-dark: many catalog SVGs are black line art */
.asset-card { display: grid; gap: 4px; background: #d7dade; border: 1px solid #aeb3ba; padding: 6px; text-align: left; cursor: pointer; }
.asset-card:hover { background: #e2e5e8; border-color: var(--accent); }
.asset-preview { display: block; height: 62px; overflow: hidden; }
.asset-preview img, .asset-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.asset-card .asset-name { font-size: 11px; color: #2b2f34; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.upload-tile { display: grid; place-items: center; font-size: 22px; color: #5a6068; border: 1px dashed #8b9097; }

/* timeline (shared renderTimeline markup, graphite skin) */
.timeline-wrap .timeline-list { position: relative; flex: 1; overflow-y: auto; padding: 8px 12px; }
.timeline-wrap { display: grid; grid-template-rows: 34px 1fr; min-height: 0; }
.tl-playhead-bar { position: absolute; top: 0; bottom: 0; width: 2px; background: #ff5454; pointer-events: none; z-index: 10; left: 0; }
.tl-ruler { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; margin-bottom: 4px; }
.tl-ruler-lane { position: relative; height: 24px; border-bottom: 2px solid var(--line); cursor: pointer; }
.tl-tick { position: absolute; top: 0; width: 1px; height: 10px; background: var(--text-dim); pointer-events: none; }
.tl-tick::after { content: attr(data-label); position: absolute; top: 11px; left: 3px; font: 600 10px var(--mono); color: var(--text-dim); white-space: nowrap; }
.timeline-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: center; cursor: pointer; border-bottom: 1px solid var(--line-soft); padding: 4px 0; }
.timeline-row:hover { background: var(--panel-2); }
.timeline-row-label { font-weight: 600; color: #d2d7de; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.timeline-lane { position: relative; height: 26px; background: var(--inset); overflow: hidden; }
.timeline-clip { position: absolute; top: 3px; bottom: 3px; min-width: 2px; background: linear-gradient(90deg, #1f4f9f, #2f7ff0); border: 1px solid rgba(255, 255, 255, 0.22); display: flex; align-items: center; overflow: hidden; cursor: grab; user-select: none; }
.timeline-clip:active { cursor: grabbing; }
.tl-clip-label { color: #fff; font-size: 11px; font-weight: 600; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; flex: 1; }
.tl-resize { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgba(255, 255, 255, 0.15); flex-shrink: 0; z-index: 2; }
.tl-resize:hover { background: rgba(255, 255, 255, 0.4); }
.tl-resize-l { left: 0; } .tl-resize-r { right: 0; }

/* shared layer-list renderer (renderLayers markup, dark skin) */
.layer-row.is-active { background: var(--accent-soft); border-color: var(--accent); }
.layer-vis-btn, .layer-btn { border: 0; background: transparent; padding: 2px 4px; color: var(--text-dim); font-size: 14px; line-height: 1; flex: none; }
.layer-vis-btn:hover, .layer-btn:hover { color: var(--text); background: var(--panel-3); }
.layer-type-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; background: var(--panel-3); color: #aeb5bd; padding: 1px 5px; flex: none; }
.layer-label { flex: 1; font-size: 12px; color: #d2d7de; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-info { margin: 0 0 6px 26px; padding: 6px 10px; border-left: 2px solid var(--accent); font-size: 11px; color: var(--text-soft); background: var(--inset); }
.layer-info div { display: flex; gap: 8px; }
.layer-info div > span:first-child { min-width: 72px; color: var(--text-dim); text-transform: uppercase; font-size: 9px; letter-spacing: 0.05em; line-height: 1.9; }
.layer-info code { font-size: 10px; word-break: break-all; color: #c8cdd4; }

/* collapsible inspector sections */
.panel-section { border-bottom: 1px solid var(--line-soft); padding-bottom: 12px; margin-bottom: 12px; }
.panel-section:last-child { border-bottom: 0; margin-bottom: 0; }
.panel-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; background: none; border: 0; padding: 0 0 9px; cursor: pointer; font: inherit; font-weight: 800; font-size: 13px; color: var(--text); text-align: left; }
.panel-toggle:hover { background: none; color: #fff; }
.panel-toggle .ic { transition: transform 0.15s ease; color: var(--text-dim); }
.panel-section.is-collapsed .panel-toggle { padding-bottom: 0; }
.panel-section.is-collapsed .panel-toggle .ic { transform: rotate(-90deg); }
.panel-section.is-collapsed .panel-body { display: none; }

/* effect picker grid (shared modal markup); section titles collapse their grid */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fx-section-title { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; background: none; border: 0; padding: 0; margin: 14px 0 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); cursor: pointer; text-align: left; }
.fx-section-title:hover { background: none; color: var(--text); }
.fx-section-title .chev { transition: transform 0.15s ease; font-style: normal; }
.fx-section-title.is-collapsed .chev { transform: rotate(-90deg); }
.fx-section-title.is-collapsed + .fx-grid, .fx-section-title.is-collapsed + .fx-cards { display: none; }
#fx-grid > .fx-section-title:first-child { margin-top: 0; }
.fx-card { display: block; text-align: center; }
.fx-card .fx-preview { height: 54px; background: var(--inset); border: 1px solid var(--line); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; }
.fx-card .fx-card-label { font-size: 12px; font-weight: 700; }
.fx-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 127, 240, 0.2); }
.fx-card .fx-live { font-family: Bangers, Inter, sans-serif; font-size: 24px; }

/* jobs tab */
.job-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--text-soft); }
.job-line .job-path { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 11px; }
.job-line .job-log-link { margin-left: auto; color: var(--accent-edge); text-decoration: none; font-size: 11px; }
.job-line .job-log-link:hover { text-decoration: underline; }

/* doodle stage (classic /editor/ artwork — cream canvas is part of the look) */
.stage-canvas {
  position: relative;
  width: min(880px, 94%);
  aspect-ratio: 1280 / 720;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  background: linear-gradient(180deg, #fbf7ef, #f4efe6);
  user-select: none;
}
.stage-node { position: absolute; display: block; border: none; background: transparent; padding: 0; text-align: left; cursor: grab; color: #111; }
.stage-node:hover { background: transparent; }
.stage-node:active { cursor: grabbing; }
.stage-node:not(.background):hover { outline: 1px dashed rgba(29, 53, 87, 0.35); }
.stage-node.is-selected { outline: 2px dashed var(--gold); }
.stage-node.background { z-index: 1; cursor: default; }
.stage-node.character, .stage-node.hand, .stage-node.stickman, .stage-node.prop, .stage-node.icon { z-index: 2; }
.stage-node.text { z-index: 3; }
.stage-node .stage-image { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.stage-label { display: inline-block; margin-top: 3px; padding: 2px 7px; background: rgba(15, 23, 42, 0.7); color: #fff; font-size: 10px; pointer-events: none; }
.stage-text { display: flex; align-items: center; width: 100%; height: 100%; font-weight: 700; line-height: 1.2; word-break: break-word; pointer-events: none; }
/* hand-draw runtime overlay (playback-hand.js positions it with inline left/top) */
.hand-overlay { position: absolute; pointer-events: none; z-index: 50; width: auto; opacity: 0; }
/* typography effects on the doodle stage (text-fx.js unit spans; v2-only —
   mirrors reel-stage.css, which this page doesn't load) */
.stage-text .tfx-line { display: inline-block; }
.tfx-w { display: inline-block; white-space: nowrap; }
.tfx-u { display: inline-block; will-change: transform, opacity; }
.tfx-mask { overflow: hidden; vertical-align: bottom; }
.tfx-mask .tfx-i { display: inline-block; }

/* bold / italic / align toggles */
.prop-toggle-row { display: flex; gap: 4px; margin-top: 8px; }
.prop-toggle-btn { border: 1px solid var(--line); background: var(--panel-2); color: #cfd6de; padding: 5px 10px; font-size: 13px; line-height: 1; }
.prop-toggle-btn:hover { background: var(--panel-3); }
.prop-toggle-btn.is-active { background: var(--accent-soft); border-color: var(--accent); color: #fff; }

.fx-card .fx-card-desc { font-size: 10px; color: var(--text-dim); line-height: 1.3; margin-top: 3px; }
.statusbar.has-error #status-message { color: #ff9eb1; }

/* statusbar */
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 14px; background: #1c1e20; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-soft); }
.statusbar #status-message { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar > span:last-child { flex: none; font-family: var(--mono); }

/* ---------- typography page ---------- */
.typo-stage {
  position: relative;
  height: min(56vh, 540px);
  max-width: 94%;
  background: #101014;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  user-select: none;
}
.typo-stage .sh { display: none; } /* workbench has no resize handles (sizes live in the props panel) */
.layers-empty { color: var(--text-dim); font-size: 12px; padding: 8px 4px; }
.layer-row .fx-name { color: var(--text-dim); font-size: 11px; font-family: var(--mono); }
button.badge { cursor: pointer; }
button.badge.active { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
#btn-path-preview.active { background: var(--accent-soft); border-color: var(--accent); color: #fff; }

.snippet-strip { border-top: 1px solid var(--line); background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.typo-gallery { display: flex; gap: 10px; overflow-x: auto; min-height: 0; }
/* left-panel variant: vertical card list */
.typo-gallery.typo-gallery-column { flex-direction: column; gap: 6px; overflow-x: hidden; overflow-y: auto; max-height: 38vh; }
.typo-gallery-column .typo-card { width: 100%; }
.typo-card { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; width: 240px; flex: none; text-align: left; cursor: pointer; }
.typo-thumb { width: 52px; height: 52px; background: #14151a; border: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: center; color: var(--text-dim); overflow: hidden; }
.typo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.typo-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.typo-aspect { font-size: 10px; color: var(--text-soft); background: var(--panel-3); padding: 1px 5px; border: 1px solid var(--line); font-family: var(--mono); }

/* effect picker cards (live "Aa" previews) */
.fx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fx-cards .fx-card { display: block; text-align: center; }
.fx-cards .swatch { overflow: hidden; }
.fx-cards .fx-live { font-family: Bangers, Inter, sans-serif; font-size: 26px; color: #fff; }

/* ---------- motion page ---------- */
.motion-viewport { position: relative; flex: 1; width: min(960px, 94%); background: var(--black); border: 1px solid var(--line-strong); overflow: hidden; }
.motion-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.motion-svg path { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 7 7; }
.motion-svg circle { fill: var(--bg); stroke: var(--gold); stroke-width: 2; cursor: grab; }
.motion-obj { position: absolute; padding: 9px 13px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: 12px; font-weight: 700; }
.motion-obj.ghost { opacity: 0.4; border-style: dashed; }
.keys { position: absolute; inset: 3px 0; }
.keys i { position: absolute; top: 5px; width: 11px; height: 11px; background: var(--gold); transform: rotate(45deg); border: 1px solid #fff3; }
.curve { height: 90px; background: var(--inset); border: 1px solid var(--line); position: relative; overflow: hidden; }
.curve::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 12%; top: 14%; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 250px 1fr 280px; }
  .caption-layer { font-size: 22px; }
  .asset-grid { grid-template-columns: 1fr; }
  .picker-body, .render-body { grid-template-columns: 170px 1fr; }
  .picker-side, .render-summary { display: none; }
}

/* ---------- responsive: read-mostly views only ----------
   Editors stay desktop-only (the workspace/timeline don't collapse). The
   Render Queue is a read-mostly view that end users & stakeholders may check
   on a phone, so it stacks: 5-col summary → 2, pipeline → 1, list+log → 1. */
@media (max-width: 820px) {
  .queue-main { overflow: auto; padding: 12px 14px 16px; }
  .queue-summary { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: 1fr; }
  .queue-layout { grid-template-columns: 1fr; }
}

/* ---------- file upload / reference slots ----------
   The shared upload pattern: a dashed dropzone thumb + Upload / Pick / Clear
   actions. Accepts click-to-pick, Upload-from-disk (hidden file input), and
   drag-drop. Used by frame-conditioning, scene references, cast views. */
.frame-slots { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.frame-slot label { margin-bottom: 5px; }
.slot-thumb { width: 132px; height: 92px; background: var(--inset); border: 1px dashed var(--line-strong); display: grid; place-items: center; cursor: pointer; overflow: hidden; position: relative; }
.slot-thumb:hover, .slot-thumb.dragover { border-color: var(--accent); background: var(--accent-soft); }
.slot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slot-thumb .ic { color: var(--text-dim); }
.slot-actions { display: flex; gap: 4px; margin-top: 5px; }
.slot-actions button { padding: 3px 8px; }

/* Upload pattern — variant 2: a drop-zone bar for bulk file drops (uploads tab).
   Same core behaviors (click to choose, drag-drop) without per-item thumbs. */
.upload-bar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; border: 1px dashed var(--line-strong); padding: 14px; }
.upload-bar.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-bar .control-group { margin: 0; }
.upload-hint { color: var(--text-dim); font-size: 12px; }
