:root {
  --bg: #EDEFF1;
  --surface: #FFFFFF;
  --surface-2: #F6F7F8;
  --ink: #171A1F;
  --muted: #667085;
  --line: #D5D9DF;
  --line-strong: #B8BEC7;
  --accent: #1B4FD8;
  --accent-ink: #FFFFFF;
  --marker: #FFE45C;
  --marker-ink: #2B2300;
  --star: #D99A00;
  --danger: #C2410C;
  --shadow: 0 18px 50px rgba(20, 24, 31, 0.22);
  --radius: 6px;
  --rail: 248px;
  --sheet: 880px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171B;
    --surface: #1C2026;
    --surface-2: #232830;
    --ink: #E9ECEF;
    --muted: #98A2B3;
    --line: #2D333C;
    --line-strong: #414A56;
    --accent: #8FAEFF;
    --accent-ink: #0B1020;
    --marker: #6B5A00;
    --marker-ink: #FFF1A8;
    --star: #F2B824;
    --danger: #FB923C;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button {
  background: var(--ink); color: var(--bg); border: 0; border-radius: var(--radius);
  padding: 7px 12px; cursor: pointer;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
button.small { padding: 4px 8px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
kbd { font: 11px/1 ui-monospace, Menlo, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted); }

/* ------------------------------------------------------------ top bar */
.top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: var(--rail) 1fr auto auto auto auto; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.top .pill { text-decoration: none; font-size: 13px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); white-space: nowrap; }
.top .pill:hover { background: var(--surface-2); }
.search { position: relative; max-width: 760px; }
.search input {
  width: 100%; height: 38px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.search input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.jobs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.jobs .bar { width: 120px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.jobs .bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: calc(100% - 56px); }
.rail {
  position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto;
  padding: 18px 12px 24px 20px; border-right: 1px solid var(--line); background: var(--surface);
}
.main { padding: 22px 28px 120px; min-width: 0; }

.rail h3 { margin: 18px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rail h3:first-child { margin-top: 0; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li a, .rail li button {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  padding: 5px 8px; border-radius: 5px; text-decoration: none; background: none; border: 0; color: var(--ink); cursor: pointer;
}
.rail li a:hover, .rail li button:hover { background: var(--surface-2); }
.rail li.on a, .rail li.on button { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 500; }
.rail .n { color: var(--muted); font-size: 12px; }
/* An interview with clips that still run on past their last word (Trim dead air would re-cut them). */
.rail .deadair { flex: none; margin-left: auto; font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 4px; background: color-mix(in srgb, var(--marker) 45%, transparent); color: var(--ink); white-space: nowrap; }
.rail .chapter-num { color: var(--muted); margin-right: 6px; min-width: 16px; display: inline-block; }
.rail .chapter-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ivhead .facts { color: var(--muted); margin: 0 0 8px; }
.rail .tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.rail .tagcloud button { width: auto; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; }
.rail .tagcloud li.on button { border-color: var(--accent); }
.rail .empty { color: var(--muted); font-size: 13px; padding: 4px 8px; }

/* ------------------------------------------------------------ interview header */
.ivhead { margin-bottom: 22px; }
.ivhead h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.015em; max-width: 60ch; }
.ivhead .who { color: var(--muted); margin: 0 0 8px; }
.ivhead .summary { max-width: 72ch; margin: 0 0 14px; }
.timeline { position: relative; height: 40px; margin: 6px 0 4px; display: flex; gap: 2px; }
.timeline .ch { position: relative; height: 26px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; cursor: pointer; }
.timeline .ch:hover, .timeline .ch.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.timeline .ch span { position: absolute; inset: 0; padding: 4px 6px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.timeline .ch.on span { color: var(--accent); }
.timeline .ch:hover span { color: var(--ink); }
.timeline .marks { position: absolute; left: 0; right: 0; top: 30px; height: 8px; }
.timeline .marks i { position: absolute; top: 0; height: 8px; background: var(--line-strong); border-radius: 1px; min-width: 2px; }
.timeline .marks i.star { background: var(--star); }
.timeline .marks i.hit { background: var(--accent); }
.tl-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ------------------------------------------------------------ toolbar */
.toolbar { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; flex-wrap: wrap; }
.toolbar .count { font-weight: 500; }
.toolbar .spacer { flex: 1; }
.toolbar select { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 8px; }
.toolbar .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; }
.toolbar .chip button { background: none; color: var(--muted); padding: 0 6px; font-size: 14px; line-height: 1; }
.toolbar .chip button:hover { color: var(--ink); }

/* ------------------------------------------------------------ cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 22px 18px; }
.card { position: relative; display: block; text-decoration: none; }
.card .thumb {
  display: block; position: relative; aspect-ratio: 16 / 9; background: var(--surface-2) center / cover no-repeat; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.card .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .thumb.scrub img { visibility: hidden; }
.card .dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; font-size: 12px; background: rgba(17,20,26,.82); color: #fff; border-radius: 4px; }
.card .pick { position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); opacity: 0; transition: opacity .12s; }
.card:hover .pick, .card .pick:checked, .card .pick:focus-visible { opacity: 1; }
.card .star { position: absolute; right: 6px; top: 6px; background: rgba(17,20,26,.7); color: #fff; border-radius: 4px; padding: 2px 6px; font-size: 12px; opacity: 0; border: 0; }
.card:hover .star, .card .star.on { opacity: 1; }
.card .star.on { color: var(--star); }
.card h3 { font-size: 14.5px; line-height: 1.3; font-weight: 500; margin: 9px 0 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; }
.card .use { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.score { display: inline-flex; gap: 2px; align-items: center; }
.score i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.score i.on { background: var(--ink); }
.card:focus-visible { outline: none; }
.card:focus-visible .thumb { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ search results */
.results { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.result { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.result .thumb { aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--surface-2); position: relative; display: block; }
.result .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 500; }
.result h3 a { text-decoration: none; }
.result h3 a:hover { text-decoration: underline; }
.result .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }
.result .snippet { margin: 8px 0 6px; line-height: 1.5; max-width: 76ch; }
.result .hits { display: flex; flex-wrap: wrap; gap: 6px; }
.result .hits a { text-decoration: none; font-size: 12.5px; padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); background: var(--surface); }
.result .hits a:hover { border-color: var(--accent); color: var(--accent); }
.result .hits a b { font-weight: 500; color: var(--muted); margin-right: 6px; }
mark { background: var(--marker); color: var(--marker-ink); padding: 0 2px; border-radius: 2px; }

