/* Creative OS — Praxis brand
   Ink #1D1D1B, Paper #F3F1EC, Lime #EFFD6B (accents on Ink only, never on light).
   Bricolage Grotesque for display and text, Fragment Mono for labels and data.
   Layout and behavior are unchanged from Ads OS; only the brand layer moved. */

:root {
  --canvas: #F3F1EC;     /* Paper */
  --card: #FBFAF7;
  --ink: #1D1D1B;        /* Ink */
  --ink-2: #6B6A64;      /* Mute */
  --ink-3: #8F8D85;
  --line: #DCD8CE;       /* Line */
  --line-2: #D0CCC1;
  --fog: #E9E6DE;        /* Fog */
  --lime: #EFFD6B;       /* Lime */
  --fb: #1D1D1B;         /* interaction color: Ink */
  --fb-hover: #000000;
  --fb-tint: #E9E6DE;
  --danger: #E41E3F;
  --ok: #31A24C;
  --ig-gradient: linear-gradient(135deg, #1D1D1B 0%, #1D1D1B 100%);
  --shadow-1: 0 1px 2px rgba(29,29,27,.10);
  --shadow-2: 0 2px 12px rgba(29,29,27,.14);
  --radius: 8px;
  --font-ui: 'Bricolage Grotesque', -apple-system, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, Menlo, monospace;
  --font-feed: Helvetica Neue, Helvetica, Arial, sans-serif;
  --topbar-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
}
.hidden { display: none !important; }
code { background: var(--canvas); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ============ app shell: left nav + views ============ */
.app { display: flex; height: 100vh; }
.sidenav {
  width: 176px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
  padding: 12px 10px; position: relative; z-index: 25;
}
.sidenav .brand { padding: 0 4px; }
.sidenav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--ink-2);
  border-radius: 8px; padding: 9px 10px;
  display: flex; align-items: center; gap: 9px;
  transition: background .12s;
}
.nav-item:hover { background: var(--canvas); }
.nav-item.active { background: var(--fb-tint); color: var(--fb); }
.nav-ico { font-size: 16px; width: 20px; text-align: center; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ============ top bar ============ */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  box-shadow: var(--shadow-1);
  display: flex; align-items: center; gap: 20px;
  padding: 0 16px;
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ig-gradient);
  color: #fff; font-weight: 800; font-size: 17px;
  display: grid; place-items: center;
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }

