:root {
  --brand: #2dd388;
  --brand-dim: #1BAA6E;
  --brand-soft: rgba(45,211,136,0.18);
  --brand-edge: rgba(45,211,136,0.6);
  --brand-glow: rgba(45,211,136,0.55);
  --bg: #0d1814;
  --bg-2: #16241e;
  --surface: #1d2e27;
  --surface-2: #263b32;
  --line: rgba(255,255,255,0.18);
  --line-strong: rgba(255,255,255,0.30);
  --text: #ffffff;
  --text-dim: rgba(255,255,255,0.92);
  --text-mute: rgba(255,255,255,0.75);
  --warn: #FBBF24;
  --danger: #F97171;
  --info: #7BB6FF;
  --code: #0d1714;
  --radius: 14px;
  --radius-sm: 10px;
}
/* HTML5 hidden attribute must always win — guards .lightbox, .topnav, etc. */
[hidden] { display: none !important; }


* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', 'InterVariable', ui-sans-serif, -apple-system, system-ui, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11','ss01','ss03'; font-size: 15px; letter-spacing: -0.005em;
}
/* No overlay — keep solid bg from html/body so nothing can stack on top of content. */

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--text); }
button, .btn {
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: all .15s;
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--brand-edge); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #001209; border-color: var(--brand); }
.btn-primary:hover { background: #22cc83; color: #001209; }
.btn-danger { color: var(--danger); border-color: rgba(249,113,113,0.3); }
.btn-danger:hover { background: rgba(249,113,113,0.1); border-color: var(--danger); }
.btn-link { background: transparent; border-color: transparent; padding: 6px 8px; color: var(--text-dim); }
.btn-link:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

#root { max-width: 1400px; margin: 0 auto; padding: 0 20px 96px; min-height: 100vh; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line-strong); margin-bottom: 22px;
  position: sticky; top: 0; backdrop-filter: saturate(180%) blur(12px);
  background: rgba(10,19,16,0.92); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; flex-shrink: 0; }
img.brand-mark { width: 36px; height: 36px; object-fit: contain; display: block; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #001209; font-weight: 800; box-shadow: 0 0 28px var(--brand-glow); font-size: 14px; }
.brand-name .dot { color: var(--text-mute); margin: 0 6px 0 4px; }
.brand-name .sub { color: var(--text-dim); font-weight: 500; font-size: 14px; }
.topnav { display: flex; gap: 16px; align-items: center; font-size: 13px; flex: 1; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { color: var(--text-dim); font-weight: 600; padding: 6px 4px; border-bottom: 2px solid transparent; }
.topnav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.topnav a:hover { color: var(--text); }
.topnav .sep { width: 1px; height: 18px; background: var(--line); }
.who { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-dim); }
/* Agents master toggle — stops/starts every agent the tick loop dispatches.
   Per-agent disables on /agents page are independent: stopping here doesn't
   un-disable them, starting here doesn't re-enable them. */
.agents-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand);
  transition: background .15s, border-color .15s, color .15s;
}
.agents-toggle .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 10px var(--brand-glow);
}
.agents-toggle:hover { background: rgba(45,211,136,0.26); }
.agents-toggle.is-stopped {
  border-color: rgba(251,191,36,0.7); background: rgba(251,191,36,0.16); color: var(--warn);
}
.agents-toggle.is-stopped .dot {
  background: var(--warn); box-shadow: 0 0 10px rgba(251,191,36,0.5);
  border-radius: 2px;  /* square = stopped */
}
.agents-toggle.is-stopped:hover { background: rgba(251,191,36,0.26); }
.agents-toggle.is-loading {
  border-color: var(--line-strong); background: var(--bg-2); color: var(--text-mute); cursor: wait;
}
.agents-toggle.is-loading .dot { background: var(--text-mute); box-shadow: none; }
.agents-toggle:disabled { opacity: 0.6; cursor: not-allowed; }

/* Campaign-mode pill — sits next to the agents toggle. Two states only:
   "launch" (declarative orange/amber) and "consumer_reach" (ambient blue).
   Click to flip. The orchestrator's Persona/Script/Visual agents read the
   current mode and branch their generation behavior accordingly. */
.campaign-mode {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  border: 1px solid var(--info); background: rgba(123,182,255,0.16); color: var(--info);
  transition: background .15s, border-color .15s, color .15s;
}
.campaign-mode .cm-icon { font-size: 14px; line-height: 1; }
.campaign-mode:hover { background: rgba(123,182,255,0.26); }
.campaign-mode.is-launch {
  border-color: rgba(251,191,36,0.7); background: rgba(251,191,36,0.16); color: var(--warn);
}
.campaign-mode.is-launch:hover { background: rgba(251,191,36,0.26); }
.campaign-mode.is-loading {
  border-color: var(--line-strong); background: var(--bg-2); color: var(--text-mute); cursor: wait;
}
.campaign-mode:disabled { opacity: 0.6; cursor: not-allowed; }
.badge {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 6px;
  background: var(--warn); color: #1a1300; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle;
}
.badge:empty { display: none; }

/* Search bar (in topnav) */
.search-wrap { position: relative; min-width: 220px; }
.search-wrap input {
  width: 100%; padding: 7px 12px 7px 32px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: 8px; color: var(--text); font: inherit; font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='rgba(244,250,247,0.7)' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3 3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.search-wrap input:focus { outline: none; border-color: var(--brand); background-color: var(--surface); }
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 360px; max-width: 480px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  max-height: 60vh; overflow: auto; z-index: 50; box-shadow: 0 16px 36px rgba(0,0,0,0.5);
}
.search-results .group { padding: 6px 12px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-mute); border-bottom: 1px solid var(--line); margin-top: 4px; font-weight: 600; }
.search-results .item { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; }
.search-results .item:hover, .search-results .item.active { background: var(--bg-2); }
.search-results .item .title { font-size: 13px; }
.search-results .item .meta { font-size: 11px; color: var(--text-mute); margin-top: 2px; font-family: ui-monospace, monospace; }
.search-results .empty { padding: 20px; color: var(--text-mute); text-align: center; font-size: 12.5px; }

/* Main + view */
main { flex: 1; }

/* Section heads */
.section-head { margin: 8px 0 22px; }
.section-eyebrow { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: var(--brand); text-transform: uppercase; margin-bottom: 6px; }
h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 700; color: var(--text); }
h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -0.01em; font-weight: 700; color: var(--text); }
h3 { font-size: 14.5px; margin: 0 0 8px; font-weight: 700; color: var(--text); }
.muted { color: var(--text-mute); font-size: 13px; }
.eyebrow { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* Cards / grids */
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid.cols-9 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 800px) { .grid.cols-9 { grid-template-columns: repeat(9, 1fr); } }
@media (max-width: 760px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5, .grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 22px rgba(0,0,0,0.35); }
.card:hover { border-color: var(--brand-edge); }
.card-link { cursor: pointer; }
.card-link:hover { transform: translateY(-1px); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--text); }
.stat .num .unit { color: var(--brand); font-size: 0.55em; font-weight: 700; margin-left: 4px; }
.stat .label { margin-top: 6px; font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat .sub { font-size: 12px; color: var(--text-mute); margin-top: 6px; font-family: ui-monospace, monospace; }
.stat.brand .num { color: var(--brand); }
.stat.warn .num { color: var(--warn); }
.stat.info .num { color: var(--info); }
.stat.danger .num { color: var(--danger); }

/* Agent compact card */
.agent-card { padding: 14px; }
.agent-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agent-icon { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); border: 1px solid var(--brand); color: #001209; display: grid; place-items: center; font-weight: 800; font-size: 11px; font-family: ui-monospace, monospace; flex-shrink: 0; box-shadow: 0 0 14px var(--brand-glow); }
.agent-card .name { font-weight: 600; font-size: 13.5px; }
.agent-card .last { color: var(--text-mute); font-size: 11.5px; font-family: ui-monospace, monospace; }
.agent-card .stats-line { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }
.agent-card .pill { padding: 2px 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-family: ui-monospace, monospace; }
.agent-card .pill.warn { color: var(--warn); border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.06); }
.agent-card .pill.brand { color: var(--brand); border-color: var(--brand-edge); background: var(--brand-soft); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 11px 13px; color: var(--text-dim); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line-strong); position: sticky; top: 0; background: var(--surface-2); }
tbody td { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
tbody tr:hover { background: var(--surface-2); }
tbody tr.row-link { cursor: pointer; }
.cell-truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-strong); font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.tag.brand { color: var(--brand); border-color: var(--brand-edge); background: var(--brand-soft); }
.tag.warn { color: var(--warn); border-color: rgba(251,191,36,0.55); background: rgba(251,191,36,0.14); }
.tag.danger { color: var(--danger); border-color: rgba(249,113,113,0.55); background: rgba(249,113,113,0.14); }
.tag.info { color: var(--info); border-color: rgba(123,182,255,0.55); background: rgba(123,182,255,0.14); }

