/* ============================================================
   app.css — screen layout (sidebar shell, composer, results,
   library, prompts, settings). Tokens only; components come
   from components.css.
   ============================================================ */

body { display: flex; }
#app { display: flex; flex: 1; min-width: 0; }

/* ---------------- sidebar ---------------- */

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 26px;
  font-weight: 600;
  font-size: 16px;
}
.logo img { max-height: 24px; display: block; }
.logo .wordmark { height: 26px; width: auto; display: block; color: var(--text); }
.logo .brandmark { display: none; width: 26px; height: 26px; }

/* ---------------- collapsible sidebar ---------------- */
.side-top { display: flex; align-items: center; justify-content: space-between; }
.side-collapse {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); margin-bottom: 26px;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.side-collapse:hover { background: var(--surface-2); color: var(--text); }
.side-collapse svg { width: 15px; height: 15px; transition: transform var(--dur-open) var(--ease); }

body.rail .sidebar { width: 68px; padding: 24px 10px; }
body.rail .logo { padding: 0 6px 26px; }
body.rail .logo .wordmark { display: none; }
body.rail .logo .brandmark { display: block; }
.nav button span { white-space: nowrap; overflow: hidden; max-width: 170px;
  opacity: 1; transition: max-width var(--dur-open) var(--ease), opacity .16s var(--ease); }
body.rail .nav button span { max-width: 0; opacity: 0; }
body.rail .sidebar-foot .segmented { display: none; }
body.rail .nav button { justify-content: center; padding: 11px 0; gap: 0; }
.side-collapse { border: 1px solid var(--hairline); background: var(--surface); }
body.rail .side-collapse { position: absolute; right: -14px; top: 26px; z-index: 5;
  box-shadow: var(--shadow); }
body.rail .side-collapse svg { transform: rotate(180deg); }
body.rail .status-row { justify-content: center; }
.sidebar { transition: width var(--dur-open) var(--ease), padding var(--dur-open) var(--ease); }

.nav { display: flex; flex-direction: column; gap: 3px; }
body.rail .nav button { position: relative; }
body:not(.rail) .nav button[data-tip]:hover::after,
body:not(.rail) .nav button[data-tip]:focus-visible::after { content: none; }
body.rail .nav button[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 6px 11px; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; z-index: 80; box-shadow: var(--shadow);
  pointer-events: none;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  text-align: left;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.active { background: var(--accent-tint); color: var(--accent); }
.nav svg { width: 18px; height: 18px; stroke-width: 1.7; flex-shrink: 0; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px;
}
.status-row {
  color: var(--text-faint);
  font-size: var(--fs-label);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.status-dot.bad { background: var(--danger); }

/* ---------------- main canvas ---------------- */

.main { flex: 1; display: flex; justify-content: center; padding: 44px 36px; min-width: 0; }
/* YouTube-scale content width: tiles stay big on 24" AND 34" screens
   (was 1080px — on ultrawides the grid shrank to thumbnail soup) */
.canvas { width: 100%; max-width: 1760px; }

/* ---------------- composer (New clips) ---------------- */

.hero { text-align: center; margin-bottom: 36px; position: relative; }
/* faint brand wordmark behind the composer — barely-there amber tint,
   not Opus's flat grey. Sits behind everything; never interactable. */
.hero-mark {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-weight: 700;
  font-size: clamp(60px, 12vw, 168px);
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--watermark);
}
@media (prefers-reduced-motion: no-preference) { .hero-mark { transition: color var(--dur-open) var(--ease); } }
.hero h1 { font-size: var(--fs-hero); font-weight: 600; margin-bottom: 6px; }
.hero > p { color: var(--text-muted); margin-bottom: 26px; }

.linkbox {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 22px;
  align-items: center;
  transition: border-color var(--dur-hover) var(--ease);
}
.linkbox:focus-within { border-color: var(--accent); }
.linkbox svg { flex-shrink: 0; color: var(--text-faint); }
.linkbox input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font: var(--fs-base) var(--font-data);
  outline: none;
  min-width: 0;
}
.linkbox input::placeholder { font-family: var(--font-ui); }

.composer-zone { max-width: 720px; margin: 0 auto; text-align: left; }

#range-strip { margin-top: 18px; }
.range-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-label);
  margin-bottom: 2px;
}
.probe-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
#probe-thumb {
  height: 38px; aspect-ratio: 16/9; object-fit: cover; flex: none;
  border-radius: 8px; border: 1px solid var(--hairline);
  background: var(--surface-2);
}
#probe-title {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#range-label { color: var(--accent); font: var(--fs-label) var(--font-data); white-space: nowrap; }

.composer-toggle-row { text-align: center; margin-top: 16px; }

#settings-panel { margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.subgrid { display: flex; gap: 10px; }
.subgrid .field { flex: 1; }

#advanced-zone { margin-top: 16px; }
#advanced-fields { margin-top: 14px; }

.prompt-block { margin-top: 16px; }
.prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.prompt-head .label { margin: 0; }

#progress-card { max-width: 720px; margin: 22px auto 0; }
#composer-error, #notice { max-width: 720px; margin: 22px auto 0; text-align: left; }