.empty-state { max-width: 60ch; color: var(--muted); padding: 40px 0; }
.empty-state code { background: var(--surface); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; }

/* ------------------------------------------------------------ selection tray */
.tray {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow);
}
.tray button { background: var(--bg); color: var(--ink); }
.tray button.ghost { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }

/* ------------------------------------------------------------ clip sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); z-index: 40; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--sheet), 100vw); z-index: 50;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  overflow-y: auto; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr);
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.sheet .head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.sheet .head .nav { display: flex; gap: 4px; }
.sheet .head .crumbs { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .head .crumbs a { text-decoration: none; }
.sheet .head .crumbs a:hover { text-decoration: underline; }
.sheet .body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; min-width: 0; }
.sheet .stage { padding: 16px 18px 24px; min-width: 0; }
.sheet .side { padding: 16px 18px 24px; border-left: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; }
.sheet video { width: 100%; max-width: 100%; min-width: 0; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); display: block; }
.sheet .title-row { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 4px; }
.sheet h2 { font-size: 20px; line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; flex: 1; }
.sheet h2[contenteditable]:focus { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.sheet .starbtn { background: none; border: 1px solid var(--line-strong); color: var(--muted); padding: 5px 10px; }
.sheet .starbtn.on { color: var(--star); border-color: var(--star); }
.sheet .times { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.sheet .times a { text-decoration: none; color: var(--accent); }
.sheet .summary { margin: 0 0 14px; max-width: 72ch; }

.transcript { font-size: 15.5px; line-height: 1.75; max-width: 76ch; padding: 14px 16px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); }
.transcript .w { cursor: pointer; border-radius: 3px; padding: 1px 1px; }
.transcript .w:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.transcript .w.now { background: var(--accent); color: var(--accent-ink); }
.transcript .w.hit { background: var(--marker); color: var(--marker-ink); }
.transcript .w.hit.now { background: var(--accent); color: var(--accent-ink); }
.transcript-tools { display: flex; gap: 8px; align-items: center; margin: 12px 0 8px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }

.side h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.side section { margin-bottom: 18px; }
.side .quote { font-style: italic; margin: 0; padding-left: 10px; border-left: 3px solid var(--marker); }
.side textarea { width: 100%; min-height: 64px; resize: vertical; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
.side input[type=text] { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
.side .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.side .tags .tag { background: var(--surface); }
.side .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.side .actions a, .side .actions button { text-decoration: none; font-size: 12.5px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.side .actions a:hover, .side .actions button:hover { border-color: var(--accent); color: var(--accent); }
.side .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.side .kv b { font-weight: 500; color: var(--muted); }
.side .scoresel { display: flex; gap: 4px; }
.side .scoresel button { background: var(--surface); border: 1px solid var(--line); color: var(--muted); width: 28px; padding: 3px 0; }
.side .scoresel button.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.side .variants a { display: block; text-decoration: none; padding: 5px 0; border-bottom: 1px solid var(--line); }
.side .variants a:hover { color: var(--accent); }

.trim { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: end; }
.trim label { font-size: 12.5px; color: var(--muted); display: block; }
.trim .val { font-size: 15px; font-weight: 500; color: var(--ink); margin: 2px 0 6px; }
.trim .nudge { display: flex; gap: 3px; }
.trim .nudge button { padding: 3px 6px; font-size: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.trim .newdur { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.trim .save { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.busy { opacity: .6; pointer-events: none; }

/* ------------------------------------------------------------ dialog / toast */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; width: min(520px, 92vw); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 12, 16, .45); }
dialog h2 { margin: 0 0 6px; font-size: 18px; }
dialog p { margin: 0 0 14px; }
dialog label { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
dialog input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 80vw; }
.toast.error { background: var(--danger); color: #fff; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) { .sheet .body { grid-template-columns: 1fr; } .sheet .side { border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 860px) {
  :root { --rail: 0px; }
  .top { grid-template-columns: auto 1fr auto auto auto; gap: 10px; padding: 0 12px; }
  .userbar .who { display: none; }
  .top .jobs { display: none; }
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .main { padding: 16px 14px 120px; }
  .result { grid-template-columns: 150px 1fr; gap: 12px; }
}

