:root {
  --bg: #0c0c0d;
  --panel: #151517;
  --panel-2: #1d1d20;
  --line: #2a2a2e;
  --text: #ececee;
  --muted: #9a9aa2;
  --accent: #7716cc;          /* buttons, badges, bars */
  --accent-ink: #ffffff;      /* text on accent (7.6:1) */
  --accent-text: #b07cf0;     /* accent-colored text on the dark background (6.4:1) */
  --accent-soft: #1b1029;     /* tinted panels */
  --danger: #ff5d5d;
  --ok: #4fd18b;
  --radius: 4px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 26px; letter-spacing: -.01em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.boot { padding: 40px; color: var(--muted); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- buttons and inputs */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 3px; font-weight: 500;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .08s, border-color .08s;
}
.btn:hover { border-color: #46464d; background: #26262a; }
.btn:active { background: #1a1a1d; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #8423dd; border-color: #8423dd; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=search], input[type=number], input[type=password], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 1px solid var(--accent-text); outline-offset: 0; border-color: var(--accent-text); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ---------- layout */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: rgba(12,12,13,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.home-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 9px; border-radius: 3px; text-decoration: none;
  font-weight: 650; border: 1px solid var(--line); background: var(--panel); }
.home-btn:hover, .home-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.home-btn svg { width: 19px; height: 19px; fill: var(--accent-text); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 2px; color: var(--muted); }
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel-2); }
.me { display: flex; align-items: center; gap: 8px; }
.me a:not(.btn) { text-decoration: none; font-weight: 600; }
.me a:not(.btn):hover { color: var(--accent-text); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); object-fit: cover; }
main { padding: 20px; max-width: 1500px; margin: 0 auto; }