/* ---------------- results ---------------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 16px;
}
.section-head .head-text { min-width: 0; }
.section-head h2 {
  font-size: var(--fs-title);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-head .count { font: var(--fs-label) var(--font-data); color: var(--text-faint); }
.section-head .head-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 4-up compact grid (Opus-style density) */
.cards {
  display: grid;
  /* YouTube-sized tiles: ~360-440px wide at every screen size */
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
@media (max-width: 820px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
@media (max-width: 540px)  { .cards { grid-template-columns: 1fr; } }

/* caption style gallery — demos preview the on-video look, so their
   plate stays dark in both themes */
.cap-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.cap-card {
  font: inherit;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  text-align: left;
  transition: border-color var(--dur-hover) var(--ease);
}
.cap-card:hover { border-color: var(--text-faint); }
.cap-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cap-card .cap-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 68px;
  padding: 0 6px;
  /* clean neutral stage — every style must read against it */
  background: linear-gradient(180deg, #1E1E24, #141419);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
}
.cap-card .cap-name {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 7px 9px;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}
.cap-card.on .cap-name { color: var(--text); }
.cap-demo i { font-style: normal; }
.cap-demo .cap-off { color: #9a9aa2; font-weight: 600; }
.cap-clean { text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.cap-yellow {
  font-family: Impact, "Arial Black", sans-serif;
  color: #ffd400;
  text-shadow: 0 0 3px #000, 0 2px 2px #000;
  letter-spacing: .3px;
}
.cap-karaoke { text-shadow: 0 0 3px #000; }
.cap-karaoke i { color: #ffd400; }
.cap-wordpop { font-size: 19px; text-shadow: 0 0 4px #000, 0 2px 3px #000; }
.cap-karaoke span, .cap-greenword span { background: none; }
.cap-boxed span { background: #000; padding: 3px 7px; }
.cap-subtitle { font-weight: 700; }
.cap-subtitle span { background: rgba(0, 0, 0, .8); color: #fff; padding: 3px 9px; border-radius: 2px; }
.cap-greenword { text-shadow: 0 0 3px #000; }
.cap-greenword i { color: #22c55e; }
.cap-minimal { font-weight: 600; }
.cap-minimal span { background: rgba(0, 0, 0, .72); padding: 3px 8px; }
.cap-neon { text-shadow: 0 0 6px #00e5ff, 0 0 12px #00e5ff; }

/* per-clip note (e.g. tracking fell back to center crop) */
.card-note {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin: 8px 0 0;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--warn);
  background: var(--warn-tint);
  border-radius: var(--radius-sm);
}
.card-note::before { content: "ⓘ"; font-size: 12px; }

/* recent projects strip (homepage, under the composer/results) */
#recent { margin-top: 56px; }
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.recent-card {
  font: inherit;
  text-align: left;
  padding: 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--dur-hover) var(--ease);
}
.recent-card:hover { border-color: var(--text-faint); }
.recent-card .r-thumb { aspect-ratio: 16 / 9; background: var(--surface-2); }
.recent-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-card .r-text { padding: 10px 12px 12px; }
.recent-card .r-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-card .r-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* uploaded-file chip + drag state */
.upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
}
.upload-chip svg { color: var(--accent); flex: none; }
.upload-chip .chip-x {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.upload-chip .chip-x:hover { color: var(--text); background: var(--surface-2); }
.hero.dropping .linkbox { border-color: var(--accent); box-shadow: var(--focus-ring); }

/* clip card internals */
.clip-card { display: flex; flex-direction: column; }
.clip-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  /* the card no longer clips its children (the ⋯ menu must escape it),
     so the thumb rounds its own top corners; -1px hugs the card border */
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
}
.clip-card video { width: 100%; height: 100%; display: block; background: var(--surface-2); }
/* 9:16 clips: portrait video pillarboxed inside the same 16:9 thumb area,
   so the grid stays uniform when a re-cut mixes formats in one job.
   Letterbox bars are video-standard black in both themes. */
.clip-card .thumb.portrait, .clip-card .thumb.portrait video { background: #000; }
.clip-card .thumb.portrait video { object-fit: contain; }
.clip-card .dur-chip {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--video-scrim);
  color: #F2F1ED;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font: 11px var(--font-data);
  pointer-events: none;
}
.clip-card .hot-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--video-scrim);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.data-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ts { font: var(--fs-label) var(--font-data); color: var(--text-muted); }
.card-body h3 { font-size: var(--fs-title); font-weight: 600; margin: 10px 0 4px; }
.why { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

.tweet {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: 12px/1.75 var(--font-data);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 158px; /* ~9 lines */
  overflow: hidden;
  position: relative;
}
.tweet.expanded { max-height: none; }
.tweet::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38px;
  background: linear-gradient(transparent, var(--surface-2));
  pointer-events: none;
}
.tweet.expanded::after, .tweet.short::after { display: none; }

.showall {
  font-size: var(--fs-label);
  color: var(--accent);
  margin-top: 8px;
  align-self: flex-start;
  border-radius: var(--radius-pill);
  padding: 2px 6px;
}
.verify { font-size: 11px; color: var(--text-faint); margin-top: 10px; }

.card-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.card-actions .spacer { flex: 1; }

.clip-card.posted .thumb, .clip-card.posted .tweet,
.clip-card.posted h3, .clip-card.posted .why { opacity: .45; }

/* variant blocks inside the rewrite modal */
.variant-box {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
}
.variant-box .tweet { max-height: 200px; overflow-y: auto; }
.variant-box .variant-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------------- library (card grid, like the dashboard) ---------------- */

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}
.lib-card {
  position: relative;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--dur-hover) var(--ease);
}
.lib-card:hover { border-color: var(--text-faint); }
.lib-thumb {
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
  background: var(--surface-2);
}
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-body { padding: 11px 13px 13px; min-width: 0; }
.lib-title {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}
.lib-sub {
  display: flex;
  align-items: center;
  gap: 7px 9px;
  font: var(--fs-label) var(--font-data);
  color: var(--text-muted);
  flex-wrap: wrap;
}
/* ⋯ button floats over the thumbnail's top-right. No z-index here on
   purpose — it would trap the open popover below neighbouring cards' dots;
   the absolutely-positioned button already sits above the thumbnail. */
.lib-menu { position: absolute; top: 6px; right: 6px; }
.menu-dots {
  width: 30px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--video-scrim);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.menu-dots:hover { background: rgb(0 0 0 / .85); }

/* ---------------- prompts ---------------- */

.prompt-card { margin-bottom: 14px; padding: 20px; }
.prompt-card .p-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.prompt-card .p-head h3 { font-size: var(--fs-base); font-weight: 600; }
.prompt-card pre {
  font: 11.5px/1.65 var(--font-data);
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 120px;
  overflow: hidden;
  position: relative;
}
.prompt-card pre.expanded { max-height: none; }
.prompt-card textarea { margin-bottom: 12px; }

/* ---------------- settings ---------------- */

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .s-text { min-width: 0; }
.settings-row .s-title { font-weight: 500; margin-bottom: 2px; }
.settings-row .s-sub { font-size: var(--fs-label); color: var(--text-muted); }
.settings-row pre.cmd {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: var(--fs-label) var(--font-data);
  user-select: all;
  margin-top: 8px;
  overflow-x: auto;
}

/* view titles (library/prompts/settings) */
.view-head { margin-bottom: 22px; }
.view-head h1 { font-size: var(--fs-hero); font-weight: 600; }
.view-head p { color: var(--text-muted); margin-top: 4px; }

/* ---------------- setup (engine not ready) ---------------- */

.setup-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.setup-card { max-width: 620px; width: 100%; }
.setup-card .logo { padding: 0 0 18px; }
.setup-card h1 { font-size: var(--fs-hero); font-weight: 600; margin-bottom: 10px; }
.setup-card p { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
.setup-card pre.cmd {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: 13px var(--font-data);
  user-select: all;
  margin: 8px 0 14px;
  overflow-x: auto;
}

/* ---------------- Brand Kit ---------------- */

.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-size: var(--fs-label); font-weight: 500;
}
.linklike:hover { text-decoration: underline; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.brand-card {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
}
.brand-card-logo {
  width: 56px; height: 56px; flex: none; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-card-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-card-logo.empty::after { content: "—"; color: var(--text-faint); }
.brand-card-body { flex: 1; min-width: 0; }
.brand-card-body h3 { font-size: var(--fs-base); font-weight: 600; }
.brand-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 6px; font-size: var(--fs-label); color: var(--text-muted);
}
.brand-card-actions { display: flex; gap: 4px; flex: none; }

.swatches { display: inline-flex; gap: 4px; }
.swatch {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--hairline); display: inline-block;
}

.brand-asset-row { display: flex; align-items: center; gap: 12px; }
.brand-logo-preview {
  width: 72px; height: 72px; flex: none; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--hairline);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo-preview span { font-size: var(--fs-label); color: var(--text-faint); }
.brand-font-name {
  flex: 1; font-family: var(--font-data); font-size: 13px; color: var(--text-muted);
}
.field input[type="color"] {
  width: 100%; height: 38px; padding: 3px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}

/* ---------------- nav groups ---------------- */
.nav-group {
  font: 600 10.5px var(--font-ui); letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint); padding: 14px 14px 5px;
}
.nav-group:first-child { padding-top: 0; }
.nav-sep { display: block; height: 1px; background: var(--hairline); margin: 14px 8px 8px; }
.nav .nav-minor { font-size: 13.5px; padding: 8px 14px; }
.nav .nav-minor svg { width: 16px; height: 16px; }
body.rail .nav-group { visibility: hidden; height: 8px; padding: 0; }
body.rail .nav-sep { margin: 8px 4px; }
.sidebar { overflow-y: auto; scrollbar-width: none; }

/* ---------------- compact clip cards + score ---------------- */
.clip-card.compact { cursor: pointer; }
.clip-card.compact:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compact-body { padding: 12px 14px 14px; }
.compact-body h3 {
  font-size: 13.5px; font-weight: 600; line-height: 1.4; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.compact-meta { display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-faint); }
.score-chip {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font: 700 12px var(--font-data);
  background: var(--video-scrim); color: #fff;
  border-radius: var(--radius-pill); padding: 3px 9px;
}
.score-chip.hot { background: var(--accent-solid); color: var(--accent-ink); }

/* ---------------- clip detail overlay (Opus-style expand) ---------------- */
.detail-bd { display: flex; align-items: center; justify-content: center; overflow-y: auto; }
.detail {
  width: min(980px, 94vw); max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px 24px;
}
.detail-top { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.detail-nav { display: flex; gap: 4px; }
.detail-grid {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 190px; gap: 20px;
  align-items: start;
}
.detail-score .d-num { font: 800 40px/1 var(--font-ui); letter-spacing: -0.02em; }
.detail-score .d-num span { font-size: 16px; color: var(--text-faint); font-weight: 600; }
.d-grades { margin-top: 16px; display: flex; flex-direction: column; gap: 8px;
  font-size: 13px; color: var(--text-muted); }
.d-grades i {
  font-style: normal; font: 700 12px var(--font-data); color: var(--success);
  display: inline-block; width: 26px;
}
.d-why { margin-top: 16px; font-size: 12.5px; color: var(--text-muted); }
.detail-player video { width: 100%; border-radius: var(--radius-sm); background: #000; display: block; max-height: 56vh; }
.detail-player.portrait video { max-width: 300px; margin: 0 auto; }
.detail-mid { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.d-variants {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 16px;
}
.dv-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.dv-label span { display: block; font-weight: 400; color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
.dv-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dv-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 12px var(--font-ui); color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 5px 11px; cursor: pointer;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.dv-chip i { font: 700 10px var(--font-data); font-style: normal; color: var(--accent); }
.dv-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent-solid) 50%, var(--hairline)); }
.dv-chip:disabled { opacity: .5; cursor: default; }
.detail-actions { display: flex; flex-direction: column; gap: 6px; }
.d-act {
  text-align: left; font-size: 13px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text);
  transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.d-act:hover { border-color: var(--accent); }
.d-act.primary { background: var(--accent-solid); color: var(--accent-ink); border-color: transparent; }
.detail-copy { margin-top: 20px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.detail-copy .d-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.detail-copy h3 { font-size: 16px; margin-bottom: 10px; }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: row; flex-wrap: wrap; }
}

/* ---------------- calendar ---------------- */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-dow { font: 600 11px var(--font-ui); color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; }
.cal-day {
  min-height: 92px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.cal-day .d { font: 500 11.5px var(--font-data); color: var(--text-faint); }
.cal-day.today { border-color: var(--accent); }
.cal-day.today .d { color: var(--accent); font-weight: 700; }
.cal-chip {
  font: 500 10.5px var(--font-data); text-align: left;
  background: var(--accent-tint); color: var(--accent);
  border-radius: 6px; padding: 3px 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal-chip.waiting { background: var(--warn-tint); color: var(--warn); }
.cal-chip.posted { background: var(--success-tint); color: var(--success); }

/* ---------------- stats / analytics ---------------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 18px;
}
.stat b { display: block; font: 700 26px/1.1 var(--font-ui); letter-spacing: -0.02em; }
.stat span { font-size: 12px; color: var(--text-muted); }
.panel-title { font-size: var(--fs-title); font-weight: 600; margin-bottom: 14px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars .bar { flex: 1; background: var(--surface-2); border-radius: 3px 3px 0 0; }
.bars .bar.has { background: var(--accent); opacity: .85; }
.an-row { display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.an-row:last-child { border-bottom: 0; }
.an-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------------- social / tiers / api / help ---------------- */
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.social-card h3 { font-size: 15px; margin-bottom: 6px; }
.social-card .social-row { display: flex; gap: 8px; margin: 12px 0 10px; }
.social-card input { flex: 1; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.tier { position: relative; display: flex; flex-direction: column; gap: 4px; }
.tier.featured { border-color: var(--accent); }
.tier-flag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font: 600 10.5px var(--font-ui); background: var(--accent-solid); color: var(--accent-ink);
  border-radius: var(--radius-pill); padding: 3px 12px; white-space: nowrap;
}
.tier h3 { font-size: 15px; }
.tier-price { font: 800 32px/1.1 var(--font-ui); letter-spacing: -0.02em; }
.tier-list { list-style: none; margin: 14px 0 16px; display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px; color: var(--text-muted); flex: 1; }
.tier-list li { padding-left: 18px; position: relative; }
.tier-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.api-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--hairline); font-size: 13px; }
.api-row:last-child { border-bottom: 0; }
.help-item {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 0 18px; margin-bottom: 8px;
}
.help-item summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 14px 0; list-style: none; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::before { content: "+"; color: var(--accent); margin-right: 10px; font-weight: 700; }
.help-item[open] summary::before { content: "−"; }
.help-item p { padding: 0 0 16px 22px; color: var(--text-muted); font-size: 13.5px; }
.linklike-row { display: flex; }

/* ---------------- account chip ---------------- */
.account-chip {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  background: var(--surface-2); border-radius: var(--radius);
}
.account-chip img { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.account-chip .acc-text { flex: 1; min-width: 0; line-height: 1.25; }
.account-chip b { display: block; font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-chip i { display: block; font-style: normal; font-size: 10.5px; color: var(--text-faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.rail .account-chip { display: none; }

/* ---------------- support chat widget ---------------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-solid); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: transform var(--dur-hover) var(--ease);
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.chat-fab svg { width: 22px; height: 22px; }
.chat-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font: 700 10.5px/18px var(--font-data); text-align: center; padding: 0 4px;
}
.chat-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 70;
  width: min(360px, calc(100vw - 44px)); height: 460px; max-height: 70vh;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.chat-head b { font-size: 14px; flex: 1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg {
  max-width: 82%; padding: 8px 12px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.mine { align-self: flex-end; background: var(--accent-solid); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.chat-msg.theirs { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.chat-inrow { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--hairline); }
.chat-inrow input { flex: 1; }

/* ---------------- admin ---------------- */
.admin-tabs { margin-bottom: 20px; }
.admin-tabs .pill { margin-left: 6px; }
.adm-addrow { display: grid; grid-template-columns: 2fr 1.4fr auto 90px auto; gap: 8px; }
.adm-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--hairline); font-size: 13px; flex-wrap: wrap;
}
.adm-user:last-child { border-bottom: 0; }
.adm-user.off { opacity: .55; }
.adm-user .au-id { min-width: 200px; line-height: 1.3; }
.adm-user .au-id b { display: block; font-size: 13.5px; }
.adm-user .au-id i { font-style: normal; font-size: 11.5px; color: var(--text-faint); }
.support-split { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
.sup-list { padding: 10px; max-height: 60vh; overflow-y: auto; }
.sup-row {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  border-radius: var(--radius-sm); line-height: 1.35;
}
.sup-row:hover, .sup-row.on { background: var(--surface-2); }
.sup-row b { font-size: 13px; display: inline-block; margin-right: 6px; }
.sup-row i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-faint);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sup-thread { display: flex; flex-direction: column; min-height: 380px; max-height: 60vh; }
.sup-thread .chat-msgs { border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.sup-thread .chat-inrow { border-top: 0; padding: 10px 0 0; }
@media (max-width: 900px) { .support-split { grid-template-columns: 1fr; } .adm-addrow { grid-template-columns: 1fr 1fr; } }

.flash { animation: flashring 1.6s var(--ease); }
@keyframes flashring {
  0%, 60% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px var(--focus-ring); border-radius: var(--radius-sm); }
  100% { box-shadow: none; }
}

/* ---------------- editor picker (editor as a tool) ---------------- */

.picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.picker-card {
  text-align: left; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform var(--dur-open) var(--ease), border-color var(--dur-open) var(--ease);
}
.picker-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.picker-card video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; pointer-events: none; }
.picker-card .p-body { display: block; padding: 12px 14px; }
.picker-card b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.picker-card i { display: block; font: 400 11px var(--font-data); color: var(--text-faint); margin-top: 6px; font-style: normal; }

/* ---------------- unified card actions ---------------- */

.card-actions.unified { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.card-actions.unified .menu-wrap { display: block; }
.card-actions.unified .act {
  width: 100%; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding-inline: 6px;
}
.card-actions.unified .act svg { width: 14px; height: 14px; flex: none; }

/* b-roll rows + timeline bands */
.cutband.cut-broll { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.cut-src.cut-broll, .broll-q { font-family: var(--font-data); }
.broll-q {
  flex: 1; min-width: 0; font-size: 12px; padding: 4px 8px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); color: var(--text);
}

/* ---------------- pro editor layout ---------------- */

body.editor-wide .canvas { max-width: none; }
.editor-main {
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 328px;
  gap: 16px; align-items: stretch;
  min-height: calc(100vh - 320px);
}
.editor-script {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; min-height: 0;
}
.script-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.script-head h3 { font-size: var(--fs-title); font-weight: 600; }
.script-body {
  flex: 1; overflow-y: auto; font-size: 14px; line-height: 2;
  user-select: text; cursor: text; min-height: 120px; max-height: 52vh;
}
.script-body .sw { cursor: pointer; border-radius: 4px; padding: 1px 1px; }
.script-body .sw:hover { background: var(--accent-tint); color: var(--accent); }
.script-body .sw.gone { text-decoration: line-through; color: var(--text-faint); }
.editor-script .help { margin-top: 10px; }

.editor-tools { display: flex; gap: 10px; min-height: 0; }
.tool-rail {
  display: flex; flex-direction: column; gap: 4px; flex: none; width: 62px;
}
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: var(--radius-sm);
  color: var(--text-faint); font-size: 10px; font-weight: 600;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover { background: var(--surface-2); color: var(--text); }
.rail-btn.active { background: var(--accent-tint); color: var(--accent); }
.tool-pages { flex: 1; min-width: 0; overflow-y: auto; }
.tool-page { height: 100%; }

.editor-dock {
  margin-top: 16px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 12px 16px 16px;
}
.editor-dock .editor-transport { margin: 0 0 10px; }
.editor-dock .editor-timeline { height: 88px; }

@media (max-width: 1100px) {
  .editor-main { grid-template-columns: 1fr; }
  .editor-script { max-height: 240px; }
  .editor-tools { flex-direction: column; }
  .tool-rail { flex-direction: row; width: auto; }
}

/* ---------------- Clip Editor ---------------- */

.editor-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
}
.editor-head h1 { font-size: var(--fs-h2); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-head-actions { display: flex; align-items: center; gap: 10px; }
.editor-head-actions .muted { font-size: var(--fs-label); white-space: nowrap; }


.editor-player {
  position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16 / 9; display: flex;
}
.editor-player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.editor-crop {
  position: absolute; top: 0; height: 100%;
  border: 2px solid var(--accent); background: rgba(0,229,255,0.08);
  cursor: ew-resize; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.35); box-sizing: border-box;
}
.editor-cap {
  position: absolute; left: 0; right: 0; padding: 0 6%; text-align: center;
  pointer-events: none; display: flex; flex-wrap: wrap; gap: 0 .4em;
  justify-content: center;
}
.editor-cap.cap-bottom { bottom: 8%; }
.editor-cap.cap-middle { top: 50%; transform: translateY(-50%); }
.editor-cap.cap-top { top: 8%; }
.editor-cap b {
  font-weight: 800; color: #fff; font-size: clamp(14px, 3vw, 30px);
  text-shadow: 0 0 4px #000, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}
.editor-cap b.on { color: var(--accent); }
/* boxed styles preview with a per-word black backing, like the burn-in */
.editor-cap.style-subtitle b, .editor-cap.style-boxed b, .editor-cap.style-minimal b {
  background: rgba(0,0,0,0.8); padding: 0.04em 0.22em; text-shadow: none;
}
.editor-cap.style-subtitle b.on, .editor-cap.style-boxed b.on,
.editor-cap.style-minimal b.on { color: #fff; }
/* per-style colours, mirroring CAPTION_STYLES so the preview reads like the
   burn: yellow/karaoke are yellow text, greenword highlights green, neon
   glows cyan, wordpop is bigger */
.editor-cap.style-yellow b, .editor-cap.style-yellow b.on,
.editor-cap.style-karaoke b.on { color: #ffd400; }
.editor-cap.style-greenword b.on { color: #22c55e; }
.editor-cap.style-neon b { text-shadow: 0 0 6px #00e5ff, 0 0 14px #00e5ff; }
.editor-cap.style-neon b.on { color: #00e5ff; }
.editor-cap.style-wordpop b { font-size: clamp(20px, 4.5vw, 44px); }
.editor-cap.style-wordpop b.on { color: #fff; }

.editor-transport { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
.editor-transport .mono { font-size: var(--fs-label); color: var(--text-muted); }
.editor-skip { display: flex; align-items: center; gap: 6px; font-size: var(--fs-label); color: var(--text-muted); cursor: pointer; }

.editor-timeline {
  position: relative; height: 72px; background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; user-select: none;
}
.editor-timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.editor-ticks span { position: absolute; top: 0; width: 1px; height: 7px; background: var(--text-faint); opacity: .5; }
.editor-cutbands .cutband { position: absolute; top: 0; height: 100%; box-sizing: border-box; }
.cutband.cut-filler { background: rgba(245,158,11,0.30); }
.cutband.cut-silence { background: rgba(99,102,241,0.28); }
.cutband.cut-manual { background: rgba(239,68,68,0.28); }
.cutband.off { background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,0.06) 4px, rgba(255,255,255,0.06) 8px); }
.editor-dim { position: absolute; top: 0; height: 100%; background: rgba(0,0,0,0.45); pointer-events: none; }
.trim-handle {
  position: absolute; top: 0; height: 100%; width: 12px; margin-left: -6px;
  background: var(--accent); border-radius: 3px; cursor: ew-resize; z-index: 3;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}
.trim-handle::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 2px; height: 40%; background: rgba(0,0,0,0.5); }
.playhead { position: absolute; top: 0; height: 100%; width: 2px; background: #fff; margin-left: -1px; pointer-events: none; z-index: 2; }
.editor-tl-help { margin-top: 8px; }

.editor-panels { display: flex; flex-direction: column; gap: 14px; }
.editor-panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px 18px; }
.editor-panel h3 { font-size: var(--fs-base); font-weight: 600; margin-bottom: 12px; }
.editor-panel .prompt-head { margin-bottom: 12px; }

.editor-cuts-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.editor-cut-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); cursor: pointer; }
.editor-cut-row span { flex: 1; }
.cut-src { text-transform: uppercase; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-pill); }
.cut-src.cut-filler { background: rgba(245,158,11,0.18); color: #f59e0b; }
.cut-src.cut-silence { background: rgba(99,102,241,0.18); color: #818cf8; }
.cut-src.cut-manual { background: rgba(239,68,68,0.18); color: #ef4444; }

.editor-words { display: flex; flex-wrap: wrap; gap: 5px; max-height: 200px; overflow-y: auto; padding: 2px; }
.editor-word { width: auto; min-width: 36px; max-width: 130px; padding: 4px 7px; font: 12px var(--font-data); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm); color: var(--text); field-sizing: content; }
.editor-word.edited { border-color: var(--accent); color: var(--accent); }

@media (max-width: 980px) {
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}


/* ---------------- mobile app layer (PWA) ---------------- */

.mobile-bar {
  display: none; position: sticky; top: 0; z-index: 40;
  align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.drawer-scrim {
  position: fixed; inset: 0; z-index: 59; background: var(--scrim);
}

@media (max-width: 820px) {
  body { display: block; }
  #app { display: block; }
  .mobile-bar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    width: min(300px, 84vw) !important; height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top)) 14px 20px;
    transform: translateX(-102%);
    transition: transform var(--dur-open) var(--ease);
    box-shadow: var(--shadow);
  }
  body.drawer .sidebar { transform: none; }
  body.rail .sidebar { width: min(300px, 84vw) !important; }
  body.rail .nav button span { max-width: 170px; opacity: 1; }
  body.rail .logo .wordmark, body.rail .sidebar-foot .segmented { display: initial; }
  body.rail .logo .brandmark { display: none; }
  .side-collapse { display: none; }
  .main { padding: 18px 14px calc(90px + env(safe-area-inset-bottom)); }
  .hero h1 { font-size: 20px; }
  .linkbox { flex-wrap: wrap; padding: 10px 14px; }
  .linkbox input { min-width: 100%; order: -1; padding-bottom: 8px; }
  .linkbox .btn { flex: 1; }
  .editor-head { flex-wrap: wrap; }
  .editor-head-actions { width: 100%; justify-content: flex-end; }
  .detail { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .cal-grid { overflow-x: auto; grid-template-columns: repeat(7, minmax(96px, 1fr)); }
  .chat-fab { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .chat-panel { right: 10px; left: 10px; width: auto; }
  .adm-addrow { grid-template-columns: 1fr; }
}

/* ---------------- autopilot ---------------- */

/* the three-step setup strip — the whole product, live */
.ap-setup {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-bottom: 22px; border-left: 2px solid var(--accent-solid);
}
@media (max-width: 980px) { .ap-setup { grid-template-columns: 1fr; } }
.aps-step { display: flex; align-items: flex-start; gap: 12px; }
.aps-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 12.5px var(--font-data); color: var(--text-muted);
  border: 1px solid var(--hairline); margin-top: 1px;
}
.aps-step.done .aps-n {
  color: var(--accent-ink); background: var(--accent-solid);
  border-color: var(--accent-solid);
}
.aps-step.done .aps-n::before { content: "✓"; }
.aps-step.done .aps-n { font-size: 0; }
.aps-step.done .aps-n::before { font-size: 13px; }
.aps-text { flex: 1; min-width: 0; }
.aps-text b { display: block; font-size: 14px; }
.aps-text span { display: block; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.aps-step .btn { flex: none; margin-top: 2px; }
#aps-dismiss { position: absolute; top: 10px; right: 10px; }

/* brand kit: opt-in checkboxes + draggable preview assets */
.bk-use {
  float: right; font: 500 11.5px var(--font-ui); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.bk-use input { accent-color: var(--accent-solid); cursor: pointer; }
#bk-logo, #bk-handle { touch-action: none; user-select: none; }
#bk-logo:hover, #bk-handle:hover { outline: 1px dashed color-mix(in srgb, var(--accent-solid) 60%, transparent); outline-offset: 3px; }

/* social: any number of channels per platform */
.chan-list { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.chan-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 7px 10px;
}
.chan-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* editor: your-media bands + retime inputs */
.cutband.cut-media { background: color-mix(in srgb, var(--accent-solid) 45%, transparent); border-top: 2px solid var(--accent-solid); }
.cutband.cut-media.off { opacity: .25; }
.cut-time {
  width: 52px; background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 2px 6px; color: var(--text); font-size: 12px;
}
.cut-time:focus { border-color: var(--accent); outline: none; }

.ap-queue { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
@media (max-width: 900px) { .ap-queue { grid-template-columns: 1fr; } }
.ap-post {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.ap-post h4 { font-size: 14.5px; line-height: 1.35; }
.ap-meta { color: var(--text-faint); font: 12px var(--font-data); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ap-badge {
  font: 600 10.5px var(--font-data); color: var(--accent);
  background: var(--accent-tint); border-radius: var(--radius-pill); padding: 2px 8px;
}
.ap-cap {
  color: var(--text-muted); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ap-actions { display: flex; gap: 8px; margin-top: 2px; }
.ap-watcher {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 8px;
  transition: border-color var(--dur-hover) var(--ease);
}
.ap-watcher:hover { border-color: color-mix(in srgb, var(--accent-solid) 30%, var(--hairline)); }
.ap-watcher.paused { opacity: .55; }
.aw-body { flex: 1; min-width: 0; }
.aw-src { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-note { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }
.aw-meta { color: var(--text-faint); font: 11.5px var(--font-data); margin-top: 5px; }
.w-plats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 14px; }
.w-plats label { display: flex; gap: 7px; align-items: center; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.w-plats input { accent-color: var(--accent-solid); }
.ap-vidwrap { position: relative; }
.ap-vid {
  width: 100%; max-height: 220px; border-radius: var(--radius-sm);
  background: #000; border: 1px solid var(--hairline); object-fit: contain;
  display: block;
}
.ap-sz { position: absolute; inset: 1px; pointer-events: none; border-radius: var(--radius-sm); overflow: hidden; }
.ap-sz i {
  position: absolute; background: color-mix(in srgb, var(--danger, #ff5c5c) 22%, transparent);
  border: 1px dashed color-mix(in srgb, var(--danger, #ff5c5c) 55%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.ap-sz i b { font: 600 10px var(--font-data); color: #fff; text-shadow: 0 1px 4px #000; letter-spacing: .03em; }
.ap-sz-btn {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font: 600 10.5px var(--font-data); color: var(--text-muted);
  background: rgba(8,8,10,.72); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 3px 9px; cursor: pointer;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.ap-sz-btn:hover, .ap-sz-btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent-solid) 50%, var(--hairline)); }
.ap-render { color: var(--text-faint); font: 11.5px var(--font-data); }
.ap-cap-edit {
  width: 100%; background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text);
  font: 13px/1.5 var(--font-ui); resize: vertical;
}
.ap-cap-edit:focus { border-color: var(--accent); outline: none; }

/* ---------------- discover ---------------- */

.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-head h2 { font-size: var(--fs-title); font-weight: 600; }
.view-sub { color: var(--text-muted); margin-top: 4px; }
.disc-foot { color: var(--text-faint); font-size: var(--fs-label); margin-top: 22px; text-align: center; }

.disc-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) { .disc-cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .disc-cats { grid-template-columns: 1fr; } }

.disc-cat {
  position: relative; aspect-ratio: 16/10; border-radius: var(--radius);
  overflow: hidden; background-size: cover; background-position: center;
  border: 1px solid var(--hairline); text-align: left; isolation: isolate;
  transition: transform var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
}
.disc-cat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent-solid) 45%, var(--hairline)); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.dc-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(8,8,10,.16) 22%, rgba(8,8,10,.7) 62%, rgba(8,8,10,.95) 100%);
  transition: background var(--dur-hover) var(--ease);
}
.disc-cat:hover .dc-shade { background: linear-gradient(180deg, rgba(8,8,10,.06) 18%, rgba(8,8,10,.72) 60%, rgba(8,8,10,.96) 100%); }
.dc-body { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.dc-name { font-weight: 700; font-size: 16.5px; color: #fff; letter-spacing: .1px; text-shadow: 0 1px 10px rgba(0,0,0,.85); }
.dc-blurb { color: rgba(255,255,255,.85); font-size: var(--fs-label); text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.dc-count {
  margin-top: 7px; align-self: flex-start;
  font: 600 11px var(--font-data); color: var(--accent-solid);
  border: 1px solid color-mix(in srgb, var(--accent-solid) 45%, transparent);
  border-radius: var(--radius-pill); padding: 2px 9px;
  background: rgba(8,8,10,.72);
}

.disc-channels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 900px) { .disc-channels { grid-template-columns: 1fr; } }
.disc-ch {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 12px 14px;
  transition: border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}
.disc-ch:hover { border-color: color-mix(in srgb, var(--accent-solid) 45%, var(--hairline)); background: var(--surface-2); }
.disc-ch img { width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--surface-2); }
.ch-body { min-width: 0; flex: 1; }
.ch-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-stats { display: block; color: var(--text-faint); font: var(--fs-label) var(--font-data); margin-top: 2px; }
.ch-score {
  flex: none; font: 700 13px var(--font-data); color: var(--accent-solid);
  border: 1px solid color-mix(in srgb, var(--accent-solid) 40%, transparent);
  border-radius: var(--radius-pill); padding: 3px 10px;
}
.ch-score.big { font-size: 20px; padding: 6px 14px; }
.ch-score.big small { font-size: 11px; color: var(--text-faint); }

.disc-ch-head { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 18px; }
.chd-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); }
.chd-body { flex: 1; min-width: 0; }
.chd-name { font-weight: 600; font-size: 17px; }
.chd-handle { color: var(--text-faint); font-weight: 400; font-size: var(--fs-label); margin-left: 6px; }
.chd-stats { color: var(--text-muted); font-size: var(--fs-label); margin-top: 4px; }
.chd-actions { display: flex; align-items: center; gap: 12px; flex: none; }

.disc-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) { .disc-videos { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .disc-videos { grid-template-columns: 1fr; } }
.disc-vid {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.disc-vid:hover { border-color: color-mix(in srgb, var(--accent-solid) 40%, var(--hairline)); transform: translateY(-2px); }
.dv-thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-2); }
.dv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dv-dur {
  position: absolute; right: 8px; bottom: 8px;
  font: 600 11px var(--font-data); color: #fff;
  background: rgba(0,0,0,.72); border-radius: var(--radius-pill); padding: 2px 8px;
}
.dv-title { font-weight: 500; font-size: 14px; padding: 10px 12px 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px; }
.dv-meta { color: var(--text-faint); font: var(--fs-label) var(--font-data); padding: 2px 12px 10px; }
.dv-clip { margin: 0 12px 12px; }

/* honest-UI banner for features that aren't live yet */
.soon-banner {
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--accent-solid) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-solid) 30%, var(--hairline));
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
  color: var(--text-muted); font-size: var(--fs-label);
}
.soon-banner svg { color: var(--accent-solid); flex: none; }
.soon-banner b { color: var(--text); font-weight: 600; }

/* composer enhancer row — four matching cards, one visual system */
.enh-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .enh-row { grid-template-columns: 1fr 1fr; } }
.enh {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 12px 14px 13px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color var(--dur-hover) var(--ease);
}
.enh:hover { border-color: color-mix(in srgb, var(--accent-solid) 30%, var(--hairline)); }
.enh .label { display: flex; align-items: center; gap: 7px; margin: 0; }
.enh .segmented { align-self: flex-start; }
.enh .help { margin-top: auto; }
.enh select:focus { border-color: var(--accent); outline: none; }

/* "?" info buttons + their expanding explanations (settings V2) */
.tipb {
  flex: none; width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--hairline); background: none;
  color: var(--text-faint); font: 600 10.5px var(--font-data);
  line-height: 1; padding: 0; cursor: pointer;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.tipb:hover, .tipb.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent-solid) 50%, var(--hairline));
}
.tipbox {
  margin-top: 8px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent-solid);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: var(--fs-label); line-height: 1.55;
}
.tipbox b { color: var(--text); font-weight: 600; }
.field > label .tipb, .field > .label .tipb { vertical-align: -3px; margin-left: 6px; }

/* caption size: the three options previewed at true relative scale */
.capsize-row { display: flex; gap: 10px; max-width: 460px; }
.capsize-row button {
  flex: 1; padding: 0; overflow: hidden; cursor: pointer;
  background: transparent; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); text-align: left;
  transition: border-color var(--dur-hover) var(--ease);
}
.capsize-row button:hover { border-color: var(--text-faint); }
.capsize-row button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.capsize-row .sz-demo {
  display: flex; align-items: center; justify-content: center; height: 54px;
  background: linear-gradient(180deg, #1E1E24, #141419);
}
.capsize-row .sz-demo b {
  color: #fff; font-family: Arial, sans-serif; font-weight: 900;
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
}
.capsize-row .sz-name {
  display: block; font-size: 11.5px; color: var(--text-muted);
  padding: 6px 9px; background: var(--surface); border-top: 1px solid var(--hairline);
}
.capsize-row button.on .sz-name { color: var(--text); }

/* bias slider readout */
.bias-out {
  font: 600 11px var(--font-data); color: var(--accent);
  background: var(--accent-tint); border-radius: var(--radius-pill);
  padding: 2px 8px; margin-left: 6px; vertical-align: 1px;
}

/* curation prompt: expand/collapse instead of an inner scrollbar */
.prompt-well { position: relative; }
.prompt-well textarea { display: block; width: 100%; resize: none; overflow: hidden; }
.prompt-block.open .prompt-well textarea { overflow: auto; }
.prompt-block:not(.open) .prompt-well::after {
  content: ""; position: absolute; left: 1px; right: 1px; bottom: 1px;
  height: 40px; pointer-events: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: linear-gradient(transparent, var(--surface));
}

/* platform-native copy picker in the clip detail */
.plat-row { display: flex; gap: 6px; margin: 12px 0 10px; flex-wrap: wrap; }
.plat-chip {
  font: 600 12.5px var(--font-ui); color: var(--text-muted);
  border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  padding: 5px 13px; background: none;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}
.plat-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent-solid) 40%, var(--hairline)); }
.plat-chip.on { color: var(--accent); background: var(--accent-tint); border-color: transparent; }
.plat-block { margin-bottom: 12px; }
.plat-block-head {
  display: flex; justify-content: space-between; align-items: center;
  font: 600 11px var(--font-data); text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint); margin-bottom: 5px;
}