/* ------------------------------------------------------------ sign in */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 34px 32px 30px; box-shadow: 0 12px 40px rgba(20, 24, 31, .08); }
.login-mark { width: 40px; height: 40px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; margin-bottom: 18px; }
.login-mark i { display: block; width: 22px; height: 14px; border-radius: 3px; background: var(--marker); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); position: relative; }
.login-mark i::after { content: ""; position: absolute; left: 8px; top: 3px; border-left: 7px solid var(--ink); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.login h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.015em; }
.login p.muted { margin: 0 0 22px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.login input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 15px; }
.login input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.login button { width: 100%; padding: 11px; font-size: 15px; font-weight: 500; margin-top: 4px; }
.login-error { color: var(--danger); font-size: 13.5px; margin: -4px 0 12px; }

/* ------------------------------------------------------------ user bar + admin pages */
.userbar { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.userbar .who { color: var(--ink); font-weight: 500; margin-right: 4px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbar a { text-decoration: none; padding: 5px 8px; border-radius: 5px; color: var(--muted); }
.userbar a:hover, .userbar a.on { background: var(--surface-2); color: var(--ink); }
.notice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 0 18px; border-radius: 8px; background: var(--marker); color: var(--marker-ink); font-size: 13.5px; }
.notice a { color: inherit; font-weight: 500; }
.notice .close { margin-left: auto; background: none; color: inherit; padding: 2px 6px; font-size: 16px; line-height: 1; opacity: .7; }

.page { max-width: 880px; }
.page h1 { font-size: 24px; margin: 4px 0 6px; letter-spacing: -0.015em; }
.page .lead { color: var(--muted); margin: 0 0 22px; max-width: 64ch; }
.page section { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.page section h2 { font-size: 15px; margin: 0 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; align-items: end; }
.form-grid label { display: block; font-size: 12.5px; color: var(--muted); }
.form-grid input, .form-grid select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.form-grid .submit { display: flex; gap: 8px; align-items: center; }
.form-msg { font-size: 13px; margin: 8px 0 0; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--muted); }

table.users { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.users th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
table.users td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users tr:last-child td { border-bottom: 0; }
table.users .name { font-weight: 500; }
table.users .sub { color: var(--muted); font-size: 12.5px; }
table.users .role { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; color: var(--muted); }
table.users .role.admin { border-color: var(--ink); color: var(--ink); }
table.users .you { color: var(--muted); font-size: 12px; margin-left: 6px; }
table.users td.actions { text-align: right; white-space: nowrap; }
table.users td.actions button { margin-left: 4px; }
button.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); }
dialog.userdlg { width: min(460px, 92vw); }
dialog.userdlg .form-grid { grid-template-columns: 1fr 1fr; }
dialog.userdlg .form-grid .wide { grid-column: 1 / -1; }