/* Login */
.login-wrap { max-width: 420px; margin: 80px auto; }
.login-wrap .card { padding: 28px; }
.login-wrap input { width: 100%; padding: 11px 14px; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font-family: inherit; font-size: 14px; margin: 12px 0; }
.login-wrap input:focus { outline: none; border-color: var(--brand); }
.login-wrap .btn { width: 100%; padding: 12px; }
.login-msg { margin-top: 14px; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; }
.login-msg.success { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-edge); }
.login-msg.error { background: rgba(249,113,113,0.06); color: var(--danger); border: 1px solid rgba(249,113,113,0.3); }
.login-wrap .hint { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-mute); }

/* HITL */
.hitl-item { padding: 0; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); margin-bottom: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.hitl-item:hover { border-color: var(--brand-edge); }
.hitl-item.priority-urgent { border-color: rgba(249,113,113,0.6); background: rgba(249,113,113,0.06); }
.hitl-item.priority-high { border-color: rgba(251,191,36,0.55); background: rgba(251,191,36,0.04); }

/* Asset gallery */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.asset-tile { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; box-shadow: 0 4px 14px rgba(0,0,0,0.32); }
.asset-tile:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px var(--brand-edge); }
.asset-tile .preview { aspect-ratio: 1/1; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.asset-tile .preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-tile .preview.ph { background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); color: var(--text-dim); font-family: ui-monospace, monospace; font-size: 11px; padding: 8px; text-align: center; font-weight: 600; }
.asset-tile .meta { padding: 9px 11px; font-size: 12px; }
.asset-tile .meta .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.asset-tile .meta .hook { color: var(--text); font-size: 12.5px; line-height: 1.4; max-height: 36px; overflow: hidden; margin-top: 5px; font-weight: 500; }

/* Asset strip (horizontal scroll) */
.asset-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x mandatory; }
.asset-strip::-webkit-scrollbar { height: 8px; }
.asset-strip::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 4px; }
.asset-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.asset-strip .asset-tile { flex: 0 0 200px; scroll-snap-align: start; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(2,5,4,0.92); z-index: 100;
  display: grid; grid-template-columns: 1fr min(360px, 30%); gap: 0;
  backdrop-filter: blur(4px);
}
.lightbox .stage {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  min-width: 0; min-height: 0; position: relative; overflow: hidden;
  height: 100vh; /* clamp to viewport so children's max-height: 100% actually clamps */
  box-sizing: border-box;
}
.lightbox .stage > img,
.lightbox .stage > video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 64px); /* viewport minus stage padding */
  width: auto; height: auto;
  object-fit: contain;
  background: var(--bg-2); border-radius: 10px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
}
.lightbox .stage > video { background: #000; }
.lightbox .stage pre { max-width: 100%; max-height: 100%; overflow: auto; }
.lightbox .stage .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-strong);
  color: var(--text); display: grid; place-items: center;
  cursor: pointer; font-size: 18px; transition: all .15s; z-index: 2;
}
.lightbox .stage .nav:hover { background: var(--surface); border-color: var(--brand-edge); }
.lightbox .stage .nav.prev { left: 18px; }
.lightbox .stage .nav.next { right: 18px; }
.lightbox .sidebar {
  background: var(--surface); border-left: 1px solid var(--line);
  overflow: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.lightbox .sidebar .close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text); display: grid; place-items: center;
  cursor: pointer; font-size: 18px; z-index: 3;
}
.lightbox .sidebar .close:hover { background: var(--bg-2); border-color: var(--danger); color: var(--danger); }

/* Asset counter + inline chevrons (Issue #7). */
.lightbox .lb-counter-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px; padding-right: 44px; /* clear close button */
}
.lightbox .lb-counter {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-edge, var(--text));
}
.lightbox .lb-chev {
  width: 26px; height: 26px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--text); cursor: pointer; font-size: 15px; line-height: 1;
  display: grid; place-items: center; padding: 0;
  transition: all .12s;
}
.lightbox .lb-chev:hover { background: var(--bg-2); border-color: var(--brand-edge); }

/* Title (Issue #3 — wraps cleanly on every viewport). */
.lightbox .lb-title {
  margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700;
  color: var(--text);
  word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;
}

.lightbox .meta-row {
  display: grid; grid-template-columns: 92px 1fr auto; column-gap: 10px;
  align-items: baseline;
  font-size: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.lightbox .meta-row .k { color: var(--text-mute); }
.lightbox .meta-row .v {
  color: var(--text); text-align: right;
  word-break: break-word; overflow-wrap: anywhere;
  font-family: inherit; /* sans by default — Issue #5 */
}
.lightbox .meta-row .v.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Storage URI row (Issue #4 — single-line, ellipsised, copy button). */
.lightbox .meta-row.uri-row { grid-template-columns: 92px 1fr 28px; }
.lightbox .meta-row.uri-row .uri-val {
  display: inline-block; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; font-size: 11.5px;
  text-align: right; direction: rtl; /* keep filename visible, ellipsise scheme/prefix */
}
.lightbox .lb-copy-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--text); cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center; padding: 0;
  transition: all .12s;
}
.lightbox .lb-copy-btn:hover { background: var(--surface); border-color: var(--brand-edge); }

