:root {
  --bg: #f5f3ff; --panel: #ffffff; --ink: #1e1b3a; --muted: #6b6890; --line: #e4e0fb;
  --accent: #7048e8; --accent-ink: #ffffff; --ok: #2b8a3e; --err: #c92a2a; --soft: #ede9fe;
  --heading: #3b1fa8; --accent-2: #9c36b5;
  --single: #e8590c; --split: #7950f2; --fit: #1c7ed6; --stage: #0f0f0e;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
/* Theme: follows the system unless the switch sets data-theme="light" or "dark" on <html>. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13111c; --panel: #1c1930; --ink: #ecebf7; --muted: #9d99bd; --line: #2e2a47;
    --accent: #9775fa; --accent-ink: #13111c; --ok: #51cf66; --err: #ff6b6b; --soft: #25213b;
    --heading: #c5b5ff; --accent-2: #da77f2;
    --single: #ff8c42; --split: #9775fa; --fit: #4dabf7; --stage: #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #13111c; --panel: #1c1930; --ink: #ecebf7; --muted: #9d99bd; --line: #2e2a47;
    --accent: #9775fa; --accent-ink: #13111c; --ok: #51cf66; --err: #ff6b6b; --soft: #25213b;
    --heading: #c5b5ff; --accent-2: #da77f2;
    --single: #ff8c42; --split: #9775fa; --fit: #4dabf7; --stage: #000;
    color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* author display rules (e.g. on buttons) must not undo `hidden` */
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
header.top { display: flex; align-items: center; gap: 12px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
header.top h1 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
header.top h1 span { display: inline-block; width: 9px; height: 16px; margin-right: 8px; background: var(--accent);
                     border-radius: 2px; vertical-align: -2px; }
header.top a.home { color: inherit; text-decoration: none; }
header.top a.home:hover { opacity: .8; }
header.top p { display: none; }  /* the tagline crowded the bar */
header.top .theme { margin-left: auto; align-self: center; }
header.top .tabs { display: flex; gap: 4px; align-self: center; margin-left: 12px; }
header.top .tabs a { padding: 5px 12px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14px; }
header.top .tabs a:hover { color: var(--ink); background: var(--soft); }
header.top .tabs a.on { color: var(--ink); background: var(--soft); font-weight: 600; }
@media (max-width: 600px) { header.top p { display: none; } }
.theme { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.theme button { border: 0; border-radius: 0; padding: 5px 9px; background: transparent; color: var(--muted); gap: 5px; }
.theme button + button { border-left: 1px solid var(--line); }
.theme button.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.theme svg { display: block; }
@media (max-width: 600px) { .theme .lbl { display: none; } }
main { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 54px); }
aside { border-right: 1px solid var(--line); position: relative; }
aside .panel { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
section#detail { padding: 20px 24px; min-width: 0; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }

.drop { display: block; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 20px 14px; text-align: center;
        background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--soft); }
.drop strong { display: block; }
.drop small { color: var(--muted); }
.drop input { display: none; }
.upload-bar { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; margin-top: 10px; display: none; }
.upload-bar i { display: block; height: 100%; width: 0; background: var(--accent); }

form.path { display: flex; gap: 6px; }
input[type=text] { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
                   background: var(--panel); color: var(--ink); font: 13px var(--mono); }
button, a.button { font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 7px; border: 1px solid var(--line);
                   background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex;
                   align-items: center; gap: 6px; white-space: nowrap; }
button:hover:not(:disabled), a.button:hover { border-color: var(--muted); }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--err); }
button:disabled { opacity: .45; cursor: default; }
button.icon { padding: 6px 9px; }
select.select, .title select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 100%; }
select.select { width: 100%; }
kbd { font: 11px var(--mono); padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }

ul#projects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
ul#projects li button { width: 100%; text-align: left; display: flex; align-items: center; gap: 8px;
                        border-color: transparent; background: transparent; padding: 8px 10px; }