/* ---- modal (Ship to atwork) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 14, 20, 0.55); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; width: min(440px, 92vw); box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.modal p { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.modal label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.modal select { width: 100%; padding: 9px 10px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); }
.modal select option { background: var(--surface); color: var(--ink); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal .btn.primary { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------ video creator */
.propose { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 22px; }
.propose label { display: block; font-size: 12.5px; color: var(--muted); }
.propose textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 15px; line-height: 1.45;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); resize: vertical;
}
.propose textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.propose-opts { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; }
.propose-opts select { margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.propose-opts .spacer { flex: 1; }

.vidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px 16px; }
.vidcard { display: block; text-decoration: none; }
.vidcard .thumb { display: block; position: relative; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.vidcard .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vidcard .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }
.vidcard .dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; font-size: 12px; background: rgba(17,20,26,.82); color: #fff; border-radius: 4px; }
.vidcard b { display: block; font-size: 14.5px; font-weight: 500; line-height: 1.3; margin: 9px 0 4px; }
.vidcard .meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.vidcard .asked { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; margin-top: 5px; }

.statuspill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; color: var(--muted); }
.statuspill.ready { border-color: var(--accent); color: var(--accent); }
.statuspill.stale { border-color: var(--star); color: var(--star); }

.page.videopage { max-width: 1000px; }
.videopage h1 { max-width: 34ch; }
.videopage h1:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.videopage .crumbs { font-size: 13px; margin: 0 0 6px; }
.videopage .crumbs a { color: var(--muted); text-decoration: none; }
.videopage .asked { font-size: 13px; margin: 0 0 18px; max-width: 72ch; }
.vidplayer { display: block; width: 100%; max-width: 760px; border-radius: 8px; background: #000; margin-bottom: 16px; }
.vidbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vidbar .spacer { flex: 1; }
.vidopts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); padding: 12px 0 4px; }
.vidopts label { display: inline-flex; align-items: center; gap: 6px; }
.vidopts input { accent-color: var(--accent); }