/* ---------------- brand kit rework ---------------- */
.bk-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 980px) { .bk-layout { grid-template-columns: 1fr; } }
.bk-form { display: flex; flex-direction: column; gap: 14px; }
.bk-group-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.bk-mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.bk-side { position: sticky; top: 20px; }
.bk-fmt { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.bk-fmt button {
  font: 600 11px var(--font-data); color: var(--text-muted);
  border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  padding: 4px 11px; background: none; cursor: pointer;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.bk-fmt button:hover { color: var(--text); }
.bk-fmt button.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent-solid) 55%, var(--hairline)); background: var(--accent-tint); }
.bk-preview {
  position: relative; aspect-ratio: 9/16; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--hairline); background: #000;
  box-shadow: var(--shadow);
  transition: aspect-ratio .3s var(--ease);
}
.bk-preview.wide { aspect-ratio: 16/9; }
.bk-platsafe { position: absolute; inset: 0; pointer-events: none; }
.bk-platsafe i {
  position: absolute; background: color-mix(in srgb, var(--danger, #ff5c5c) 20%, transparent);
  border: 1px dashed color-mix(in srgb, var(--danger, #ff5c5c) 50%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.bk-platsafe i b { font: 600 10px var(--font-data); color: #fff; text-shadow: 0 1px 4px #000; }
.bk-preview video { width: 100%; height: 100%; object-fit: cover; }
.bk-safe {
  position: absolute; border: 1px dashed rgba(255,255,255,.18);
  border-radius: 6px; pointer-events: none;
}
.bk-logo { position: absolute; opacity: .9; max-width: 50%; height: auto; }
.bk-handle {
  position: absolute; font: 600 12px var(--font-ui); color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.7); letter-spacing: .01em;
}
.bk-cap {
  position: absolute; left: 8%; right: 8%; bottom: 16%;
  text-align: center; font: 800 17px var(--font-ui); line-height: 1.35;
  color: #fff; text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,.85);
}
.bk-cap i { font-style: normal; }
.bk-cap b { color: #00e5ff; }
.bk-note { color: var(--text-faint); font-size: var(--fs-label); margin-top: 10px; text-align: center; }

/* preset cards */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }


/* caption gallery: horizontal 2-row carousel with arrows */
.cap-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.cap-wrap .cap-gallery {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: calc((100% - 36px) / 5);
  gap: 10px 9px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; margin-top: 0; flex: 1;
}
.cap-wrap .cap-gallery::-webkit-scrollbar { display: none; }
.cap-wrap .cap-card { scroll-snap-align: start; }
.cap-arrow {
  flex: none; width: 26px; height: 56px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); color: var(--text-faint);
  font-size: 18px; line-height: 1; background: var(--surface);
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.cap-arrow:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent-solid) 40%, var(--hairline)); }
.label-note { font-weight: 400; color: var(--text-faint); font-size: 11.5px; margin-left: 8px; }

/* new caption demo looks */
.cap-beast { font-family: Impact, "Arial Black", sans-serif; text-shadow: 0 0 4px #000, 0 2px 3px #000; font-size: 15px; }
.cap-shadowplay { text-shadow: 0 3px 8px rgba(0,0,0,.9); font-weight: 700; }
.cap-broadcast span { font-family: Georgia, serif; background: rgba(0,0,0,.62); padding: 2px 7px; border-radius: 3px; }
.cap-terminal span { font-family: "JetBrains Mono", Consolas, monospace; color: #22C55E; background: rgba(10,12,10,.9); padding: 2px 7px; border-radius: 3px; }
.cap-royal { color: #FFD700; font-family: Georgia, serif; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.cap-blush { color: #FF6FB5; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.cap-ocean { color: #00E5FF; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.cap-inkline { text-shadow: 0 0 2px #000; font-weight: 600; }
.cap-slate span { background: rgba(16,16,19,.9); padding: 3px 8px; border-radius: 5px; }
.cap-punch { color: #FF3B30; font-family: Impact, sans-serif; font-size: 16px; text-shadow: 0 0 4px #000, 0 2px 3px #000; }
.cap-voltword { color: var(--accent-solid, #C9F542); font-size: 15px; text-shadow: 0 0 4px #000, 0 2px 3px #000; }
.cap-goldpop { color: #FFD700; font-family: Impact, sans-serif; font-size: 15px; text-shadow: 0 0 4px #000, 0 2px 3px #000; }
.cap-redline i { color: #FF3B30; } .cap-redline { text-shadow: 0 0 3px #000; }
.cap-voltline i { color: #C9F542; } .cap-voltline { text-shadow: 0 0 3px #000; }
.cap-goldrush i { color: #FFD700; } .cap-goldrush { font-family: Impact, sans-serif; text-shadow: 0 0 3px #000; }
.cap-bluebolt i { color: #3B82F6; } .cap-bluebolt { text-shadow: 0 0 3px #000; }
.cap-hotpink i { color: #FF6FB5; } .cap-hotpink { text-shadow: 0 0 3px #000; }
.cap-violetglow { text-shadow: 0 0 8px #A855F7, 0 0 3px #000; }
.cap-mintglow { text-shadow: 0 0 8px #A7F0B4, 0 0 3px #000; }
.cap-sunset i { color: #FF8C42; } .cap-sunset { text-shadow: 0 0 3px #000; }
.cap-icefill i { color: #ADE8F4; } .cap-icefill { text-shadow: 0 0 3px #000; }
.cap-voltfill i { color: #C9F542; } .cap-voltfill { text-shadow: 0 0 3px #000; }


/* ---- sidebar must not clip the rail tooltips ---- */
.sidebar { overflow: visible; }

/* ---- 7) minor nav paired two-up ---- */
.nav-mini { display: grid; grid-template-columns: 1fr; gap: 2px; }
.nav-mini button { padding: 9px 14px; font-size: 13.5px; }
.nav-mini button svg { width: 15px; height: 15px; }

/* ---- widen the clip settings panel (shorter, not longer) ---- */
#settings-panel {
  position: relative; left: 50%; transform: translateX(-50%);
  width: min(960px, calc(100vw - 300px));
}
@media (max-width: 1240px) { #settings-panel { width: 100%; left: 0; transform: none; } }
#advanced-fields .grid-2 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { #advanced-fields .grid-2 { grid-template-columns: 1fr; } }

/* ---- discover line under the composer ---- */
.disc-line { text-align: center; color: var(--text-faint);
  font-size: var(--fs-label); margin-top: 14px; }
.disc-line .linklike { font-size: inherit; }

/* ---- library cards: quiet mono meta, one line ---- */
.lib-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-meta { font: var(--fs-label) var(--font-data); color: var(--text-faint);
  letter-spacing: .01em; }

/* ---- affiliate page ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 18px; text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--accent); font-weight: 700; }
.stat span { color: var(--text-faint); font-size: var(--fs-label); }
.aff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 900px) { .aff-grid { grid-template-columns: 1fr; } }
.aff-step { position: relative; padding-top: 22px; }
.aff-num { position: absolute; top: 14px; right: 16px;
  font: 700 26px var(--font-data); color: var(--accent-tint);
  -webkit-text-stroke: 1px var(--accent); opacity: .8; }
.aff-step h3 { font-size: 15.5px; margin-bottom: 8px; }
.aff-step p { color: var(--text-muted); font-size: 13.5px; }
.aff-rules { padding-left: 20px; color: var(--text-muted); font-size: 13.5px; display: grid; gap: 6px; }

/* ---- settings defaults grid ---- */
.set-defaults { display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px; margin-top: 12px; }
@media (max-width: 900px) { .set-defaults { grid-template-columns: 1fr 1fr; } }

/* ---- brand kit empty state ---- */
.bk-empty { max-width: 620px; margin-top: 8px; }
.bk-empty-art { position: relative; height: 110px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #17181c, #0e0f12);
  border: 1px solid var(--hairline); margin-bottom: 16px; overflow: hidden; }
.bk-chip-demo { position: absolute; left: 12px; bottom: 10px;
  font: 600 11px var(--font-ui); color: #fff; opacity: .85; }
.bk-cap-demo { position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%); font: 800 15px var(--font-ui);
  color: #fff; letter-spacing: .02em; white-space: nowrap; }
.bk-cap-demo i { font-style: normal; color: var(--accent-solid); }
.bk-empty h3 { margin-bottom: 8px; }
.bk-empty p, .bk-empty li { color: var(--text-muted); font-size: 13.5px; }
.bk-empty ul { padding-left: 20px; margin: 10px 0 16px; display: grid; gap: 6px; }


/* ---------------- discover funnel ---------------- */
.disc-search { max-width: 240px; }
.disc-chips {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 7px; overflow-x: auto; padding: 8px 0 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.disc-chips::-webkit-scrollbar { display: none; }
.disc-chip {
  flex: none; font: 600 13px var(--font-ui); color: var(--text-muted);
  border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  padding: 6px 14px; white-space: nowrap;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}
.disc-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent-solid) 40%, var(--hairline)); }
.disc-chip.on { color: var(--accent); background: var(--accent-tint); border-color: transparent; }

.disc-onboard {
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
  margin-bottom: 16px;
  border-left: 2px solid var(--accent-solid);
}
.do-text h3 { margin-bottom: 4px; }
.do-text p { color: var(--text-muted); font-size: var(--fs-label); margin-bottom: 10px; }
.do-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.do-chips .disc-chip.on {
  border-color: var(--accent); color: var(--text);
  background: var(--accent-tint);
}
.do-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: none; }
.do-actions .btn:disabled { opacity: .45; }

.disc-howto { color: var(--text-muted); font-size: var(--fs-label);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 9px 14px; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.disc-howto b { color: var(--accent); }

.disc-h3 { font-size: 15px; font-weight: 600; margin: 18px 0 10px; }
.disc-h3-sub { color: var(--text-faint); font-weight: 400; font-size: 12px; margin-left: 8px; }

.disc-follows { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.df-item { flex: none; width: 86px; text-align: center; background: none; position: relative; }
.df-item img { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--hairline);
  transition: border-color var(--dur-hover) var(--ease); }
.df-item:hover img { border-color: var(--accent); }
.df-item .df-name { display: block; font-size: 11.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 5px; }
.df-new { position: absolute; top: 2px; right: 16px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent-solid); border: 2px solid var(--bg); }

.disc-fresh { display: grid; grid-auto-flow: column; grid-auto-columns: 250px;
  gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.fr-card { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden; scroll-snap-align: start;
  display: flex; flex-direction: column; text-align: left;
  transition: border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease); }
.fr-card:hover { border-color: color-mix(in srgb, var(--accent-solid) 40%, var(--hairline)); transform: translateY(-2px); }
.fr-thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-2); }
.fr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-score { position: absolute; top: 7px; left: 7px; font: 700 10.5px var(--font-data);
  color: var(--volt-ink, #0E1206); background: var(--accent-solid); border-radius: var(--radius-pill); padding: 2px 7px; }
.fr-body { padding: 9px 11px 11px; }
.fr-title { font-size: 13px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.fr-meta { display: flex; align-items: center; gap: 6px; color: var(--text-faint);
  font: 11.5px var(--font-data); margin-top: 6px; }
.fr-meta img { width: 16px; height: 16px; border-radius: 50%; }

/* denser mosaic tiles: 4-up, faces instead of stock */
.disc-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1200px) { .disc-cats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .disc-cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .disc-cats { grid-template-columns: 1fr; } }
.disc-cat { aspect-ratio: 16/11; background: var(--surface); }
.dc-faces { position: absolute; inset: 0; display: grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.dc-faces img { width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.8) brightness(.82); transition: filter var(--dur-hover) var(--ease); }
.disc-cat:hover .dc-faces img { filter: saturate(1) brightness(.95); }

.disc-suggest { margin-top: 26px; display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center; }
.ds-text h3 { margin-bottom: 4px; }
.ds-text p { color: var(--text-muted); font-size: var(--fs-label); }
.ds-form { display: flex; gap: 8px; align-items: center; }
.ds-form input { min-width: 240px; }
.ds-form select { max-width: 180px; }
.ds-note { grid-column: 1 / -1; color: var(--text-faint); font-size: 12px; }
@media (max-width: 900px) { .disc-suggest { grid-template-columns: 1fr; } .ds-form { flex-wrap: wrap; } }

.ch-follow { flex: none; }
.ch-follow.on { color: var(--accent); border-color: var(--accent); }

/* admin suggestions */
.sug-row { display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.sug-row img { width: 38px; height: 38px; border-radius: 50%; }
.sug-body { flex: 1; min-width: 0; }
.sug-name { font-weight: 600; }
.sug-meta { color: var(--text-faint); font: 12px var(--font-data); }

/* smart tighten */
.smart-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.smart-target { display: flex; gap: 6px; align-items: center; }
.smart-target input { width: 64px; text-align: center; font: 500 13px var(--font-data);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 7px 8px; color: var(--text); outline: none; }
.smart-target input:focus { border-color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.cut-boring { color: var(--accent); border-color: color-mix(in srgb, var(--accent-solid) 45%, transparent) !important; }
.cut-reason { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }


/* analytics v2 */
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .an-grid { grid-template-columns: 1fr; } }
.an-panel h3 { margin-bottom: 12px; }
#an-trend { width: 100%; height: 160px; display: block; }
.an-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.an-bar-label { width: 150px; font-size: 12.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.an-bar-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.an-bar-track i { display: block; height: 100%; background: var(--accent-solid); border-radius: 999px; }
.an-bar-val { font: 11.5px var(--font-data); color: var(--text-faint); flex: none; max-width: 100%; }
@media (max-width: 700px) {
  .an-bar-label { width: 100%; }
  .an-bar-val { width: 100%; }
}
.an-top-row { display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--hairline); }
.an-top-row:last-child { border-bottom: none; }
.an-top-head { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-top-meta { font: 11.5px var(--font-data); color: var(--text-faint); flex: none; }