ul#projects li button:hover { background: var(--soft); }
ul#projects li button.sel { background: var(--panel); border-color: var(--line); }
ul#projects .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ready { background: var(--ok); } .dot.error { background: var(--err); }
.dot.running, .dot.queued { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.empty, .muted { color: var(--muted); font-size: 13px; }

.title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.title h3 { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.chip.ready { color: var(--ok); } .chip.error { color: var(--err); } .chip.running, .chip.queued { color: var(--accent); }
.spacer { flex: 1; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.progress { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; margin: 8px 0 6px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.error-box { color: var(--err); font: 13px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.warn { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; font-size: 13px;
        background: color-mix(in srgb, var(--accent) 12%, transparent); }
ol.stages { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ol.stages li { font-size: 13px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
ol.stages li.done { color: var(--ok); border-color: currentColor; }
ol.stages li.now { color: var(--accent); border-color: currentColor; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dt { color: var(--muted); } dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
details.card summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.card[open] summary { margin-bottom: 12px; }
.placeholder { color: var(--muted); text-align: center; padding: 80px 20px; }
.placeholder strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---- editor --------------------------------------------------------------- */
.ed { display: flex; flex-direction: column; gap: 12px; }
.ed-views { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.ed-pane { background: var(--stage); border-radius: var(--radius); overflow: hidden; position: relative; }
.ed-pane .label { position: absolute; left: 8px; top: 6px; font-size: 11px; color: #fff; opacity: .75;
                  text-transform: uppercase; letter-spacing: .06em; pointer-events: none; z-index: 2; }
.stage { position: relative; line-height: 0; }
.stage video { width: 100%; display: block; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.stage canvas.dragging { cursor: grabbing; }
.ed-preview canvas { display: block; height: var(--preview-h, 420px); aspect-ratio: 9 / 16; }

.ed-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-bar .time { font: 13px var(--mono); color: var(--muted); min-width: 150px; }
.ed-bar .sep { width: 1px; height: 22px; background: var(--line); }
.save-state { font-size: 12px; color: var(--muted); }
.save-state.err { color: var(--err); }
.render-box { display: flex; align-items: center; gap: 8px; }
.render-box .progress { width: 120px; margin: 0; }
.stale { font-size: 12px; color: var(--accent); }

.timeline { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
            padding: 8px; user-select: none; }
.timeline canvas { display: block; width: 100%; height: 86px; cursor: pointer; touch-action: none; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.inspector { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
.inspector .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.inspector .head strong { font-size: 15px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--soft); font-weight: 600; }
.seg button .sw { width: 9px; height: 9px; border-radius: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row label { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
input[type=range] { width: 120px; accent-color: var(--accent); }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid currentColor; color: var(--muted); }
.badge.edited { color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  main, body.compact main { grid-template-columns: 1fr; }
  body.compact aside .panel { position: static; width: auto; opacity: 1; transform: none; pointer-events: auto;
                              visibility: visible; box-shadow: none; border: 0; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-views { grid-template-columns: 1fr; }
  .ed-preview { justify-self: center; }
  .inspector { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  header.top { padding: 12px 16px; }
  aside .panel, section#detail { padding: 16px; }
}

/* ---- trim screen ---------------------------------------------------------- */
.trim { display: flex; flex-direction: column; gap: 12px; }
.trim .card { margin: 0; }
.trim-player { background: var(--stage); border-radius: 8px; overflow: hidden; line-height: 0; }
.trim-player video { width: 100%; max-height: 52vh; display: block; object-fit: contain; }
.trim-strip-wrap { margin-top: 10px; }
.trim-strip { display: block; width: 100%; height: 64px; cursor: pointer; touch-action: none; border-radius: 6px; }
input.clock { width: 84px; flex: none; font: 13px var(--mono); padding: 5px 7px; border: 1px solid var(--line);
              border-radius: 6px; background: var(--panel); color: var(--ink); }
.trim-go { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.trim-len strong { font-size: 16px; }
.trim-go select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line);
                  background: var(--panel); color: var(--ink); }

/* ---- brand page ----------------------------------------------------------- */
body.page-brand main { grid-template-columns: 1fr; }
body.page-brand aside { display: none; }
.brand { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 20px; align-items: start; }
.brand-controls { display: flex; flex-direction: column; gap: 12px; }
.brand-controls .card, .brand-side .card { margin: 0; }
.brand-controls .title { margin-bottom: 2px; flex-direction: column; align-items: flex-start; gap: 2px; }
/* Pinned so the preview stays in view while editing on the left; scrolls on its own when taller than the window. */
.brand-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px;
              max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 4px; }
.brand-preview { display: flex; flex-direction: column; align-items: center; }
.brand-stage { position: relative; height: min(62vh, 760px); max-width: 100%; background: #000; border-radius: 10px;
               overflow: hidden; box-shadow: 0 2px 16px rgba(0,0,0,.15); }
.brand-stage video.v-main, .brand-stage video.v-bg { position: absolute; display: block; }
.brand-stage video.v-bg { inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(.9);
                          transform: scale(1.08); }
.brand-stage .ov { position: absolute; display: block; pointer-events: none; }
.brand-stage .ov.jacket { inset: 0; width: 100%; height: 100%; object-fit: fill; }
.brand-stage .ov.logo { pointer-events: auto; cursor: grab; touch-action: none; user-select: none; }
.brand-stage .placeholder { color: #bbb; padding: 120px 30px; }
button.big { width: 100%; justify-content: center; padding: 10px; font-size: 15px; }
.pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.pick-list li { display: flex; gap: 4px; }
.pick-list li > button:first-child { flex: 1; min-width: 0; justify-content: space-between; text-align: left; }
.pick-list li > button.sel { border-color: var(--accent); background: var(--soft); }
.pick-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.small { padding: 12px; margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 9 / 12; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden;
        background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 14px 14px; }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.tile-main { all: unset; cursor: pointer; position: absolute; inset: 0; display: grid; place-items: center; }
.tile-main img, .tile-main video { width: 100%; height: 100%; object-fit: contain; }
.tile-name { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; padding: 2px 4px; color: #fff;
             background: rgba(0,0,0,.55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.none .tile-main, .tile.add { color: var(--muted); font-size: 13px; }
.tile.add { display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
            border-style: dashed; background: var(--panel); text-align: center; gap: 2px; }
.tile.add:hover { border-color: var(--accent); color: var(--accent); }
.tile.add small { font-size: 10px; }
.tile-del { position: absolute; top: 3px; right: 3px; padding: 0 5px; font-size: 11px; line-height: 18px; opacity: 0; }
.tile:hover .tile-del { opacity: 1; }
.tile-warn { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; display: grid;
             place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.presets { display: grid; grid-template-columns: repeat(3, 30px); gap: 4px; }
.presets button { padding: 3px 0; justify-content: center; }
.presets button.on { border-color: var(--accent); color: var(--accent); }
.sliders { display: flex; flex-direction: column; gap: 6px; }
.sliders label, .area-grid label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; }
.area-grid label { min-width: 0; }
.area-grid input[type=range] { width: 100%; min-width: 0; }
.area-grid .hint { white-space: nowrap; }
input[type=color] { width: 36px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.burn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.burn-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap;
            padding: 8px 0; border-bottom: 1px solid var(--line); }
.burn-row:last-child { border-bottom: 0; }
.burn-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.burn-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burn-info .chip { align-self: flex-start; }
.burn-info .progress { margin: 0; }
.hint.err { color: var(--err); }
@media (max-width: 900px) {
  .brand { grid-template-columns: 1fr; }
  .brand-side { position: static; max-height: none; overflow: visible; }
  .brand-stage { height: 60vh; }
}

/* ---- brand: text and timeline -------------------------------------------- */
.brand-stage canvas.ov.text { inset: 0; width: 100%; height: 100%; pointer-events: none; }
.text-edit { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.text-edit label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.text-edit select { font: inherit; font-size: 13px; padding: 5px 6px; border-radius: 7px; border: 1px solid var(--line);
                    background: var(--panel); color: var(--ink); max-width: 190px; }
textarea.text-input { width: 100%; font: 15px/1.4 inherit; font-family: inherit; padding: 8px 10px; border-radius: 8px;
                      border: 1px solid var(--line); background: var(--panel); color: var(--ink); resize: vertical; }
/* One slider per row: label | slider | value, in fixed columns so nothing spills out of the card. */
.text-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.text-grid label { display: grid; grid-template-columns: 96px minmax(0, 1fr) 56px; align-items: center; gap: 10px; min-width: 0; }
.text-grid input[type=range] { width: 100%; min-width: 0; }
.text-grid .hint { text-align: right; white-space: nowrap; }
.text-edit .row { min-width: 0; }
.text-edit .row input[type=range] { flex: 1 1 80px; min-width: 0; width: auto; }
button.tog { min-width: 34px; justify-content: center; font-weight: 700; }
button.tog.on { background: var(--soft); border-color: var(--accent); color: var(--accent); }
button.tog:nth-of-type(2) { font-style: italic; }

.tl-card { --tl-label: 64px; }
.tl { position: relative; user-select: none; }
.tl-head, .tl-lane { display: grid; grid-template-columns: var(--tl-label) 1fr; align-items: center; }
.tl-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tl-ruler { position: relative; height: 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tl-ruler .tick { position: absolute; top: 2px; font: 10px var(--mono); color: var(--muted); transform: translateX(-50%);
                  pointer-events: none; }
.tl-ruler .tick:first-child { transform: none; }
.tl-tracks { position: relative; }
.tl-lane { height: 30px; border-bottom: 1px dashed var(--line); }
.tl-track { position: relative; height: 100%; cursor: pointer; }
.tl-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; overflow: hidden; display: flex; align-items: center;
          padding: 0 8px; font-size: 12px; color: #fff; cursor: grab; touch-action: none; min-width: 6px;
          box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.tl-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.tl-bar::before, .tl-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.tl-bar::before { left: 0; } .tl-bar::after { right: 0; }
.tl-bar.video { background: #6d6a64; cursor: default; }
.tl-bar.video::before, .tl-bar.video::after { display: none; }
.tl-bar.jacket { background: var(--fit); }
.tl-bar.logo { background: var(--split); }
.tl-bar.music { background: #24693a; }  /* same deep green in both themes, so the waveform stands out */
.tl-bar.text { background: var(--single); }
.tl-bar.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none;
               transform: translateX(-1px); }

.cap-tools { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 9px;
             background: var(--soft); }
.cap-tools select { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 7px; border: 1px solid var(--line);
                    background: var(--panel); color: var(--ink); }
.tl-bar.caption { background: color-mix(in srgb, var(--single) 75%, #fff 0%); padding: 0; border-radius: 3px;
                  border-right: 1px solid rgba(0,0,0,.35); }

/* B-roll */
.brand-stage .broll-layer { position: absolute; inset: 0; overflow: hidden; background: #000; pointer-events: none; }
.broll-layer .br-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
                      filter: blur(14px) brightness(.88); transform: scale(1.08); }
.broll-layer .br-inner { position: absolute; }
.broll-layer .br-fg { display: block; width: 100%; height: 100%; }
.tile.broll { aspect-ratio: 4 / 3; }
.tile.broll .tile-main img, .tile.broll .tile-main video { object-fit: cover; }
.tl-bar.broll { background: #0c8599; }
.commons .row input.commons-q { flex: 1; min-width: 160px; font: inherit; font-size: 13px; padding: 6px 9px; border-radius: 8px;
                                border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.commons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.commons-item { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
                background: var(--panel); }
.commons-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--soft); display: block; }
.commons-meta { display: flex; flex-direction: column; gap: 3px; padding: 7px 8px 8px; font-size: 12px; min-width: 0; }
.commons-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.commons-meta .muted, .commons-meta .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broll-edit { margin-top: 12px; }
input.credit-in { flex: 1; min-width: 110px; font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 7px;
                  border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.tl-bar canvas.wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tl-bar.music span { display: none; }  /* the song's name is the bar's tooltip, so the waveform stays clear */

/* ---- Brand editor: tool rail, one panel, preview, full-width timeline ---- */
body.page-brand section#detail { padding: 0; }
/* the editor fills exactly the window below the header, so the page itself never scrolls */
body.page-brand { display: flex; flex-direction: column; height: 100vh; }
body.page-brand main { flex: 1 1 auto; min-height: 0; }
body.page-brand section#detail { min-height: 0; }
.editor { display: grid; grid-template-columns: 72px 340px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
          height: 100%; min-height: 520px; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px 0 12px;
          border-bottom: 1px solid var(--line); background: var(--panel); }
.ed-top .grow { flex: 1; }
.ed-top svg { width: 17px; height: 17px; flex: none; }
.ed-top .src { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 9px; min-width: 0;
               max-width: min(560px, 60%); height: 34px; padding: 0 12px 0 10px; border-radius: 8px; font-size: 13.5px; }
.ed-top .src:hover { background: var(--soft); }
.ed-top .src:focus-visible { outline: 2px solid var(--accent); }
.ed-top .src svg { color: var(--muted); }
.ed-top .src strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ed-top .src .meta { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ed-top .status { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ed-top .status:empty { display: none; }
.undo-group { flex: none; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.undo-group button { border: 0; border-radius: 0; height: 32px; width: 36px; padding: 0; display: grid; place-items: center;
                     background: transparent; color: var(--ink); }
.undo-group button + button { border-left: 1px solid var(--line); }
.undo-group button:hover:not(:disabled) { background: var(--soft); }
.undo-group button:disabled { color: var(--muted); opacity: .45; }
.ed-top .primary { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px 0 13px; font-size: 13.5px; }
.ed-rail { grid-row: 2 / 4; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; overflow-y: auto;
           border-right: 1px solid var(--line); background: var(--panel); }
.ed-rail button { all: unset; box-sizing: border-box; position: relative; cursor: pointer; display: flex; flex-direction: column;
                  align-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 10px; font-size: 11px; color: var(--muted); }
.ed-rail button:hover { color: var(--ink); background: var(--soft); }
.ed-rail button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ed-rail button.on { color: var(--ink); background: var(--soft); font-weight: 600; }
.ed-rail button.on svg { color: var(--accent); }
.ed-rail .badge { position: absolute; top: 3px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
                  background: var(--accent); color: var(--accent-ink); font: 600 10px/16px system-ui, sans-serif; text-align: center; }
.ed-rail .badge.dot { min-width: 0; width: 7px; height: 7px; padding: 0; top: 7px; right: 16px; }
.ed-rail .sp { flex: 1; min-height: 8px; }
.ed-panel { grid-row: 2 / 4; overflow-y: auto; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.ed-panel .card { border: 0; border-radius: 0; background: transparent; margin: 0; padding: 16px 18px; }
.ed-panel .card + .card { border-top: 1px solid var(--line); }
.ed-panel .card > h2:first-child { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: 12px; }
.ed-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 20px 10px; min-width: 0;
            min-height: 0; background: var(--bg); }
.ed-stage .stage-wrap { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; justify-content: center; }
.ed-stage .brand-stage { height: 100%; max-height: 100%; max-width: 100%; }
.ed-stage .ed-bar { justify-content: center; }
.ed-timeline { grid-column: 3 / 4; border-top: 1px solid var(--line); padding: 10px 18px 12px; max-height: 32vh;
               overflow-y: auto; background: var(--panel); }
.ed-timeline .hint { display: none; }
@media (max-width: 900px) {
  body.page-brand { display: block; height: auto; }
  .editor { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; min-height: 0; }
  .ed-top, .ed-rail, .ed-panel, .ed-stage, .ed-timeline { grid-column: auto; grid-row: auto; }
  .ed-rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; order: 1; }
  .ed-rail button { min-width: 62px; }
  .ed-rail .sp { display: none; }
  .ed-stage { order: 2; }
  .ed-stage .brand-stage { height: 58vh; }
  .ed-timeline { order: 3; max-height: none; }
  .ed-panel { order: 4; border-right: 0; border-top: 1px solid var(--line); }
}
.ed-panel .seg { display: flex; width: 100%; }
.ed-panel .seg button { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; justify-content: center;
                        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-panel .row > .muted:first-child { min-width: 0; }
.ed-panel .burn-row { flex-direction: column; align-items: stretch; gap: 8px; }
.ed-panel .burn-row .row { justify-content: flex-start; }

/* ---- Home: drop zone + project gallery ---- */
body.home main { grid-template-columns: 1fr; }
body.home aside#side { display: none; }
.home-wrap { max-width: 1320px; margin: 0 auto; padding: 30px 8px 56px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 20px 16px; }
.pcard { display: flex; flex-direction: column; min-width: 0; cursor: pointer; border-radius: 14px; outline: none; }
.pcard:focus-visible .pthumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
/* thumbnail: the picture carries the status, the source and the length */
.pthumb { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--soft);
          color: var(--muted); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line);
          transition: box-shadow .15s, transform .15s; }
.pcard:hover .pthumb { box-shadow: 0 0 0 1px var(--muted), 0 8px 22px -12px rgba(0,0,0,.45); transform: translateY(-2px); }
.pthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pthumb::after { content: ""; position: absolute; inset: auto 0 0; height: 46%; pointer-events: none;
                 background: linear-gradient(to top, rgba(0,0,0,.62), transparent); }
.pstatus { position: absolute; top: 8px; left: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
           max-width: calc(100% - 56px); padding: 4px 9px 4px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff;
           background: rgba(20, 19, 18, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pstatus i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #cfcac0; }
.pstatus.ok i { background: #51cf66; }
.pstatus.mid i { background: #74c0fc; }
.pstatus.todo i { background: #ffd43b; }
.pstatus.busy i { background: #ff8c42; animation: pulse 1.2s ease-in-out infinite; }
.pstatus.err { background: rgba(201, 42, 42, .9); }
.pstatus.err i { background: #fff; }
@keyframes pulse { 50% { opacity: .35; } }
.pfoot { position: absolute; inset: auto 8px 8px; z-index: 1; display: flex; align-items: center; justify-content: space-between;
         gap: 6px; color: #fff; font-size: 11.5px; font-weight: 600; }
.psrc { display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 8px 3px 6px; border-radius: 99px;
        background: rgba(20, 19, 18, .55); color: #fff; text-decoration: none; white-space: nowrap; }
.psrc svg { flex: none; width: 13px; height: 13px; }
.psrc.yt svg rect { fill: #ff3b30; }
.psrc.yt svg path { fill: #fff; }
a.psrc.yt:hover { background: #ff3b30; }
a.psrc.yt:hover svg rect { fill: #fff; }
a.psrc.yt:hover svg path { fill: #ff3b30; }
.plen { flex: none; padding: 3px 7px; border-radius: 6px; background: rgba(20, 19, 18, .55);
        font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.pbusy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 19, 18, .45); }
.pbar { position: absolute; inset: auto 0 0; z-index: 2; height: 3px; background: rgba(255,255,255,.25); }
.pbar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.spin { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
        animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* below the picture: name, then type · last edit and the Brand shortcut */
.pbody { display: flex; flex-direction: column; gap: 3px; padding: 10px 2px 0; min-width: 0; }
.pbody strong { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
                -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.pmeta-line { display: flex; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pmeta-line span { overflow: hidden; text-overflow: ellipsis; }
.pmeta-line span:first-child { flex: none; }
.pmeta-line span + span::before { content: "·"; margin: 0 6px; opacity: .7; }
.home-empty { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; padding: 36px; text-align: center;
              border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
@media (max-width: 760px) {
  .home-wrap { padding: 18px 0 40px; }
  .newbox > header { padding: 14px 14px 0; }
  .nb-tabs { width: 100%; }
  .nb-tabs button { flex: 1; justify-content: center; padding: 0 6px; }
  .nb-tabs button svg { display: none; }
  .nb-body { padding: 14px; }
  .newbox .field button { padding: 0 12px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }
}
@media (max-width: 600px) {
  header.top { flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; }
  header.top p, header.top .theme .lbl { display: none; }
  header.top .tabs { margin-left: 0; }
}
.pcard .pdel { position: absolute; top: 6px; right: 6px; z-index: 1; width: 30px; height: 30px; padding: 0; display: grid;
               place-items: center; border: 0; border-radius: 99px; background: rgba(20, 19, 18, .62); color: #fff; opacity: 0;
               transition: opacity .15s, background .15s; }
.pcard .pdel svg { width: 15px; height: 15px; }
.pcard:hover .pdel, .pcard:focus-within .pdel, .pcard .pdel:focus-visible { opacity: 1; }
.pcard .pdel:hover:not(:disabled) { background: var(--err); border-color: transparent; }
@media (hover: none) { .pcard .pdel { opacity: 1; } }
.tl-bar.caption span { padding: 0 5px; font-size: 11px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }

/* cut shots in the shot editor */
.badge.cut { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); border-color: transparent; }
.legend .cut-sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 5px;
                  background: repeating-linear-gradient(135deg, #555 0 2px, #2a2826 2px 4px); }
button.danger-soft { color: var(--err); }
button.danger-soft:hover:not(:disabled) { border-color: var(--err); }
.ed-bar .out-len { margin-left: 6px; white-space: nowrap; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer;
              white-space: nowrap; }
label.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

/* ---- caption page (Gemini post captions) ---------------------------------- */
body.page-caption main { grid-template-columns: 1fr; }
body.page-caption aside { display: none; }
.post .card:empty { display: none; }
.post-side { position: sticky; top: 12px; }
.post { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 20px; align-items: start; }
.post-controls, .post-side, .post-results { display: flex; flex-direction: column; gap: 12px; }
.post .card { margin: 0; }
.post-controls .title { margin-bottom: 2px; flex-direction: column; align-items: flex-start; gap: 2px; }
.post-controls .card > h2:first-child { margin-top: 0; }
.post-controls button.big { width: 100%; }
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.post .field { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.post .post-grid .field { margin-top: 0; }
.post .field input[type=text] { flex: none; width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; }
.seg.wrap { flex-wrap: wrap; }
.post-context { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 8px 9px; resize: vertical;
                border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.post-context:focus, .post .field input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--soft); }
.post-player { display: flex; flex-direction: column; align-items: center; }
.post-player video { height: min(46vh, 520px); max-width: 100%; aspect-ratio: 9 / 16; object-fit: contain;
                     background: var(--stage); border-radius: 10px; display: block; }
.post-player .placeholder { padding: 60px 20px; }
.post-hook { font-size: 17px; font-weight: 700; margin: 10px 0 8px; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; line-height: 1.5; }
.post-tags { color: var(--fit); font-size: 13px; margin: 8px 0 0; overflow-wrap: anywhere; }
.chip.energy-high { color: var(--accent); } .chip.energy-low { color: var(--fit); }
@media (max-width: 900px) {
  .post { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
}
.post input[type=password] { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
                             background: var(--panel); color: var(--ink); font: 13px var(--mono); }

/* ---- trim screen: who to follow --------------------------------------------- */
.people-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.people-head h3 { margin: 0; font-size: 15px; }
.people-head .muted { font-size: 13px; }
.people-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 82px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0;
          background: none; color: var(--muted); cursor: pointer; width: 64px; }
.person .face { position: relative; width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
                display: grid; place-items: center; background: var(--soft); color: var(--muted);
                box-shadow: 0 0 0 1px var(--line); transition: box-shadow .12s, transform .12s; }
.person .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person .who { font-size: 12px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.person:hover .face { transform: scale(1.04); }
.person.on .face { box-shadow: 0 0 0 2.5px var(--accent); }
.person.on .who { color: var(--ink); font-weight: 600; }
.person.on:not(.anyone) .face::after { content: "✓"; position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; }
.person:focus-visible { outline: none; }
.person:focus-visible .face { box-shadow: 0 0 0 2.5px var(--accent), 0 0 0 5px var(--soft); }
label.check:has(input:disabled) { opacity: .7; }

/* ---- layout chips (analyze page, Re-analyse) --------------------------------------- */
.layouts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.layouts .lay { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border-radius: 99px;
                font-size: 13px; color: var(--muted); background: var(--panel); }
.layouts .lay.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
                   background: color-mix(in srgb, var(--accent) 9%, var(--panel)); font-weight: 600; }
.layouts .lay:disabled { opacity: 1; cursor: default; }
.layouts .lay:disabled:not(.on) { opacity: .45; }
.layouts.compact { gap: 3px; }
.layouts.compact .lay { padding: 5px 7px; }
.trim-go .layouts-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px; }



/* Keyboard shortcuts behind a button under the timeline */
.keys-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.keys-btn { font-size: 12px; padding: 2px 8px; }

/* With a project open, only that project is on screen: no project rail or drawer.
   "← Projects" in the title bar (or the Projects tab) goes back to the list. */
body.compact main { grid-template-columns: 1fr; }
body.compact aside { display: none; }

/* Project header: a name row, then the framing settings grouped in one toolbar */
.phead { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.phead-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.phead-top .ptitle { margin: 0; font-size: 19px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead-top .chip { flex: none; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: var(--soft); border-color: transparent; color: var(--ink); }
button.ghost.danger { color: var(--err); }
button.ghost.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); }
.phead-top .back { flex: none; padding-left: 6px; }
.framing { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 0; padding: 8px 10px;
           background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.framing .fgroup { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.framing .fgroup + .fgroup { border-left: 1px solid var(--line); }
.framing .fgroup:first-child { padding-left: 4px; }
.framing .flabel { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.framing select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line);
                  background: var(--panel); color: var(--ink); }
.framing .redo { margin-left: 8px; }

/* Whole-frame background picker in the shot panel */
.bg-pick { margin-top: 10px; align-items: center; gap: 10px; }
.bg-pick .seg label.colour { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; cursor: pointer;
                             font-size: 13px; position: relative; }
.bg-pick .seg label.colour.on { color: var(--ink); background: var(--soft); font-weight: 600; }
.bg-pick .seg label.colour input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.bg-pick .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }

/* ---- Home (creator look): hero + new project, continue strip, filters, cards with actions ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 22px; }
.hero h2 { margin: 0; font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; text-transform: none; color: var(--heading); font-weight: 700; }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.hero-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.hero-steps li { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px; border: 1px solid var(--line);
                 border-radius: 99px; background: var(--panel); font-size: 13px; }
.hero-steps b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
                background: var(--soft); color: var(--accent); }
.newbox { border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 16px; background: var(--panel);
          padding: 16px; transition: border-color .15s, box-shadow .15s; }
.newbox.over { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.nb-up { display: flex; align-items: center; gap: 14px; }
.nb-up .ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.nb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb-t strong { font-size: 15px; } .nb-t .muted { font-size: 12.5px; }
.newbox label.button { cursor: pointer; white-space: nowrap; padding: 9px 18px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.newbox label.button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.newbox .upload-bar { margin-top: 10px; }
.nb-yt { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.nb-yt .yt-ic { display: grid; flex: none; }
.nb-yt .yt-ic svg { width: 22px; height: 22px; } .nb-yt .yt-ic rect { fill: #ff3b30; } .nb-yt .yt-ic path { fill: #fff; }
.nb-yt input { flex: 1; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
               background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; outline: 0; }
.nb-yt input:focus { border-color: var(--accent); }
.nb-yt button { height: 36px; }
button.primary, a.button.primary, label.button.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
.newbox label.button { display: inline-flex; align-items: center; border: 1px solid transparent; }
.cont { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin-bottom: 28px; border: 1px solid var(--line);
        border-radius: 14px; background: var(--panel); cursor: pointer; }
.cont:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cont img { flex: none; width: 34px; height: 60px; object-fit: cover; border-radius: 6px; }
.cont-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cont-t small { color: var(--muted); font-size: 12px; }
.cont-t strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.cont button { flex: none; }
.pill { flex: none; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.mid { background: var(--soft); color: var(--accent); }
.pill.busy { background: color-mix(in srgb, #1c7ed6 15%, transparent); color: #1c7ed6; }
.home-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 2px 16px; }
.home-head h3 { margin: 0 6px 0 0; font-size: 19px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-f { border-radius: 99px; padding: 4px 12px; font-size: 13px; color: var(--muted); background: var(--panel); }
.chip-f em { font-style: normal; opacity: .65; margin-left: 5px; }
.chip-f.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.psearch { margin-left: auto; display: flex; align-items: center; gap: 7px; width: 240px; height: 34px; padding: 0 10px;
           border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); }
.psearch:focus-within { border-color: var(--accent); }
.psearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; }
.pgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
         transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.pcard .pthumb { border-radius: 0; aspect-ratio: 3 / 4; }
.pcard:hover .pthumb { box-shadow: none; transform: none; }
.pcard .pbody { padding: 11px 13px 13px; gap: 4px; }
.pacts { display: flex; gap: 7px; margin-top: 8px; }
.pacts > button, .pacts > a.button { flex: 1; justify-content: center; font-size: 13px; padding: 6px 8px; }
.pacts > a.button.icon { flex: none; padding: 6px 9px; display: inline-flex; align-items: center; }
.home-none { grid-column: 1 / -1; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .psearch { width: 100%; margin-left: 0; } }

/* Timeline zoom: Fit / 5 min / 2 min / 1 min / 30 s, next to the shortcuts button */
.zoom-bar { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.zoom-bar .seg button { padding: 3px 10px; font-size: 12px; }
.zoom-bar .view-label { white-space: nowrap; }