/* Footer (Issue #8 — keyboard hints + download button pinned at bottom). */
.lightbox .lb-footer {
  margin-top: auto; padding-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line);
}
.lightbox .lb-kbd-hint {
  font-size: 11px; color: var(--text-dim);
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.lightbox .lb-kbd-hint kbd {
  display: inline-block; padding: 1px 6px; min-width: 18px; text-align: center;
  font: 600 10.5px/1.4 ui-monospace, monospace;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 4px;
  color: var(--text);
}
.lightbox .lb-footer .btn { align-self: flex-start; }

/* Mobile (Issue #3a, #6 — bottom drawer, no overlapping nav arrows). */
@media (max-width: 800px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .lightbox .stage { padding: 16px; height: 45vh; }
  .lightbox .stage > img,
  .lightbox .stage > video { max-height: calc(45vh - 32px); }
  .lightbox .stage .nav { display: none; }
  .lightbox .sidebar {
    max-height: 55vh; padding: 16px 18px;
    border-left: none; border-top: 1px solid var(--line);
  }
  .lightbox .lb-title { font-size: 15.5px; }
  .lightbox .meta-row { grid-template-columns: 78px 1fr auto; font-size: 11.5px; }
  .lightbox .meta-row.uri-row { grid-template-columns: 78px 1fr 28px; }
}

/* Filter bar */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.filter-bar label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.filter-bar select, .filter-bar input { padding: 6px 11px; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); font: inherit; font-size: 13px; }
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--brand); }
.filter-bar .pill {
  padding: 4px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line);
  font-family: ui-monospace, monospace; font-size: 11.5px; cursor: pointer; transition: all .12s;
}
.filter-bar .pill.active { background: var(--brand-soft); border-color: var(--brand-edge); color: var(--brand); }
.filter-bar .pill:hover { border-color: var(--brand-edge); }
.filter-bar .clear { color: var(--text-mute); font-size: 12px; padding: 4px 10px; cursor: pointer; }
.filter-bar .clear:hover { color: var(--danger); }
.filter-bar .count { margin-left: auto; font-size: 11.5px; color: var(--text-mute); font-family: ui-monospace, monospace; }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-head { padding: 7px 10px; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; text-align: center; font-weight: 700; }
.cal-cell { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; min-height: 96px; padding: 7px 9px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.today { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 14px var(--brand-glow); }
.cal-cell.past { opacity: 0.7; }
.cal-cell .num { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-cell .num.today { color: var(--brand); }
.cal-cell .item { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line-strong); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; color: var(--text-dim); text-decoration: none; }
.cal-cell .item:hover { color: var(--text); border-color: var(--brand-edge); }
.cal-cell .item.published { background: var(--brand-soft); border-color: var(--brand-edge); color: var(--brand); }
.cal-cell .item.awaiting { background: rgba(251,191,36,0.10); border-color: rgba(251,191,36,0.4); color: var(--warn); }
.cal-cell .item.failed { background: rgba(249,113,113,0.10); border-color: rgba(249,113,113,0.4); color: var(--danger); }
.cal-cell .more { font-size: 10px; color: var(--text-mute); margin-top: auto; }

/* Persona card */
.persona-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.persona-card:hover { border-color: var(--brand-edge); }
.persona-card .avatar {
  width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dim) 100%);
  display: grid; place-items: center; color: #001209; font-weight: 800; font-family: ui-monospace, monospace; font-size: 18px; flex-shrink: 0;
}
.persona-card .body { min-width: 0; }
.persona-card .role { font-size: 14.5px; font-weight: 700; color: var(--text); }
.persona-card .meta { font-size: 11.5px; color: var(--text-mute); font-family: ui-monospace, monospace; margin-top: 4px; }
.persona-card .channels { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.persona-card .channel-pill { padding: 2.5px 8px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line-strong); font-size: 10.5px; font-family: ui-monospace, monospace; color: var(--text-dim); font-weight: 500; }
.persona-card .channel-pill.fit-high { color: var(--brand); border-color: var(--brand-edge); background: var(--brand-soft); }
.persona-card .channel-pill.fit-medium { color: var(--info); border-color: rgba(123,182,255,0.45); background: rgba(123,182,255,0.14); }
.persona-card .stats { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.persona-card .stats span { display: flex; align-items: center; gap: 4px; }
.persona-card .stats strong { color: var(--text); font-family: ui-monospace, monospace; }

/* Variant comparison */
.variant-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.variant-cols .variant-block { display: flex; flex-direction: column; height: 100%; }
.variant-block { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 16px; box-shadow: 0 4px 14px rgba(0,0,0,0.32); }
.variant-block.winner { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 0 24px var(--brand-glow); }
.variant-block .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.variant-block .body { font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; flex: 1; }
.variant-block .voice-bar { height: 5px; background: var(--bg-2); border-radius: 3px; margin-top: 10px; overflow: hidden; border: 1px solid var(--line-strong); }
.variant-block .voice-bar > div { height: 100%; background: var(--brand); transition: width .4s; }
.variant-block .voice-bar.bad > div { background: var(--danger); }
.variant-block .voice-bar.warn > div { background: var(--warn); }

/* Code blocks */
pre { margin: 0; padding: 12px 14px; background: var(--code); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; line-height: 1.6; color: #d8efe2; font-family: ui-monospace, monospace; }
.mono { font-family: ui-monospace, monospace; }

/* Footer */
.foot { margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--line-strong); color: var(--text-dim); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-strong); font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-dim); }
kbd { padding: 2px 6px; background: var(--bg-2); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 11px; color: var(--text); }

/* Charts container */
.chart-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 18px; box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.chart-card canvas { max-height: 320px; }

/* Misc */
.empty { padding: 44px; text-align: center; color: var(--text-mute); font-size: 13.5px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 90; max-width: 320px; }
.toast { padding: 12px 16px; background: var(--surface); border: 1px solid var(--brand-edge); border-radius: 10px; color: var(--text); font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: toast-in .25s ease-out; }
.toast.error { border-color: rgba(249,113,113,0.5); background: rgba(249,113,113,0.06); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Toggle */
.toggle { position: relative; display: inline-block; width: 46px; height: 24px; cursor: pointer; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; inset: 0; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: .2s; }
.toggle .knob { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-dim); transition: .2s; }
.toggle.on .slider { background: var(--brand); border-color: var(--brand); }
.toggle.on .knob { left: 24px; background: #001209; }

/* Voice classifier histogram */
.voice-hist { display: flex; gap: 4px; align-items: flex-end; height: 60px; }
.voice-hist > div { flex: 1; background: var(--surface-2); border-radius: 3px 3px 0 0; min-height: 6px; position: relative; }
.voice-hist > div .label { position: absolute; bottom: -16px; left: 0; right: 0; font-size: 9.5px; text-align: center; color: var(--text-mute); font-family: ui-monospace, monospace; }
.voice-hist > div .count { position: absolute; top: -14px; left: 0; right: 0; font-size: 10px; text-align: center; color: var(--text-dim); font-family: ui-monospace, monospace; }
.voice-hist .b-excellent { background: var(--brand); }
.voice-hist .b-good { background: rgba(34,204,131,0.7); }
.voice-hist .b-marginal { background: var(--warn); }
.voice-hist .b-poor { background: var(--danger); }
.voice-hist .b-unscored { background: var(--line-strong); }

/* Modal helpers */
details summary { cursor: pointer; }
details summary:hover { color: var(--text); }

/* Briefs page — sort/group/multi-select/mass-delete */
.briefs-table thead th.sortable { cursor: pointer; user-select: none; }
.briefs-table thead th.sortable:hover { color: var(--text); background: var(--bg-2); }
.briefs-table thead th.sortable.sorted { color: var(--brand); }
.briefs-table .cell-checkbox { width: 32px; padding-left: 14px; padding-right: 4px; }
.briefs-table .cell-checkbox input { cursor: pointer; }
.briefs-table tbody tr.row-corrupted { background: rgba(249,113,113,0.04); }
.briefs-table tbody tr.row-corrupted:hover { background: rgba(249,113,113,0.10); }
.briefs-table tbody tr.row-group-lead { background: var(--surface); font-weight: 500; }
.briefs-table tbody tr.row-group-lead:hover { background: var(--surface-2); }
.briefs-table tbody tr.row-indent td:nth-child(2) { padding-left: 32px; }
.briefs-table .sibling-arrow { color: var(--text-mute); font-size: 11px; margin-right: 4px; }
.briefs-table .expand-btn {
  background: transparent; border: 1px solid var(--line-strong); color: var(--text-dim);
  padding: 2px 8px; font-size: 11px; border-radius: 6px; cursor: pointer;
  font-family: ui-monospace, monospace;
}
.briefs-table .expand-btn:hover { border-color: var(--brand-edge); color: var(--brand); }

.health-cell { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.health-pill {
  display: inline-block; padding: 2px 7px; border-radius: 999px;
  font-family: ui-monospace, monospace; font-size: 10.5px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--line-strong); color: var(--text-mute);
}
.health-pill.ok { color: var(--text-mute); border-color: var(--line); background: transparent; opacity: 0.6; }
.health-pill.warn { color: var(--warn); border-color: rgba(251,191,36,0.55); background: rgba(251,191,36,0.12); }
.health-pill.danger { color: var(--danger); border-color: rgba(249,113,113,0.55); background: rgba(249,113,113,0.12); }

.filter-bar .chip {
  padding: 6px 11px; font-size: 11.5px; font-weight: 600; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line-strong); color: var(--text-dim);
  cursor: pointer; letter-spacing: 0;
}
.filter-bar .chip:hover { border-color: var(--brand-edge); color: var(--text); }
.filter-bar .chip.chip-active { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.55); color: var(--warn); }

.briefs-action-bar {
  position: sticky; bottom: 12px; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--brand-edge);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 18px var(--brand-glow);
}
.briefs-action-bar .sel-count { font-weight: 700; color: var(--brand); font-size: 13px; }