.segments { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: seg; }
.seg { display: grid; grid-template-columns: 168px 1fr auto; gap: 16px; align-items: start; padding: 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.seg.missing { grid-template-columns: 1fr auto; opacity: .8; }
.seg .thumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.seg .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.seg .dur { position: absolute; right: 5px; bottom: 5px; padding: 1px 6px; font-size: 11.5px; background: rgba(17,20,26,.82); color: #fff; border-radius: 4px; }
.seg .segmeta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.seg .segmeta .from { min-width: 0; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg h3 { font-size: 15px; font-weight: 500; margin: 4px 0 5px; counter-increment: seg; }
.seg h3::before { content: counter(seg) ". "; color: var(--muted); font-weight: 400; }
.seg .role { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg .why { margin: 0 0 4px; max-width: 72ch; }
.seg .bridge { margin: 0; color: var(--muted); font-style: italic; max-width: 72ch; }
.seg .bridge::before { content: "→ "; font-style: normal; }
.segact { display: flex; flex-direction: column; gap: 4px; }

.addclip input[type=search] { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.addresults { margin-top: 10px; }
.addrow { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.addrow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gaps { margin: 0; padding-left: 20px; color: var(--muted); }
.gaps li { margin-bottom: 4px; }

@media (max-width: 860px) {
  .seg { grid-template-columns: 110px 1fr auto; gap: 10px; padding: 10px; }
  .segact { flex-direction: row; }
}

/* b-roll */
.page.wide { max-width: 1280px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; text-decoration: none; font-size: 13px; background: var(--surface); }
.chip.on { border-color: currentColor; font-weight: 600; }
.chips .spacer { flex: 1; }
.vidgrid.broll .thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.brollcard.rejected { opacity: .6; }
.brollcard .row { display: flex; gap: 6px; margin-top: 6px; }
button.small { padding: 2px 8px; font-size: 12px; }
.sources { margin: -6px 0 16px; font-size: 13px; color: var(--muted); }
.sources summary { cursor: pointer; }
.sources ul { margin: 6px 0 0; padding-left: 18px; }

/* left nav: Interviews / B-roll */
.rail .mode { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin: 0 0 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.rail .mode a { text-align: center; text-decoration: none; font-size: 13px; padding: 6px 8px; border-radius: 6px; color: var(--muted); }
.rail .mode a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 24, 31, .08); }
.rail .rail-foot { margin-top: 24px; font-size: 11.5px; padding: 0 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head .count { font-size: 15px; font-weight: 400; }
.userbar { white-space: nowrap; flex-shrink: 0; }
.vidgrid.broll .stillcard .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Find & replace */
.fx-modal { width: min(620px, 94vw); max-height: 88vh; overflow: auto; }
.fx-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fx-row input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); }
.modal label.fx-case { display: flex; gap: 6px; align-items: center; margin: 10px 0; font-weight: 500; }
.fx-scope { margin: 6px 0 12px; font-size: 13px; }
.fx-scope summary { cursor: pointer; color: var(--muted); }
.fx-ivs { max-height: 160px; overflow: auto; margin-top: 6px; }
.modal label.fx-iv { display: flex; gap: 6px; align-items: center; font-weight: 400; color: var(--ink); margin: 0 0 4px; }
.fx-hits { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow: auto; font-size: 12.5px; }
.fx-hits li { padding: 6px 0; border-top: 1px solid var(--line); }
.fx-hits s { color: var(--muted); }
.fx-out .err { color: #c0392b; }

/* Interviews in the rail: search box and "Show all" */
.rail-search { width: 100%; box-sizing: border-box; margin: 0 0 6px; padding: 5px 8px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
.rail-more button { background: none; border: 0; padding: 4px 8px; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; }
.rail-more button:hover { text-decoration: underline; }
.rail-none { padding: 4px 8px; font-size: 12px; }