.status-tabs { display: flex; gap: 2px; height: 100%; }
.status-tab {
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  color: var(--ink-2); padding: 0 14px; position: relative;
  border-radius: 8px 8px 0 0;
  transition: background .12s;
}
.status-tab:hover { background: var(--canvas); }
.status-tab.active { color: var(--fb); }
.status-tab.active::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 0;
  height: 3px; border-radius: 2px 2px 0 0; background: var(--fb);
}
.status-tab.tab-final.active { color: #D62976; }
.status-tab.tab-final.active::after { background: var(--ig-gradient); }
.count {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  background: var(--canvas); border-radius: 10px; padding: 1px 7px; margin-left: 3px;
}
.status-tab.active .count { background: var(--fb-tint); color: var(--fb); }
.status-tab.tab-final.active .count { color: #D62976; background: #FDEFF5; }
.status-tab.tab-existing { margin-left: 10px; border-left: 1px solid var(--line); border-radius: 0 8px 0 0; }
.status-tab.tab-existing.active { color: #16A38A; }
.status-tab.tab-existing.active::after { background: #16A38A; }
.status-tab.tab-existing.active .count { color: #16A38A; background: #E4F5F1; }
.status-tab.tab-upload.active { color: #1E8E5A; }
.status-tab.tab-upload.active::after { background: #1E8E5A; }
.status-tab.tab-upload.active .count { color: #1E8E5A; background: #E6F6EE; }
.status-tab.tab-live.active { color: #C2410C; }
.status-tab.tab-live.active::after { background: #C2410C; }
.status-tab.tab-live.active .count { color: #C2410C; background: #FFEDD5; }
.status-tab.tab-deferred.active { color: #B7791F; }
.status-tab.tab-deferred.active::after { background: #B7791F; }
.status-tab.tab-deferred.active .count { color: #B7791F; background: #FBF3E0; }
.existing-card .chip.campaign { background: #E4F5F1; color: #16A38A; }
.status-tab.drag-over { background: var(--fb-tint); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  border: 0; background: var(--canvas); border-radius: 18px;
  height: 36px; padding: 0 16px; width: 250px;
  font-family: var(--font-ui); font-size: 14px; color: var(--ink);
  outline: none;
}
.search:focus { box-shadow: 0 0 0 2px var(--fb-tint); }
.spent { font-weight: 700; color: var(--ink-2); font-size: 13px; white-space: nowrap; }

/* ============ buttons / inputs ============ */
.btn {
  border: 0; cursor: pointer; font-family: var(--font-ui);
  background: var(--fb); color: #fff; font-weight: 700; font-size: 14px;
  border-radius: 7px; padding: 9px 16px;
  transition: background .12s, transform .06s;
}
.btn:hover { background: var(--fb-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.ghost { background: var(--canvas); color: var(--ink); }
.btn.ghost:hover { background: var(--line); }
.btn.alt { background: var(--fb-tint); color: var(--fb); }
.btn.alt:hover { background: #E2DED4; }
.btn.danger { background: #FDECEF; color: var(--danger); }
.btn.danger:hover { background: #FADBE1; }
.btn.generate {
  width: 100%; padding: 11px; font-size: 15px;
  background: var(--ig-gradient); background-size: 160% 160%;
  transition: background-position .35s, transform .06s;
}
.btn.generate:hover { background-position: 90% 50%; }

.select {
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--card);
  height: 34px; padding: 0 8px; outline: none; max-width: 100%;
}
.select.slim { height: 30px; font-size: 12px; }
.icon-btn {
  border: 1px solid var(--line-2); background: var(--card); border-radius: 7px;
  width: 34px; height: 34px; cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: var(--canvas); }

textarea, input[type="text"], input[type="search"] { font-family: var(--font-ui); }
textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink);
  resize: vertical; outline: none; background: var(--card);
}
textarea:focus, input[type="text"]:focus { border-color: var(--fb); box-shadow: 0 0 0 2px var(--fb-tint); }
input[type="text"] {
  border: 1px solid var(--line-2); border-radius: 7px; height: 34px;
  padding: 0 10px; font-size: 13.5px; outline: none; width: 100%;
}

.row { display: flex; align-items: center; }
.row.gap { gap: 8px; margin-top: 8px; }
.grow { flex: 1; min-width: 0; }

/* segmented controls */
.seg { display: flex; background: var(--canvas); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: none; cursor: pointer; flex: 1;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  border-radius: 6px; padding: 6px 8px;
}
.seg button.active { background: var(--card); color: var(--fb); box-shadow: var(--shadow-1); }
.seg button:disabled { opacity: .35; cursor: default; }
.seg.mini button { padding: 4px 8px; font-size: 11.5px; }
.seg-field { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.seg-field .seg { flex: 1; }
.seg-label { font-size: 12px; font-weight: 700; color: var(--ink-2); width: 58px; flex-shrink: 0; }

/* ============ layout ============ */
.layout { display: flex; flex: 1; min-height: 0; }

/* composer — retired: generations are driven through Claude, not the UI.
   Elements stay in the DOM (app.js binds to them); this only hides the panel. */
.composer {
  width: 320px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line);
  padding: 16px; overflow-y: auto;
  display: none; flex-direction: column; gap: 10px;
}
.composer-head h2 { font-size: 16px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.2px; }
.template-row { display: flex; gap: 6px; }
.template-row .select { flex: 1; min-width: 0; }

.style-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: #F7F5F0; }
.style-block summary { font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; user-select: none; }
.style-block textarea { margin-top: 8px; font-size: 12.5px; }

.batch-toggle { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.field-grid { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.field-grid label, .text-field { font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.field-grid .select { width: 100%; }
.text-field input { font-weight: 400; }

.ref-field { display: flex; align-items: center; gap: 10px; }
.ref-pick {
  flex: 1; border: 1px dashed var(--line-2); background: none; border-radius: 7px;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-2); font-weight: 600;
  padding: 8px; cursor: pointer; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ref-pick:hover { border-color: var(--fb); color: var(--fb); }
.ref-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.status-line { font-size: 12.5px; color: var(--ink-2); min-height: 18px; line-height: 1.4; }
.status-line.err { color: var(--danger); font-weight: 600; }
.status-line.busy::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border: 2px solid var(--fb); border-top-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ gallery ============ */
.gallery-wrap { flex: 1; overflow-y: auto; padding: 18px 20px 80px; }
/* Row-first grid: newest reads left→right, top→bottom (was CSS columns,
   which filled each column top-to-bottom and scrambled the visual order). */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  align-items: start;
}

/* ---- Existing Ads: dense uniform grid with performance stats ---- */
.gallery.existing-grid {
  column-width: auto; column-gap: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 10px;
  align-items: start;
}
.ex-toolbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 8px; box-shadow: var(--shadow-1);
  padding: 8px 14px; margin-bottom: 2px;
}
.ex-total { font-size: 13px; color: var(--ink-2); }
.ex-total b { color: var(--ink); }
.ex-sort { font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.existing-card.compact { margin-bottom: 0; animation: none; }
.existing-card.compact .thumb {
  aspect-ratio: 1; overflow: hidden; background: var(--canvas);
}
.existing-card.compact .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.existing-card.compact .card-body { padding: 7px 9px 8px; }
.card-prompt.one-line {
  -webkit-line-clamp: 1; font-weight: 600; color: var(--ink); font-size: 11.5px;
}
.stat-row { display: flex; gap: 7px; align-items: baseline; margin-top: 4px; flex-wrap: wrap; }
.stat { font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.stat.spend { font-size: 13px; font-weight: 800; color: var(--ink); }
.stat.res { color: var(--ok); font-weight: 700; }
.stat.none { color: var(--ink-3); font-weight: 500; font-style: italic; }
.existing-card.compact .card-actions { margin-top: 6px; }
.existing-card.compact .chip { font-size: 9.5px; padding: 1px 6px; }
.existing-card.compact .mv { font-size: 10px; padding: 3px 6px; }
.card {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-1);
  break-inside: avoid; margin-bottom: 0; overflow: hidden;
  cursor: pointer; position: relative;
  animation: cardIn .25s ease both;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } }
.card img { width: 100%; display: block; background: var(--canvas); min-height: 120px; }
.card.is-final { outline: 2px solid transparent; border-radius: 10px;
  background-image: linear-gradient(var(--card), var(--card)), var(--ig-gradient);
  background-origin: border-box; background-clip: padding-box, border-box;
  border: 2px solid transparent; }

.card-check {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 20px; height: 20px; accent-color: var(--fb);
  opacity: 0; transition: opacity .12s; cursor: pointer;
}
.card:hover .card-check, .card-check:checked { opacity: 1; }

.card-body { padding: 8px 10px 10px; }
.card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.chip {
  font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 2px 7px;
  background: var(--canvas); color: var(--ink-2); white-space: nowrap;
}
.chip.campaign { background: var(--fb-tint); color: var(--fb); }
.chip.status-for-review { background: #E7F0FF; color: #1E5BB8; }
.chip.status-awaiting-approval { background: #FFF4E0; color: #B25E09; }
.chip.status-final { background: #FDEFF5; color: #D62976; }
.chip.status-upload { background: #E6F6EE; color: #1E8E5A; }
.chip.status-live { background: #FFEDD5; color: #C2410C; }
.mv-stage { font: inherit; font-size: 11px; padding: 3px 4px; border: 1px solid var(--line, #ddd); border-radius: 6px; background: #fff; color: inherit; cursor: pointer; max-width: 120px; }
.mv-stage:hover { border-color: var(--fb, #1877F2); }
.mv.mv-fwd { font-weight: 700; padding: 3px 9px; color: #1E8E5A; border-color: #9BD8BB; }
.mv.mv-fwd:hover { background: #E6F6EE; }
.mv.mv-arch { color: #8A8A8A; }
.mv.mv-arch:hover { background: #F2F2F2; color: #444; }
.status-btn.fwd { border-style: dashed; font-weight: 600; }
.chip.status-archive { background: var(--canvas); color: var(--ink-3); }
.chip.cost { margin-left: auto; background: none; }
.card-prompt {
  font-size: 12px; color: var(--ink-2); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-actions { display: flex; gap: 4px; margin-top: 8px; align-items: center; }
.pill {
  border: 0; cursor: pointer; font-family: var(--font-ui);
  font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 4px 8px;
  background: var(--canvas); color: var(--ink-3);
}
.pill.current { background: var(--ink); color: #fff; cursor: default; }
.pill.has { background: var(--fb-tint); color: var(--fb); }
.pill.has:hover { background: #E2DED4; }
.pill.none:hover { background: var(--line); color: var(--ink); }
.card-move { margin-left: auto; display: flex; gap: 4px; }
.mv {
  border: 0; cursor: pointer; background: var(--canvas); border-radius: 6px;
  font-size: 11px; padding: 4px 7px; color: var(--ink-2); font-weight: 700; font-family: var(--font-ui);
}
.mv:hover { background: var(--fb-tint); color: var(--fb); }
.mv.mv-final:hover { background: #FDEFF5; color: #D62976; }

.empty { text-align: center; margin-top: 12vh; color: var(--ink-3); }
.empty-mark {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  background: var(--ig-gradient); color: #fff; font-size: 28px;
  display: grid; place-items: center; opacity: .85;
}

/* compare bar */
.compare-bar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 24px;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 18px;
  box-shadow: var(--shadow-2); z-index: 30; font-weight: 600; font-size: 13px;
  animation: cardIn .2s ease both;
}
.compare-bar .btn.ghost { background: rgba(255,255,255,.14); color: #fff; }

/* ============ modals ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(244,244,244,.85);
  backdrop-filter: blur(2px);
  z-index: 40; display: grid; place-items: center;
  animation: fadeIn .15s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-2);
  position: relative; max-height: 92vh; overflow: hidden;
  animation: popIn .18s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.96); } }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--canvas); color: var(--ink-2); font-size: 20px; cursor: pointer;
}
.modal-close:hover { background: var(--line); }
.modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--card); box-shadow: var(--shadow-2);
  font-size: 22px; color: var(--ink-2); cursor: pointer;
}
.modal-nav.prev { left: 12px; } .modal-nav.next { right: 452px; }
.modal-nav:hover { color: var(--fb); }

.modal.detail { width: min(1200px, 96vw); height: min(860px, 92vh); display: flex; }
.detail-left {
  flex: 1; background: var(--canvas); display: flex; flex-direction: column;
  align-items: center; padding: 16px; gap: 12px; min-width: 0;
}
.view-toggle { display: flex; background: var(--card); border-radius: 9px; padding: 3px; gap: 2px; box-shadow: var(--shadow-1); }
.view-toggle button {
  border: 0; background: none; cursor: pointer; font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); border-radius: 7px; padding: 6px 14px;
}
.view-toggle button.active { background: var(--fb); color: #fff; }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; width: 100%; overflow-y: auto; }
.stage > img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-1); object-fit: contain; }

.detail-right {
  width: 440px; flex-shrink: 0; overflow-y: auto; padding: 18px 18px 24px;
  display: flex; flex-direction: column; gap: 16px;
  border-left: 1px solid var(--line);
}
.detail-right section h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-2); margin-bottom: 8px; }
.detail-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.status-btn {
  border: 1px solid var(--line-2); background: var(--card); cursor: pointer;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  border-radius: 16px; padding: 6px 13px;
}
.status-btn:hover { border-color: var(--fb); color: var(--fb); }
.status-btn.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.status-btn.current.final-cur { background: var(--ig-gradient); border-color: transparent; }
.sibs { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.sibs .lab { font-size: 11px; font-weight: 700; color: var(--ink-3); margin-right: 2px; }

.copy-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.copy-field textarea, .copy-field input { font-weight: 400; }
.save-flash { color: var(--ok); font-weight: 700; font-size: 12.5px; margin-left: 8px; }

.meta-table { font-size: 12px; color: var(--ink-2); background: #F7F5F0; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.meta-table div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.meta-table b { color: var(--ink); font-weight: 600; text-align: right; word-break: break-all; }
.meta-table a { color: var(--fb); text-decoration: none; font-weight: 700; }
.detail-danger { margin-top: auto; justify-content: space-between; }

/* compare modal */
.modal.compare { width: min(1300px, 96vw); padding: 40px 20px 20px; }
.compare-grid { display: grid; gap: 12px; max-height: 84vh; }
.compare-grid.cols-1 { grid-template-columns: 1fr; justify-items: center; }
.compare-cell.lightbox img { max-height: 82vh; width: auto; max-width: 100%; }
.compare-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.compare-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.compare-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.compare-cell img { width: 100%; border-radius: 8px; }
.compare-cell figcaption { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; text-align: center; }

/* reference picker */
.modal.refpick { width: min(900px, 94vw); padding: 20px; }
.modal.refpick h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.hint { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.ref-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; max-height: 60vh; overflow-y: auto;
}
.ref-cell { cursor: pointer; border-radius: 8px; overflow: hidden; position: relative; border: 2px solid transparent; }
.ref-cell:hover { border-color: var(--fb); }
.ref-cell img { width: 100%; height: 110px; object-fit: cover; display: block; }
.ref-cell span {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); padding: 14px 6px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ref-none { grid-column: 1 / -1; }

/* template modal */
.modal.tpl { width: min(440px, 92vw); padding: 20px; }
.modal.tpl h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }

/* ============ feed previews (authentic FB/IG anatomy, Helvetica) ============ */
.feed-frame { width: 400px; max-width: 100%; font-family: var(--font-feed); background: #fff; border-radius: 8px; box-shadow: var(--shadow-2); overflow: hidden; text-align: left; }
.feed-frame img.creative { width: 100%; display: block; }

/* facebook */
.fb-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #16A38A, #1877F2);
  color: #fff; font-weight: 700; font-size: 17px; display: grid; place-items: center;
  font-family: var(--font-feed);
}
.fb-page { font-size: 14.5px; font-weight: 600; color: #1D1D1B; line-height: 1.2; }
.fb-sponsored { font-size: 12.5px; color: #6B6A64; }
.fb-dots { margin-left: auto; color: #6B6A64; font-size: 18px; letter-spacing: 1px; }
.fb-primary { padding: 8px 12px 10px; font-size: 14.5px; color: #1D1D1B; line-height: 1.35; white-space: pre-wrap; }
.fb-primary .see-more { color: #6B6A64; font-weight: 600; }
.fb-linkbar { background: #F3F1EC; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.fb-linkmeta { min-width: 0; flex: 1; }
.fb-domain { font-size: 12px; color: #6B6A64; text-transform: uppercase; }
.fb-headline { font-size: 15px; font-weight: 600; color: #1D1D1B; line-height: 1.25; }
.fb-desc { font-size: 13px; color: #6B6A64; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-cta {
  flex-shrink: 0; background: #E4E6EB; border-radius: 6px; border: 0;
  font-family: var(--font-feed); font-size: 14px; font-weight: 600; color: #1D1D1B;
  padding: 8px 14px; white-space: nowrap;
}
.fb-social { display: flex; justify-content: space-around; border-top: 1px solid #E4E6EB; margin: 0 12px; padding: 4px 0; }
.fb-social span { font-size: 14px; color: #6B6A64; font-weight: 600; padding: 6px 10px; }

/* instagram */
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-avatar-ring { padding: 2px; border-radius: 50%; background: var(--ig-gradient); }
.ig-avatar-ring .avatar { width: 34px; height: 34px; border: 2px solid #fff; font-size: 14px; }
.ig-name { font-size: 13.5px; font-weight: 600; color: #1D1D1B; line-height: 1.2; }
.ig-sponsored { font-size: 11.5px; color: #6B6A64; }
.ig-cta {
  display: flex; justify-content: space-between; align-items: center;
  background: #0095F6; color: #fff; font-size: 14px; font-weight: 600;
  padding: 11px 14px;
}
.ig-icons { display: flex; gap: 14px; padding: 10px 12px 6px; font-size: 20px; }
.ig-icons .save { margin-left: auto; }
.ig-likes { padding: 0 12px; font-size: 13.5px; font-weight: 600; }
.ig-caption { padding: 4px 12px 14px; font-size: 13.5px; line-height: 1.35; color: #1D1D1B; }
.ig-caption b { font-weight: 600; }
.ig-caption .see-more { color: #8F8D85; }

/* ============ testimonials view ============ */
.view-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.t-count { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.topbar-right .btn.ghost.small { text-decoration: none; display: inline-flex; align-items: center; }

.t-catbar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 20px 0; background: var(--canvas);
}
.cat-chip {
  border: 0; cursor: pointer; font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  background: var(--card); border-radius: 16px; padding: 6px 12px;
  box-shadow: var(--shadow-1); transition: background .12s;
}
.cat-chip:hover { background: var(--fb-tint); color: var(--fb); }
.cat-chip.active { background: var(--fb); color: #fff; }
.cat-chip .n { font-weight: 700; opacity: .6; margin-left: 4px; font-size: 11px; }

.t-wrap { padding-top: 14px; }
.t-grid { column-width: 320px; column-gap: 14px; }
.t-card {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-1);
  break-inside: avoid; margin-bottom: 14px; padding: 14px 16px;
  animation: cardIn .25s ease both;
}
.t-quote {
  font-size: 13.5px; line-height: 1.5; color: var(--ink); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}
.t-card.expanded .t-quote { display: block; -webkit-line-clamp: unset; }
.t-more {
  border: 0; background: none; cursor: pointer; padding: 0; margin-top: 4px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--fb);
}
.t-who { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.t-who b { color: var(--ink); font-weight: 700; }
.t-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; align-items: center; }
.chip.t-cat { background: var(--fb-tint); color: var(--fb); }
.chip.t-prog { background: #E4F5F1; color: #16A38A; }
.t-copy {
  margin-left: auto; border: 0; cursor: pointer; font-family: var(--font-ui);
  font-size: 11px; font-weight: 800; border-radius: 6px; padding: 4px 9px;
  background: var(--canvas); color: var(--ink-2);
}
.t-copy:hover { background: var(--fb-tint); color: var(--fb); }
.t-copy.done { background: #E4F5F1; color: var(--ok); }

/* ---- testimonial marketing-analysis layouts ---- */
.t-layoutseg { flex: 0 0 auto; }
.t-layoutseg button { padding: 6px 14px; }

.score {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 24px; padding: 0 6px; border-radius: 12px;
  font-size: 12.5px; font-weight: 800;
}
.score.s-fire { background: var(--ig-gradient); color: #fff; }
.score.s-hot { background: #E4F5F1; color: #16A38A; }
.score.s-ok { background: var(--fb-tint); color: var(--fb); }
.score.s-low { background: var(--canvas); color: var(--ink-3); }
.score.s-none { background: var(--canvas); color: var(--ink-3); }

b.hl { font-weight: 700; background: #FFF4D6; border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.t-dim { color: var(--ink-3); font-weight: 400; }
.t-analysis { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); background: #F7F5F0; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
.chip.t-pain { background: #F3EBFB; color: #962FBF; }
.t-fulltext { font-size: 13.5px; line-height: 1.55; white-space: pre-line; }

/* layout 1 — ranked table */
.t-tablewrap { background: var(--card); border-radius: 10px; box-shadow: var(--shadow-1); overflow: hidden; }
.t-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.t-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card); z-index: 2;
}
.t-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.t-row { cursor: pointer; }
tr.t-row:hover td { background: #F7F5F0; }
.td-rank { color: var(--ink-3); font-weight: 700; width: 72px; white-space: nowrap; }
.t-grab { cursor: grab; user-select: none; }
.t-grab:active { cursor: grabbing; }
tr.t-dragging td { opacity: 0.4; }
tr.t-drop-above td { border-top: 2px solid var(--fb); }
tr.t-drop-below td { border-bottom: 2px solid var(--fb); }
.td-line { line-height: 1.45; max-width: 520px; }
.td-who { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; min-width: 150px; }
.td-who b { color: var(--ink); }
.td-pains { min-width: 140px; }
.td-pains .chip { margin: 0 3px 3px 0; display: inline-block; }
.td-act { width: 60px; }
tr[data-xidx] td { background: #F7F5F0; padding: 14px 18px 16px 58px; }

/* inline full-quote expansion (click any row/card/item) */
.q-card, .t-card, .pain-item { cursor: pointer; }
.t-open { font-size: 12px; font-weight: 700; color: var(--fb); margin-left: auto; white-space: nowrap; }
.t-full { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }

/* layout 2 — top quotes */
.t-quotegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.q-card { background: var(--card); border-radius: 10px; box-shadow: var(--shadow-1); padding: 14px 16px; animation: cardIn .25s ease both; }
.q-card.q-fire {
  background-image: linear-gradient(var(--card), var(--card)), var(--ig-gradient);
  background-origin: border-box; background-clip: padding-box, border-box;
  border: 2px solid transparent;
}
.q-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.q-line { font-size: 15.5px; line-height: 1.45; font-weight: 600; letter-spacing: -.1px; }
.q-card .t-who { margin-top: 8px; }
.q-card .t-fulltext { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }

/* layout 3 — pain-point map */
.t-painlist { max-width: 900px; }
.pain-group { margin-bottom: 22px; }
.pain-head {
  font-size: 15px; font-weight: 800; letter-spacing: -.2px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.pain-head .n { font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--card); border-radius: 10px; padding: 2px 8px; box-shadow: var(--shadow-1); }
.pain-items { background: var(--card); border-radius: 10px; box-shadow: var(--shadow-1); overflow: hidden; }
.pain-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.pain-item:last-child { border-bottom: 0; }
.pain-item .score { flex-shrink: 0; margin-top: 1px; }
.pain-body { flex: 1; min-width: 0; }
.pain-line { font-size: 13.5px; line-height: 1.45; }
.pain-item .t-who { margin-top: 4px; }
.pain-item .t-copy { flex-shrink: 0; }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

@media (max-width: 980px) {
  .composer { display: none; }
  .modal.detail { flex-direction: column; }
  .detail-right { width: 100%; }
  .modal-nav.next { right: 12px; }
}

/* ============ dashboard view ============ */
.dash-wrap { overflow-y: auto; padding: 16px; }
.dash { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.d-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.d-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-1); }
.d-tile .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.d-tile .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.d-tile .n { font-size: 11.5px; color: var(--ink-3); }
.d-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; box-shadow: var(--shadow-1); }
.d-card h2 { font-size: 15px; font-weight: 800; letter-spacing: -.2px; margin-bottom: 2px; }
.d-note { font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.d-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .d-grid2 { grid-template-columns: 1fr; } }
.d-grid { stroke: #F3F1EC; stroke-width: 1; }
.d-axis { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font-ui); }
.d-bar { cursor: pointer; }
.d-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.d-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.d-hrow { display: grid; grid-template-columns: 240px 1fr 90px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); cursor: default; }
.d-hrow:last-child { border-bottom: 0; }
.d-hlab b { display: block; font-size: 13px; }
.d-hlab span { font-size: 11px; color: var(--ink-3); }
.d-htrack { background: #F3F1EC; border-radius: 4px; height: 14px; }
.d-hfill { background: var(--fb); height: 100%; border-radius: 4px; }
.d-hval { font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.d-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.d-table th, .d-table td { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); }
.d-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.d-table .num { text-align: right; }
.d-src { font-size: 11px; color: var(--ink-3); }
.d-tip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; opacity: 0; transition: opacity .1s; white-space: nowrap; z-index: 99; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .d-hrow { grid-template-columns: 1fr; gap: 3px; } .d-hval { text-align: left; } }
.ex-note { color: var(--ink-3); font-weight: 500; }
.ex-controls { display: flex; align-items: center; gap: 12px; }

/* ============ creative analysis view ============ */
.ca-chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #F3F1EC; color: var(--ink-2); margin: 2px 3px 0 0; }
.ca-chip.ang { background: var(--fb-tint); color: var(--fb); }
.ca-chip.gap { background: #FDECEF; color: var(--danger); }
.ca-chipbox { display: flex; flex-wrap: wrap; gap: 4px; }
.ca-angle-row { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ca-angle-row:hover { background: #F7F5F0; }
.ca-angle-row:last-child { border-bottom: 0; }
.ca-angle-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.ca-angle-head span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ca-thumbrow { display: flex; gap: 6px; overflow-x: auto; }
.ca-thumbrow img { height: 84px; border-radius: 6px; border: 1px solid var(--line); }
.ca-browse-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.ca-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ca-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--card); transition: box-shadow .12s; }
.ca-card:hover { box-shadow: var(--shadow-2); }
.ca-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #F3F1EC; }
.ca-card-body { padding: 8px 10px 10px; }
.ca-hook { font-size: 12px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ca-chiprow { margin: 4px 0 2px; }
.ca-spend { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ============ competitors ============ */
/* Category accents: high-ticket amber, non-sales-info blue, static-inspo green */
.comp-seg {
  display: flex; align-self: center; gap: 3px;
  background: var(--canvas); border-radius: 12px; padding: 3px;
}
.comp-seg-btn {
  border: 0; cursor: pointer; font-family: var(--font-ui);
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  background: transparent; border-radius: 9px; padding: 7px 16px;
  transition: background .12s, color .12s, box-shadow .12s;
}
.comp-seg-btn:hover { color: var(--ink); }
.comp-seg-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.comp-seg-btn .seg-n {
  font-size: 11px; font-weight: 800; color: var(--ink-3);
  background: var(--canvas); border-radius: 10px; padding: 1px 7px; margin-left: 4px;
}
.comp-seg-btn.active .seg-n { background: var(--fb-tint); color: var(--fb); }
.cat-chip-cat { box-shadow: inset 0 0 0 1.5px var(--line-2); }

.comp-tablewrap { overflow-x: auto; }
.comp-table td { vertical-align: top; }
.comp-table .td-brand b { display: block; font-size: 13.5px; letter-spacing: -.1px; white-space: nowrap; }
.comp-sitelink { font-size: 11.5px; color: var(--ink-3); text-decoration: none; }
.comp-sitelink:hover { color: var(--fb); }
.comp-table .td-thumbs { white-space: nowrap; }
.comp-rowthumb {
  width: 44px; height: 58px; object-fit: cover; border-radius: 5px;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18);
  margin-right: 4px; vertical-align: middle; cursor: zoom-in;
  transition: transform .12s ease;
}
.comp-rowthumb:hover { transform: scale(2.6); position: relative; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.comp-nothumb { color: var(--ink-3); font-size: 12px; }
.comp-table .td-cat { white-space: nowrap; }
.chip.c-cat { font-weight: 800; }
.chip.c-cat.cc-high-ticket { background: #FFF4E0; color: #B25E09; }
.chip.c-cat.cc-info { background: var(--fb-tint); color: var(--fb); }
.chip.c-cat.cc-static-inspo { background: #E4F5F1; color: #16A38A; }
.comp-table .td-stat { white-space: nowrap; }
.comp-stat-n {
  font-family: var(--font-ui); font-size: 17px; font-weight: 800;
  color: var(--ink); letter-spacing: -.3px; font-variant-numeric: tabular-nums;
}
.comp-stat-when { display: block; font-size: 10px; color: var(--ink-3); }
.comp-stat-none { color: var(--ink-3); }
.comp-nopid { display: block; font-size: 10.5px; color: var(--ink-3); }
.comp-snap { margin-left: 4px; }
.comp-snap.busy { opacity: .55; cursor: wait; }
.comp-table .td-strengths { max-width: 190px; }
.comp-table .td-strengths .chip { margin: 0 3px 3px 0; display: inline-block; }
.comp-table .td-why { line-height: 1.45; max-width: 420px; min-width: 240px; font-size: 12.5px; }
.comp-notes-line { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.comp-table .td-links { white-space: nowrap; text-align: right; }
.comp-link {
  font-size: 12px; font-weight: 700; color: var(--fb); text-decoration: none;
  margin-left: 10px; border: 0; background: none; cursor: pointer; font-family: var(--font-ui); padding: 0;
}
.comp-link:hover { text-decoration: underline; }
.comp-del {
  width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--canvas); color: var(--ink-3); font-size: 14px; line-height: 1;
  margin-left: 10px; opacity: 0; transition: opacity .12s, background .12s, color .12s;
  vertical-align: middle;
}
tr.comp-row:hover .comp-del { opacity: 1; }
.comp-del:hover { background: #FDECEF; color: #D6293A; }
.chip.c-vertical { background: #F3EBFB; color: #962FBF; }
.chip.c-strength { background: var(--fb-tint); color: var(--fb); }
.chip.c-status { border: 0; cursor: pointer; font-family: var(--font-ui); font-weight: 700; }
.chip.c-status.s-not-pulled { background: var(--canvas); color: var(--ink-3); }
.chip.c-status.s-swiped { background: #FFF4E0; color: #B25E09; }
.chip.c-status.s-analyzed { background: #E4F5F1; color: #16A38A; }
#compModal .field-grid { grid-template-columns: 1fr 1fr; }
#compModal .text-field textarea { font-weight: 400; font-family: var(--font-ui); }
#compModal .text-field .row { display: flex; gap: 8px; align-items: center; }
#compModal .text-field .row .grow { flex: 1; }
#compResolveHint { font-size: 12px; color: var(--ink-2); margin: -6px 0 8px; }
tr.comp-row { cursor: grab; }
tr.comp-row:hover td { background: #F7F5F0; }
tr.comp-row.dragging { opacity: .45; cursor: grabbing; }
tr.comp-row.drag-over td { box-shadow: inset 0 2px 0 var(--fb); }

.comp-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 10px; padding: 10px 16px; z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: cardIn .2s ease both;
}
.comp-undo {
  border: 0; background: none; cursor: pointer; font-family: var(--font-ui);
  color: #6FB2FF; font-size: 13px; font-weight: 800; margin-left: 10px; padding: 0;
}
.comp-undo:hover { text-decoration: underline; }

/* creative analysis — report port */
.ca-scorehead { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; text-align: center; }
.ca-bignum .v { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--fb); }
.ca-bignum .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.ca-badge { display: inline-block; font-size: 10px; font-weight: 800; border: 1px solid; border-radius: 999px; padding: 1px 10px; margin-top: 4px; }
.ca-dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ca-dim { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: center; box-shadow: var(--shadow-1); }
.ca-dim .v { font-size: 22px; font-weight: 800; }
.ca-dim .k { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--ink-2); margin: 2px 0 6px; }
.ca-dimbar { height: 4px; background: #F3F1EC; border-radius: 2px; }
.ca-dimbar i { display: block; height: 100%; border-radius: 2px; }
.ca-insight { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ca-insight:last-child { border-bottom: 0; }
.ca-swim { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.ca-lane { flex: 1 1 0; min-width: 150px; border: 1px solid var(--line); border-radius: var(--radius); background: #F7F5F0; display: flex; flex-direction: column; }
.ca-lane.gap { background: #FDF5F6; border: 1px dashed #F3C1CB; }
.ca-lane-head { padding: 8px 10px 2px; text-align: center; font-size: 12.5px; }
.ca-lane-head span { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
.ca-lane-body { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; justify-content: center; padding: 8px; min-height: 74px; align-items: center; }
.ca-gap-pill { font-size: 10px; font-weight: 800; color: var(--danger); background: #FDECEF; border-radius: 6px; padding: 3px 10px; }
.ca-sw-ad { position: relative; cursor: pointer; }
.ca-sw-ad img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 2px solid var(--fb-tint); display: block; }
.ca-varbadge { position: absolute; top: -5px; right: -5px; background: var(--fb); color: #fff; font-size: 9px; font-weight: 800; border-radius: 999px; padding: 1px 5px; }
.ca-more { font-size: 11px; font-weight: 700; color: var(--ink-2); background: #F3F1EC; border-radius: 6px; padding: 4px 7px; }
.ca-lane-foot { text-align: center; font-size: 10.5px; color: var(--ink-3); padding: 4px 8px 8px; font-variant-numeric: tabular-nums; }
.ca-cl-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ca-cl-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.ca-cl-info { flex: 1; min-width: 0; }
.ca-cl-info b { font-size: 13px; display: block; }
.ca-cl-info span { font-size: 11px; color: var(--ink-2); display: block; }
.ca-cl-imgtext { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.ca-cl-spend { font-size: 13px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ca-cl-spend small { font-weight: 500; color: var(--ink-2); }
.ca-cluster { cursor: pointer; }
.ca-cluster .ca-variations { display: none; gap: 6px; flex-wrap: wrap; padding: 8px 0 10px 64px; border-bottom: 1px solid var(--line); }
.ca-cluster.open .ca-variations { display: flex; }
.ca-fw-row { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ca-fw-row:last-child { border-bottom: 0; }
.ca-fw-head { display: flex; justify-content: space-between; font-size: 12.5px; }
.ca-fw-head span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ca-fw-bar { height: 5px; background: #F3F1EC; border-radius: 3px; margin: 4px 0 2px; }
.ca-fw-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.ca-fw-desc { font-size: 10.5px; color: var(--ink-3); }
.ca-using h2, .ca-recadd h2 { display: flex; align-items: center; gap: 8px; }
.ca-count-pill { font-size: 10px; font-weight: 800; background: #E6F4EA; color: var(--ok); border-radius: 999px; padding: 2px 9px; }
.ca-count-pill.warn { background: #FEF3E2; color: #d97706; }
.ca-rec { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px dashed #F3C1CB; background: #FDF9F9; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; font-size: 12.5px; }
.ca-impact { font-size: 9.5px; font-weight: 800; color: var(--danger); background: #FDECEF; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
/* cost-per-result dashboard cards */
.d-cpr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.d-cpr-head h2 { display: flex; align-items: center; gap: 8px; }
.d-dot { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.d-cpr-now { text-align: right; flex-shrink: 0; }
.d-cpr-now .v { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.d-cpr-now .n { font-size: 11.5px; color: var(--ink-2); }
.d-pos { color: var(--ok); } .d-neg { color: var(--danger); }
.d-vlab { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font-ui); }
.d-striplab { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; margin: 10px 0 2px; }
@media (max-width: 1100px) { .d-cpr { grid-template-columns: 1fr; } }

/* ---- speakable ref badges (E# existing / D# drafts) ---- */
.ref-badge {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: var(--fb, #1877F2); color: #fff;
  font-size: 15px; font-weight: 800; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 8px; pointer-events: none;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  font-variant-numeric: tabular-nums;
}
.existing-card .thumb { position: relative; }

/* ---- ICP view ---- */
.icp { max-width: 1180px; margin: 0 auto; }
.icp-hero {
  border-radius: 16px; padding: 26px 30px; color: #fff; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.icp-blue   { background: linear-gradient(120deg, #1877F2, #0E5FCB 60%, #0A4FA8); }
.icp-purple { background: linear-gradient(120deg, #962FBF, #7A2BA8 55%, #D62976); }
.icp-amber  { background: linear-gradient(120deg, #B8860B, #9A6F09 60%, #7E5B07); }
.icp-hero-share { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.icp-hero-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; }
.icp-hero-gear { font-size: 14px; opacity: .92; }
.icp-hero-gear p { margin: 4px 0; }
.icp-hero-stakes { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.icp-stake {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; font-weight: 600;
}
.icp-howwesell {
  background: var(--card, #fff); border: 1px solid var(--line, #DADDE1);
  border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; font-size: 13.5px;
}
.icp-howwesell summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink, #1C1E21); }
.icp-howwesell[open] summary { margin-bottom: 8px; }
.icp-grid { column-count: 2; column-gap: 14px; }
@media (max-width: 1000px) { .icp-grid { column-count: 1; } }
.icp-card {
  background: var(--card, #fff); border: 1px solid var(--line, #DADDE1);
  border-radius: 12px; padding: 16px 20px 14px; margin-bottom: 14px;
  break-inside: avoid; font-size: 13.5px; line-height: 1.55; color: var(--ink, #1C1E21);
  border-top-width: 3px;
}
.icp-blue-b   { border-top-color: #1877F2; }
.icp-purple-b { border-top-color: #962FBF; }
.icp-amber-b  { border-top-color: #B8860B; }
.icp-card h3 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 8px; }
.icp-h4 {
  font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted, #6B6A64); margin: 14px 0 6px;
}
.icp-card p { margin: 7px 0; }
.icp-list { margin: 6px 0 6px 18px; padding: 0; }
.icp-list li { margin: 5px 0; }
.icp-vq {
  background: #FFF3CD; border-radius: 4px; padding: 0 4px;
  font-style: italic; color: #5C4400;
}
.icp-blue-b .icp-vq, .icp-hero .icp-vq { background: rgba(24, 119, 242, .09); color: #0A4FA8; }
.icp-purple-b .icp-vq { background: rgba(150, 47, 191, .09); color: #3A3A36; }
.icp-hero .icp-vq { background: rgba(255,255,255,.18); color: #fff; }
.icp-callout {
  margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--line, #DADDE1);
  background: var(--bg, #F3F1EC); border-radius: 0 8px 8px 0; font-size: 13px; color: var(--muted, #6B6A64);
}
.icp-card code { background: var(--bg, #F3F1EC); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.icp-empty { color: var(--muted, #6B6A64); padding: 40px; text-align: center; }

/* ---------- Program Comparison tab (Competitors view) ----------
   Ad-graphic treatment: lined notebook paper, B4C column as the raised hero,
   Caveat handwritten annotations. B4C brand palette, not Ads OS chrome. */
.comp-tablewrap:has(.cmp-paper) { background: transparent; box-shadow: none; overflow: visible; }
.cmp-paper {
  --c-ink: #2F0155; --c-purple: #9534F8; --c-coral: #E8654A; --c-green: #0E8A57;
  --c-tint: #F6EFFF; --c-line: rgba(47,1,85,.10);
  background:
    linear-gradient(90deg, rgba(232,101,74,.35) 0, rgba(232,101,74,.35) 2px, transparent 2px) 56px 0 / 100% 100% no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--c-line) 35px 36px),
    radial-gradient(700px 400px at 92% -5%, rgba(149,52,248,.10), transparent 60%),
    #FFFCF5;
  border-radius: 16px; padding: 42px 40px 36px; font-family: 'Poppins', 'Figtree', sans-serif;
  color: var(--c-ink); box-shadow: 0 24px 60px -30px rgba(47,1,85,.35);
}
.cmp-sheet { max-width: 1080px; margin: 0 auto; }
.cmp-kick { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c-purple); }
.cmp-h1 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; margin: 6px 0 4px; }
.cmp-hand, .cmp-note-hand { font-family: 'Caveat', cursive; }
.cmp-h1 .cmp-hand { color: var(--c-coral); font-size: 1.25em; font-weight: 700; }
.cmp-sub { font-size: 14px; color: #7d6f96; margin-bottom: 26px; }

.cmp-board { display: flex; flex-direction: column; gap: 10px; }
.cmp-row {
  display: grid; grid-template-columns: 128px 1.5fr 1fr 1fr 1fr; align-items: center; gap: 0;
  background: #fff; border: 1px solid rgba(47,1,85,.08); border-radius: 14px;
  box-shadow: 0 2px 10px -4px rgba(47,1,85,.10);
  animation: cmpIn .38s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes cmpIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cmp-row.cmp-cols { background: transparent; border: 0; box-shadow: none; align-items: end; animation: none; }
.cmp-c { padding: 14px 16px; font-size: 14px; line-height: 1.45; color: #4a3a63; font-weight: 500; }
.cmp-c-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #9a8bb4; line-height: 1.3; }
.cmp-colhead { font-size: 13px; font-weight: 700; color: var(--c-ink); padding-bottom: 8px; }
.cmp-c-b4c.cmp-colhead-b4c {
  background: linear-gradient(135deg, var(--c-purple), #6D1FD8); color: #fff; border-radius: 14px 14px 0 0;
  padding: 14px 18px 10px; box-shadow: 0 10px 30px -12px rgba(149,52,248,.55);
}
.cmp-b4c-name { display: block; font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; }
.cmp-b4c-with { display: block; font-size: 11px; font-weight: 500; opacity: .85; margin-top: 1px; }
.cmp-c-b4c { position: relative; background: var(--c-tint); box-shadow: inset 3px 0 0 var(--c-purple), inset -1px 0 0 rgba(149,52,248,.15); }
.cmp-row:not(.cmp-cols) .cmp-c-b4c { align-self: stretch; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.cmp-b4c-val { font-size: 15px; font-weight: 700; color: var(--c-ink); }
.cmp-note-hand { font-size: 16px; color: var(--c-coral); line-height: 1; white-space: nowrap; transform: rotate(-2deg); }
.cmp-miss { color: #C9BCCE; font-weight: 800; font-size: 15px; }
.cmp-row:not(.cmp-cols):hover { transform: translateY(-1px); box-shadow: 0 8px 22px -8px rgba(47,1,85,.18); transition: .15s; }

.cmp-fine { margin-top: 22px; font-size: 11.5px; color: #9a8bb4; line-height: 1.7; max-width: 90ch; }
@media (max-width: 1100px) { .cmp-row { grid-template-columns: 104px 1.4fr 1fr 1fr 1fr; } .cmp-c { padding: 12px 10px; font-size: 13px; } }

/* creative analysis — original Creative Diversification Analyzer skin (scoped) */
#view-creative .gallery-wrap { background: linear-gradient(155deg, #F3F1EC 0%, #EFECE5 45%, #F3F1EC 100%); }
#view-creative .topbar { background: transparent; border-bottom: 0; }
#view-creative .view-title { font-family: var(--font-ui); font-weight: 800; font-size: 20px; color: #1D1D1B; letter-spacing: -.4px; }
#view-creative .status-tab { border-radius: 12px; padding: 8px 16px; font-weight: 700; color: #6B7280; }
#view-creative .status-tab.active { background: linear-gradient(90deg, #1D1D1B, #3A3A36); color: #fff; border-radius: 12px; }
#view-creative .d-card { border-radius: 16px; border: 1px solid rgba(124, 58, 237, .10); box-shadow: 0 4px 18px rgba(124, 58, 237, .06); }
#view-creative .d-card h2 { font-family: var(--font-ui); font-weight: 700; font-size: 17px; padding-left: 12px; border-left: 4px solid; border-image: linear-gradient(180deg, #1D1D1B, #3A3A36) 1; margin-bottom: 6px; }
#view-creative .ca-scorehead { border-radius: 18px; padding: 26px 16px; }
#view-creative .ca-bignum .v { font-family: var(--font-ui); font-size: 44px; font-weight: 800; background: linear-gradient(90deg, #1D1D1B, #3A3A36); -webkit-background-clip: text; background-clip: text; color: transparent !important; line-height: 1.1; }
#view-creative .ca-bignum .k { color: #6B7280; letter-spacing: .08em; margin-top: 2px; }
#view-creative .ca-badge { background: #FEF3E2; border: 1px solid #F5D9A8 !important; color: #d97706 !important; padding: 2px 14px; font-size: 11px; }
#view-creative .ca-dim { border-radius: 14px; border-width: 1.5px; padding: 14px 12px; }
#view-creative .ca-dim .v { font-family: var(--font-ui); font-size: 26px; }
#view-creative .ca-dim[style*="#31A24C"] { background: #F3FBF5; }
#view-creative .ca-dim[style*="#d97706"] { background: #FEF9F0; }
#view-creative .ca-dim[style*="danger"], #view-creative .ca-dim[style*="#E41E3F"] { background: #FDF4F6; }
#view-creative .ca-sw-ad img { border: 2px solid #DCD8CE; border-radius: 8px; }
#view-creative .ca-varbadge { background: #1D1D1B; }
#view-creative .ca-lane { background: #fff; border-radius: 12px; }
#view-creative .ca-lane.gap { background: #FDF3F5; }
#view-creative .ca-lane-head b { font-family: var(--font-ui); font-weight: 700; }
#view-creative .ca-cl-spend, #view-creative .ca-hval { color: #1D1D1B; }
#view-creative .ca-count-pill { background: #E9E6DE; color: #1D1D1B; }
#view-creative .ca-fw-bar i { background: linear-gradient(90deg, #1D1D1B, #3A3A36); }
#view-creative .ca-more { background: #E9E6DE; color: #1D1D1B; }
#view-creative .select.slim { border-radius: 10px; }

/* ---------- Call Library (iframed encrypted app) ---------- */
.calls-frame { flex: 1; width: 100%; border: 0; min-height: 0; background: #f7f1e5; }

/* ---- Creative Analysis: angle coverage matrix (all 15 at once) ---- */
.ca-mx { display: flex; flex-direction: column; margin-top: 6px; }
.ca-mx-row {
  display: grid; grid-template-columns: 178px 1fr 74px 62px 130px;
  align-items: center; gap: 10px; padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.ca-mx-row:last-child { border-bottom: 0; }
.ca-mx-name { font-size: 12.5px; font-weight: 700; }
.ca-mx-row.gap .ca-mx-name { color: var(--ink-3); }
.ca-mx-thumbs { display: flex; align-items: center; gap: 4px; min-height: 34px; }
.ca-mx-thumbs .ca-sw-ad { width: 34px; height: 34px; flex-shrink: 0; }
.ca-mx-thumbs .ca-sw-ad img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.ca-mx-thumbs .ca-varbadge { font-size: 9px; padding: 0 4px; }
.ca-mx-gapnote { font-size: 11px; color: var(--ink-3); }
.ca-mx-n, .ca-mx-spend { font-size: 12px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.ca-mx-spend { font-weight: 700; color: var(--ink); }
.ca-mx-bar { height: 8px; background: var(--canvas); border-radius: 4px; overflow: hidden; }
.ca-mx-bar i { display: block; height: 100%; background: var(--fb); border-radius: 4px; }

/* scoring v2 additions */
.ca-dimwhy { font-size: 10.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.35; }
.ca-method { margin: 2px 2px 10px; }

/* ════════════ Video Studio ════════════ */
#view-video { padding: 0; }
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px; padding: 20px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start;
}
.video-card {
  /* overflow must stay visible: with overflow:hidden Chrome sizes the grid row
     without the aspect-ratio thumb (collapsed-thumbnail bug); vc-thumb clips itself */
  background: var(--card); border-radius: 12px; overflow: visible;
  box-shadow: var(--shadow-1); display: flex; flex-direction: column; cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.video-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.vc-thumb { position: relative; aspect-ratio: 9/16; background: #111; flex-shrink: 0; }
.vc-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-dur {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.7);
  color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600;
}
.vc-badge {
  position: absolute; bottom: 8px; left: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 10px; color: #fff; z-index: 2;
}
.vc-review { background: #1D1D1B; } .vc-final { background: #31A24C; } .vc-archive { background: #8F8D85; }
.vc-meta { padding: 10px 12px 12px; }
.vc-brief { font-size: 13px; color: var(--ink); line-height: 1.35; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vc-buckets { display: flex; gap: 6px; }
.vc-bucket {
  flex: 1; font-size: 11px; padding: 4px 6px; border: 1px solid var(--line-2);
  background: #fff; border-radius: 6px; cursor: pointer; color: var(--ink-2); text-transform: capitalize;
}
.vc-bucket:hover { border-color: #1D1D1B; color: #1D1D1B; }
.vc-bucket.on { background: #1D1D1B; color: #fff; border-color: #1D1D1B; font-weight: 600; }
#videoHint { font-size: 12px; color: var(--ink-3); }

/* detail modal */
.video-modal { width: min(1000px, 94vw); max-height: 92vh; padding: 0; overflow: hidden; }
.vm-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.vm-player { background: #111; display: flex; align-items: center; justify-content: center; }
.vm-player video { max-height: 92vh; max-width: 100%; display: block; }
/* side-by-side with the external original (swipe file) */
.video-modal.has-orig { width: min(1500px, 96vw); }
.vm-pane { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; flex: 1; height: 100%; }
.vm-pane figcaption { color: #ddd; font-size: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vm-pane figcaption a { color: #C9A6FF; }
.vm-pane-label { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: #fff; }
.has-orig .vm-player { gap: 2px; align-items: stretch; }
.has-orig .vm-player video, .vm-orig-media img { max-height: 80vh; max-width: 100%; display: block; }
.vm-orig-media { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.vm-orig-pick { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 8px; }
.vm-orig-pick button { font-size: 11px; min-width: 26px; padding: 3px 6px; border-radius: 5px; border: 1px solid #555; background: #222; color: #ddd; cursor: pointer; }
.vm-orig-pick button.on { background: #1D1D1B; border-color: #1D1D1B; color: #fff; }
.vm-side { padding: 22px 22px 18px; overflow-y: auto; max-height: 92vh; }
.vm-side h2 { font-size: 18px; margin-bottom: 6px; color: #1D1D1B; }
.vm-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 16px 0 8px; }
.vm-brief { font-size: 12px; color: var(--ink-2); margin-bottom: 12px; }
.vm-status { display: flex; gap: 6px; }
.vm-shots { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.vm-shots li { font-size: 12px; line-height: 1.5; padding: 10px 12px; background: #F6F2FB; border-radius: 8px; color: var(--ink); }
.vm-shots em { color: #1D1D1B; font-style: normal; font-weight: 600; }
.vm-shots span { display: block; margin-top: 2px; }
.vm-plate { color: var(--ink-3); }
.vm-txt { color: #1D1D1B; font-weight: 500; }
.vm-vo { color: var(--ink-2); }
.vm-stk { color: var(--ink-3); font-size: 11px; }
.vm-actions { margin-top: 18px; }
.btn.danger, .vc-bucket.danger { color: var(--danger); border-color: var(--danger); }

/* ════════════ Video Studio sub-nav ════════════ */
.subnav {
  display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line);
  background: var(--card); flex-shrink: 0;
}
.subnav-btn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border: 0;
  background: transparent; color: var(--ink-2); border-radius: 8px; cursor: pointer;
}
.subnav-btn:hover { background: #E9E6DE; color: #1D1D1B; }
.subnav-btn.active { background: #1D1D1B; color: #fff; }
.vsub { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vsub.hidden { display: none; }
.lab-frame { flex: 1; width: 100%; border: 0; min-height: 0; background: var(--ivory, #F0EFED); }

/* Remotion reels strip (Video Studio) */
.remotion-strip{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 14px;margin:0 0 12px;background:#f6f2fb;border:1px solid #e7dcf5;border-radius:10px}
.remotion-strip.hidden{display:none}
.rs-label{font-size:12.5px;color:#5d4a75;font-weight:600;margin-right:4px}
.rs-loading{font-size:12.5px;color:#8a7aa0}
.rs-chip{font-size:12px;font-weight:600;color:#4a3563;background:#fff;border:1px solid #d9c8f0;border-radius:20px;padding:5px 12px;cursor:pointer;transition:all .12s}
.rs-chip:hover:not(:disabled){background:#1D1D1B;color:#fff;border-color:#1D1D1B}
.rs-chip:disabled{opacity:.7;cursor:default}

/* Video card number + id handle */
.vc-num{position:absolute;top:8px;right:8px;background:rgba(149,52,248,.92);color:#fff;font-size:11px;font-weight:800;padding:2px 8px;border-radius:10px;letter-spacing:.02em;z-index:2}
.vc-id{display:block;margin-top:3px;font-size:10.5px;color:#8a7aa0;font-family:var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Video card one-click delete (mirrors image cards) */
.vc-del{position:absolute;top:8px;left:8px;width:26px;height:26px;border:none;border-radius:50%;background:rgba(17,17,17,.62);color:#fff;font-size:16px;line-height:1;cursor:pointer;opacity:.85;transition:opacity .12s,background .12s;z-index:3;display:flex;align-items:center;justify-content:center}
.video-card:hover .vc-del{opacity:1}
.vc-del:hover{background:#d0342c}

/* Video cards reuse image .card styling; these are the video-only bits */
.video-card .vc-thumb { position: relative; aspect-ratio: 9/16; background: #111; border-radius: 10px 10px 0 0; overflow: hidden; flex-shrink: 0; }
.video-card .vc-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(17,17,17,.62); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; z-index: 4; display: flex; align-items: center; justify-content: center; transition: background .12s; }
.card-del:hover { background: #d0342c; }
.chip.mono { font-family: var(--font-mono); font-size: 10px; opacity: .75; }

/* video #num badge to top-left so it clears the delete ✕ (top-right) */
.video-card .ref-badge { left: 8px; right: auto; }

/* QA gate badge + detail list */
.qa-badge { position: absolute; top: 8px; left: 34px; z-index: 2; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .2px; white-space: nowrap; }
.qa-badge.qa-pass { background: #E4F5F1; color: #16A38A; }
.qa-badge.qa-fail { background: #FDE8E8; color: #C53030; }
.qa-badge.qa-warn { background: #FBF3E0; color: #B7791F; }
.qa-badge.qa-pending { background: #EEE; color: #888; }
#qaBox .qa-badge { position: static; font-size: 12px; }
.qa-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qa-head .muted { font-size: 11px; color: var(--ink-2); flex: 1; }
.qa-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.qa-list li { font-size: 12px; padding: 5px 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); }
.qa-list li b { font-weight: 700; display: block; }
.qa-list li span { display: block; color: var(--ink-2); margin-top: 2px; }
.qa-list li.bad { border-color: #F5B5B5; background: #FFF6F6; }
.qa-list li.bad b { color: #C53030; }
.qa-list li.warn { border-color: #F1D9A3; background: #FFFBF0; }
.qa-list li.warn b { color: #B7791F; }
.qa-list li.ok b { color: #16A38A; }

/* ───── Reports view (markdown reports rendered by section) ───── */
.rep-wrap { background: linear-gradient(160deg, #F3F1EC 0%, #F9F7FB 55%, #FBF8F6 100%); }
.rep { max-width: 1180px; margin: 0 auto; }
.rep-picker { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; max-width: 360px; }
.rep-picker.hidden { display: none; }
.rep-intro { background: linear-gradient(120deg, #1D1D1B, #2A2A27 60%, #3A3A36); color: #fff; border-radius: 16px; padding: 22px 26px; margin-bottom: 18px; font-size: 14.5px; line-height: 1.55; }
.rep-intro p { margin: 6px 0; }
.rep-intro .rep-vq { background: rgba(255,255,255,.16); color: #fff; }
.rep-intro strong { color: #FFD166; }
.rep-h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 12px; color: #1D1D1B; }
.rep-lead { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #1D1D1B; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; font-size: 14.5px; line-height: 1.6; }
.rep-lead p { margin: 6px 0; }
.rep-grid { column-count: 2; column-gap: 14px; }
.rep-grid-wide { column-count: 1; }
.rep-card { break-inside: avoid; background: var(--card); border: 1px solid var(--line); border-top: 4px solid #1D1D1B; border-radius: 12px; padding: 16px 18px; margin: 0 0 14px; font-size: 14px; line-height: 1.58; }
.rep-card h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 8px; color: #1D1D1B; }
.rep-card p, .rep-lead p { margin: 7px 0; }
.rep-h4 { font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 14px 0 4px; }
.rep-h5 { font-size: 13.5px; font-weight: 700; margin: 10px 0 2px; }
.rep-list { margin: 6px 0 6px 20px; padding: 0; }
.rep-list li { margin: 5px 0; }
.rep-vq { background: rgba(149, 52, 248, .09); color: #5B1BA8; border-radius: 4px; padding: 0 3px; font-style: italic; }
.rep-quote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid #1D1D1B; background: rgba(29,29,27,.04); border-radius: 0 8px 8px 0; }
.rep-quote p { margin: 4px 0; }
.rep-card code, .rep-lead code { background: var(--bg, #F3F1EC); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.rep-tablewrap { overflow-x: auto; margin: 8px 0 4px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rep-table th { background: #E9E6DE; color: #1D1D1B; font-weight: 800; padding: 8px 10px; border-bottom: 2px solid #DCD8CE; position: sticky; top: 0; }
.rep-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rep-table tr:hover td { background: #FAF7FE; }
.rep-table td:first-child { color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.rep-empty { color: var(--ink-2); padding: 40px; text-align: center; }
.rep a { color: var(--fb); }

.rep-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 16px; }
.rep-tabs .status-tab { background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.rep-tabs .status-tab:hover { background: #E9E6DE; color: #1D1D1B; }
.rep-tabs .status-tab.active { background: #1D1D1B; border-color: #1D1D1B; color: #fff; }
.rep-tabs .status-tab.active::after { display: none; }
#view-reports .view-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }

/* ---- 2026 Ads tab: sortable performance table, one row per creative ---- */
.status-tab.tab-year.active { color: #1D1D1B; }
.status-tab.tab-year.active::after { background: #1D1D1B; }
.status-tab.tab-year.active .count { color: #1D1D1B; background: #E9E6DE; }
.gallery.year-grid { column-width: auto; column-gap: 0; display: block; }
.year-toolbar { margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.year-table-wrap {
  background: var(--card); border-radius: 8px; box-shadow: var(--shadow-1);
  overflow-x: auto;
}
.year-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.year-table th, .year-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.year-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--card); font-size: 11px; font-weight: 700; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.year-table th.sortable { cursor: pointer; user-select: none; }
.year-table th.sortable:hover { color: var(--ink); }
.year-table th.sortable.on { color: #1D1D1B; }
.year-table th.sortable.on::after { content: ' ▾'; }
.year-table th.sortable.on.asc::after { content: ' ▴'; }
.year-table td.num, .year-table th.sortable { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.year-table td.strong { font-weight: 700; color: var(--ink); }
.year-table td.good { color: #16A38A; }
.year-table tbody tr.year-row { cursor: pointer; }
.year-table tbody tr.year-row:hover { background: #FAF8FE; }
.year-table td.y-thumb { width: 72px; padding-right: 0; }
.year-table .y-thumb .thumb {
  position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--canvas);
}
.year-table .y-thumb .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.year-table .y-thumb .thumb.tiny img { image-rendering: auto; filter: saturate(.9); }
.year-table .y-thumb .ref-badge { font-size: 10px; padding: 1px 5px; top: 3px; right: 3px; border-width: 1.5px; border-radius: 5px; }
.year-table td.y-name { max-width: 380px; }
.y-title { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.y-chips .chip { font-size: 9.5px; padding: 1px 6px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.video { background: #E9E6DE; color: #1D1D1B; }
.y-type { display: inline-block; font-size: 9.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; margin-left: 3px; }
.y-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }

/* detail modal */
.modal.year-detail { width: min(1200px, 96vw); height: min(860px, 92vh); }
.year-detail-body { display: grid; grid-template-columns: 380px 1fr; height: 100%; }
.year-detail-media { background: var(--canvas); padding: 40px 20px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; overflow-y: auto; }
.year-detail-media img { max-width: 100%; max-height: 420px; border-radius: 8px; box-shadow: var(--shadow-1); }
.year-detail-media img.tiny { width: 192px; height: 192px; image-rendering: pixelated; }
.year-detail-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.year-detail-stats div { background: var(--card); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.year-detail-stats b { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.year-detail-stats span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.year-detail-text { padding: 40px 24px 24px; overflow-y: auto; }
.year-detail-text .y-ref { font-size: 13px; font-weight: 800; color: #1D1D1B; display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.year-detail-text h3 { font-size: 17px; margin-bottom: 14px; }
.year-detail-text label { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }
.y-headline { font-weight: 600; }
.y-body pre { white-space: pre-wrap; font-family: var(--font-feed); font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--canvas); padding: 10px 12px; border-radius: 8px; max-height: 260px; overflow-y: auto; }
.y-link a { font-size: 12px; color: var(--fb); word-break: break-all; }
.year-table.mini { font-size: 12px; }
.year-table.mini th, .year-table.mini td { padding: 6px 8px; }
.year-table.mini thead th { position: static; }

/* report inline images (ad creatives) */
.rep-img {
  max-height: 230px; max-width: 46%; border-radius: 8px;
  border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.16);
  margin: 6px 8px 6px 0; vertical-align: top;
}

.d-asof { font-size: 10.5px; font-weight: 700; color: var(--ink-3); margin-left: 8px; letter-spacing: .03em; }

.comp-table .td-scale { white-space: normal; font-size: 11.5px; line-height: 1.3; min-width: 150px; max-width: 170px; }
.comp-scale { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px dotted var(--ink-3); display: inline; overflow-wrap: anywhere; }
.comp-scale:hover { color: var(--fb); border-color: var(--fb); }
.comp-scale.estimate, .comp-scale.proxy { font-weight: 600; color: var(--ink-2); }
.comp-table .td-scale .comp-stat-none { white-space: normal; font-size: 11px; color: var(--ink-3); display: inline-block; max-width: 180px; line-height: 1.3; }

/* Reports: one continuous page; sections stack with a rule between them */
.rep-section { padding-top: 28px; margin-top: 28px; border-top: 1px solid #E6DEF3; scroll-margin-top: 72px; }
.rep-section:first-of-type { border-top: 0; margin-top: 8px; }

/* ---- For Review ranking (only bucket Peter ranks) ---- */
.card.is-rankable { position: relative; }
.rank-handle {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(47, 1, 85, .88); color: #fff;
  font-size: 12px; line-height: 1; letter-spacing: .02em;
  cursor: grab; user-select: none;
}
.rank-handle:active { cursor: grabbing; }
.rank-handle b { font-weight: 700; }
.card.g-dragging { opacity: .45; }
.card.drop-before { box-shadow: inset 4px 0 0 0 #1D1D1B; }
.card.drop-after  { box-shadow: inset -4px 0 0 0 #1D1D1B; }

/* Library headings (Models tab sections, Video Studio → Stills groups) */
.models-head { grid-column: 1 / -1; margin: 18px 0 4px; font-size: 14px; color: #1D1D1B; }
.models-head .count { font-weight: 400; opacity: .6; }
.stills-wrap { flex: 1; overflow-y: auto; padding: 8px 24px 40px; }
.stills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stills-grid .card img { width: 100%; display: block; }

/* ---- Formats view: one scrolling page, original vs ours ---- */
.fmt-layout { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }
.fmt-index { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; }
.fmt-ix { font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.fmt-ix:hover { background: #fff; }
.fmt-ix .count { font-weight: 400; color: #999; margin-left: 4px; }
.fmt-fam { margin: 0 0 28px; }
.fmt-fam h2 { font-size: 18px; margin: 4px 0 10px; scroll-margin-top: 12px; }
.fmt-fam h2 small { display: block; font-size: 13px; font-weight: 400; color: #666; margin-top: 2px; max-width: 900px; }
.fmt-sp { background: #fff; border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.fmt-sp-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.fmt-sp-head h3 { margin: 0; font-size: 16px; }
.fmt-shift { font-size: 13px; color: #6b6b7a; }
.fmt-links { font-size: 12px; margin-left: auto; }
.fmt-links a { margin-left: 4px; }
.fmt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fmt-side { background: #f4f4f7; border-radius: 10px; padding: 8px 10px 4px; min-width: 0; }
.fmt-side.ours { background: #F3EBFF; }
.fmt-side-label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: #6b6b7a; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.fmt-side-label .btn { margin-left: auto; padding: 2px 8px; font-size: 11px; }
.fmt-stats { text-transform: none; letter-spacing: 0; color: #888; }
.fmt-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.fmt-tile { margin: 0; flex: 0 0 auto; width: 200px; }
.fmt-tile video, .fmt-tile img { width: 200px; height: 356px; object-fit: cover; border-radius: 8px; background: #111; display: block; }
.fmt-tile.orig img { object-fit: contain; background: #222; }
.fmt-tile figcaption { font-size: 11px; color: #555; margin-top: 4px; width: 200px; white-space: normal; line-height: 1.3; }
.fmt-noimg { width: 200px; height: 356px; border-radius: 8px; background: #e6e0f0; color: #7a6a9a; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.fmt-breakdown { margin-top: 10px; }
.fmt-breakdown summary { cursor: pointer; font-size: 12px; color: #6b6b7a; text-transform: uppercase; letter-spacing: .05em; }
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 8px; }
.fmt-col h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #6b6b7a; }
.fmt-col ul { margin: 0; padding-left: 18px; font-size: 13px; }
.fmt-nums span { margin-right: 6px; font-size: 12px; color: #444; }
.chip.format { background: #EFE4FF; color: #5B21B6; }

/* ---- API spend: sidebar counter + Spend view (spend.js) ---- */
.spend-pill {
  border: 1px solid var(--line); background: var(--canvas); border-radius: 10px; cursor: pointer;
  padding: 8px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  font-family: var(--font-ui); text-align: left;
}
.spend-pill:hover { border-color: var(--line-2); background: var(--card); }
.spend-pill-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.spend-pill-usd { font-size: 18px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sp { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.sp-hero { display: flex; gap: 40px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.sp-k { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.sp-v { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sp-v-sm { font-size: 24px; color: var(--ink-2); }
.sp-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.sp-h { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.sp-bars { display: flex; flex-direction: column; gap: 8px; }
.sp-bar-row { display: grid; grid-template-columns: 140px 1fr 90px 150px; align-items: center; gap: 12px; }
.sp-bar-name { font-weight: 700; }
.sp-bar-track { height: 12px; background: var(--canvas); border-radius: 6px; overflow: hidden; }
.sp-bar-fill { display: block; height: 100%; background: #5B6B82; border-radius: 6px; }
.sp-bar-usd { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.sp-bar-calls { color: var(--ink-3); font-size: 12px; }
.sp-scroll { overflow-x: auto; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.sp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-table code { font-size: 12px; }
.sp-dim { color: var(--ink-3); }
.sp-foot { color: var(--ink-3); font-size: 12px; padding: 0 4px 24px; }

/* ════════════════ 2026-10 shell: main nav | status column | page | preview ════════════════
   Look 1 "Blue on white". Status colors match shell.js SC. */
:root { --sc-gap: 16px; }
.sidenav { display: none; }
#view-studio > .topbar, #videoSubnav, #vsub-videos > .topbar, #vsub-formats > .topbar { display: none !important; }

.mainnav {
  width: var(--mn-w, 236px); flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); position: relative;
  display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto; z-index: 25;
}
.mn-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; padding: 0 8px 10px; }
.mn-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ig-gradient); flex-shrink: 0; }
.mn-items { display: flex; flex-direction: column; gap: 1px; }
.mn-group { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 14px 10px 5px; }
.mn-item {
  border: 0; background: none; cursor: pointer; text-align: left; font-family: var(--font-ui);
  font-size: 15px; font-weight: 600; color: var(--ink-2); border-radius: 8px; padding: 8px 10px;
  display: flex; align-items: center; gap: 11px; transition: background .12s;
}
.mn-item svg { color: var(--ink-3); }
.mn-item:hover { background: var(--canvas); }
.mn-item.on { background: var(--fb-tint); color: var(--fb); }
.mn-item.on svg { color: var(--fb); }
.mn-spend {
  margin-top: auto; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; font-family: var(--font-ui);
  display: flex; justify-content: space-between; align-items: baseline; padding: 12px 10px 2px; color: var(--ink-3); font-size: 12.5px;
}
.mn-spend b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mn-spend:hover b { color: var(--fb); }

.subcol {
  width: var(--sc-w, 214px); flex-shrink: 0; background: #F7F5F0; border-right: 1px solid var(--line); position: relative;
  padding: 22px 12px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto;
}
.sc-head { padding: 0 10px 6px; }
.sc-head h2 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.sc-head p { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.sc-group { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 16px 10px 5px; }
.sc-item {
  border: 0; background: none; cursor: pointer; text-align: left; font-family: var(--font-ui);
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--ink-2);
}
.sc-item:hover { background: #E9E6DE; }
.sc-item .sc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); flex-shrink: 0; }
.sc-item .sc-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item .sc-n { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sc-item.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); }
.sc-item.on .sc-n { color: var(--fb); }
.sc-item.dim { color: var(--ink-3); }
.sc-item.sm { font-size: 14px; padding: 6px 10px; }

/* page header (replaces the old top bars) */
.pagehead { padding: 22px 24px 4px; flex-shrink: 0; }
.pagehead:empty { display: none; }
.ph-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ph-row h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.ph-desc { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.ph-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.fchip {
  font: inherit; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); white-space: nowrap;
}
.fchip span { color: var(--ink-3); margin-left: 2px; }
.fchip:hover { border-color: var(--line-2); color: var(--ink); }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fchip.on span { color: #bbb; }
.btn-open {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; text-decoration: none;
  color: var(--fb); background: var(--fb-tint); padding: 8px 14px; border-radius: 8px;
}
.btn-open:hover { background: #E2DED4; }

/* gallery + cards */
.gallery-wrap { padding: 16px 24px 80px; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sc-gap); }
.card { border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); }
.card.sel { outline: 3px solid var(--fb); outline-offset: -1px; }
.card .ref-badge { font-size: 14px; top: 8px; right: 8px; border-radius: 7px; padding: 3px 9px; }
.card-body { padding: 9px 10px 10px; }
.card-top { flex-wrap: nowrap; margin-bottom: 9px; min-width: 0; }
.chip { font-size: 11.5px; border-radius: 6px; padding: 2px 7px; }
.chip.model { background: var(--canvas); color: var(--ink-2); flex-shrink: 0; }
.chip.campaign { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.cost { margin-left: auto; color: var(--ink-3); flex-shrink: 0; padding-right: 0; }
.card-move { margin-left: 0; display: flex; gap: 6px; }
.card-move .mv {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 12.5px; font-weight: 700; padding: 6px 9px; border-radius: 8px;
}
.card-move .mv:hover { background: var(--canvas); color: var(--ink); }
.card-move .mv.mv-fwd { flex: 1; background: var(--fb); border-color: var(--fb); color: #fff; }
.card-move .mv.mv-fwd:hover { background: var(--fb-hover); }
.card-move .mv.ic { padding: 6px 7px; }
.card-move .mv.mv-arch { color: var(--ink-3); }
.card .rank-handle { z-index: 3; }
.empty-line { padding: 24px; color: var(--ink-3); font-size: 15px; }

/* stills board */
#stillsWrap { flex: 1; overflow-y: auto; padding: 16px 24px 80px; }
.gallery.stills { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card.still img { aspect-ratio: 9/14; object-fit: cover; object-position: top; }
.still-title { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* videos */
.video-grid { padding: 16px 24px 80px; }
.video-card .card-move .mv.mv-fwd { flex: 1; }

/* library documents */
.doc-wrap { flex: 1; min-height: 0; padding: 12px 24px 24px; display: flex; }
.doc-frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.doc-card { margin: 40px auto; max-width: 560px; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-1); padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.doc-card h2 { font-size: 22px; font-weight: 800; color: var(--ink); }
.doc-card p { font-size: 15px; line-height: 1.5; }
.doc-card .muted { color: var(--ink-3); }
.card.video-card .ref-badge { left: 8px; right: auto; }
.card-move .mv.mv-fwd + .mv.mv-fwd { background: var(--card); color: var(--fb); border-color: #B9D6FB; }
.card-move .mv.mv-fwd + .mv.mv-fwd:hover { background: var(--fb-tint); }

/* Kit › Formats: ranked list, each row opens the original-vs-ours compare */
#vsub-formats .gallery-wrap { padding-top: 12px; }
#vsub-formats .fmt-layout { display: block; }
#fmtFamilies:empty { display: none; }
.fr-list { display: flex; flex-direction: column; gap: 8px; max-width: 1100px; }
.fr { background: var(--card); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); }
.fr.dragging { opacity: .5; }
.fr-row { display: grid; grid-template-columns: 36px auto 64px minmax(0,1fr) auto 36px; align-items: center; gap: 14px; padding: 10px 14px; cursor: pointer; }
.fr-list:not(.rankable) .fr-row { grid-template-columns: 36px 64px minmax(0,1fr) auto 36px; }
.fr-row:hover { background: #F7F5F0; border-radius: 10px; }
.fr-row.open { border-bottom: 1px solid var(--line); }
.fr-rank { font-size: 22px; font-weight: 800; color: var(--fb); text-align: center; font-variant-numeric: tabular-nums; }
.fr-grip { color: var(--ink-3); cursor: grab; display: flex; }
.fr-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--canvas); display: block; }
.fr-name { min-width: 0; display: flex; flex-direction: column; }
.fr-name b { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-name span { font-size: 13px; color: var(--ink-3); }
.fr-ours { display: flex; gap: 4px; }
.fr-v { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--fb-tint); color: var(--fb); }
.fr-none { font-size: 13px; color: var(--ink-3); }
.fr-row .mv.ic { border: 1px solid var(--line); background: var(--card); color: var(--ink-3); border-radius: 8px; padding: 6px 7px; cursor: pointer; display: inline-flex; }
.fr-detail { padding: 4px 16px 16px; }
.fr-detail .fmt-sp { margin: 0; box-shadow: none; padding: 0; }

/* Kit › Voices + Sound effects */
#view-voices .gallery-wrap, #view-sfx .gallery-wrap { display: flex; flex-direction: column; }
.voices-legacy { min-height: calc(100vh - 140px); }
.vo-script { margin-top: 10px; font-size: 14px; color: var(--ink-2); background: var(--card); border-radius: 8px; padding: 10px 14px; max-width: 1100px; box-shadow: var(--shadow-1); }
.vo-script b { color: var(--ink); margin-right: 4px; }
.vo-row { display: grid; grid-template-columns: 36px auto 36px minmax(0,1.4fr) 110px 52px minmax(0,1fr) auto 36px; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.vo-row.nodrag { grid-template-columns: 36px 36px minmax(0,1.4fr) 110px 52px minmax(0,1fr) auto 36px; }
.vo-row:hover { background: #F7F5F0; border-radius: 10px; }
.vo-row.open { border-bottom: 1px solid var(--line); }
.vo.dragging { opacity: .5; }
.vo-play { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--fb-tint); color: var(--fb); cursor: pointer; }
.vo-play.on { background: var(--fb); color: #fff; }
.vo-eng { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-align: center; white-space: nowrap; background: var(--canvas); color: var(--ink-2); }
.vo-eng.ai { background: #FFF4E0; color: #B25E09; }
.vo-dur { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vo-heard { font-size: 13.5px; font-style: italic; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vo-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.vo-tags span { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--fb-tint); color: var(--fb); }
.vo-row .mv.ic { border: 1px solid var(--line); background: var(--card); color: var(--ink-3); border-radius: 8px; padding: 6px 7px; cursor: pointer; display: inline-flex; }
.vo-detail { padding: 12px 18px 16px 64px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.vo-note { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.vo-taglabel { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; flex-direction: column; gap: 6px; }
.vo-taglabel input { font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.sx-list { display: flex; flex-direction: column; gap: 18px; max-width: 1100px; }
.sx-group { background: var(--card); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); padding: 6px 4px; }
.sx-group h2 { font-size: 17px; font-weight: 800; padding: 10px 14px 4px; }
.sx-group h2:empty, .sx-group h2:has(> span:empty):not(:has(+ *)) { display: none; }
.sx-group h2 span { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 6px; }
.sx-row { display: grid; grid-template-columns: 36px minmax(0,1fr) 80px minmax(0,260px) 40px; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; }
.sx-row:hover { background: #F7F5F0; }
.sx-row.pick { background: #FFFBEA; }
.sx-note { font: inherit; font-size: 13px; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; background: transparent; color: var(--ink-2); }
.sx-note:hover, .sx-note:focus { border-color: var(--line); background: var(--card); outline: none; }
.sx-star { border: 0; background: none; cursor: pointer; color: var(--line-2); display: grid; place-items: center; }
.sx-star.on { color: #E0A100; }
.sx-star.on svg { fill: #E0A100; }
.vo { background: var(--card); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); }
.card-move .mv-stage { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: var(--card); max-width: 112px; min-width: 0; cursor: pointer; }
.card-move .mv-stage:hover { border-color: var(--fb); }

/* Kit › Styles + Overlays: ranked card grids */
.kc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sc-gap); }
.kc { background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); display: flex; flex-direction: column; }
.kc.dragging { opacity: .45; }
.kc-media { position: relative; aspect-ratio: 4/3; background: var(--canvas); display: grid; place-items: center; overflow: hidden; }
.kc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kc-grid .kc-media img[src*="/collage/"] { object-fit: contain; padding: 12px; }
.kc-char { font-size: 64px; }
.kc-text { font-family: var(--font-ui); font-weight: 800; font-size: 22px; color: var(--ink); padding: 16px; text-align: center; }
.kc-rank { position: absolute; top: 8px; left: 8px; background: var(--fb); color: #fff; font-weight: 800; font-size: 14px; padding: 3px 9px; border-radius: 7px; }
.kc-grip { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); color: var(--ink-2); border-radius: 7px; padding: 4px; cursor: grab; display: flex; }
.kc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kc-title { display: flex; align-items: center; gap: 8px; }
.kc-title b { font-size: 15px; font-weight: 700; }
.kc-flag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #E6F6EE; color: #1E8E5A; white-space: nowrap; }
.kc-body p { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.kc-body details summary { font-size: 12.5px; font-weight: 700; color: var(--fb); cursor: pointer; }
.kc-more { font-size: 12.5px; color: var(--ink-2); background: var(--canvas); border-radius: 6px; padding: 8px 10px; margin-top: 6px; line-height: 1.45; }
.kc-acts { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.kc-acts .in-btn { flex: 1; padding: 6px 8px; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-content: flex-start; }
.kc-acts .mv.ic { border: 1px solid var(--line); background: var(--card); color: var(--ink-3); border-radius: 8px; padding: 6px 7px; cursor: pointer; display: inline-flex; }

/* drag-to-resize edges (shell.js) — double-click resets */
.rz { position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 30; }
.rz.right { right: -4px; }
.rz.left { left: -4px; }
.rz::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .12s; }
.rz:hover::after, body.resizing .rz.on::after { background: var(--fb); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }
.mainnav, .subcol { overflow-x: hidden; }
/* shared bits (were in the old preview panel): label/value list, outline button */
.in-kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13.5px; margin: 0; }
.in-kv dt { color: var(--ink-3); }
.in-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.in-btn {
  font: inherit; font-size: 13.5px; font-weight: 700; padding: 10px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
}
.in-btn:hover { background: var(--canvas); }
.card.still .card-top { gap: 6px; } .card.still .still-title { min-width: 0; flex: 1; }
.card.still .card-move { flex-wrap: wrap; } .card.still .card-move .mv-stage { order: 9; flex: 1 1 100%; max-width: none; }
.sx-row { grid-template-columns: 30px 20px 36px minmax(0,1fr) 80px minmax(0,260px) 40px; }
.sx-row.nodrag { grid-template-columns: 36px minmax(0,1fr) 80px minmax(0,260px) 40px; }
.sx-row.dragging { opacity: .45; }
.sx-rank { font-size: 17px; }

/* main nav: a colored tile per item */
.mn-item { gap: 10px; padding: 6px 8px; }
.mn-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); transition: background .12s, color .12s; }
.mn-item svg, .mn-item.on svg { color: inherit; }
.mn-item.on { background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--ink); }
.mn-item.on .mn-ic { background: var(--c); color: #fff; }
.mn-item:hover .mn-ic { background: color-mix(in srgb, var(--c) 22%, #fff); }
.mn-item.on:hover .mn-ic { background: var(--c); }
.vo-row .fr-name span, .fr-row .fr-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vo-row { grid-template-columns: 36px auto 36px minmax(180px,1.4fr) 110px 52px minmax(0,1fr) auto 36px; }
@media (max-width: 1350px) {
  .vo-heard { display: none; }
  .vo-row { grid-template-columns: 36px auto 36px minmax(160px,1fr) 110px 52px auto 36px; }
  .vo-row.nodrag { grid-template-columns: 36px 36px minmax(160px,1fr) 110px 52px auto 36px; }
}
/* subtler: colored glyph only; the active item gets the solid tile */
.mn-ic { background: transparent; color: color-mix(in srgb, var(--c) 80%, #555); }
.mn-item:hover .mn-ic { background: transparent; }
.mn-item:hover { background: var(--canvas); }
.mn-item.on { background: #E9E6DE; color: var(--ink); }
.mn-item.on .mn-ic, .mn-item.on:hover .mn-ic { background: var(--c); color: #fff; }

/* ---------- Automated ads › headline shapes ---------- */
.aa-list { display: flex; flex-direction: column; gap: 8px; max-width: 980px; }
.aa-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 14px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.aa-row.st-keep { border-left: 4px solid var(--ok); }
.aa-row.st-rewrite { border-left: 4px solid #D99000; }
.aa-row.st-cut { opacity: .55; }
.aa-id { font: 600 13px var(--font-ui); color: var(--ink-3); padding-top: 3px; }
.aa-shape { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.35; outline: none; border-radius: 4px; }
.aa-shape[contenteditable] { background: #FFF8E6; padding: 2px 6px; margin: -2px -6px; cursor: text; }
.aa-src { margin-top: 4px; color: var(--ink-2); font-style: italic; font-size: 14px; }
.aa-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.aa-brand { background: #E9E6DE; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.aa-brand.ours { background: var(--fb-tint); color: var(--fb); }
.aa-orig { color: #D99000; font-weight: 600; cursor: help; }
.aa-note { margin-top: 8px; width: 100%; border: 1px solid transparent; background: transparent; font: 13px var(--font-ui); color: var(--ink-2); padding: 4px 6px; border-radius: 6px; }
.aa-note:hover, .aa-note:focus { border-color: var(--line-2); background: #F7F5F0; outline: none; }
.aa-btns { display: flex; gap: 6px; }
.aa-btn { border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font: 600 13px var(--font-ui); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.aa-btn:hover { background: #F5F6F7; }
.aa-btn.b-keep.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.aa-btn.b-rewrite.on { background: #D99000; border-color: #D99000; color: #fff; }
.aa-btn.b-cut.on { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (max-width: 760px) { .aa-row { grid-template-columns: 1fr; } .aa-btns { justify-content: flex-start; } }

/* Make › Audio: compare clips made for a video */
.acmp { margin-bottom: 28px; }
.acmp-head h3 { margin: 0 0 4px; font-size: 16px; }
.acmp-line { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: var(--ink); }
.acmp-note { margin: 0 0 12px; color: var(--ink-3); font-size: 13px; max-width: 760px; }
.acmp-list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.acmp-row { display: grid; grid-template-columns: 22px 36px minmax(0,1fr) 110px 64px 48px auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.acmp-row:hover { background: #F7F5F0; }
.acmp-row.on { background: var(--fb-tint); }
.acmp-n { color: var(--ink-3); font-size: 12px; font-weight: 600; text-align: center; }
.acmp-num { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.acmp-acts { display: inline-flex; gap: 6px; justify-content: flex-end; }
.acmp-row .mv.ic { border: 1px solid var(--line); background: var(--card); color: var(--ink-3); border-radius: 8px; padding: 6px 7px; cursor: pointer; display: inline-flex; }
.acmp-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.acmp-video { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 6px 6px; flex: none; }
.acmp-video img { width: 44px; height: 78px; object-fit: cover; border-radius: 6px; }
.acmp-video small { color: var(--ink-3); }
.acmp-row { grid-template-columns: 36px 22px 36px minmax(0,1fr) 110px 64px 84px 48px 36px; }
.acmp-row.nodrag { grid-template-columns: 36px 36px minmax(0,1fr) 110px 64px 84px 48px 36px; }
.acmp-row.dragging { opacity: .5; }
.chip.audio { text-decoration: none; }
.mn-item.mn-sub { margin-left: 18px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.mn-item.mn-sub .mn-ic { transform: scale(.85); }
.aa-panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; max-width: 980px; }
.aa-panel h3, .aa-h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.aa-h3 { margin: 18px 0 8px; }
.aa-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aa-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.aa-seg button { border: 0; background: var(--card); padding: 7px 14px; font: 600 13px var(--font-ui); color: var(--ink-2); cursor: pointer; }
.aa-seg button.on { background: #1D1D1B; color: #fff; }
.aa-sel { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font: 14px var(--font-ui); max-width: 420px; background: var(--card); }
.aa-sel-sm { max-width: 150px; }
.aa-go { border: 0; background: #1D1D1B; color: #fff; font: 600 14px var(--font-ui); padding: 9px 18px; border-radius: 999px; cursor: pointer; }
.aa-go:disabled { background: #DCD8CE; cursor: default; }
.aa-hint { color: var(--ink-3); font-size: 13px; font-weight: 400; margin-top: 8px; }
.aa-recipe { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.aa-recipe b { color: var(--ink); font-weight: 600; margin-right: 2px; }
.aa-round { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: inherit; }
.aa-round:hover { border-color: #DCD8CE; }
.aa-rn { font: 800 20px var(--font-ui); color: #1D1D1B; }
.aa-rbrief { font-weight: 600; font-size: 15px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.aa-pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #E9E6DE; color: var(--ink-2); }
.aa-pill.st-rating { background: #E9E6DE; color: #1D1D1B; }
.aa-pill.st-done { background: #E7F6EC; color: #1E7B39; }
.aa-pill.st-failed { background: #FDE8EC; color: var(--danger); }
.aa-v { font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; }
.v-supported .aa-vbig, .aa-v.v-supported { color: var(--ok); }
.v-refuted .aa-vbig, .aa-v.v-refuted { color: var(--danger); }
.v-inconclusive .aa-vbig, .aa-v.v-inconclusive { color: #B7791F; }
.aa-group { display: grid; grid-template-columns: 28px repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; max-width: 1200px; }
.aa-gn { font: 700 13px var(--font-ui); color: var(--ink-3); padding-top: 14px; }
.aa-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.aa-card.done { border-color: #DCD8CE; background: #F7F5F0; }
.aa-hl { font-size: 16.5px; font-weight: 700; line-height: 1.3; flex: 1; color: var(--ink); }
.aa-score { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.aa-score button { border: 1px solid var(--line-2); background: var(--card); border-radius: 6px; font: 600 12px var(--font-ui); padding: 5px 0; cursor: pointer; color: var(--ink-2); }
.aa-score button:hover { background: #F3F1EC; }
.aa-score button.on { background: #1D1D1B; border-color: #1D1D1B; color: #fff; }
.aa-card .aa-note { margin-top: 0; }
.aa-finish { margin: 18px 0 40px 38px; }
.aa-verdict .aa-vbig { font: 800 26px var(--font-ui); text-transform: uppercase; letter-spacing: .02em; }
.aa-claim { font-size: 16px; font-weight: 600; margin-top: 6px; }
.aa-nums { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.aa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1200px; }
.aa-tr { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.aa-tr summary { padding: 9px 12px; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; }
.aa-tr summary em { color: var(--ink-3); font-weight: 400; }
.aa-sc { display: inline-block; min-width: 26px; text-align: center; background: #E9E6DE; color: #1D1D1B; border-radius: 6px; margin-right: 8px; font-size: 12.5px; padding: 1px 4px; }
.aa-trace { padding: 4px 14px 12px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.aa-trace pre { white-space: pre-wrap; font: 12.5px var(--font-ui); background: #F7F5F0; padding: 8px 10px; border-radius: 6px; margin-top: 4px; max-height: 180px; overflow: auto; }
.aa-trace ol, .aa-trace ul, .aa-ul { padding-left: 20px; margin-top: 4px; }
.aa-trace li span { color: var(--ink-3); }
.aa-trace li.chosen { color: var(--ink); font-weight: 600; }
.aa-ign { color: var(--ink-3); }
.aa-ul li { margin-bottom: 4px; font-size: 14px; }
.aa-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.aa-tbl th, .aa-tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aa-tbl th { color: var(--ink-3); font-weight: 600; }
.aa-doc { max-width: 860px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 26px 26px; font-size: 14.5px; line-height: 1.55; }
.aa-doc h2 { font-size: 18px; margin: 24px 0 8px; }
.aa-doc p { margin: 8px 0; }
.aa-snote { margin-top: 8px; width: 100%; border: 1px solid transparent; background: transparent; font: 13px var(--font-ui); color: var(--ink-2); padding: 4px 6px; border-radius: 6px; }
.aa-snote:hover, .aa-snote:focus { border-color: var(--line-2); background: #F7F5F0; outline: none; }
@media (max-width: 900px) { .aa-group { grid-template-columns: 1fr 1fr; } .aa-gn { display: none; } .aa-cols { grid-template-columns: 1fr; } }
.acmp-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 0 2px 70px; cursor: pointer; touch-action: none; }
.acmp-track { position: relative; flex: 1; height: 6px; background: var(--line); border-radius: 3px; }
.acmp-row:hover .acmp-track, .acmp-row.on .acmp-track { height: 8px; }
.acmp-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fb); border-radius: 3px; pointer-events: none; }
.acmp-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #E11D48; border-radius: 1px; pointer-events: none; }
.acmp-time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.acmp-round { font-weight: 500; font-size: 11px; color: var(--ink-3); background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.aa-hood h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 16px 0 6px; }
.aa-tl { list-style: none; padding: 0; margin: 0; border-left: 2px solid #E9E3FB; }
.aa-tl li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 4px 0 4px 12px; font-size: 13.5px; color: var(--ink-2); position: relative; }
.aa-tl li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #DCD8CE; }
.aa-tl li.k-hypothesis::before, .aa-tl li.k-verdict::before { background: #1D1D1B; }
.aa-tl li.k-error::before, .aa-tl li.k-reject::before { background: var(--danger); }
.aa-tl li.k-memory-change::before, .aa-tl li.k-ready::before { background: var(--ok); }
.aa-tl li.k-hypothesis span:last-child, .aa-tl li.k-verdict span:last-child { color: var(--ink); font-weight: 600; }
.aa-tt { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.aa-chosen { background: #F7F5FF; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.aa-why { margin-top: 6px; font-size: 13.5px; }
.aa-cons ul { padding-left: 18px; margin-top: 6px; font-size: 13.5px; }
.aa-cons li { margin-bottom: 6px; }
.aa-cons { margin-top: 10px; }
.aa-k { font-family: var(--font-mono); font-size: 12px; background: #E9E6DE; border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
.aa-hide { background: #FFF8E6; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.aa-io { margin-top: 10px; font-size: 13px; }
.aa-io summary { cursor: pointer; color: #1D1D1B; font-weight: 600; }
.aa-ioc { margin-top: 8px; }
.aa-ioc pre { white-space: pre-wrap; font: 12px var(--font-mono); background: #F7F5F0; padding: 8px 10px; border-radius: 6px; max-height: 320px; overflow: auto; margin: 4px 0 8px; }
.aa-iol { font-weight: 700; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.aa-more { float: right; font-size: 13px; font-weight: 600; color: #1D1D1B; text-decoration: none; }
.aa-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; font-size: 14px; }
.aa-two p { color: var(--ink-2); margin-top: 4px; }
.aa-conf { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #B7791F; margin-right: 4px; }
.aa-conf.c-clear, .aa-conf.c-fairly-clear { color: var(--ok); }
.aa-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.aa-chips span { background: #E9E6DE; border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--ink-2); }
.aa-fm { margin-left: 8px; font-size: 11.5px; font-weight: 600; color: #1D1D1B; background: #F3F1EC; border-radius: 999px; padding: 1px 8px; }
.aa-odds td { vertical-align: middle; }
.aa-odds tr.untried td { color: var(--ink-3); }
.aa-bar { display: inline-block; width: 120px; height: 8px; background: #E9E6DE; border-radius: 4px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.aa-bar i { display: block; height: 100%; background: #1D1D1B; }
.aa-lede { max-width: 860px; margin-bottom: 12px; }
@media (max-width: 900px) { .aa-two { grid-template-columns: 1fr; } }
.still-sec { margin-bottom: 26px; }
.still-sec-h { margin: 4px 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); position: sticky; top: 0; background: var(--canvas); padding: 6px 0; z-index: 2; }
.still-sec-h span { font-weight: 500; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.card.still.rankable { cursor: grab; }
.card.still.dragging { opacity: .45; }
.still-rank { position: absolute; top: 10px; left: 10px; z-index: 3; background: rgba(17,17,17,.78); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.still-rank.top { background: #0E9F6E; }
.still-kept { position: absolute; top: 40px; left: 10px; z-index: 3; background: #0E9F6E; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.mv.mv-kept { background: #E7F6EF; color: #0B7A55; border: 1px solid #9FD9BF; font-weight: 700; }

/* ════════════════ phone: top bar + nav drawer; status column becomes a chip strip ════════════════ */
.mbar, .mnav-scrim { display: none; }
@media (max-width: 760px) {
  .app { flex-direction: column; height: 100dvh; }
  .app-main { min-height: 0; }
  .mbar { display: flex; align-items: center; gap: 8px; height: 52px; flex-shrink: 0; padding: 0 8px; background: var(--card); border-bottom: 1px solid var(--line); }
  .mbar-btn { border: 0; background: none; color: var(--ink); width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
  .mbar-btn:active { background: var(--canvas); }
  .mbar-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
  .mainnav { position: fixed; top: 0; bottom: 0; left: 0; width: min(280px, 82vw) !important; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.mnav-open .mainnav { transform: none; box-shadow: 0 0 24px rgba(0,0,0,.18); }
  .mnav-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  body.mnav-open .mnav-scrim { display: block; }
  .mn-item { padding: 9px 8px; }
  .subcol { width: auto !important; flex-direction: row; flex-shrink: 0; overflow-x: auto; overflow-y: hidden; gap: 6px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .subcol::-webkit-scrollbar { display: none; }
  .subcol .sc-head, .subcol .sc-group { display: none; }
  .subcol .sc-item { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
  .subcol .sc-item .sc-n { margin-left: 4px; }
  .rz { display: none; }
  .pagehead { padding: 14px 14px 2px; }
  .ph-row h1 { font-size: 22px; }
  /* modals fill the phone and stack: media on top, details below */
  .modal-overlay { place-items: stretch; }
  .modal { width: 100vw !important; height: 100dvh !important; max-height: none; border-radius: 0; overflow-y: auto; }
  .modal.detail { flex-direction: column; }
  .modal.detail > * { flex-shrink: 0; }
  .modal-nav.next { right: 12px; }
  .vm-body { grid-template-columns: 1fr; }
  .vm-player video, .has-orig .vm-player video { max-height: 72dvh; }
  .has-orig .vm-player { flex-direction: column; }
  .vm-side { max-height: none; padding: 16px; }
  .vm-status { flex-wrap: wrap; }
  .modal-close { top: 8px; right: 8px; width: 40px; height: 40px; background: rgba(255,255,255,.9); }
}

/* ---- Settings: gear button + API keys page ---- */
.mn-settings {
  border: 0; background: none; cursor: pointer; font-family: var(--font-ui); font-size: 15px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 11px; border-radius: 8px; padding: 8px 10px; margin-top: 6px;
}
.mn-settings svg { color: var(--ink-3); }
.mn-settings:hover { background: var(--canvas); }
.mn-settings.on { background: var(--fb-tint); color: var(--fb); }
.mn-settings.on svg { color: var(--fb); }
.mn-back { margin-bottom: 4px; }
.keys { max-width: 980px; display: flex; flex-direction: column; gap: 22px; }
.k-intro { color: var(--ink-2); font-size: 14px; max-width: 70ch; margin: 0; }
.k-intro code, .k-meta code { background: var(--canvas); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.k-msg { background: var(--fb-tint); color: var(--fb); border-radius: 8px; padding: 9px 12px; font-size: 14px; font-weight: 600; }
.k-group h2 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.k-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.k-card.is-off { opacity: .6; }
.k-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.k-name { font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.k-models { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.k-note { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.k-pill { font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
.k-pill.ok { background: #DCFCE7; color: #166534; }
.k-pill.off { background: var(--canvas); color: var(--ink-3); }
.k-keyrow { display: flex; gap: 8px; }
.k-input, .k-add input, .k-add select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: var(--card); color: var(--ink); }
.k-meta { font-size: 12.5px; color: var(--ink-3); }
.k-remove { align-self: flex-start; border: 0; background: none; color: #DC2626; font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.k-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.k-switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.k-switch span { position: absolute; inset: 0; background: #CBD5E1; border-radius: 99px; transition: background .15s; pointer-events: none; }
.k-switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; }
.k-switch input:checked + span { background: var(--fb); }
.k-switch input:checked + span::after { transform: translateX(18px); }
.k-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 640px; margin-bottom: 8px; }
.k-addbtns { grid-column: 1 / -1; display: flex; gap: 8px; }
@media (max-width: 760px) { .k-grid { grid-template-columns: 1fr; } .k-add { grid-template-columns: 1fr; } }

/* ---- Workspace switcher ---- */
.ws { position: relative; margin: 0 0 6px; }
.ws-btn { width: 100%; border: 1px solid var(--line); background: var(--canvas); border-radius: 9px; padding: 7px 10px; cursor: pointer; font-family: var(--font-ui); text-align: left; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center; }
.ws-btn:hover { border-color: var(--ink-3); }
.ws-k { grid-column: 1; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ws-name { grid-column: 1; font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-caret { grid-column: 2; grid-row: 1 / span 2; color: var(--ink-3); font-size: 12px; }
.ws-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 5px; }
.ws-item { width: 100%; border: 0; background: none; cursor: pointer; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: left; border-radius: 7px; padding: 7px 9px; display: flex; justify-content: space-between; gap: 8px; }
.ws-item:hover { background: var(--canvas); }
.ws-item.on { color: var(--fb); }
.ws-new { color: var(--fb); }
.ws-sep { height: 1px; background: var(--line); margin: 4px 2px; }

.ws-row { display: flex; align-items: center; gap: 2px; }
.ws-row .ws-item { flex: 1; min-width: 0; }
.ws-del { border: 0; background: none; cursor: pointer; font-size: 13px; padding: 5px 7px; border-radius: 6px; opacity: 0; filter: grayscale(1); }
.ws-row:hover .ws-del, .ws-del:focus-visible { opacity: .75; }
.ws-del:hover { opacity: 1; background: #FEE2E2; filter: none; }

/* workspace menu: blue arrow marks the selected one, centered; Delete current is red */
.ws-item { align-items: center; justify-content: flex-start; gap: 6px; }
.ws-arrow { width: 14px; flex-shrink: 0; color: var(--fb); font-weight: 800; text-align: center; line-height: 1; }
.ws-label { min-width: 0; }
.ws-delete { color: #DC2626; }
.ws-delete:hover { background: #FEE2E2; }
.ws-item.on { color: var(--ink); }

/* workspace menu: selected row = blue-tinted gray container, bigger arrow, more space before the name */
.ws-item { gap: 12px; padding: 8px 10px; }
.ws-arrow { width: 22px; font-size: 20px; }
.ws-item.on { background: #E9E6DE; box-shadow: inset 0 0 0 1px #DCD8CE; }
.ws-item.on:hover { background: #E2DED4; }

/* Ads OS logo: Praxis brand kit (Cobalt #1D1D1B, Archivo wide bold, square edges) */
.mn-brand { gap: 10px; }
.mn-logo { display: block; width: 28px; height: 28px; flex-shrink: 0; }
.mn-brand b { font: 800 18px/1 var(--font-ui); font-stretch: 125%; letter-spacing: .02em; color: #000; }

/* empty state: the original rounded tile and sparkle, recolored from the Instagram gradient to Praxis cobalt */
.empty-mark { background: linear-gradient(135deg, #3A3A36 0%, #1D1D1B 52%, #1D1D1B 100%); }
/* workspace menu: same breathing room to the right of the name as between arrow and name */
.ws-item { padding-right: 22px; }

/* ad cards: 4 per row, delete button, meta line */
.gallery.gen-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .gallery.gen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .gallery.gen-grid { grid-template-columns: 1fr; } }
.chip.ratio { background: var(--canvas); color: var(--ink-3); flex-shrink: 0; }
.card-top { margin-bottom: 7px; }
.card-body { padding-bottom: 8px; }
.card-move .mv.mv-del { color: var(--ink-3); }
.card-move .mv.mv-del:hover { border-color: #D93025; color: #D93025; background: #FDEEED; }

/* Ads OS wordmark: Poppins */
.mn-brand b { font: 700 19px/1 var(--font-ui); letter-spacing: 0; font-stretch: normal; }
.mn-logo { width: 38px; height: auto; }

/* Drafts: blueprint plus-grid from the Praxis kit (Light Silver ground, cobalt plus marks) */
.app-main {
  background: #F6F6F6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 17v10M17 22h10' stroke='%23144495' stroke-opacity='.22' stroke-width='1'/%3E%3C/svg%3E");
}
/* the grid lives on .app-main for every section: it sits behind each page header and fills the space when the second menu collapses */
.app-main .pagehead, .app-main .gallery-wrap { background: transparent; }

/* empty state: a card centered in the whole workspace */
.app-main { position: relative; }
#emptyState, #videoEmpty {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; z-index: 2;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 6px 24px rgba(29,29,27,.08);
  padding: 32px 44px; max-width: min(440px, 90%); text-align: center;
}
#emptyState .empty-mark, #videoEmpty .empty-mark { margin: 0 auto 14px; }

/* collapsible second menu */
.app { position: relative; }
.sub-toggle {
  position: absolute; top: 24px; left: calc(var(--mn-w, 236px) + var(--sc-w, 214px) - 13px); z-index: 30;
  width: 26px; height: 26px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 50%;
  font: 600 17px/1 var(--font-ui); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.sub-toggle:hover { border-color: #1D1D1B; color: #1D1D1B; }
body.sub-collapsed .subcol { display: none; }
body.sub-collapsed .sub-toggle { left: calc(var(--mn-w, 236px) - 13px); }
@media (max-width: 760px) { .sub-toggle { display: none; } }

/* Coming soon */
.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 8px 0; }
.soon-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: 0 4px 16px rgba(29,29,27,.06); }
.soon-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.soon-card p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.ref-badge.ref-named { font-size: 12px; padding: 3px 8px; max-width: calc(100% - 52px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Jeremy AI feedback modal */
#jeremyModal { position: fixed; inset: 0; z-index: 200; background: rgba(12,26,18,.55); display: grid; place-items: center; padding: 24px; }
#jeremyModal .jm-card { background: #fff; border-radius: 16px; max-width: 640px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#jeremyModal .jm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
#jeremyModal .jm-body { padding: 18px 20px; overflow-y: auto; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

.mv-del-bar { background: #D93025; color: #fff; border-color: #D93025; }
.mv-del-bar:hover { background: #B3261E; }
#compareBtn:disabled { opacity: .45; cursor: not-allowed; }

.compare-bar .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Download naming dialog */
#namingModal { position: fixed; inset: 0; z-index: 200; background: rgba(12,26,18,.5); display: grid; place-items: center; padding: 20px; }
#namingModal .nm-card { background: #fff; border-radius: 16px; padding: 22px 24px; width: min(440px, 100%); display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#namingModal h3 { font-size: 17px; font-weight: 800; margin: 0; }
#namingModal .nm-opt { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
#namingModal .nm-opt small { display: block; color: var(--ink-3); margin-top: 2px; }
#namingModal input[type=text] { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
#namingModal .nm-btns { display: flex; justify-content: flex-end; gap: 8px; }


/* ============ Creative OS: Praxis brand layer ============ */
/* logo: Praxis icon tile + Creative OS in Bricolage ExtraBold */
.mn-brand { gap: 10px; }
.mn-logo { width: 32px; height: 32px; border-radius: 0; }
.mn-brand b { font: 800 19px/1 var(--font-ui); letter-spacing: -.03em; color: var(--ink); font-stretch: normal; }
.mbar-title { letter-spacing: -.03em; }

/* headlines run tight */
h1, h2, h3, .sc-head h2, .pagehead h1 { letter-spacing: -.03em; }

/* eyebrows and labels: Fragment Mono, caps, open tracking */
.mn-group, .sc-group, .ws-k, .mn-spend span {
  font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.mn-spend b, .sc-item .sc-n, .count { font-family: var(--font-mono); font-weight: 400; }

/* main nav: one palette. Mute icons, active item is an Ink tile with a Lime icon */
.mn-ic { color: var(--ink-2); }
.mn-item:hover { background: var(--fog); }
.mn-item.on { background: var(--fog); color: var(--ink); }
.mn-item.on .mn-ic, .mn-item.on:hover .mn-ic { background: var(--ink); color: var(--lime); }
.mn-settings.on { background: var(--fog); color: var(--ink); }
.mn-settings.on svg { color: var(--ink); }
.mn-spend:hover b { color: var(--ink); }

/* status column: selected row lifts on Paper */
.sc-item:hover { background: var(--fog); }
.sc-item.on { background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(29,29,27,.06); }
.sc-item.on .sc-n { color: var(--ink); }

/* workspace picker */
.ws-arrow { color: var(--ink); }

/* buttons: primary actions in Ink with Paper type */
.btn.primary, .btn-primary { background: var(--ink); color: var(--canvas); }
.btn.primary:hover, .btn-primary:hover { background: #000; }

/* empty state: the Praxis tile, Lime sparkle on Ink */
.empty-mark { background: var(--ink); color: var(--lime); }
.btn.generate { color: var(--lime); }

/* canvas: Paper with the plus-grid in Line */
.app-main {
  background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 17v10M17 22h10' stroke='%231D1D1B' stroke-opacity='.12' stroke-width='1'/%3E%3C/svg%3E");
}
.mainnav, .subcol { background: var(--card); }
#emptyState, #videoEmpty, .soon-card { background: var(--card); }
.sub-toggle { background: var(--card); }
.sub-toggle:hover { border-color: var(--ink); color: var(--ink); }

/* focus rings in Ink, never browser blue */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--lime); }