/* ─── Settings page ─────────────────────────────────────────── */
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-section {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 1px solid var(--line);
  padding-bottom: 6px; margin-top: 14px; margin-bottom: 4px;
}
.settings-section:first-child { margin-top: 0; }
.settings-row {
  display: grid; grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px; align-items: center; padding: 8px 0;
}
.settings-label .settings-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.settings-label .settings-hint { font-size: 12px; margin-top: 2px; line-height: 1.4; }
.settings-control { display: flex; align-items: center; gap: 10px; min-width: 0; }
.settings-control .input { min-width: 0; }
.settings-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-pair > span { font-size: 12px; color: var(--text-dim); min-width: 28px; text-align: right; }
.settings-pair > input { width: 96px; }
.settings-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.settings-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.toast.success { border-color: var(--brand-edge); background: rgba(45,211,136,0.08); }
.toast.info { border-color: var(--line); }
@media (max-width: 720px) {
  .settings-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ─── Approvals page ────────────────────────────────────────── */
.approvals-filter { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.approvals-filter .btn-sm.is-active { background: var(--brand); color: var(--bg); border-color: var(--brand-edge); }
.approvals-list { display: flex; flex-direction: column; gap: 14px; }
.approval-card {
  display: grid; grid-template-columns: 320px 1fr; gap: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; transition: opacity 0.2s ease;
}
.approval-card.is-resolved { opacity: 0.55; }
.approval-preview {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  min-height: 200px; overflow: hidden; aspect-ratio: 9/16;
  max-height: 420px;
}
.approval-preview video, .approval-preview img {
  width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer;
}
.approval-preview-empty { color: var(--text-dim); font-size: 12px; padding: 20px; text-align: center; }
.approval-meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.approval-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval-section-label {
  font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 6px;
}
.approval-brief { font-size: 13px; color: var(--text); }
.approval-hook {
  font-size: 14px; color: var(--text); font-style: italic;
  border-left: 2px solid var(--brand); padding-left: 10px; margin: 4px 0;
}
.approval-caption {
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; white-space: pre-wrap; word-break: break-word;
}
.approval-hashtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.approval-hashtags .tag {
  font-size: 12px; color: var(--text-dim);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 10px;
}
.approval-gate {
  background: rgba(255, 168, 0, 0.06);
  border: 1px solid rgba(255, 168, 0, 0.25);
  border-radius: 8px; padding: 10px 12px; margin-top: 6px;
}
.approval-gate-label { color: rgba(255, 168, 0, 0.95); margin-top: 0; }
.approval-gate-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.approval-error {
  font-size: 12px; color: rgba(255, 95, 95, 0.95);
  background: rgba(255, 95, 95, 0.06); border: 1px solid rgba(255, 95, 95, 0.25);
  border-radius: 6px; padding: 8px 10px;
}
.approval-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn-danger { background: rgba(255, 95, 95, 0.10); border-color: rgba(255, 95, 95, 0.35); color: rgba(255, 145, 145, 0.95); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 95, 95, 0.18); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.pill-awaiting  { background: rgba(255, 168, 0, 0.12); color: rgba(255, 200, 80, 0.95); border: 1px solid rgba(255, 168, 0, 0.35); }
.pill-approved  { background: rgba(45, 211, 136, 0.12); color: var(--brand); border: 1px solid var(--brand-edge); }
.pill-rejected  { background: rgba(255, 95, 95, 0.12); color: rgba(255, 145, 145, 0.95); border: 1px solid rgba(255, 95, 95, 0.35); }
.pill-status { text-transform: uppercase; }
@media (max-width: 720px) {
  .approval-card { grid-template-columns: 1fr; }
  .approval-preview { aspect-ratio: 16/9; }
}

/* ─── Budget tab — windowed counters ────────────────────────────── */
.spend-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.spend-counter {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spend-counter-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}
.spend-counter-value {
  font-size: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.05;
}
.spend-counter-sub { font-size: 12px; }
.spend-windowed { width: 100%; border-collapse: collapse; }
.spend-windowed thead th {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}
.spend-windowed tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.spend-windowed tbody tr.spend-live { background: rgba(45, 211, 136, 0.06); }
.spend-windowed tbody tr.spend-live td { color: var(--text); }
@media (max-width: 720px) {
  .spend-totals { grid-template-columns: 1fr; }
  .spend-counter-value { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .toast { animation: none; } }

/* ─── Media browser ─────────────────────────────────────────────── */
.media-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.media-chip {
  padding: 6px 14px; border-radius: 20px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--text-dim); cursor: pointer; font: inherit; font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.media-chip:hover { color: var(--text); border-color: var(--brand-edge); }
.media-chip.active {
  background: var(--brand); color: var(--bg);
  border-color: var(--brand); font-weight: 700;
}
.media-counts { margin-bottom: 14px; font-size: 12.5px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.media-card {
  padding: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.media-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-edge);
  box-shadow: 0 6px 24px rgba(45,211,136,.18);
}
.media-thumb {
  position: relative;
  width: 100%; height: 160px;
  background: #0a1410;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.media-thumb img, .media-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.media-thumb .media-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.72); color: #fff;
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
  font-family: ui-monospace, monospace;
}
.media-audio {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 16px;
  background: linear-gradient(135deg, #1a3530, #0a1410);
}
.media-audio .audio-glyph { font-size: 44px; opacity: 0.7; }
.media-audio .audio-name {
  font-size: 11px; color: var(--text-mute);
  text-align: center; word-break: break-all;
  font-family: ui-monospace, monospace;
}
/* Hover toolbar on media tiles — Download + Delete. */
.media-toolbar {
  position: absolute; top: 6px; left: 6px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity .12s;
  z-index: 2;
}
.media-card:hover .media-toolbar,
.media-card:focus-within .media-toolbar { opacity: 1; }
.media-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  background: rgba(0,0,0,0.72); color: #fff;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
  font-size: 13px; line-height: 1; cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, transform .08s;
}
.media-action:hover { background: rgba(0,0,0,0.92); border-color: rgba(255,255,255,0.36); transform: scale(1.05); }
.media-action.del:hover { background: #c8302a; border-color: #ea4f49; }
.media-action:disabled { opacity: 0.5; cursor: wait; }

/* Schedule table — Actions column buttons. */
.row-actions-cell { padding-right: 10px; }
.row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; margin-left: 4px;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 5px;
  font-size: 12px; line-height: 1; cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.row-action:hover { background: var(--surface-alt, #0e1d18); border-color: var(--brand-edge); color: var(--text); }
.row-action.del:hover { background: #c8302a; border-color: #ea4f49; color: #fff; }
.row-action.disabled { opacity: 0.35; cursor: not-allowed; }
.row-action:disabled { opacity: 0.5; cursor: wait; }

.media-meta { padding: 10px 12px; }
.media-meta .mm-hook {
  font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-meta .mm-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-mute);
  font-family: ui-monospace, monospace;
}
.media-meta .mm-tool { opacity: 0.85; }
.media-meta .mm-time { margin-left: auto; }

/* ─── QC fixes tab ─────────────────────────────────────────────── */
.qc-fix-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.qc-fix-row {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: start;
}
.qc-fix-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.qc-fix-icon { font-size: 16px; }
.qc-fix-check {
  font-family: ui-monospace, monospace; font-size: 12px;
  color: var(--text); font-weight: 500;
}
.qc-fix-time { margin-left: auto; color: var(--text-mute); font-family: ui-monospace, monospace; font-size: 11.5px; }
.qc-sev {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; font-family: ui-monospace, monospace;
}
.qc-sev-fail { background: rgba(200,48,42,0.18); color: #ff8a83; border: 1px solid rgba(200,48,42,0.36); }
.qc-sev-warn { background: rgba(220,160,40,0.16); color: #f0c87a; border: 1px solid rgba(220,160,40,0.32); }
.qc-sev-info { background: rgba(80,140,200,0.16); color: #95c0e8; border: 1px solid rgba(80,140,200,0.32); }
.qc-fix-body { grid-column: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.qc-fix-label {
  display: inline-block; min-width: 50px;
  color: var(--text-mute); text-transform: uppercase;
  font-size: 10.5px; letter-spacing: 0.5px; margin-right: 8px;
  font-family: ui-monospace, monospace;
}
.qc-fix-before { color: var(--text-dim); }
.qc-fix-after { color: var(--text); }
.qc-fix-cost {
  margin-left: 10px; padding: 1px 6px; border-radius: 3px;
  background: rgba(45,211,136,0.12); color: var(--brand);
  font-family: ui-monospace, monospace; font-size: 11px;
}
.qc-fix-preview {
  grid-column: 2; position: relative;
  width: 120px; height: 88px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #0a1410; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.qc-fix-preview img, .qc-fix-preview video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.qc-fix-preview .media-action {
  position: absolute; top: 6px; right: 6px;
}
.qc-fix-script-meta {
  grid-column: 2; display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px; font-size: 11px;
}
.qc-fix-foot {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 6px; border-top: 1px dashed var(--line);
  font-size: 12px;
}
.qc-fix-brief {
  color: var(--text-dim); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1; min-width: 0;
}
.qc-fix-brief:hover { color: var(--brand); }
.qc-fix-tags { display: flex; gap: 4px; }

/* ─── Recycler tab ────────────────────────────────────────────── */
.recycler-row {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px;
}
.recycler-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.recycler-icon { font-size: 18px; }
.recycler-kind {
  font-family: ui-monospace, monospace; font-size: 12px;
  color: var(--text); font-weight: 500;
  text-transform: lowercase; letter-spacing: 0.2px;
}
.recycler-cost {
  margin-left: auto; padding: 1pt 6pt; border-radius: 3pt;
  background: rgba(45,211,136,0.12); color: var(--brand);
  font-family: ui-monospace, monospace; font-size: 11px;
}
.recycler-when { color: var(--text-mute); font-family: ui-monospace, monospace; font-size: 11.5px; }
.recycler-body { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.recycler-summary { font-size: 13px; color: var(--text-dim); }
.recycler-fanout { display: flex; flex-wrap: wrap; gap: 4px; }
.recycler-tag {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  background: var(--bg-soft, #0e1d18); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 10.5px;
  font-family: ui-monospace, monospace;
}
.recycler-tag.muted { color: var(--text-mute); border-style: dashed; }
.recycler-foot {
  display: flex; gap: 14px; padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--text-mute);
}

/* Audio stage in lightbox */
.audio-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 40px;
}
.audio-stage .audio-icon { font-size: 72px; opacity: 0.8; }
.audio-stage .audio-name {
  font-family: ui-monospace, monospace; color: var(--text-dim);
  font-size: 13px; word-break: break-all; text-align: center;
}

/* ─── Reviews (Phase A — strict-approval gate) ─────────────────── */
.reviews-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.review-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 16px; align-items: center;
  padding: 14px 16px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.review-meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.review-row-head { display: flex; align-items: center; gap: 10px; }
.review-brief { font-size: 13px; }
.review-hook { margin: 2px 0 0 0; }
.review-summary {
  font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  padding: 4px 8px; border-radius: 4px;
}
.review-actions { display: flex; gap: 8px; }
.pill-agent { font-size: 11px; padding: 3px 8px; border-radius: 99px; font-weight: 600; }

.review-detail { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.review-detail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.review-hook-large {
  font-size: 18px; line-height: 1.4; font-weight: 500;
  padding: 16px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.review-output {
  padding: 16px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.review-output h3 { margin: 0 0 12px 0; font-size: 14px; color: var(--text-dim); }
.review-payload-json {
  font-family: ui-monospace, monospace;
  font-size: 11px; line-height: 1.5;
  max-height: 400px; overflow: auto;
  background: rgba(0,0,0,0.25); padding: 12px;
  border-radius: 4px; white-space: pre-wrap;
}

.script-variant-card {
  padding: 12px; margin-bottom: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: 6px;
}
.sv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sv-body { white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.sv-caption { margin-top: 8px; font-size: 13px; }
.sv-rejection {
  margin-top: 8px; padding: 6px 10px;
  background: rgba(220, 38, 38, 0.1); color: #ef4444;
  border-radius: 4px; font-size: 12px;
}

.asset-card video, .asset-card img {
  width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: 4px; cursor: pointer;
  background: #0a0a0a;
}

.review-decision-panel {
  padding: 16px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.review-decision-panel textarea {
  width: 100%; padding: 10px; font: inherit; font-size: 13px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); resize: vertical;
}
.review-btn-row { display: flex; gap: 12px; justify-content: flex-end; }
.review-decided {
  background: rgba(255,255,255,0.02);
  font-size: 12px;
}
.btn-danger {
  background: #b91c1c; color: white; border: 1px solid #ef4444;
}
.btn-danger:hover:not([disabled]) { background: #dc2626; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 720px) {
  .review-row { grid-template-columns: 1fr; }
  .review-actions { justify-content: flex-end; }
}

/* Phase B — inline edit form on script variants */
.sv-edit-label {
  display: block; margin-top: 10px; margin-bottom: 4px;
  font-size: 11px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sv-edit-textarea {
  width: 100%; padding: 8px 10px;
  font: inherit; font-size: 13px; line-height: 1.5;
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  resize: vertical; box-sizing: border-box;
}
.sv-edit-textarea:focus {
  outline: 2px solid #2dd388; outline-offset: -2px;
}
.sv-edit-actions {
  display: flex; align-items: center; margin-top: 12px; gap: 8px; flex-wrap: wrap;
}
.sv-edit-hint {
  font-size: 11px; flex-basis: 100%; line-height: 1.5;
}
.sv-choose-btn {
  background: rgba(45, 211, 136, 0.18); color: #2dd388;
  border: 1px solid rgba(45, 211, 136, 0.5); font-weight: 600;
}
.sv-choose-btn:hover:not([disabled]) {
  background: rgba(45, 211, 136, 0.30);
  border-color: rgba(45, 211, 136, 0.8);
}
.sv-choose-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success {
  /* Reuse choose-btn styling as the generic success accent */
}
.btn-warn {
  background: #b45309; color: white; border: 1px solid #f59e0b;
}
.btn-warn:hover:not([disabled]) { background: #d97706; }
.btn-warn:disabled { opacity: 0.5; cursor: not-allowed; }
.pill-status.pill-edited_then_approved {
  background: rgba(45, 211, 136, 0.15); color: #2dd388;
  border: 1px solid rgba(45, 211, 136, 0.4);
}

/* Phase C — video edit panel */
.video-edit-panel {
  margin-top: 16px; padding: 14px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.25); border-radius: 6px;
}
.video-edit-panel h4 {
  margin: 0 0 4px 0; font-size: 13px;
  color: #f59e0b; text-transform: uppercase; letter-spacing: 0.04em;
}
.video-edit-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; flex-wrap: wrap;
}
.video-edit-label {
  font-size: 12px; min-width: 160px; color: var(--text-dim);
}
.video-edit-input {
  flex: 0 0 auto; padding: 6px 10px;
  font: inherit; font-size: 13px;
  background: rgba(0,0,0,0.25); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
}
.video-edit-input[type=number] { width: 90px; }
.video-edit-input[type=file] {
  padding: 4px; max-width: 280px;
}
.video-edit-status {
  margin: 0 0 12px 0; padding: 8px 12px;
  background: rgba(0,0,0,0.3); border-radius: 4px;
  font-size: 12px; display: flex; align-items: center; gap: 8px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 99px;
  display: inline-block; flex-shrink: 0;
}
.status-info { background: #3b82f6; animation: pulse-dot 1.6s ease-in-out infinite; }
.status-ok { background: #2dd388; }
.status-warn { background: #f59e0b; }
.status-error { background: #ef4444; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Phase F — shot list in video edit panel */
.video-edit-shots-row { align-items: flex-start; }
.video-shots-list {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.shot-card {
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
.shot-card-head {
  grid-column: 1; display: flex; gap: 8px; align-items: baseline;
}
.shot-card-query { grid-column: 1; word-break: break-word; }
.shot-card-id { grid-column: 1; font-family: ui-monospace, monospace; }
.shot-card .btn { grid-column: 2; grid-row: 1 / span 3; align-self: center; white-space: nowrap; }

/* Phase G — trainer recommendations */
.rec-filter-row {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 16px;
}
.rec-list { display: flex; flex-direction: column; gap: 12px; }
.rec-card {
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, #2dd388);
  border-radius: 4px;
}
.rec-card.rec-applied { border-left-color: #4ade80; opacity: 0.7; }
.rec-card.rec-dismissed { border-left-color: #9ca3af; opacity: 0.5; }
.rec-card.rec-reviewed { border-left-color: #fbbf24; }
.rec-head {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px;
}
.rec-badge {
  display: inline-block; padding: 1px 7px; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: 3px; background: rgba(255,255,255,0.06);
}
.rec-badge-agent { background: rgba(45, 211, 136, 0.18); color: #2dd388; }
.rec-badge-persona { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.rec-label { font-family: ui-monospace, monospace; }
.rec-signal { font-size: 12px; }
.rec-value, .rec-conf, .rec-date { font-size: 11px; opacity: 0.7; margin-left: auto; }
.rec-value { margin-left: 0; }
.rec-body { margin: 0 0 10px 0; line-height: 1.5; }
.rec-detail { margin-bottom: 10px; }
.rec-detail summary {
  cursor: pointer; font-size: 11px; color: var(--muted);
  user-select: none;
}
.rec-detail-pre {
  margin-top: 8px; padding: 10px; font-size: 11px;
  background: rgba(0,0,0,0.3); border-radius: 3px;
  max-height: 240px; overflow: auto;
  font-family: ui-monospace, monospace;
}
.rec-actions { display: flex; gap: 8px; }

/* Phase G follow-up — script variant prose preview + voice/leader pills.
   Operator was approving blind because the editable textarea collapsed
   the body. Prose preview reads top-down; textarea is below for edits. */
.sv-prose-preview {
  margin: 12px 0 16px 0;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--accent, #2dd388);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: 'Inter', system-ui, sans-serif;
}
.sv-voice-pill { font-family: ui-monospace, monospace; }
.sv-voice-auto { background: rgba(45, 211, 136, 0.22); color: #2dd388; }
.sv-voice-pass { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.sv-voice-fail { background: rgba(248, 113, 113, 0.18); color: #f87171; }
.sv-leader-pill {
  background: rgba(96, 165, 250, 0.20); color: #60a5fa;
  font-weight: 600;
}

/* Phase G UX (2026-05-04) — kid-friendly approval surfaces.
   Brief context strip, approval hint, resolved persona strip,
   structured persona cards with score breakdown bars. */

.brief-context-strip {
  margin: 16px 0 12px 0;
  padding: 14px 18px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.brief-context-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 10px;
}
.brief-context-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 18px;
}
.bcc { display: flex; flex-direction: column; gap: 2px; }
.bcc-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.bcc-value { font-size: 13px; font-weight: 500; }
.bcc-hook {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(45, 211, 136, 0.08);
  border-left: 2px solid var(--accent, #2dd388);
  border-radius: 2px; font-size: 13px;
}
.bcc-hook-label {
  display: block; font-size: 10px; color: var(--accent, #2dd388);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.bcc-hook-text { font-weight: 500; }
.bcc-ab { margin-top: 8px; font-size: 12px; }

.approval-hint {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 8px 0 16px 0; padding: 12px 14px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 4px;
}
.approval-hint-icon {
  display: inline-flex; justify-content: center; align-items: center;
  width: 20px; height: 20px;
  border-radius: 50%; background: rgba(96, 165, 250, 0.25);
  color: #60a5fa; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.approval-hint-text { font-size: 13px; line-height: 1.5; }

.resolved-persona-strip {
  margin: 12px 0; padding: 10px 14px;
  background: rgba(45, 211, 136, 0.06);
  border-left: 2px solid var(--accent, #2dd388);
  border-radius: 2px;
}
.rps-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent, #2dd388);
}
.rps-headline { font-size: 14px; margin-top: 2px; }
.rps-summary { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.rps-conf { font-size: 11px; }

/* Persona cards (chosen + alternatives) */
.persona-card {
  margin: 12px 0;
  padding: 16px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.persona-card-chosen {
  border-left: 3px solid var(--accent, #2dd388);
  background: rgba(45, 211, 136, 0.04);
}
.persona-card-alt { opacity: 0.78; }
.persona-card-head {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px;
}
.persona-card-role { font-size: 14px; }
.persona-pill-code { font-family: ui-monospace, monospace; }
.persona-pill-chosen { background: rgba(45, 211, 136, 0.22); color: #2dd388; }
.persona-pill-score { background: rgba(96, 165, 250, 0.18); color: #60a5fa; font-family: ui-monospace, monospace; }
.persona-pill-whynot { background: rgba(248, 113, 113, 0.16); color: #f87171; cursor: help; }
.persona-card-summary { margin: 0 0 12px 0; line-height: 1.6; font-size: 13px; }
.persona-card-detail {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 16px; margin-bottom: 12px;
}
.pcc { display: flex; flex-direction: column; gap: 2px; }
.pcc-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pcc-value { font-size: 12px; }
.persona-card-cues, .persona-refs {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  margin-top: 8px; font-size: 12px; line-height: 1.5;
}
.persona-card-notes { margin-top: 8px; font-size: 11px; }

.persona-confidence-line {
  margin: 14px 0; padding: 10px 14px;
  border-radius: 4px; font-size: 13px;
}
.persona-confidence-line.conf-strong { background: rgba(45, 211, 136, 0.10); color: #2dd388; }
.persona-confidence-line.conf-okay { background: rgba(251, 191, 36, 0.10); color: #fbbf24; }
.persona-confidence-line.conf-weak { background: rgba(248, 113, 113, 0.10); color: #f87171; }

/* Score breakdown bars */
.persona-score-breakdown {
  margin-top: 10px; padding: 10px 12px;
  background: rgba(0,0,0,0.18); border-radius: 3px;
  display: flex; flex-direction: column; gap: 6px;
}
.psb-row {
  display: grid; grid-template-columns: 140px 1fr 110px;
  gap: 10px; align-items: center; font-size: 11px;
}
.psb-label { color: var(--muted); cursor: help; }
.psb-track {
  height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden;
}
.psb-fill {
  height: 100%; background: linear-gradient(90deg, #2dd388, #60a5fa);
  transition: width 0.3s ease;
}
.psb-value { font-family: ui-monospace, monospace; text-align: right; color: var(--muted); }

/* Persona rendering profile chips */
.persona-rendering-summary {
  margin-top: 18px; padding: 12px 14px;
  background: rgba(255,255,255,0.025);
  border-radius: 4px; border: 1px solid var(--border);
}
.prs-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 8px;
}
.prs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.prs-chip {
  padding: 8px 10px; border-radius: 3px;
  background: rgba(45, 211, 136, 0.06);
  border-left: 2px solid var(--accent, #2dd388);
}
.prs-chip-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;
}
.prs-chip-value { font-size: 12px; font-weight: 500; }

/* Phase G UX (2026-05-04) — script approval polish.
   Side-by-side variant grid + length pill + emphasis chip. */

.sv-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.sv-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .sv-grid-two { grid-template-columns: 1fr; }
}

.sv-compare-hint {
  margin: 8px 0 12px 0;
  padding: 10px 12px;
  background: rgba(96, 165, 250, 0.05);
  border-left: 2px solid rgba(96, 165, 250, 0.5);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.5;
}

.script-variant-card {
  display: flex;
  flex-direction: column;
}

/* Emphasis pill colors — different argument shapes get different hues */
.sv-emphasis-pill { font-weight: 500; }
.sv-emphasis-story-arc   { background: rgba(167, 139, 250, 0.18); color: #a78bfa; }
.sv-emphasis-number-led  { background: rgba(45, 211, 136, 0.18); color: #2dd388; }
.sv-emphasis-question-led{ background: rgba(96, 165, 250, 0.18); color: #60a5fa; }
.sv-emphasis-feature-led { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }

/* Length-vs-target row */
.sv-length-row {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin: 8px 0 12px 0;
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 12px;
  cursor: help;
}
.sv-len-good { background: rgba(45, 211, 136, 0.10); }
.sv-len-warn { background: rgba(251, 191, 36, 0.10); }
.sv-len-bad  { background: rgba(248, 113, 113, 0.12); }
.sv-length-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted);
}
.sv-length-value { font-family: ui-monospace, monospace; font-weight: 600; }
.sv-length-target { font-size: 11px; }
.sv-length-delta {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
}
.sv-len-good .sv-length-delta { color: #2dd388; }
.sv-len-warn .sv-length-delta { color: #fbbf24; }
.sv-len-bad  .sv-length-delta { color: #f87171; }

/* Live word count under the body textarea (editable mode) */
.sv-live-wc {
  font-size: 11px;
  margin: 4px 0 12px 0;
  padding: 3px 8px;
  display: inline-block;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
}
.sv-live-wc.sv-len-good { color: #2dd388; }
.sv-live-wc.sv-len-warn { color: #fbbf24; }
.sv-live-wc.sv-len-bad  { color: #f87171; }

.sv-hashtags {
  margin-top: 6px;
  font-size: 12px;
  cursor: help;
}

/* Phase G UX (2026-05-04) — kid-friendly upgrades for HITL, Recommendations,
   Briefs, Audit. Section-intro pattern shared across all four. */

.section-intro {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 8px 0 18px 0;
  padding: 12px 14px;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.20);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.55;
}
.section-intro-icon {
  display: inline-flex; justify-content: center; align-items: center;
  width: 20px; height: 20px;
  border-radius: 50%; background: rgba(96, 165, 250, 0.25);
  color: #60a5fa; font-weight: 700; font-size: 11px; flex-shrink: 0;
  font-family: ui-serif, serif; font-style: italic;
}
.section-intro-text { font-size: 13px; }

/* HITL */
.hitl-empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-mute);
}
.hitl-group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 6px 0;
  font-size: 14px;
  font-weight: 600;
}
.hitl-group-title { font-size: 14px; }
.hitl-group-count {
  background: rgba(255,255,255,0.06); color: var(--text-dim);
  font-size: 11px; padding: 1px 8px;
}
.hitl-group-hint {
  font-size: 12px; line-height: 1.5;
  margin: 0 0 10px 0;
  padding-left: 2px;
}
.hitl-item-head {
  display: flex; justify-content: space-between; gap: 14px;
  align-items: center; cursor: pointer; padding: 14px;
}
.hitl-item-main { flex: 1; min-width: 0; }
.hitl-item-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 11.5px; margin-bottom: 6px;
}
.hitl-meta-chip { font-size: 11px; }
.hitl-item-hook { font-size: 14px; }
.hitl-item-toggle {
  font-family: ui-monospace, monospace; font-size: 14px;
  color: var(--text-mute);
}
.priority-pill { text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px; }
.priority-pill.priority-urgent { background: rgba(248, 113, 113, 0.22); color: #f87171; font-weight: 700; }
.priority-pill.priority-high   { background: rgba(251, 191, 36, 0.22); color: #fbbf24; font-weight: 600; }
.priority-pill.priority-normal { background: rgba(255,255,255,0.08); color: var(--text-mute); }
.agent-pill {
  background: rgba(45, 211, 136, 0.14); color: #2dd388;
  font-size: 11px;
}

.hitl-why-card { padding: 12px; margin-bottom: 10px; }
.hitl-why-text { font-size: 13.5px; line-height: 1.55; }
.hitl-payload-details { margin-top: 10px; }
.hitl-payload-details summary {
  font-size: 11.5px; color: var(--text-mute);
  cursor: pointer; user-select: none;
}
.hitl-payload-pre {
  margin-top: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 3px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  max-height: 240px; overflow: auto;
}

.hitl-decision-block {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.hitl-decision-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  margin-top: 10px;
  resize: vertical;
}
.hitl-decision-actions {
  display: flex; gap: 8px;
  margin-top: 10px;
  justify-content: flex-end; flex-wrap: wrap;
}

/* Recommendations friendly detail */
.rec-conf-strong { background: rgba(45, 211, 136, 0.18); color: #2dd388; }
.rec-conf-okay   { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.rec-conf-weak   { background: rgba(248, 113, 113, 0.16); color: #f87171; }
.rec-signal-row {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 10px;
}
.rec-signal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.rec-signal-value { font-size: 12px; }
.rec-signal-hint {
  font-size: 12px; line-height: 1.5;
  margin: 4px 0 12px 0;
  padding-left: 2px;
}
.rec-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-mute); margin: 12px 0 6px 0;
}
.rec-detail-friendly { margin-top: 8px; }
.rec-counts-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.rec-count-cell {
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border-radius: 3px;
}
.rec-count-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-mute);
}
.rec-count-value {
  font-size: 18px; font-weight: 600;
  font-family: ui-monospace, monospace;
}
.rec-rates {
  display: flex; flex-direction: column; gap: 4px;
  margin: 8px 0;
}
.rec-rate-row {
  display: flex; justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255,255,255,0.02);
  border-radius: 2px;
  font-size: 12px;
}
.rec-rate-value { font-family: ui-monospace, monospace; font-weight: 600; }
.rec-notes-list {
  margin: 6px 0;
  padding-left: 22px;
  font-size: 12px; line-height: 1.6;
}
.rec-notes-list li {
  margin-bottom: 4px;
  color: var(--text-dim);
}
.rec-verb-dist {
  display: flex; flex-direction: column; gap: 4px;
}
.rec-verb-row {
  display: grid; grid-template-columns: 140px 1fr 90px;
  gap: 8px; align-items: center;
  font-size: 11px;
}
.rec-verb-label { color: var(--text-dim); }
.rec-verb-bar {
  height: 6px; background: rgba(255,255,255,0.05);
  border-radius: 3px; overflow: hidden;
}
.rec-verb-fill {
  height: 100%; background: linear-gradient(90deg, #fbbf24, #f87171);
  transition: width 0.3s ease;
}
.rec-verb-count { font-family: ui-monospace, monospace; text-align: right; }
.rec-detail-json-fold {
  margin-top: 12px;
}
.rec-detail-json-fold summary {
  font-size: 11px; color: var(--text-mute);
  cursor: pointer; user-select: none;
}

/* Audit table */
.audit-filter-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.audit-filter-pill {
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border: 1px solid var(--line);
  cursor: pointer;
}
.audit-filter-pill.is-active {
  background: rgba(45, 211, 136, 0.20);
  color: #2dd388;
  border-color: rgba(45, 211, 136, 0.45);
}
.audit-card { padding: 0; }
.audit-table { width: 100%; }
.audit-table th {
  cursor: help;
  font-weight: 500;
}
.audit-row.audit-cat-error    { background: rgba(248, 113, 113, 0.04); }
.audit-row.audit-cat-hitl     { background: rgba(251, 191, 36, 0.04); }
.audit-row.audit-cat-hitl_ok  { background: rgba(45, 211, 136, 0.03); }
.audit-row.audit-cat-config   { background: rgba(96, 165, 250, 0.03); }
.audit-row.audit-cat-auth     { background: rgba(167, 139, 250, 0.03); }
.audit-seq { color: var(--text-mute); width: 60px; }
.audit-brief { font-size: 11px; }
.audit-chain { font-size: 11px; color: var(--text-mute); }

/* Phase G UX (2026-05-04) — Agents pipeline explainer */
.agents-pipeline-card {
  margin-bottom: 18px;
  padding: 16px 18px;
  background: rgba(45, 211, 136, 0.06);
  border: 1px solid rgba(45, 211, 136, 0.20);
  border-radius: 4px;
}
.agents-pipeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand, #2dd388);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.agents-pipeline-flow {
  display: flex; flex-wrap: wrap;
  gap: 8px; align-items: center;
}
.agp-step {
  flex: 1 1 180px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.025);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.5;
  min-width: 160px;
}
.agp-step strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}
.agp-arrow {
  font-family: ui-monospace, monospace;
  color: var(--brand, #2dd388);
  font-size: 18px;
  flex-shrink: 0;
}
@media (max-width: 800px) {
  .agp-arrow { display: none; }
}
.agents-pipeline-foot {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.5;
}


/* ─── Strategy + Posting plan cards (Phase G UX 2026-05-06) ──── */
.strategy-plan-card,
.posting-plan-card {
  padding: 16px;
  background: var(--card-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
}
.plan-headline {
  margin: 0 0 14px 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.plan-section-h {
  margin: 18px 0 10px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-warnings {
  margin: 0 0 14px 0;
  padding: 10px 12px;
  background: rgba(239,176,77,0.10);
  border: 1px solid rgba(239,176,77,0.4);
  border-radius: 6px;
  font-size: 12.5px;
}
.plan-warnings strong { color: #efb04d; display: block; margin-bottom: 4px; }
.plan-warnings-list { margin: 0; padding-left: 20px; line-height: 1.5; }

/* Pillar bar — single horizontal segmented bar. */
.pillar-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
  margin-bottom: 6px;
}
.pillar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  border-right: 1px solid rgba(0,0,0,0.4);
}
.pillar-seg:last-child { border-right: none; }
.pillar-capability_proof  { background: #1BAA6E; }
.pillar-vertical_deep_dive { background: #2DD68C; }
.pillar-operator_spotlight { background: #7BB6FF; }
.pillar-customer_win       { background: #efb04d; }
.pillar-educational        { background: #b97cff; }
.pillar-behind_the_scenes  { background: #6c7a89; }
.pillar-industry_pov       { background: #ff7c8a; }

/* Brief cards inside strategy plan. */
.plan-brief-list {
  display: grid;
  gap: 10px;
}
.plan-brief-card {
  padding: 11px 13px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 6px;
}
.plan-brief-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.plan-pillar-pill {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: rgba(0,0,0,0.85);
}
.plan-pillar-pill.plan-pillar-capability_proof  { background: #1BAA6E; }
.plan-pillar-pill.plan-pillar-vertical_deep_dive { background: #2DD68C; }
.plan-pillar-pill.plan-pillar-operator_spotlight { background: #7BB6FF; }
.plan-pillar-pill.plan-pillar-customer_win       { background: #efb04d; }
.plan-pillar-pill.plan-pillar-educational        { background: #b97cff; color: rgba(255,255,255,0.95); }
.plan-pillar-pill.plan-pillar-behind_the_scenes  { background: #6c7a89; color: rgba(255,255,255,0.95); }
.plan-pillar-pill.plan-pillar-industry_pov       { background: #ff7c8a; }

.plan-chan-chip,
.plan-meta-chip {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.plan-chan-chip { color: var(--text); }
.plan-meta-chip-sub { background: rgba(123,182,255,0.10); border-color: rgba(123,182,255,0.35); }
.plan-brief-hook {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* Posting publish rows. */
.plan-publish-list,
.plan-comments-list {
  display: grid;
  gap: 8px;
}
.plan-publish-row,
.plan-comment-row {
  padding: 10px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 6px;
  font-size: 13px;
}
.plan-publish-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-platform-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.plan-status-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-status-badge.st-green { background: rgba(45,214,140,0.18); color: #2DD68C; border: 1px solid rgba(45,214,140,0.4); }
.plan-status-badge.st-amber { background: rgba(239,176,77,0.18); color: #efb04d; border: 1px solid rgba(239,176,77,0.4); }
.plan-status-badge.st-red   { background: rgba(255,124,138,0.18); color: #ff7c8a; border: 1px solid rgba(255,124,138,0.4); }
.plan-status-badge.st-grey  { background: rgba(160,160,160,0.18); color: var(--text-dim); border: 1px solid rgba(160,160,160,0.4); }
.plan-link {
  color: var(--brand, #1BAA6E);
  font-size: 11.5px;
  text-decoration: none;
  margin-left: auto;
}
.plan-link:hover { text-decoration: underline; }
.plan-hitl-reason {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}


/* ─── Visual + Video approval review block (Phase G UX 2026-05-06) ── */
.asset-script-ref {
  margin: 0 0 14px 0;
  padding: 10px 12px;
  background: rgba(123,182,255,0.06);
  border: 1px solid rgba(123,182,255,0.25);
  border-radius: 6px;
}
.asset-script-ref-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.asset-script-ref-meta { font-size: 11px; }
.asset-script-ref-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  color: var(--text-dim);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.asset-script-ref-toggle:hover { color: var(--text); }
.asset-script-ref-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}
.asset-script-ref.collapsed .asset-script-ref-body { display: none; }

.asset-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.asset-chip-row-channels { margin-top: 4px; }
.asset-chip {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.asset-chip-aspect { color: var(--text); }
.asset-chip-aspect.a-16x9 { background: rgba(123,182,255,0.10); border-color: rgba(123,182,255,0.35); }
.asset-chip-aspect.a-9x16 { background: rgba(45,214,140,0.10); border-color: rgba(45,214,140,0.35); }
.asset-chip-aspect.a-1x1  { background: rgba(239,176,77,0.10); border-color: rgba(239,176,77,0.35); }
.asset-chip-tool { background: rgba(255,255,255,0.08); }
.asset-chip-cost { color: var(--text); }
.asset-chip-channel { background: rgba(27,170,110,0.12); border-color: rgba(27,170,110,0.4); color: var(--brand, #1BAA6E); }


/* ─── Mentor anchor chip on script variant header (2026-05-06) ──── */
.sv-anchor-pill {
  background: rgba(123, 92, 255, 0.14);
  color: #b18bff;
  border: 1px solid rgba(123, 92, 255, 0.42);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
}
/* Family colourways — copywriting masters cluster green, persuasion lever masters
 * cluster purple, headline-first masters cluster amber, voice-of-customer
 * cluster blue. The list is small enough that a switch is fine. */
.sv-anchor-pill.sv-anchor-ogilvy   { background: rgba(45,214,140,0.12); color: #2DD68C; border-color: rgba(45,214,140,0.40); }
.sv-anchor-pill.sv-anchor-schwartz { background: rgba(45,214,140,0.12); color: #2DD68C; border-color: rgba(45,214,140,0.40); }
.sv-anchor-pill.sv-anchor-sugarman { background: rgba(45,214,140,0.12); color: #2DD68C; border-color: rgba(45,214,140,0.40); }
.sv-anchor-pill.sv-anchor-cialdini { background: rgba(177,139,255,0.14); color: #b18bff; border-color: rgba(177,139,255,0.42); }
.sv-anchor-pill.sv-anchor-halbert  { background: rgba(239,176,77,0.14); color: #efb04d; border-color: rgba(239,176,77,0.42); }
.sv-anchor-pill.sv-anchor-wiebe    { background: rgba(123,182,255,0.14); color: #7BB6FF; border-color: rgba(123,182,255,0.42); }

/* ── Lightbox workspace (2026-05-16) ───────────────────────────────────── */
.lightbox .lb-workspace {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lightbox .lb-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lightbox .lb-status {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.lightbox .lb-status-active {
  background: var(--bg-2);
  color: var(--text-mute);
  border: 1px solid var(--line-strong);
}
.lightbox .lb-status-approved {
  background: rgba(34, 197, 94, 0.15);
  color: rgb(74, 222, 128);
  border: 1px solid rgb(34, 197, 94);
}
.lightbox .lb-status-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(248, 113, 113);
  border: 1px solid rgb(239, 68, 68);
}
.lightbox .lb-status-superseded {
  background: rgba(148, 163, 184, 0.15);
  color: rgb(148, 163, 184);
  border: 1px solid rgb(148, 163, 184);
}
.lightbox .lb-actions {
  display: flex;
  gap: 8px;
}
.lightbox .lb-actions .btn {
  flex: 1;
  justify-content: center;
}
.lightbox .btn-approve {
  background: rgb(34, 197, 94);
  color: #fff;
  border-color: rgb(34, 197, 94);
}
.lightbox .btn-approve:hover:not(:disabled) {
  background: rgb(22, 163, 74);
  border-color: rgb(22, 163, 74);
}
.lightbox .btn-reject {
  background: rgb(239, 68, 68);
  color: #fff;
  border-color: rgb(239, 68, 68);
}
.lightbox .btn-reject:hover:not(:disabled) {
  background: rgb(220, 38, 38);
  border-color: rgb(220, 38, 38);
}
.lightbox .lb-instruction-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 64px;
  box-sizing: border-box;
}
.lightbox .lb-instruction-input:focus {
  border-color: var(--brand-edge, #6366f1);
  outline: none;
}
.lightbox .lb-past-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 2px;
}
.lightbox .lb-past-item {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}
.lightbox .lb-past-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.lightbox .lb-past-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-mute);
}
.lightbox .lb-past-status {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