/* ---------- landing */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.landing .card { max-width: 440px; width: 100%; text-align: center; padding: 36px 28px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; }
.landing .big-logo { font-size: 34px; font-weight: 900; letter-spacing: .05em; margin-bottom: 6px; }
.landing .big-logo span { color: var(--accent-text); }
.notice { padding: 10px 12px; border-radius: 3px; background: #2a1414; color: #ffb3b3; font-size: 14px; }
.notice.info { background: var(--accent-soft); color: #dcc6f7; }

/* ---------- archive */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 280px; font-size: 16px; padding: 10px 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card-clip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.card-clip:hover { border-color: #45454c; transform: translateY(-1px); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb .badge { position: absolute; bottom: 6px; right: 6px; }
.thumb .badge-left { top: 6px; left: 6px; bottom: auto; right: auto; }
.badge { font-size: 12px; padding: 2px 7px; border-radius: 2px; background: rgba(0,0,0,.72); font-weight: 600; }
.badge.mood { background: var(--accent); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.badge.status { background: #33302a; }
.badge.status.failed { background: #4a1d1d; color: #ffb3b3; }
.card-clip .meta { padding: 9px 11px 11px; }
.card-clip .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.load-more { display: flex; justify-content: center; margin: 22px 0; }

/* ---------- clip page */
.clip-page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.player { background: #000; border-radius: var(--radius); overflow: hidden; }
.player video, .player img { width: 100%; max-height: 72vh; object-fit: contain; }
.player audio { width: 100%; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.meter { height: 6px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin-top: 7px; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 3px 9px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line);
  cursor: pointer; }
.chip:hover { border-color: var(--accent-text); }
.transcript { max-height: 340px; overflow: auto; }
.tline { display: flex; gap: 10px; padding: 4px 6px; border-radius: 2px; cursor: pointer; }
.tline:hover { background: var(--panel-2); }
.tline .ts { color: var(--accent-text); font-variant-numeric: tabular-nums; min-width: 42px; }
.title-input { width: 100%; font-size: 22px; font-weight: 700; background: transparent; border: 1px solid transparent; padding: 2px 4px; }
.title-input:hover { border-color: var(--line); }

/* ---------- tables / admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent-text); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 24px; }
.secret { padding: 12px; border: 1px dashed var(--accent-text); border-radius: 3px; background: var(--accent-soft); word-break: break-all; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; }

/* ---------- modal + upload */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; width: min(620px, 100%);
  max-height: 90vh; overflow: auto; padding: 20px; }
.drop { border: 2px dashed var(--line); border-radius: 4px; padding: 34px 16px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--accent-text); background: var(--accent-soft); }
.up-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.up-row .meter { grid-column: 1 / -1; margin: 0; }
.up-row.err .meter > i { background: var(--danger); }
.up-row.done .meter > i { background: var(--ok); }

/* ---------- device */
.code-input { font-size: 26px; letter-spacing: .2em; text-align: center; text-transform: uppercase; width: 100%; }

/* ---------- toasts */
#toasts { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); }
.toast { background: #26262a; border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px;
  border-radius: 3px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.toast.err { border-left-color: var(--danger); }
/* the progress card: your uploads while the worker processes them (always below the toasts) */
.job-dock { order: 99; width: 300px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.4); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.job-dock.hidden { display: none; }
.job-dock-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.job-dock-head button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.job-dock-head button:hover { color: var(--text); }
.job-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.job-row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.job-row .s { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.job-row.ok .s { color: var(--ok); }
.job-row.bad .s { color: var(--danger); }
.job-bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.job-bar > i { display: block; height: 100%; background: var(--accent); transition: width .6s ease; }
.job-bar.indet > i { width: 35%; animation: job-indet 1.4s ease-in-out infinite; }
@keyframes job-indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .job-bar.indet > i { animation: none; } }

@media (max-width: 860px) {
  .clip-page { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  main { padding: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

/* ---------- home: folders */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; }
.section-head h2 { margin: 0; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.folders.big { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.folders.cats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.folder.cat .cat-art { position: absolute; inset: 0; display: grid; place-items: start end; padding: 12px 16px; font-size: 30px; line-height: 1; color: var(--accent-text); background: var(--panel-2); }
.section-head a { color: inherit; text-decoration: none; }
.folder { position: relative; display: block; border-radius: 4px; overflow: hidden; text-decoration: none; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a1442, #12091c); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.folder:hover { border-color: var(--accent-text); transform: translateY(-1px); }
.folder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.folder .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.folder .label b { display: block; font-size: 19px; }
.folder .kind { position: absolute; top: 10px; left: 10px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- social */
.edit-card .thumb { aspect-ratio: 9 / 12; }
.edit-card .thumb img { object-fit: cover; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.social { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 3px; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; }
.social:hover { border-color: var(--accent-text); }
.social b { color: var(--accent-text); font-weight: 600; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.profile-head .initial { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.edit-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 24px; align-items: start; }
.edit-page .player video { max-height: 70vh; }
.link-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; margin-bottom: 8px; }
.folder-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.auth-form { display: grid; gap: 12px; text-align: left; }
.auth-form input { width: 100%; }

@media (max-width: 860px) {
  .edit-page { grid-template-columns: 1fr; }
  .folders, .folders.big, .folders.cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .folder { aspect-ratio: 4 / 3; }
  .folder .label { padding: 10px 12px; }
  .folder .label b { font-size: 15px; }
  .link-row { grid-template-columns: 110px 1fr auto; }
}

/* ---------- YouTube */
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.yt-frame.vertical { width: auto; height: min(78vh, 900px); aspect-ratio: 9 / 16; margin: 0 auto; }
.badge.yt { background: #b3261e; color: #fff; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.segmented button { background: var(--panel); border: 0; padding: 7px 14px; cursor: pointer; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.active { background: var(--accent); color: var(--accent-ink); }

/* ---------- audio */
.audio-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.row.nowrap { flex-wrap: nowrap; }
.audio-tools input[type=search] { width: 100%; }
.row.nowrap input { flex: 1; }
.results { max-height: 420px; overflow: auto; padding: 6px; }
.result { display: grid; grid-template-columns: 60px 1fr auto; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: 3px;
  text-decoration: none; }
a.result:hover, .result.pick { background: var(--panel-2); }
.result .ts, .topic .ts { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ep-card .ep-art { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #2a1442, #12091c); display: grid; place-items: center;
  font-size: 40px; color: var(--accent-text); overflow: hidden; }
.ep-card .ep-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cut-row { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cut-row .cut-title { font-weight: 650; text-decoration: none; }
.cut-text { color: #c9c9cf; margin-top: 4px; font-style: italic; }
.chip.small { font-size: 12px; padding: 1px 7px; }
.editor { position: sticky; top: 61px; z-index: 5; margin: 14px 0; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.wave { display: block; width: 100%; border-radius: 2px; background: #0e0e10; cursor: crosshair; touch-action: none; }
.wave.overview { cursor: pointer; }
.selbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.time-in { width: 92px; text-align: center; }
.episode-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.tx { line-height: 1.75; font-size: 16px; }
.tx p { margin: 0 0 14px; }
.tx .w { cursor: pointer; border-radius: 2px; }
.tx .w:hover { background: #26262b; }
.tx .w.sel { background: var(--accent); color: var(--accent-ink); }
.tx .w.now { box-shadow: inset 0 -2px 0 var(--accent-text); }
.topic { display: grid; grid-template-columns: 56px 1fr; gap: 8px; text-decoration: none; padding: 4px 0; }
.topic:hover span:last-child { color: var(--accent-text); }
.side-cut { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.side-cut a { text-decoration: none; }
@media (max-width: 860px) {
  .audio-tools, .episode-body { grid-template-columns: 1fr; }
  .editor { top: 0; position: relative; }
  .result { grid-template-columns: 52px 1fr; }
  .result > :last-child { grid-column: 2; justify-self: start; }
}

/* ---------- editor: library left (archive / effects), preview centre, inspector right, timeline below */
.ed { display: flex; flex-direction: column; gap: 6px; height: calc(100vh - 100px); min-height: 560px; }
/* the editor owns the window: no site menu, no page margins */
body.ed-mode .topbar { display: none; }
body.ed-mode main { padding: 6px 8px 8px; max-width: none; }
body.ed-mode .ed { height: calc(100vh - 14px); }
.ed-top { gap: 8px; flex: none; flex-wrap: nowrap; }
.ed-home { font-weight: 900; letter-spacing: .04em; text-decoration: none; padding: 0 4px; font-size: 15px; }
.ed-home span { color: var(--accent-text); margin-left: 3px; }
.ed-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.ed-main { flex: 1; min-height: 0; display: grid; gap: 0;
  grid-template-columns: var(--lib-w, 330px) 6px minmax(0, 1fr) 6px var(--insp-w, 320px); }
.ed-main.no-lib { grid-template-columns: 0 0 minmax(0, 1fr) 6px var(--insp-w, 320px); }
.ed-main.no-insp { grid-template-columns: var(--lib-w, 300px) 6px minmax(0, 1fr) 0 0; }
.ed-main.no-lib.no-insp { grid-template-columns: 0 0 minmax(0, 1fr) 0 0; }
.ed-main.no-lib .ed-lib, .ed-main.no-insp .ed-side, .ed-main.no-lib .ed-split.lib, .ed-main.no-insp .ed-split.insp { display: none; }
.ed-split.lib { grid-column: 2; } .ed-split.insp { grid-column: 4; }
.ed-lib { grid-column: 1; }
.ed-center { grid-column: 3; }
.ed-side { grid-column: 5; }
.ed-split { position: relative; z-index: 5; }
.ed-split.v { cursor: col-resize; }
.ed-split.h { cursor: row-resize; height: 6px; flex: none; margin: -3px 0; }
.ed-split::after { content: ''; position: absolute; background: transparent; transition: background-color .1s; }
.ed-split.v::after { left: 2px; right: 2px; top: 0; bottom: 0; }
.ed-split.h::after { top: 2px; bottom: 2px; left: 0; right: 0; }
.ed-split:hover::after, .ed-split.on::after { background: var(--accent-text); }
.ed-lib .segmented button { white-space: nowrap; padding: 5px 7px; font-size: 12.5px; }
.ed-lib > .row.nowrap > .segmented { min-width: 0; overflow: hidden; }
.ed-lib { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; padding: 10px; }
.ed-pane { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.ed-pane.hidden { display: none; }
.ed-pane .row.nowrap input { min-width: 0; }
.ed-binsearch { display: flex; flex-direction: column; gap: 6px; }
.ed-binsearch input { width: 100%; }
.ed-binsearch select { flex: 1; max-width: none; min-width: 0; }
.ed-pane select { max-width: 120px; }
.ed-bin-list { overflow-y: auto; overflow-x: hidden; flex: 1; display: grid; gap: 4px; align-content: start; }
.ed-bin-list.picker { max-height: 55vh; }
.ed-bin-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px; border-radius: 2px; cursor: grab; }
.picker .ed-bin-item { grid-template-columns: 56px minmax(0, 1fr); cursor: pointer; }
.ed-bin-item:hover { background: var(--panel-2); }
.ed-bin-item.mine { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
.ed-bin-item.pending { cursor: default; opacity: .85; }
.danger-text { color: var(--danger); }
.ed-stock { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; }
.ed-stock .ed-bin-list { flex: 1; min-height: 0; overflow: auto; }
.ed-stock-foot { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.ed-stock-big { width: 100%; max-height: 50vh; object-fit: contain; background: #000; border-radius: 2px; }
.ed-bin-item video.ed-stock-prev, .ed-bin-item img, .ed-bin-art { width: 56px; height: 32px; object-fit: cover; border-radius: 2px; background: #000; display: grid; place-items: center; color: var(--accent-text); }
.ed-bin-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-bin-item .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.small { padding: 14px 10px; font-size: 13px; }
.ed-center { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.ed-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #000; border-radius: 3px; overflow: hidden; }
.ed-stage:fullscreen { border-radius: 0; }
.ed-full { position: absolute; top: 8px; right: 8px; opacity: .65; }
.ed-full:hover { opacity: 1; }
.ed-canvas { display: block; background: #000; }
.ed-transport { flex: none; }
.ed-side { overflow: auto; min-height: 0; }
.ed-inspector input[type=range] { width: 100%; }
.ed-slot { border: 1px dashed var(--accent-text); border-radius: 3px; padding: 8px; background: var(--accent-soft); }
.form-grid.tight { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form-grid.tight input { width: 100%; }
.ed-fx { border: 1px solid var(--line); border-radius: 3px; padding: 8px; display: grid; gap: 6px; }
.ed-tl-bar { gap: 8px; flex: none; }
.ed-tl { flex: none; height: 280px; position: relative; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; user-select: none; }
.ed-ruler { position: relative; height: 26px; border-bottom: 1px solid var(--line); cursor: text; background-repeat: repeat-x; background-size: auto 6px; }
.ed-ruler-pad { position: sticky; left: 0; height: 100%; background: var(--panel); z-index: 2; }
.ed-tick { position: absolute; top: 0; bottom: 0; font: 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted);
  border-left: 1px solid #4a4a52; padding: 4px 0 0 4px; font-variant-numeric: tabular-nums; }
.ed-row { position: relative; height: 72px; border-bottom: 1px solid var(--line); }
.ed-row.audio { height: 52px; background: rgba(255,255,255,.012); }
.ed-row-resize { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; z-index: 4; }
.ed-row-resize:hover { background: var(--accent-text); }
.ed-row-label { position: sticky; left: 0; z-index: 3; height: 100%; display: flex; align-items: center; gap: 4px; padding: 0 6px;
  background: var(--panel-2); border-right: 1px solid var(--line); font-size: 12px; }
.ed-row-label span { flex: 1; min-width: 48px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ed-item { position: absolute; top: 4px; bottom: 4px; background: #3a2160; border: 1px solid #5b3591; border-radius: 2px; overflow: hidden;
  display: flex; align-items: center; cursor: grab; }
/* a colour per kind of clip */
.ed-item.k-video { background: #22304f; border-color: #3f5a92; }
.ed-item.k-image { background: #2c2552; border-color: #5649a0; }
.ed-item.k-audio { background: #18382a; border-color: #2e6e4f; }
.ed-item.k-cut { background: #133536; border-color: #286b6c; }
.ed-item.k-text { background: #4a3714; border-color: #8d6a24; }
.ed-art { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none; overflow: hidden; }
.ed-strip { display: flex; flex: none; overflow: hidden; opacity: .9; }
.ed-strip img { flex: none; object-fit: cover; max-width: none; border-right: 1px solid rgba(0,0,0,.35); }
.ed-wave { display: block; width: 100%; flex: 1; min-height: 0; }
.ed-item.cut { background: #173a3a; border-color: #2a6a6a; }
.ed-item.slot { background: repeating-linear-gradient(135deg, #1b1029 0 10px, #24143a 10px 20px); border: 1px dashed var(--accent-text); }
.ed-item.slot.filled { background: #3a2160; border-style: dashed; }
.ed-item.sel { outline: 2px solid var(--accent-text); z-index: 1; }
.ed-item.drop-target { outline: 2px solid #fff; }
.ed-item.missing { background: #4a1d1d; border-color: #7a2d2d; }
.ed-item-name { position: absolute; left: 7px; top: 3px; max-width: calc(100% - 14px); font-size: 11.5px; font-weight: 600; padding: 1px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; background: rgba(0,0,0,.55); border-radius: 2px; z-index: 1; }
.ed-item.text .ed-item-name, .ed-item.slot .ed-item-name { position: static; background: none; flex: 1; }
.ed-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgba(255,255,255,.1); z-index: 2; }
.ed-h.l { left: 0; } .ed-h.r { right: 0; }
.ed-item:hover .ed-h { background: rgba(255,255,255,.28); }
.ed-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; z-index: 4; }
.btn.active { border-color: var(--accent-text); }
.ed-ai-wrap { position: relative; }
.ed-ai { position: absolute; right: 0; top: calc(100% + 6px); width: 420px; height: min(76vh, 760px); z-index: 70; box-shadow: 0 12px 32px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.ed-ai textarea { width: 100%; }
.ed-chat-head { gap: 8px; align-items: center; }
.ed-chat-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ed-chat-status.off { color: var(--danger); }
.ed-chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.ed-chat-empty p { margin: 0 0 8px; line-height: 1.5; }
.ed-msg { padding: 8px 10px; border-radius: 4px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; font-size: 14px; }
.ed-msg.me { align-self: flex-end; background: var(--accent); color: #fff; }
.ed-msg.ai { align-self: flex-start; background: var(--panel-2); }
.ed-msg.ai.live { border-left: 2px solid var(--accent-text); }
.ed-msg-note { align-self: center; }
.ed-msg-err { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); padding: 6px 8px; border-radius: 3px; }
.ed-act { color: var(--muted); padding-left: 4px; overflow-wrap: anywhere; }
.ed-act .ed-act-dot { color: var(--accent-text); display: inline-block; width: 1em; }
.ed-act.err .ed-act-dot { color: var(--danger); }
.ed-opts { display: flex; flex-direction: column; gap: 4px; }
.ed-opts-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ed-opt { background: var(--panel-2); border-radius: 3px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ed-opt img, .ed-opt .ed-bin-art { width: 100%; height: 72px; object-fit: cover; border-radius: 2px; background: #000; }
.ed-opt-t { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-opt .btn { align-self: flex-start; }
.ed-chat-board { background: var(--panel-2); border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.ed-chat-board ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ed-turn { border-top: 1px solid var(--line); padding-top: 6px; align-items: center; }
.ed-chat-bar { display: flex; flex-direction: column; gap: 6px; }
.ed-chat-in { resize: vertical; min-height: 44px; max-height: 160px; }
.ed-chat-console summary { cursor: pointer; }
.ed-ai-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.ed-ai-pane.hidden { display: none; }
.ed-apps-list { display: flex; flex-direction: column; gap: 4px; }
.ed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 6px; flex: none; }
.ed-dot.on { background: #46d483; }
.ed-copy { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.ed-copy code { flex: 1; min-width: 0; background: #0e0e10; border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; font-size: 12px; overflow-x: auto; white-space: nowrap; }
.ed-howto { background: var(--panel-2); border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ed-howto summary { cursor: pointer; font-weight: 600; }
.ed-howto ol { margin: 6px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ed-howto p { margin: 4px 0; }
.ed-seed { border: 1px solid var(--accent-text); border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ed-apps-log { display: flex; flex-direction: column; gap: 4px; }
#app .btn.has-apps, .btn.has-apps { box-shadow: inset 0 0 0 1px #46d483; }
.ed-dot.warn { background: #e5b13a; }
.ed-dot.pulse { animation: ed-pulse 1.4s ease-in-out infinite; }
#app .btn.listening, .btn.listening { box-shadow: inset 0 0 0 1px #46d483, 0 0 0 2px color-mix(in srgb, #46d483 35%, transparent); }
.ed-sess-bar { background: var(--panel-2); border-radius: 4px; padding: 8px 10px; line-height: 1.45; }
.ed-sess-bar code { font-size: 12px; }
.ed-sess-log { min-height: 180px; }
.ed-msg-who { font-size: 11px; font-weight: 600; opacity: .7; margin-bottom: 2px; white-space: normal; }
.ed-msg-tag { opacity: .8; font-size: 12px; }
.ed-msg.quiet { opacity: .65; font-size: 12px; }
.ed-chat-empty p { margin: 4px 0; }
#app .btn.rec, .btn.rec { background: var(--danger); color: #fff; animation: ed-pulse 1.2s ease-in-out infinite; }
.ed-ai-working { font-size: 12px; color: #46d483; white-space: nowrap; animation: ed-pulse 1.4s ease-in-out infinite; }
.ed-ai-working.hidden { display: none; }
@keyframes ed-pulse { 50% { opacity: .45; } }
.ed-feed { position: absolute; left: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; max-width: 70%; z-index: 5; }
.ed-feed-item { background: rgba(10,10,12,.82); color: #ececf0; font-size: 12px; padding: 5px 8px; border-radius: 3px; border-left: 2px solid #46d483;
  transition: opacity .5s ease, transform .5s ease; overflow-wrap: anywhere; }
.ed-feed-item b { color: #46d483; }
.ed-feed-item.out { opacity: 0; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .ed-ai-working { animation: none; } .ed-feed-item { transition: none; } }
.ed-ai-out { max-height: 220px; overflow: auto; background: #0e0e10; border-radius: 2px; padding: 8px; margin: 0; white-space: pre-wrap; }
.ed-ai-out:empty { display: none; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl { display: grid; gap: 6px; align-content: start; }
.slot-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
textarea.code { font-size: 13px; line-height: 1.5; min-height: 120px; tab-size: 2; white-space: pre; }
textarea.code.tall { min-height: 340px; }
.code-err { background: #2a1414; color: #ffb3b3; padding: 10px; border-radius: 3px; white-space: pre-wrap; font-size: 12px; margin: 0; }
.pl-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.pl-preview { width: 100%; aspect-ratio: 16 / 9; border-radius: 3px; background: #000; }
@media (max-width: 1100px) {
  .ed { height: auto; }
  .ed-main, .ed-main.no-lib, .ed-main.no-insp, .ed-main.no-lib.no-insp { grid-template-columns: 1fr; }
  .ed-lib, .ed-center, .ed-side { grid-column: 1; }
  .ed-stage { height: 50vh; flex: none; }
  .ed-lib { max-height: 320px; }
  .ed-ai { width: min(420px, 92vw); }
  .pl-grid { grid-template-columns: 1fr; }
}

/* phones: the top bar scrolls sideways; the track header keeps the target and the name (mute, solo, lock and hide are in the track menu: right-click or long-press) */
@media (max-width: 700px) {
  .ed-top { overflow-x: auto; scrollbar-width: none; }
  .ed-top::-webkit-scrollbar { display: none; }
  .ed-row-label { gap: 2px; padding: 0 3px; }
  .ed-row-label .tbtn:not(.target) { display: none; }
  .ed-row-label .tbtn.target { padding: 0 4px; }
  .ed-row-label span { min-width: 0; font-size: 12px; }
  .ed-stage { height: 42vh; }
  .ed-transport { gap: 4px; }
  .ed-ai { position: fixed; top: 52px; left: 8px; right: 8px; width: auto; height: calc(100vh - 64px); }   /* the top bar scrolls, so it would clip the panel */
  .ed-tips.ed-draft { left: 8px; right: 8px; width: auto; bottom: auto; top: 60px; }
}

/* ---------- keyframes + beats */
.kf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.kf-row input[type=range] { width: 100%; }
.kf-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.kf-btn.on { color: var(--accent-text); }
.kf-btn:hover { color: #fff; }
.kf-list { display: grid; gap: 8px; }
.kf-group { border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; display: grid; gap: 4px; }
.kf-key { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px; align-items: center; }
.kf-key select { padding: 2px 4px; }
.ed-beatbox { border: 1px solid var(--line); border-radius: 3px; padding: 8px; }
.form-grid.tight2 { grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-beat { position: absolute; bottom: 0; width: 1px; height: 6px; background: #8a6bb8; pointer-events: none; }
.ed-beat.bar { height: 12px; background: var(--accent-text); width: 2px; }
.ed-drop { position: absolute; top: 0; transform: translateX(-4px); font-size: 10px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 2px; padding: 0 4px; pointer-events: none; white-space: nowrap; }
.ed-kf { position: absolute; bottom: 2px; width: 8px; height: 8px; background: #fff; transform: rotate(45deg); border: 1px solid #000; cursor: ew-resize; z-index: 3; }
.ed-kf:hover { background: var(--accent-text); }
/* transitions: a bar across the cut on the timeline, controls in the inspector */
.ed-trans { position: absolute; top: 12px; bottom: 12px; z-index: 2; display: grid; place-items: center; font-size: 11px; color: #fff; cursor: pointer;
  background: linear-gradient(90deg, rgba(176,124,240,.15), rgba(176,124,240,.85) 50%, rgba(176,124,240,.15)); border: 1px solid var(--accent-text); border-radius: 2px; }
.ed-trans:hover, .ed-trans.sel { background: var(--accent-text); color: #12081f; }
.ed-trans.off { background: #4a1d1d; border-color: #c55; cursor: help; }
.ed-cut { padding: 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--accent-soft); }
.ed-bin-item.tr .ed-bin-art { font-size: 16px; }
/* text items and auto edit */
.ed-item.text { background: #1f3550; border-color: #3d6aa0; }
.ed-textbox textarea { min-height: 52px; }
.ae-row { display: flex; align-items: center; gap: 10px; }
.ae-row b { min-width: 52px; }
.ae-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-panel { align-items: center; background: var(--accent-soft); border-color: #3a2160; }
/* ranks, storage, queue */
.badge.rank { font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; border-radius: 2px; vertical-align: middle; }
.rank-general { background: #f5c542; color: #2a1a00; }
.rank-elite { background: var(--accent); color: #fff; }
.rank-htn { background: #2f7d5b; color: #eafff4; }
.rank-wagie { background: #3a4a63; color: #dfe8f7; }
.rank-prole { background: #3a3a3f; color: #c9c9cf; }
h1 .badge.rank { font-size: 12px; }
.storage .meter.full > i { background: #d9534f; }
.queue-box .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.queue-box .dot.on { background: #3ddc84; box-shadow: 0 0 6px #3ddc84; }
.queue-box .dot.off { background: #777; }
/* clip picking and caption list */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.pick-tile { position: relative; cursor: pointer; border: 2px solid transparent; border-radius: 3px; padding: 4px; background: #17171b; }
.pick-tile img, .pick-tile .ed-bin-art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; display: grid; place-items: center; }
.pick-tile .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.pick-tile.on { border-color: var(--accent-text); background: var(--accent-soft); }
.pick-tile .n, .ae-pick .n { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 3px; display: grid; place-items: center; padding: 0 4px; }
.ae-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-pick { position: relative; width: 74px; }
.ae-pick img, .ae-pick .ed-bin-art { width: 74px; height: 42px; object-fit: cover; border-radius: 2px; display: grid; place-items: center; }
.ae-pick .x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7); color: #fff; border: 0; border-radius: 2px; font-size: 10px; cursor: pointer; }
.cap-list .stack { max-height: 260px; overflow: auto; margin-top: 6px; }
.cap-line { display: flex; gap: 6px; align-items: center; }
.cap-line input { flex: 1; min-width: 0; }
.cap-line.cur input { border-color: var(--accent-text); }
/* safe zone guides */
.ed-safe { position: absolute; pointer-events: none; }
.ed-safe .sz { position: absolute; }
.ed-safe .band { background: repeating-linear-gradient(135deg, rgba(255, 70, 70, .28) 0 8px, rgba(255, 70, 70, .14) 8px 16px); }
.ed-safe .band span { position: absolute; left: 6px; bottom: 4px; font-size: 10px; color: #ffd6d6; text-shadow: 0 1px 2px #000; }
.ed-safe .band.side span { writing-mode: vertical-rl; left: auto; right: 2px; bottom: 8px; }
.ed-safe .safe { border: 1px dashed rgba(120, 255, 170, .9); }
.ed-safe .safe span { position: absolute; top: 3px; left: 5px; font-size: 10px; color: #b8ffd4; text-shadow: 0 1px 2px #000; }
/* ranked AI options */
.result.option { align-items: center; }
.result.option .rank { display: flex; flex-direction: column; align-items: center; min-width: 46px; gap: 2px; }
.result.option .rank b { font-size: 17px; color: var(--accent-text); }
.result.option .match { font-size: 11px; background: var(--accent-soft); border: 1px solid #3a2160; border-radius: 3px; padding: 0 6px; }
/* the AI monologue pipeline */
.workbench { margin-top: 14px; border-color: #3a2160; }
.workbench .nudges .btn { min-width: 44px; }
.chat-log { max-height: 320px; overflow: auto; }
.chat-msg { padding: 8px 10px; border-radius: 3px; background: #17171b; }
.chat-msg.user { background: var(--accent-soft); }
.lesson-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lesson-row input[type=text] { flex: 1; min-width: 200px; }
.lesson-row.off { opacity: .5; }
.plan { padding: 10px; border: 1px solid var(--line); border-radius: 3px; background: #141418; }
/* creator accounts */
.rank-creator { background: linear-gradient(90deg, #f5c542, #ff7a1a); color: #2a1200; }
.agreement { white-space: pre-wrap; line-height: 1.55; }
.drop.big { padding: 34px; text-align: center; }
.portal-file { display: flex; flex-direction: column; gap: 6px; }
.portal-file .btn { align-self: flex-start; }
.conditions { color: #ffd6a8; }
.quota-in { width: 72px; display: inline-block; padding: 2px 6px; }
.feed-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.feed-row .mono { word-break: break-all; }
.creator-line { margin-top: 6px; }

/* ---------- editor right-click menu */
.ed-menu { position: fixed; z-index: 60; min-width: 230px; padding: 5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.ed-menu-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 2px; background: none; cursor: pointer; font-size: 14px; }
.ed-menu-item:hover:not([disabled]), .ed-menu-item:focus-visible { background: var(--accent-soft); outline: none; }
.ed-menu-item[disabled] { opacity: .45; cursor: default; }
.ed-menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* ---------- editor library: episodes and their topics */
.ed-bin-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 4px 4px; }
.ed-bin-head .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ed-ep-head { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; align-items: start; width: 100%; text-align: left; padding: 6px 4px; border: 0; border-radius: 2px; background: none; cursor: pointer; }
.ed-ep-head:hover { background: var(--panel-2); }
.ed-ep-text { display: flex; flex-direction: column; min-width: 0; }
.ed-ep-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-ep-caret { color: var(--muted); }
.ed-ep-topics { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 11px; }

/* ---------- post reveal */
.modal:has(.pr-layout) { width: min(1100px, calc(100vw - 32px)); max-width: none; }
.pr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.pr-preview { width: 100%; height: auto; border-radius: 3px; border: 1px solid var(--line); background: #000; }
.pr-words { line-height: 2; font-size: 15px; max-height: 260px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); }
.pr-word { padding: 2px 3px; border-radius: 2px; cursor: default; }
.pr-word.s0 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.pr-word.s1 { background: color-mix(in srgb, var(--accent-text) 14%, transparent); }
.pr-gap { display: inline-block; min-width: 10px; padding: 0 2px; border: 0; background: none; cursor: pointer; color: var(--accent-text); font-weight: 700; }
.pr-gap:hover { background: var(--accent-soft); border-radius: 2px; }
.pr-gap.cut { color: #fff; }
@media (max-width: 760px) { .pr-layout { grid-template-columns: 1fr; } }

/* ---------- editor phase 2: selection, markers, in/out, track switches, shortcuts */
.ed-item.sel { outline: 2px solid var(--accent-text); outline-offset: -1px; z-index: 1; }
.ed-item.sel.primary { outline-color: #fff; }
.ed-row.locked .ed-item { cursor: not-allowed; opacity: .55; }
.ed-row.locked::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.035) 8px 16px); }
.ed-row.hidden-track .ed-item { opacity: .35; }
.ed-marquee { position: absolute; z-index: 6; border: 1px solid var(--accent-text); background: rgba(176,124,240,.12); pointer-events: none; }
.tbtn { width: 22px; height: 20px; padding: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 2px; font-size: 11px;
  font-weight: 700; color: var(--muted); cursor: pointer; flex: none; line-height: 1; }
.tbtn:hover { border-color: #4a4a52; color: var(--text); }
.tbtn.on { background: #3a3a40; color: var(--text); }
.tbtn.on.solo { background: #b8860b; color: #000; border-color: #b8860b; }
.ed-range { position: absolute; top: 0; height: 100%; background: rgba(176,124,240,.18); border-left: 2px solid var(--accent-text);
  border-right: 2px solid var(--accent-text); pointer-events: none; z-index: 1; }
.ed-marker { position: absolute; top: 0; width: 0; height: 100%; z-index: 3; cursor: pointer; }
.ed-marker::before { content: ''; position: absolute; left: -5px; top: 2px; width: 10px; height: 12px; background: var(--mk, #2ec4b6);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); }
.ed-marker span { position: absolute; left: 7px; top: 1px; font-size: 10.5px; white-space: nowrap; color: var(--mk, #2ec4b6); font-weight: 600; }
table.keys { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.keys td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.keys td:first-child { width: 42%; white-space: nowrap; }
kbd { font: 12px ui-monospace, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; padding: 1px 6px; border-radius: 2px; }

/* ---------- editor phase 3: fades, volume line, meters, transform handles, inline text */
.ed-decor { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ed-fadeshade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.ed-fadeshade.in { left: 0; background: linear-gradient(to top right, rgba(0,0,0,.55) 50%, transparent 50%); }
.ed-fadeshade.out { right: 0; background: linear-gradient(to top left, rgba(0,0,0,.55) 50%, transparent 50%); }
.ed-fade { position: absolute; top: 0; width: 10px; height: 10px; pointer-events: auto; cursor: ew-resize; background: #fff; opacity: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%); transition: opacity .1s; }
.ed-item:hover .ed-fade, .ed-item.sel .ed-fade { opacity: .9; }
.ed-vol { position: absolute; left: 6px; right: 6px; height: 7px; margin-top: -3px; pointer-events: auto; cursor: ns-resize; }
.ed-vol::after { content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 1px; background: #f2d36b; opacity: .85; }
.ed-vol:hover::after { height: 2px; top: 2px; opacity: 1; }
.ed-vol[data-db]:active::before { content: attr(data-db); position: absolute; right: 0; top: -16px; font: 10px ui-monospace, monospace; background: #000; padding: 0 3px; }
.ed-volsvg { position: absolute; left: 0; top: 0; pointer-events: none; }
.ed-volsvg polyline { fill: none; stroke: #f2d36b; stroke-width: 1.2; opacity: .85; }
.ed-meter { width: 120px; height: 16px; border: 1px solid var(--line); border-radius: 2px; background: #0b0b0d; flex: none; }
.ed-crop summary { cursor: pointer; color: var(--muted); }
.ed-xform { position: absolute; border: 1px solid var(--accent-text); box-shadow: 0 0 0 1px rgba(0,0,0,.6); cursor: move; z-index: 3; }
.ed-xform .hd { position: absolute; width: 10px; height: 10px; background: #fff; border: 1px solid #000; }
.ed-xform .hd.nw { left: -6px; top: -6px; cursor: nwse-resize; } .ed-xform .hd.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ed-xform .hd.sw { left: -6px; bottom: -6px; cursor: nesw-resize; } .ed-xform .hd.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ed-xform .rot { position: absolute; left: 50%; top: -26px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent-text); border: 1px solid #000; cursor: grab; }
.ed-xform .rot::after { content: ''; position: absolute; left: 5px; top: 12px; width: 1px; height: 14px; background: var(--accent-text); }
.ed-inline-text { position: absolute; left: 10%; right: 10%; top: 40%; z-index: 6; font: 600 22px system-ui, sans-serif; text-align: center;
  background: rgba(0,0,0,.82); color: #fff; border: 1px solid var(--accent-text); padding: 10px; resize: none; }
.ed-transport { flex-wrap: wrap; gap: 4px 6px; overflow: visible; }
.ed-transport > * { flex: none; }
.ed-transport select { max-width: 130px; }
.ed-meter { width: 90px; }
@media (max-width: 1300px) { .ed-meter { display: none; } }

/* ---------- editor phase 4: transcript editing, beat grid, effect previews */
.ed-tx { line-height: 1.9; font-size: 14.5px; overflow-y: auto; flex: 1; min-height: 80px; padding: 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); user-select: none; }
.ed-tx .w { cursor: pointer; border-radius: 2px; padding: 1px 0; }
.ed-tx .w:hover { background: rgba(255,255,255,.08); }
.ed-tx .w.sel { background: var(--accent); color: #fff; }
.ed-tx .w.now { box-shadow: inset 0 -2px 0 #f2d36b; }
.ed-beatgrid { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.ed-beatgrid i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(176,124,240,.16); }
.ed-beatgrid i.bar { background: rgba(176,124,240,.38); }
.ed-bin-item.fx img { width: 56px; height: 32px; object-fit: cover; border-radius: 2px; }

/* ---------- source viewer */
.ed-montabs { display: flex; gap: 2px; flex: none; margin-bottom: -6px; }
.ed-montab { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-bottom: 0; border-radius: 3px 3px 0 0; padding: 4px 12px; font: inherit; font-size: 12px; cursor: pointer; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-montab.on { background: #000; color: var(--text); border-color: var(--accent); }
.ed-montab:disabled { opacity: .45; cursor: default; }
.ed-src { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.ed-src-view { position: relative; flex: 1; min-height: 0; background: #000; border-radius: 3px; display: grid; place-items: center; overflow: hidden; }
.ed-src-media { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; display: block; }
video.ed-src-media { cursor: pointer; }
.ed-src-wave { width: 100%; height: 100%; }
.ed-src-empty { color: var(--muted); max-width: 46ch; text-align: center; padding: 16px; font-size: 13px; }
.ed-src-bar { width: 100%; height: 34px; display: block; border-radius: 2px; cursor: pointer; flex: none; }
.ed-src-ctl { flex: none; gap: 6px; }
.ed-src-ctl > .mono { white-space: nowrap; }
.ed-src-dur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ed-src-grab { cursor: grab; user-select: none; }

/* ---------- timeline tools */
.ed-tools { display: inline-flex; gap: 0; }
.ed-tools .ed-tool { border-radius: 0; min-width: 30px; padding-inline: 6px; margin-left: -1px; }
.ed-tools .ed-tool:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.ed-tools .ed-tool:last-child { border-radius: 0 3px 3px 0; }
.ed-tools .ed-tool.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); position: relative; z-index: 1; }
.ed-tl[data-tool=ripple] .ed-h.l { cursor: w-resize; }
.ed-tl[data-tool=ripple] .ed-h.r { cursor: e-resize; }
.ed-tl[data-tool=roll] .ed-h { cursor: col-resize; }
.ed-tl[data-tool=slip] .ed-item, .ed-tl[data-tool=slide] .ed-item { cursor: ew-resize; }

/* ---------- drag readout + snap line */
.ed-dragtip { position: fixed; z-index: 1000; pointer-events: none; background: rgba(0,0,0,.88); color: var(--text); border: 1px solid var(--line); border-radius: 2px; padding: 3px 7px; font: 11px/1.4 ui-monospace, Consolas, monospace; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-snapline { position: absolute; top: 0; bottom: 0; width: 1px; background: #ffd23f; box-shadow: 0 0 0 1px rgba(255,210,63,.25); z-index: 5; pointer-events: none; }

/* ---------- inspector sections, time fields */
.ed-sec { border-top: 1px solid var(--line); padding-top: 6px; }
.ed-sec > summary { cursor: pointer; list-style: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 2px 0; user-select: none; }
.ed-sec > summary::-webkit-details-marker { display: none; }
.ed-sec > summary::before { content: '▸'; font-size: 10px; transition: transform .12s; }
.ed-sec[open] > summary::before { transform: rotate(90deg); }
.ed-sec > summary:hover { color: var(--text); }
.ed-sec-body { padding: 6px 0 4px; }
input.tc { font-variant-numeric: tabular-nums; }
.ed-time { cursor: text; padding: 2px 4px; border-radius: 2px; border: 1px solid transparent; white-space: nowrap; }
.ed-time:hover { border-color: var(--line); }
.ed-time-in { width: 9.5em; padding: 2px 4px; }

/* ---------- volume + pan */
.ed-db { width: 7.5em; text-align: right; padding: 1px 4px; }
.stack.tight { gap: 6px; }

/* ---------- track names, history */
.ed-track-name { cursor: text; }
.ed-track-rename { flex: 1; min-width: 48px; font: inherit; font-weight: 600; padding: 1px 4px; }
.ed-row-label .tbtn.del { display: none; }
.ed-row-label:hover .tbtn.del { display: inline-block; }
.ed-hist-wrap { position: relative; }
.ed-hist { position: absolute; left: 0; top: calc(100% + 6px); width: 300px; z-index: 30; box-shadow: 0 12px 32px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 8px; }
.ed-hist-list { display: flex; flex-direction: column; max-height: 360px; overflow: auto; border-top: 1px solid var(--line); }
.ed-hist-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); padding: 6px 4px; font: inherit; font-size: 12px; cursor: pointer; }
.ed-hist-row:hover { background: var(--panel-2); }
.ed-hist-row.cur { box-shadow: inset 3px 0 0 var(--accent-text); font-weight: 600; }
.ed-hist-row.redo { color: var(--muted); font-style: italic; }
.ed-versions { max-height: 200px; }

/* ---------- scopes */
.ed-scope { position: absolute; left: 8px; bottom: 8px; width: 300px; height: 170px; max-width: 45%; border: 1px solid var(--line); border-radius: 2px; cursor: pointer; z-index: 3; image-rendering: auto; }
.ed-scope-lbl { position: absolute; left: 12px; bottom: 160px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.6); pointer-events: none; z-index: 4; }

/* ---------- adjustment layers */
.ed-item.k-adjust { background: repeating-linear-gradient(135deg, rgba(119,22,204,.35) 0 8px, rgba(119,22,204,.18) 8px 16px); border-color: #8f5bd6; }

.ed-item.k-callout { background: linear-gradient(90deg, rgba(255,59,48,.35), rgba(255,59,48,.15)); border-color: #ff6b61; }
.ed-item.k-solid { background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border-color: #6a6a74; }

/* ---------- markers list */
.ed-marks-wrap { position: relative; }
.ed-marks { position: fixed; width: 340px; z-index: 30; box-shadow: 0 12px 32px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 8px; }
.ed-marks-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.ed-marks-row { display: flex; align-items: center; gap: 6px; }
.ed-marks-row input { flex: 1; min-width: 0; padding: 3px 6px; }
.ed-mk-dot { width: 14px; height: 14px; border-radius: 2px; border: 1px solid rgba(255,255,255,.3); padding: 0; cursor: pointer; flex: none; }

/* ---------- montage picks */
.ed-bin-item.picked { outline: 2px solid var(--accent-text); outline-offset: -2px; background: var(--accent-soft); }
.ed-binbar { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; margin-top: 6px; background: var(--panel-2); border: 1px solid var(--accent-text); border-radius: 3px; box-shadow: 0 -6px 16px rgba(0,0,0,.4); }

.ed-item.k-nest { background: repeating-linear-gradient(90deg, #2c2240 0 12px, #241b36 12px 24px); border-color: #a07ae0; }
.ed-item.k-nest .ed-item-name::before { content: '▣ '; }

.ed-gap { position: absolute; top: 4px; bottom: 4px; background: repeating-linear-gradient(135deg, rgba(176,124,240,.28) 0 6px, transparent 6px 12px); border: 1px dashed var(--accent-text); border-radius: 2px; pointer-events: none; }
.ed-tl[data-tool=stretch] .ed-h { cursor: col-resize; }

/* ---------- track targets, clip labels */
.tbtn.target { font-weight: 800; font-size: 10px; }
.tbtn.target.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ed-item.labelled { box-shadow: inset 0 3px 0 var(--label); }
.ed-menu-colors { display: flex; align-items: center; gap: 5px; padding: 6px 10px; }
.ed-label-dot { width: 16px; height: 16px; border-radius: 2px; border: 1px solid rgba(255,255,255,.25); padding: 0; cursor: pointer; font-size: 10px; line-height: 1; color: var(--muted); background: transparent; }
.ed-label-dot:hover { outline: 2px solid var(--text); outline-offset: 1px; }

/* ---------- mixer */
.ed-mix-wrap { position: relative; }
.ed-mixer { width: 420px; }
.ed-mix-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.ed-mix-row { display: grid; grid-template-columns: 90px 22px 22px 1fr 110px; gap: 6px; align-items: center; }
.ed-mix-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ed-mix-fader { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ed-mix-fader input { flex: 1; min-width: 0; }
.ed-mix-fader span { width: 58px; text-align: right; }
.ed-mix-pan { display: flex; align-items: center; gap: 2px; }
.ed-mix-pan input { width: 80px; }

.ed-xfade { position: absolute; top: 2px; bottom: 2px; z-index: 3; cursor: pointer; border-radius: 2px;
  background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(255,255,255,.75) 50%, transparent calc(50% + 1px)),
              linear-gradient(to bottom right, transparent calc(50% - 1px), rgba(255,255,255,.75) 50%, transparent calc(50% + 1px)), rgba(46,196,182,.25);
  border: 1px solid rgba(46,196,182,.8); }
.ed-xfade.sel { border-color: #fff; }

.ed-pick { position: absolute; inset: 0; z-index: 8; cursor: crosshair; background: rgba(0,0,0,.12); display: flex; align-items: flex-start; justify-content: center; }
.ed-shape-draw { position: absolute; overflow: visible; pointer-events: none; }
.ed-shape-draw polyline { fill: rgba(33,212,253,.12); stroke: var(--accent-text, #21d4fd); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.ed-shape-draw circle { fill: #fff; stroke: #000; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.ed-pick span { margin-top: 10px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 2px; border: 1px solid var(--accent-text); }

/* ---------- command palette */
.ed-palette-veil { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.ed-palette { width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 18px 48px rgba(0,0,0,.6); }
.ed-palette-in { font-size: 15px; padding: 10px 12px; }
.ed-palette-list { display: flex; flex-direction: column; max-height: 52vh; overflow: auto; }
.ed-palette-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; background: none; border: 0; color: var(--text); padding: 7px 10px; font: inherit; font-size: 13px; cursor: pointer; border-radius: 2px; }
.ed-palette-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-text); }
.ed-palette-row kbd { font-size: 11px; }

.ed-tips { position: fixed; right: 16px; bottom: 16px; width: 340px; z-index: 40; box-shadow: 0 14px 36px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 6px; border-color: var(--accent-text); }
.ed-tips.ed-draft { right: auto; left: 16px; z-index: 41; }   /* apart from the what's-new card */
.ed-tips { max-height: calc(100vh - 32px); }
.ed-tips ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; overflow-y: auto; min-height: 0; }   /* the Got it button stays on screen */
.ed-tips kbd { font-size: 11px; }

.ed-mc { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 7; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; background: rgba(0,0,0,.82); border: 1px solid var(--accent-text); border-radius: 3px; font-size: 12px; color: #fff; }
.ed-mc-count { margin-left: auto; color: var(--accent-text); font-weight: 700; }

.ed-item.off { opacity: .35; filter: grayscale(1); }
.ed-item.off .ed-item-name::after { content: ' (off)'; }

.ed-extras summary { cursor: pointer; }
.ed-export-row { border-top: 1px solid var(--line); padding-top: 6px; }

.ed-nestbar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--accent-soft); border: 1px solid var(--accent-text); border-radius: 3px; margin-bottom: 4px; flex: none; }

/* ---------- keyframe graphs */
.kf-graph { width: 100%; height: 70px; display: block; margin: 4px 0; cursor: crosshair; }
.kf-graph .kf-bg { fill: var(--panel-2); stroke: var(--line); }
.kf-graph .kf-curve { fill: none; stroke: var(--accent-text); stroke-width: 1.5; }
.kf-graph .kf-head { stroke: #fff; stroke-width: 1; opacity: .5; }
.kf-graph .kf-dot { fill: #fff; stroke: #000; stroke-width: 1; cursor: grab; }
.kf-graph .kf-dot:hover { fill: var(--accent-text); }

.ed-compare { position: absolute; z-index: 2; pointer-events: none; border-right: 2px solid #fff; box-sizing: border-box; }
.ed-compare-lbl { position: absolute; z-index: 3; display: flex; justify-content: space-between; padding: 6px 8px; pointer-events: none; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #000; box-sizing: border-box; }

.ed-transport select { max-width: 120px; }

/* B-roll suggestions */
.ed-broll-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ed-broll { flex: none; width: 128px; display: flex; flex-direction: column; gap: 4px; padding: 4px; background: var(--panel-2, #1b1b22); border: 1px solid var(--line); border-radius: 3px; color: inherit; cursor: pointer; text-align: left; }
.ed-broll img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: #000; }
.ed-broll span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-broll.on { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text) inset; }

/* snap guides while moving a clip on the preview */
.ed-guide { position: absolute; z-index: 6; pointer-events: none; }
.ed-guide.v { width: 0; border-left: 1px dashed var(--accent-text, #21d4fd); }
.ed-guide.h { height: 0; border-top: 1px dashed var(--accent-text, #21d4fd); }

.ed-multi { padding: 10px; border-color: var(--accent-text); margin-bottom: 10px; }

.ed-sfx-row { gap: 2px; }
.ed-sfx-row .ed-menu-item { flex: 1; }

.ed-emoji-grid { display: grid; grid-template-columns: repeat(10, 34px); gap: 2px; max-height: 60vh; overflow-y: auto; }
.ed-emoji { font-size: 20px; line-height: 1; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.ed-emoji:hover, .ed-emoji:focus-visible { background: var(--line); }
@media (max-width: 700px) { .ed-emoji-grid { grid-template-columns: repeat(8, 34px); } }
.pick-list { max-height: 50vh; overflow-y: auto; }
.pick-list .btn { justify-content: flex-start; text-align: left; }
.tx .w { cursor: text; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.proj-card { display: flex; flex-direction: column; gap: 10px; justify-content: space-between; }
.proj-open { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.proj-open:hover b { text-decoration: underline; }
.section-head.row { flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.section-head input[type=search] { max-width: 220px; }
.ed-title { cursor: pointer; border-radius: 3px; padding: 2px 4px; }
.ed-title:hover, .ed-title:focus-visible { background: var(--panel-2); outline: none; }
/* the storyboard board: over the top half of the editor, the timeline stays below */
.ed-main { position: relative; }
.ed-board { position: absolute; inset: 0; z-index: 25; overflow-y: auto; background: var(--bg); padding: 12px 14px 24px; }
.ed-board.hidden { display: none; }
.ed-board-head { position: sticky; top: -12px; z-index: 2; background: var(--bg); padding: 8px 0; margin-top: -8px; gap: 10px; flex-wrap: wrap; }
.ed-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.ed-board-empty { max-width: 560px; margin: 40px auto; text-align: center; }
.ed-act { grid-column: 1 / -1; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); border-bottom: 1px solid var(--line); padding: 8px 0 4px; margin-top: 4px; }
.ed-scene { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.ed-scene.dragging { opacity: .45; }
.ed-scene.drop { box-shadow: inset 3px 0 0 var(--accent-text); }
.ed-scene-pic { position: relative; aspect-ratio: 16 / 9; background: #0e0e10; border-radius: 3px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ed-scene-pic img { width: 100%; height: 100%; object-fit: contain; }
.ed-scene-pic.empty { background: repeating-linear-gradient(135deg, #2a1745 0 14px, #1b1028 14px 28px); color: #c79bff; font-weight: 600; font-size: 13px; }
.ed-scene-num { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.75); color: #fff; font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 3px; }
.ed-scene-len { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.ed-scene-head { gap: 6px; }
.ed-scene-title { flex: 1; min-width: 0; font-weight: 700; }
.ed-board .ed-scene input.ed-scene-secs { width: 62px; min-width: 0; flex: 0 0 62px; }
.ed-scene-shot, .ed-scene-act { font-size: 13px; }
.ed-scene-desc { resize: vertical; min-height: 60px; font-size: 13px; line-height: 1.45; }
.ed-scene-cmts { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.ed-scene-cmt { position: relative; font-size: 12.5px; background: var(--panel-2); border-radius: 3px; padding: 4px 22px 4px 7px; line-height: 1.4; overflow-wrap: anywhere; }
.ed-scene-cmt.ai { border-left: 2px solid var(--accent-text); }
.ed-scene-x { position: absolute; right: 4px; top: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.ed-scene-say { flex: 1; min-width: 0; font-size: 13px; }
.ed-scene .ed-scene-tools { gap: 4px; flex-wrap: wrap; }
.ed-scene .ed-scene-tools .btn { padding-left: 8px; padding-right: 8px; }
.ed-scene { min-width: 0; overflow: hidden; }
.ed-scene.filled .ed-scene-pic { outline: 1px solid rgba(70,212,131,.35); }
.ed-scene-pic.sketch { background: #f3efe6; }
.ed-scene-pic.sketch img { object-fit: contain; padding: 4px; }
.ed-scene-unsketch { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border: 0; border-radius: 3px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; display: none; }
.ed-scene-pic:hover .ed-scene-unsketch { display: block; }
.ed-board .ed-board-snap { width: auto; padding: 4px 8px; font-size: 13px; }
