@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ============================================================================
   Krave Creative Analytics — design system
   Aligned to the locked Krave standard (hookfactory-lite / creator-db tokens):
   lavender field, white surfaces, Inter-only, purple working color, neon
   (#d8fb37) as the BRAND accent — skewed, never used as a performance verdict.
   Design refresh 2026-06: one token layer, one pill system, one hover grammar,
   tabular numerals on every metric, charts on brand color.
   ========================================================================== */

:root {
  --bg: #f4f1f8;
  --bg-elev: #ffffff;
  --bg-soft: #ece6f6;
  --bg-soft-strong: #d4c8ed;
  --bg-card: #ffffff;
  --neon: #d8fb37;
  --neon-deep: #b9dd1a;
  --neon-ink: #1a1f00;
  --purple: #6754ff;
  --purple-deep: #4a37dd;
  --purple-light: #eae5f9;
  --text: #131118;
  --text-dim: #46424f;
  --muted: #6f6a7c;
  --ink: #131118;
  --border: rgba(19, 17, 24, 0.10);
  --border-strong: rgba(19, 17, 24, 0.22);
  --border-purple: rgba(103, 84, 255, 0.28);
  --danger: #c92638;
  --success: #15803d;
  /* semantic status palette — verdict colors only. neon stays brand-only. */
  --good: #15803d;  --good-bg: #ddf3e4;
  --warn: #9a6206;  --warn-bg: #fdf0cd;
  --bad: #c92638;   --bad-bg: #fde5e7;
  --info: #2f5fd0;  --info-bg: #e3edff;
  /* charts — brand-purple current line, quiet lavender for the compare line */
  --chart-cur: #6754ff;
  --chart-prev: #c9c1de;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --sidebar-w: 240px;
  --shadow-sm: 0 1px 2px rgba(19, 17, 24, 0.05), 0 2px 8px rgba(19, 17, 24, 0.06);
  --shadow: 0 2px 6px rgba(19, 17, 24, 0.06), 0 10px 28px rgba(19, 17, 24, 0.10);
  --shadow-lg: 0 8px 20px rgba(19, 17, 24, 0.10), 0 28px 64px rgba(19, 17, 24, 0.16);
  --ring: 0 0 0 3px rgba(103, 84, 255, 0.25);
  --speed: .14s;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--purple-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.025em; }
::selection { background: var(--neon); color: var(--neon-ink); }

/* keyboard focus — one ring everywhere, no default blue */
:where(button, [role="button"], a, summary):focus-visible {
  outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs);
}

/* thin brand scrollbars (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-soft-strong); border-radius: 999px; border: 2.5px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #beafdf; }

.hl {
  background: var(--neon);
  color: var(--neon-ink);
  padding: 0 8px;
  display: inline-block;
  transform: skew(-3deg);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
}

/* numbers line up everywhere they appear */
.stat .value, .km-value, .fs-val, .lb-th-num, .lb-metric .v, .tpl-spend-v,
.tpl-stat b, .rep-stat-val, .score-pill .sv, .lb-score, td, .ct-table td {
  font-variant-numeric: tabular-nums;
}

/* ── app shell: left sidebar + content (matches creator-db) ── */
body.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 1.6rem 0.85rem 1.25rem; display: flex; flex-direction: column; z-index: 60;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 0.85rem 1.35rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 17px; line-height: 1.12; letter-spacing: -0.02em;
}
.sidebar-brand .dot { width: 15px; height: 15px; border-radius: 4px; background: var(--neon); transform: skew(-12deg); flex: none; box-shadow: 0 1px 4px rgba(216, 251, 55, 0.7); }
.nav { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left;
  padding: 0.62rem 0.85rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; font: inherit; font-size: 0.9rem; font-weight: 500;
  color: var(--text-dim); cursor: pointer;
  transition: background var(--speed) ease, color var(--speed) ease;
}
.nav-item svg { width: 19px; height: 19px; flex: none; color: var(--muted); transition: color var(--speed) ease; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item:hover svg { color: var(--purple); }
.nav-item.active { background: var(--purple-light); color: var(--purple-deep); border-color: var(--border-purple); font-weight: 700; }
.nav-item.active svg { color: var(--purple); }
/* the Krave mark: a skewed neon notch on the active view */
.nav-item.active::before {
  content: ''; position: absolute; left: -0.85rem; top: 50%; margin-top: -9px;
  width: 5px; height: 18px; background: var(--neon); border-radius: 0 3px 3px 0;
  transform: skew(0, -12deg);
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 0.75rem; }

.nav-toggle {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 70;
  width: 40px; height: 40px; border-radius: 100px; align-items: center; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--border-strong); color: var(--text);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(19, 17, 24, 0.4); z-index: 55; }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.container { max-width: none; margin: 0; padding: 28px 36px 40px; width: 100%; }
/* keep long-form, reading-width content centered even though the app is full-bleed */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; margin: 0; }

/* brief editor header — title block left, organized toolbar right, top-aligned */
.brief-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; flex-wrap: nowrap; margin-bottom: 22px; }
.brief-head-l { min-width: 0; flex: 1 1 auto; }
.brief-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; flex: 0 0 auto; margin-top: 4px; }
.brief-head-actions > select { height: 34px; }
/* status pill: only as wide as the longest option ("Complete"), color-coded per state */
.brief-status { width: auto; min-width: 116px; height: 34px; border-radius: 8px; border: 1px solid var(--border); font-weight: 700; font-size: 12.5px; padding: 0 10px; cursor: pointer; }
.brief-status.s-draft { background: #f3f4f6; border-color: #e3e5e9; color: #4b5563; }
.brief-status.s-review { background: #fff4e0; border-color: #f1d9a4; color: #b5781a; }
.brief-status.s-approved { background: #e7f7ee; border-color: #bfe8cf; color: #1b8a4b; }
.brief-status.s-shared { background: #eef0ff; border-color: #d2d8f7; color: #3f4cc0; }
.brief-status.s-live { background: #e0f7f4; border-color: #b6e6de; color: #0d9488; }
.brief-status.s-complete { background: #ecfdf3; border-color: #a9eec4; color: #067647; }
.editable-title { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 6px 0 2px; padding: 2px 8px 2px 0; margin-left: 0; border-radius: 8px; cursor: text; outline: none; transition: background var(--speed) ease, box-shadow var(--speed) ease; }
.editable-title:hover { background: var(--bg-soft); }
.editable-title:focus { background: var(--bg-elev); box-shadow: 0 0 0 2px var(--border-purple); }
.editable-title:empty:before { content: attr(data-ph); color: var(--muted); }

/* overflow ("⋯ More") menu */
.ovm { position: relative; display: inline-flex; }
.ovm-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 200px; padding: 6px; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); }
.ovm-menu.open { display: block; }
.ovm-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 11px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; }
.ovm-item:hover { background: var(--bg-soft); }
.ovm-item-danger { color: var(--bad); }
.ovm-item-danger:hover { background: var(--bad-bg); }
.ovm-div { height: 1px; margin: 5px 4px; background: var(--border); }

/* brief project bar (inside a project) — breadcrumb left, actions right, one aligned row */
.proj-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.proj-bar-l { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 auto; }
.proj-bar-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-bar-share { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; justify-content: flex-end; flex-wrap: wrap; }
.proj-share-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg-soft); padding: 3px 9px; border-radius: 100px; white-space: nowrap; }
.proj-share-status.active { color: var(--success); background: rgba(21, 128, 61, .12); border: 1px solid rgba(21, 128, 61, .32); }
.proj-share-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-elev); color: var(--text); width: 220px; max-width: 26vw; }
.proj-bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* brief board (kanban by status) — drag cards between columns to change stage */
.brief-board { display: flex; gap: 12px; align-items: flex-start; }
.bb-col { min-width: 240px; flex: 1; border-radius: 12px; padding: 4px; transition: background var(--speed) ease, box-shadow var(--speed) ease; }
.bb-col-head { font-weight: 700; text-transform: capitalize; margin-bottom: 8px; padding: 4px 6px 0; }
.bb-col-body { min-height: 48px; border-radius: 10px; padding: 2px; }
.bb-col-over { background: color-mix(in srgb, var(--purple) 8%, transparent); box-shadow: inset 0 0 0 2px var(--border-purple); }
.bb-card { transition: opacity var(--speed) ease, box-shadow var(--speed) ease; }
.bb-card[draggable="true"] { cursor: grab; }
.bb-card.bb-dragging { opacity: .45; }
.bb-vbadge { position: absolute; bottom: 8px; right: 10px; font-size: 11px; font-weight: 800; color: var(--purple-deep); background: var(--purple-light, #efeafe); border: 1px solid var(--border-purple, #d6cdf3); border-radius: 20px; padding: 1px 8px; }
.sub { color: var(--muted); font-size: 13px; }

/* the strategist drawer reuses .brand inside the chat header */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--neon); transform: skew(-12deg); }

/* ── cards / stats ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px;
}
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { padding: 18px 20px; }
.stat .label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; line-height: 1.1; }
.stat .value.neon { background: var(--neon); color: var(--neon-ink); display: inline-block; padding: 0 8px; transform: skew(-3deg); }

/* ── account funnel scores ── */
.fs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fs-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--bg-card); text-align: center; box-shadow: var(--shadow-sm); }
.fs-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.fs-val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 5px 0 2px; }
.fs-verdict { font-size: 11px; font-weight: 700; color: var(--muted); }
.fs-strong .fs-val, .fs-strong .fs-verdict { color: var(--good); }
.fs-avg .fs-val, .fs-avg .fs-verdict { color: var(--warn); }
.fs-weak .fs-val, .fs-weak .fs-verdict { color: var(--bad); }

/* ── floating Kobe assistant (persistent across UI) ── */
.kobe-fab { position: fixed; bottom: 22px; right: 22px; z-index: 65; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--neon); background: var(--purple); box-shadow: var(--shadow-lg); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: transform var(--speed) ease, box-shadow var(--speed) ease; }
.kobe-fab:hover { transform: scale(1.07); box-shadow: 0 10px 24px rgba(103, 84, 255, 0.35), var(--shadow-lg); }
.kobe-fab-fallback { position: absolute; color: #fff; font-weight: 800; font-size: 24px; }
.kobe-fab-img { position: relative; width: 100%; height: 100%; object-fit: cover; }

/* ── dashboard action cards (Create report / Compare / Tagging) ── */
.da-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.da-action { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--bg-card); cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color var(--speed) ease, transform var(--speed) ease, box-shadow var(--speed) ease; }
.da-action:hover { border-color: var(--border-purple); transform: translateY(-2px); box-shadow: var(--shadow); }
.da-action-title { font-weight: 700; font-size: 14px; }
.da-action-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ── per-client secondary sidebar (Stage 7) ── */
.client-shell { display: flex; gap: 0; align-items: flex-start; }
/* sticky so the per-client nav persists while the main column scrolls. align-self
   flex-start (not stretch) means it sizes to its own content, which is what lets
   position:sticky actually stick; it scrolls internally only if taller than the viewport. */
.client-nav { flex: 0 0 224px; align-self: flex-start; position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); padding: 4px 18px 18px 0; margin-right: 26px; background: transparent; }
.cn-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--muted); padding: 16px 12px 6px; }
.cn-item { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: var(--radius-xs); border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: background var(--speed) ease, color var(--speed) ease; }
.cn-item:hover { background: var(--purple-light); color: var(--purple-deep); }
.cn-item.active { background: var(--purple); color: #fff; }
.cn-add { color: var(--purple-deep); font-weight: 700; }
.client-main { flex: 1; min-width: 0; }
/* stage-7 mobile defenses */
@media (max-width: 640px) {
  .range-pop { left: auto; right: 0; max-width: calc(100vw - 32px); }
  .da-actions { grid-template-columns: 1fr; }
  .kobe-fab { width: 52px; height: 52px; bottom: 16px; right: 16px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .lb-table-scroll { -webkit-overflow-scrolling: touch; }
  .seg { flex-wrap: wrap; }
}
.cmp-best { background: var(--good-bg); color: var(--good); }

/* ── date range picker (Stage 7) ── */
.range-pop-wrap { position: relative; display: inline-block; }
.range-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 45; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; }
.range-opt { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; border-radius: var(--radius-xs); font: inherit; font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.range-opt:hover { background: var(--purple-light); color: var(--purple-deep); }
.range-opt.active { background: var(--purple); color: #fff; }
.range-pop input[type=date] { padding: 5px 8px; font-size: 13px; flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .client-shell { flex-direction: column; }
  .client-nav { flex: none; width: 100%; min-height: 0; flex-direction: row; flex-wrap: wrap; position: static; border-right: 0; border-bottom: 1px solid var(--border); margin-right: 0; margin-bottom: 14px; padding: 4px 0 14px; gap: 4px; }
  .cn-head { width: 100%; padding: 8px 4px 2px; }
  .cn-item { width: auto; }
}

/* ── key-metrics panel ── */
.km-panel { padding: 18px 20px 20px; }
.km-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.km-title { font-size: 17px; margin: 0; }
.km-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.km-legend i { width: 16px; height: 0; border-top: 2px solid var(--chart-cur); display: inline-block; }
.km-legend i.lg-prev { border-top-style: dashed; border-top-color: var(--chart-prev); margin-left: 8px; }
.seg { display: inline-flex; gap: 2px; background: var(--bg-soft); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color var(--speed) ease; }
.seg button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.km-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.km-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px 9px; background: var(--bg-card); }
.km-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.km-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.km-value { font-size: 25px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.km-delta { font-size: 11px; font-weight: 700; padding: 2.5px 8px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.km-good { background: var(--good-bg); color: var(--good); }
.km-bad { background: var(--bad-bg); color: var(--bad); }
.km-flat { background: var(--bg-soft); color: var(--muted); }
.km-cur { font-size: 11px; font-weight: 700; padding: 2.5px 8px; border-radius: 999px; background: var(--bg-soft); color: var(--purple-deep); }
.spark { width: 100%; height: 44px; display: block; margin-top: 6px; }
.spark-cur { fill: none; stroke: var(--chart-cur); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark-prev { fill: none; stroke: var(--chart-prev); stroke-width: 1.5; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }

/* ── buttons ── */
.btn {
  font: inherit; font-weight: 650; border-radius: 999px; border: 1px solid var(--border-strong);
  padding: 9px 17px; background: var(--bg-elev); color: var(--text); cursor: pointer;
  transition: transform .05s ease, background var(--speed) ease, border-color var(--speed) ease, color var(--speed) ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-dark { background: var(--text); color: #fff; border-color: var(--text); }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-neon { background: var(--neon); border-color: var(--neon); color: var(--neon-ink); font-weight: 700; }
.btn-neon:hover { background: var(--neon-deep); border-color: var(--neon-deep); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }

/* ── table ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border-strong); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(103, 84, 255, 0.045); }

/* ── badges / pills — one scale: 11px / 700 / 999px ── */
.badge { display: inline-block; padding: 2.5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--border); color: var(--muted); }
.badge-krave { background: var(--neon); border-color: var(--neon); color: var(--neon-ink); }
.badge-muted { background: var(--bg-soft); }
.badge-bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }

/* ── forms ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text);
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: var(--ring); }

/* Filter / control bar — compact, horizontal, auto-width controls (creator-DB style).
   Overrides the form default (width:100%) so selects don't stack full-width. */
.fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fbar input, .fbar select {
  width: auto; padding: 7px 11px; font-size: 13px; border-radius: var(--radius-sm);
  background: var(--bg-elev); border: 1px solid var(--border-strong);
}
.fbar input[type='text'], .fbar input[type='search'] { min-width: 200px; flex: 1 1 200px; max-width: 380px; }
.fbar label { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.fbar .fbar-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
/* compact buttons for tight card action rows */
.btn-xs { padding: 5px 10px; font-size: 12px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 120px; }

/* ── modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(19, 17, 24, .45); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 50; overflow: auto; }
.modal-bg.open { display: flex; }
.modal { position: relative; background: var(--bg-elev); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; padding: 26px; }
.modal-bg.open .modal { animation: modal-in .18s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal h2 { font-size: 20px; letter-spacing: -0.02em; }

/* ── modal close (✕) + discard confirm ── */
.modal-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; z-index: 3; transition: background .12s, color .12s, border-color .12s; }
.modal-x:hover { background: var(--bg-soft); color: var(--text); border-color: var(--border-strong); }
.confirm-bg { position: fixed; inset: 0; background: rgba(19, 17, 24, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 9999; }
.confirm-box { background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 380px; padding: 22px; animation: modal-in .16s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.confirm-msg { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.45; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ── misc ── */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 11px 19px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: none; z-index: 100; }
.toast.err { background: var(--danger); }
.toast.show { display: block; animation: toast-in .22s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.muted { color: var(--muted); }
.right { text-align: right; }
.spacer { flex: 1; }
.thumb { width: 40px; height: 56px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--bg-soft); }

/* ── login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }

/* ── Phase 2: dashboards ── */
.range-sel { display: inline-flex; gap: 4px; background: var(--bg-soft); border-radius: 999px; padding: 3px; }
.range-sel button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.range-sel button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }

.share-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; min-width: 70px; }
.share-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--neon)); }

.sig { display: inline-block; padding: 2.5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sig-scaling { background: var(--good-bg); color: var(--good); }
.sig-declining { background: var(--bad-bg); color: var(--bad); }
.sig-holding { background: var(--bg-soft); color: var(--muted); }
.sig-new { background: var(--info-bg); color: var(--info); }

.rep-head { display: flex; align-items: center; gap: 14px; margin: 24px 0 10px; flex-wrap: wrap; }
.rep-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-tab { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-dim); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color var(--speed) ease, color var(--speed) ease; }
.rep-tab:hover { border-color: var(--purple); color: var(--purple); }
.rep-tab.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.sv-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.sv-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; font-size: 13px; line-height: 1; margin-left: 2px; opacity: .6; }
.sv-x:hover { opacity: 1; background: rgba(255,255,255,.25); }
.vb-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.vb-row select, .vb-row input { padding: 7px 10px; }
.lb-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
/* compact, auto-width controls in any control/leaderboard row (matches .fbar) */
.lb-controls select, .lb-controls input { width: auto; padding: 7px 11px; font-size: 13px; }
/* MagicBrief-style instant filter bar */
.qf-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.qf-search { padding: 7px 11px; min-width: 200px; }
.qf-status { padding: 7px 10px; }
.qf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 11px; font-size: 12.5px; font-weight: 600; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 100px; }
.qf-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; font-size: 13px; line-height: 1; opacity: .6; cursor: pointer; }
.qf-x:hover { opacity: 1; background: rgba(103, 84, 255, .15); color: var(--purple); }
.qf-excluded { font-size: 12.5px; color: var(--muted); margin: -4px 0 12px; }
/* "Syncing ad data" indicator (bottom-center) */
.syncing-ind { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 13px 18px 15px; min-width: 240px; animation: modal-in .18s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.syncing-ind-title { font-size: 14px; font-weight: 700; color: var(--purple); }
.syncing-ind-sub { font-size: 12px; color: var(--muted); margin: 1px 0 9px; }
.syncing-ind-bar { height: 5px; border-radius: 100px; background: var(--bg-soft); overflow: hidden; }
.syncing-ind-fill { height: 100%; width: 40%; border-radius: 100px; background: linear-gradient(90deg, var(--purple), var(--purple-deep)); animation: syncing-slide 1.1s ease-in-out infinite; }
@keyframes syncing-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
/* table view */
.lb-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow-sm); }
.lb-table-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.lb-table-scroll { overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-soft); position: sticky; top: 0; }
.lb-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lb-th-num { text-align: right; }
.lb-table td.lb-th-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.lb-td-ad { display: flex; align-items: center; gap: 10px; }
.lb-td-thumb { width: 34px; height: 44px; object-fit: cover; border-radius: 5px; background: var(--bg-soft); flex: none; }
.lb-td-name { font-weight: 600; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-th-check, .lb-td-check { width: 38px; text-align: center; }
.lb-table tbody tr:hover td { background: rgba(103, 84, 255, .045); }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lb-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease; }
.lb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-purple); }
.lb-media { position: relative; }
.lb-cc { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; background: rgba(22, 132, 70, 0.92); backdrop-filter: blur(2px); pointer-events: none; }
.lb-thumb { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--bg-soft); display: block; }
.lb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.lb-play i { width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; margin-left: 3px; }
.lb-play span { width: 46px; height: 46px; border-radius: 100px; background: rgba(19, 17, 24, 0.55); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.lb-body { padding: 11px 12px; }
.lb-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.lb-tags { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.lb-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.lb-metric .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lb-metric .v { font-size: 14px; font-weight: 700; }

.ret-chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding-top: 8px; }
.ret-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.ret-bar { width: 100%; background: linear-gradient(180deg, var(--purple), var(--purple-deep)); border-radius: 4px 4px 0 0; min-height: 2px; }
.ret-lab { font-size: 10px; color: var(--muted); }
.ret-val { font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }

.cd-bg { position: fixed; inset: 0; background: rgba(19, 17, 24, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 50px 20px; z-index: 60; overflow: auto; }
.cd { background: var(--bg-elev); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; overflow: hidden; animation: modal-in .18s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.cd-head { display: flex; gap: 16px; padding: 18px; border-bottom: 1px solid var(--border); }
.conn-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: border-color var(--speed) ease; }
.conn-row:hover { border-color: var(--border-strong); }
.conn-row input[disabled] { opacity: .5; cursor: default; }
.sync-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--warn-bg); }
.sync-spinner { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(0,0,0,.15); border-top-color: var(--warn); animation: sync-spin .8s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
.cov-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--danger); border-left-width: 4px; border-radius: 12px; background: #fdecee; }
.cov-banner .sub { color: #8a2531; }
.cov-flag { flex: none; font-size: 18px; line-height: 1; color: var(--danger); }
.cov-refresh { flex: none; border: 1px solid var(--danger); color: #fff; background: var(--danger); font-weight: 700; }
.cov-refresh:hover:not(:disabled) { filter: brightness(.93); }
.cov-refresh:disabled { opacity: .6; cursor: default; }
.cov-banner-busy { border-color: var(--border); border-left-color: var(--warn); background: var(--warn-bg); }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: 9px; padding: 2.5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); vertical-align: middle; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: sync-pulse 1.1s ease-in-out infinite; }
@keyframes sync-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.cd-media { width: 220px; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-soft); flex: none; display: block; }
.cd-preview { width: 330px; height: 600px; border: 0; border-radius: var(--radius-sm); background: var(--bg-soft); flex: none; display: block; }
@media (max-width: 720px) { .cd-preview { width: 100%; height: min(190vw, 660px); max-height: none; } }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 12px; padding: 18px; }
.cd-sec { padding: 0 18px 18px; }
.cd-details { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); }
.cd-details > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: 13px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.cd-details > summary::-webkit-details-marker { display: none; }
.cd-details > summary::after { content: '+'; color: var(--muted); font-weight: 700; transition: transform var(--speed) ease; }
.cd-details[open] > summary { border-bottom: 1px solid var(--border); }
.cd-details[open] > summary::after { content: '\2212'; }
.cd-details-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.cap-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; margin-bottom: 3px; }
.cap-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.cap-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-dim); }

.lb-score { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--bg-soft); color: var(--text); padding: 0 9px; }
.lb-score.hi { background: var(--good-bg); color: var(--good); }
.lb-score.lo { background: var(--bad-bg); color: var(--bad); }
.score-row { display: flex; gap: 10px; padding: 14px 18px 4px; flex-wrap: wrap; }
.score-pill { flex: 1; min-width: 90px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.score-pill .sv { font-size: 22px; font-weight: 800; line-height: 1; }
.score-pill .sk { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }

/* ── account tools (collapsed admin) + report picker ── */
.acct-tools { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.acct-tools > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: 13px; color: var(--text-dim); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.acct-tools > summary::-webkit-details-marker { display: none; }
.acct-tools > summary::after { content: '+'; color: var(--muted); font-weight: 700; }
.acct-tools[open] > summary::after { content: '\2212'; }
.acct-tools-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.rep-pick { cursor: pointer; transition: transform var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease; }
.rep-pick:hover { transform: translateY(-2px); border-color: var(--border-purple); box-shadow: var(--shadow); }

/* report picker cards (Reports landing) */
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 14px; transition: transform var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease; }
.rp-card:hover { transform: translateY(-2px); border-color: var(--border-purple); box-shadow: var(--shadow); }
.rp-card-top { display: flex; align-items: center; gap: 13px; }
.rp-card-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-card-cta { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 650; color: var(--purple); }
.rp-card-arrow { transition: transform var(--speed) ease; }
.rp-card:hover .rp-card-arrow { transform: translateX(3px); }
/* Named fixed-window reports listed under a client on the Reports landing. */
.rp-card-custom { padding-top: 10px; margin-top: -4px; color: var(--text); gap: 10px; }
.rp-card-custom:hover { color: var(--purple); }
/* "Face" pin on a stacked leaderboard card — which member ad the card shows as. */
.lb-face-btn { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--bg-card); opacity: .85; }
.lb-face-btn:hover { opacity: 1; }
/* Stacked-winner spotlight: one full-width card, media left, blended metrics
   right. Used by the report + its client share when winners_scope = stacked. */
.rep-hero-grid { display: block; }
.rep-hero { display: flex; gap: 26px; padding: 20px; align-items: flex-start; }
.rep-hero:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border-purple); }
.rep-hero-media { position: relative; flex: 0 0 268px; max-width: 268px; border-radius: 12px; overflow: hidden; cursor: pointer; }
.rep-hero-media:hover .lb-play span { background: rgba(19, 17, 24, 0.75); transform: scale(1.06); }
.rep-hero-media .lb-play span { transition: background var(--speed) ease, transform var(--speed) ease; }
.rep-hero-thumb { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--bg-soft); display: block; }
.rep-hero-body { flex: 1; min-width: 0; }
.rep-hero-name { font-size: 15px; font-weight: 700; line-height: 1.35; margin-top: 8px; word-break: break-word; }
.rep-hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.rep-hero-stat { border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; background: var(--bg-card); }
.rep-hero-stat-val { font-size: 21px; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }
@media (max-width: 720px) {
  .rep-hero { flex-direction: column; gap: 16px; }
  .rep-hero-media { flex: none; max-width: 100%; align-self: stretch; }
  .rep-hero-thumb { aspect-ratio: 1/1; }
  .rep-hero-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
}

/* ── monthly report ── */
.rep-sheet { max-width: 1100px; margin: 0 auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 34px 38px; }
.rep-title { text-align: center; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.rep-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .2em; font-size: 12px; }
.rep-brand .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--neon); transform: skew(-12deg); }
.rep-title h1 { font-size: 30px; letter-spacing: -0.03em; margin: 12px 0 4px; }
.rep-period { color: var(--muted); font-size: 13px; }
.rep-block { margin-top: 26px; }
.rep-h2 { font-size: 16px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.rep-krave { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.rep-stat { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--bg-card); }
.rep-stat-val { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0; }
.rep-bullets { display: flex; flex-direction: column; gap: 10px; }
.rep-bullet { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--bg-card); }
.rep-bullet-label { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.rep-bullet-detail { font-size: 13px; color: var(--text-dim); }
.rep-notes-text { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--bg-card); }
.rep-notes-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; }
.rep-notes-input:focus { outline: none; border-color: var(--neon); }
@media print {
  .sidebar, .nav-toggle, .nav-overlay, .no-print { display: none !important; }
  body.app { display: block; }
  .app-content { display: block; }
  .container { padding: 0; max-width: none; }
  .rep-sheet { border: 0; box-shadow: none; padding: 0; }
  .rep-bullet, .rep-stat, .km-card, .lb-card, .rep-notes-text { break-inside: avoid; }
}

/* ── Phase 4: strategist assistant ── */
/* Docked right panel — no dimming backdrop, so the strategist keeps using the
   account view while Kobe is open. Content shifts left via body.kobe-open. */
.chat-bg { position: fixed; top: 0; right: 0; bottom: 0; width: var(--kobe-w, 440px); max-width: 100%; display: flex; justify-content: flex-end; z-index: 70; }
.chat-drawer { width: 100%; height: 100%; min-height: 0; background: var(--bg-elev); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border-left: 1px solid var(--border); }
body.kobe-open .app-content { padding-right: var(--kobe-w, 440px); transition: padding-right .15s ease; }
/* drag handle on the left edge of the dock */
.chat-resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 71; touch-action: none; }
.chat-resize::before { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .12s ease; }
.chat-resize:hover::before { background: var(--neon-deep); }
body.kobe-resizing { cursor: ew-resize; user-select: none; }
body.kobe-resizing .app-content { transition: none; }
body.kobe-open .kobe-fab { display: none; }
.kobe-mem { border-top: 1px solid var(--border); background: var(--bg-soft); max-height: 40%; overflow: auto; padding: 10px 16px; }
.kobe-mem-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.kobe-mem-row .t { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--purple-deep); flex: none; margin-top: 2px; }
.kobe-mem-row .x { margin-left: auto; cursor: pointer; color: var(--muted); flex: none; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--border); }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chat-msg { max-width: 92%; padding: 10px 14px; border-radius: 15px; font-size: 14px; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: var(--purple); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot { align-self: flex-start; background: var(--bg-soft); color: var(--text); border-bottom-left-radius: 4px; }
.chat-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input { flex: 1; resize: none; min-height: 42px; max-height: 120px; font-family: var(--font-sans); font-size: 14px; }
.chat-status { font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 2px; }
.chat-status:empty { display: none; }
/* Kobe's bot bubbles render full markdown (auditMd); keep tables readable + scrollable in the narrow drawer */
.chat-msg.bot .aud-md { font-size: 13.5px; line-height: 1.5; }
.chat-msg.bot .aud-md > :first-child { margin-top: 0; }
.chat-msg.bot .aud-md h3, .chat-msg.bot .aud-md h4, .chat-msg.bot .aud-md h5 { margin: 10px 0 4px; }
.chat-msg.bot .aud-md p { margin: 6px 0; }
.chat-msg.bot .aud-tbl { display: block; overflow-x: auto; max-width: 100%; font-size: 12.5px; }
.aud-md hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.chat-refs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.chip { border: 1px solid var(--border); background: var(--bg-elev); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; transition: border-color var(--speed) ease; }
.chip:hover { border-color: var(--purple); }
.chip-sm { padding: 3px 9px; font-size: 11px; }

/* ── mobile: sidebar becomes a slide-in drawer (≤900px, creator-db pattern) ── */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .nav-overlay { display: block; }
  .container { padding: 64px 16px 24px; }
}
@media (max-width: 640px) {
  .page-head { flex-wrap: wrap; align-items: flex-start; gap: 8px; }
  .page-head h1 { font-size: 23px; }
  .cd-head { flex-wrap: wrap; }
  .cd-media { width: 100%; aspect-ratio: 4/5; max-height: 60vh; }
  .chat-drawer { width: 100%; }
  .chat-bg { width: 100%; }
  body.kobe-open .app-content { padding-right: 0; }
}

/* ── account audit ─────────────────────────────────────────────────────────── */
.aud-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin: 12px 0; background: var(--bg-card); box-shadow: var(--shadow-sm); }
.aud-card.aud-hidden { opacity: 0.55; border-style: dashed; box-shadow: none; }
.aud-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.aud-title { font-weight: 700; font-size: 15px; color: var(--text); }
.aud-card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aud-vis { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.aud-vis input { width: auto; margin: 0; }
.aud-edit { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); resize: vertical; }
.aud-actions { display: flex; gap: 8px; margin-top: 8px; }
.aud-md { font-size: 14px; line-height: 1.6; color: var(--text-dim); }
.aud-md h3, .aud-md h4, .aud-md h5 { line-height: 1.3; margin: 12px 0 5px; color: var(--text); }
.aud-md h3 { font-size: 15px; } .aud-md h4 { font-size: 14px; } .aud-md h5 { font-size: 13px; }
.aud-md ul, .aud-md ol { margin: 5px 0 9px; padding-left: 20px; }
.aud-md li { margin: 2px 0; }
.aud-md p { margin: 7px 0; }
.aud-md code { background: var(--purple-light); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.aud-tbl { border-collapse: collapse; width: 100%; margin: 9px 0; font-size: 13px; }
.aud-tbl th, .aud-tbl td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; }
.aud-tbl th { background: var(--purple-light); font-weight: 700; }

/* ── audit gallery cards ───────────────────────────────────────────────────── */
.aud-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.aud-gc { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.aud-gc-open { cursor: pointer; transition: box-shadow var(--speed) ease, transform var(--speed) ease, border-color var(--speed) ease; }
.aud-gc-open:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-purple); }
.aud-gc-media { position: relative; height: 150px; background: var(--purple-light); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.aud-gc-img { width: 100%; height: 100%; object-fit: cover; }
.aud-gc-noimg { font-size: 48px; font-weight: 800; color: var(--purple-deep); opacity: .35; }
.aud-gc-badge { position: absolute; top: 10px; right: 10px; }
.aud-gc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.aud-gc-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.aud-gc-snippet { font-size: 13px; color: var(--text-dim); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.aud-gc-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.aud-gc-foot .badge { margin-left: auto; }
.aud-gc-del { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 4px; line-height: 1; border-radius: 6px; opacity: .55; transition: opacity var(--speed) ease, color var(--speed) ease; }
.aud-gc-del:hover { opacity: 1; color: var(--bad); }
.aud-gc-foot .badge + .aud-gc-del { margin-left: 0; }

/* ── Kobe (assistant mascot) ───────────────────────────────────────────────── */
.kobe-btn { display: inline-flex; align-items: center; gap: 7px; }
.kobe-btn-img { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.kobe-avatar { width: 40px; height: 40px; border-radius: 11px; object-fit: contain; flex: none; background: var(--purple-light); padding: 2px; }
.kobe-hero { width: 96px; height: 96px; object-fit: contain; display: block; margin: 2px auto 8px; }

/* ── Winning Script Bank — Explore-style cards (Foreplay-like) ──────────────── */
.wn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 16px; align-items: start; }
.wn-card { margin: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; display: block; width: 100%; min-width: 0; }
.wn-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px 9px; }
.wn-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; object-fit: cover; }
.wn-brand { font-weight: 650; font-size: 14px; color: var(--text); line-height: 1.1; }
.wn-sub { font-size: 11px; color: var(--muted); }
.wn-head-r { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.wn-cmt-btn { background: none; border: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 3px; font-size: 12px; padding: 2px; }
.wn-cmt-btn:hover { color: var(--purple); }
.wn-copy { padding: 0 12px 9px; font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.wn-copy.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wn-more { background: none; border: none; color: var(--purple); font-weight: 600; font-size: 12px; cursor: pointer; padding: 2px 0; }
.wn-media { position: relative; width: 100%; aspect-ratio: 4 / 5; background: #131118; cursor: pointer; overflow: hidden; }
.wn-media img, .wn-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wn-media .wn-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #888; font-size: 12px; letter-spacing: .08em; background: var(--bg-soft); }
.wn-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--speed) ease; }
.wn-play:hover { background: rgba(0,0,0,.72); }
.wn-body { padding: 11px 12px 12px; }
.wn-proof { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--neon); color: var(--neon-ink); margin-bottom: 8px; transform: skew(-3deg); }
.wn-proof.unv { background: var(--bad-bg); color: var(--bad); transform: none; }
.wn-tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wn-tag { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; font-size: 11.5px; line-height: 1.3; color: var(--text); }
.wn-tag .k { color: var(--muted); text-transform: capitalize; font-size: 10.5px; }
.wn-tag-visual { background: color-mix(in srgb, var(--purple) 12%, transparent); border-color: color-mix(in srgb, var(--purple) 30%, transparent); color: var(--purple); font-weight: 600; }

/* ── Templates: scannable, beautified cards ─────────────────────────────────── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.tpl-card { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; cursor: pointer; transition: transform var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-purple); }
.tpl-accent { height: 4px; width: 100%; }
.tpl-inner { padding: 14px 16px 16px; }
.tpl-head { display: flex; gap: 11px; align-items: flex-start; }
.tpl-emoji { flex: none; width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tpl-name { font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--text); }
.tpl-tagrow { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tpl-chip { font-size: 11px; font-weight: 700; text-transform: capitalize; padding: 2.5px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); }
.tpl-chip-accent { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
.tpl-chip-warn { background: var(--warn-bg); color: var(--warn); }
.tpl-summary { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 11px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-beatwrap { margin-top: 12px; }
.tpl-beatlabel { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 7px; }
.tpl-beats { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-beat { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 11.5px; font-weight: 500; color: var(--text); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px 3px 4px; }
.tpl-beat-n { flex: none; width: 16px; height: 16px; border-radius: 5px; background: var(--purple); color: #fff; font-size: 9.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tpl-beat-more { color: var(--muted); font-weight: 600; padding: 4px 9px; background: transparent; border-style: dashed; }
.tpl-metrics { display: flex; align-items: flex-end; gap: 16px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.tpl-spend { display: flex; flex-direction: column; margin-right: auto; }
.tpl-spend-v { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.tpl-spend-l { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.tpl-stat { display: flex; flex-direction: column; align-items: flex-end; }
.tpl-stat b { font-size: 14px; font-weight: 700; color: var(--text); }
.tpl-stat span { font-size: 10.5px; color: var(--muted); }
.wn-foot { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--border); align-items: center; }
.wn-foot .btn { flex: none; align-self: center; white-space: nowrap; }
.wn-tpl { font-size: 12px; color: var(--purple); font-weight: 600; min-width: 0; }
.wn-analyzing { font-size: 12px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.wn-spinner { width: 12px; height: 12px; flex: none; border: 2px solid var(--border-strong); border-top-color: var(--purple); border-radius: 50%; animation: wn-spin .7s linear infinite; }
@keyframes wn-spin { to { transform: rotate(360deg); } }
.wn-media-note { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 9px; border-radius: 8px; background: rgba(19,17,24,0.82); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.3; text-align: center; backdrop-filter: blur(2px); }
.wn-detail-analyzing { display: flex; align-items: center; gap: 9px; margin: 0 18px 12px; padding: 10px 13px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--purple) 10%, transparent); color: var(--purple); font-size: 13px; font-weight: 600; }

/* ── Clients table (Track-Brands-style) ───────────────────────────────────── */
.ct-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.ct-table { width: 100%; border-collapse: collapse; }
.ct-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border-strong); background: var(--bg-soft); }
.ct-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text); vertical-align: middle; }
.ct-table tr:last-child td { border-bottom: none; }
.ct-table tbody tr { cursor: pointer; }
.ct-table tbody tr:hover { background: rgba(103, 84, 255, 0.045); }
.ct-name { display: flex; align-items: center; gap: 11px; font-weight: 650; }
.ct-ava { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; object-fit: cover; }
/* real logos: rounded square + contain so wide wordmarks stay legible (vs. circle-cropped) */
img.ct-ava { border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 2px; }
.ct-muted { color: var(--muted); }
/* expandable multi-account client rows */
.ct-exp { flex: none; width: 14px; margin-right: -4px; color: var(--muted); font-size: 11px; cursor: pointer; transition: color .12s; user-select: none; }
.ct-exp:hover { color: var(--purple-deep); }
.ct-subrow { background: var(--surface-subtle, #faf9fc); }
.ct-subrow:hover { background: var(--hover, #f3f1f8); }
.ct-subrow td:first-child { padding-left: 0; }
.ct-name.ct-sub { gap: 8px; font-weight: 550; padding-left: 30px; position: relative; }
.ct-name.ct-sub .ct-sub-tick { width: 12px; height: 12px; border-left: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); border-bottom-left-radius: 4px; position: absolute; left: 14px; top: -3px; }

/* ── verbatim reviews (grouped by product) ──────────────────────────────── */
.rv-summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.rv-group { margin-bottom: 18px; }
.rv-group-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.rv-group-name { font-weight: 700; font-size: 13.5px; }
.rv-group-meta { font-size: 12px; color: var(--muted); }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rv-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; background: #fff; display: flex; flex-direction: column; gap: 7px; }
.rv-card-top { display: flex; align-items: center; gap: 8px; }
.rv-chip { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; letter-spacing: .2px; }
.rv-chip.rv-good { background: #e7f7ee; color: #1b8a4b; }
.rv-chip.rv-mid { background: #fff4e0; color: #b5781a; }
.rv-chip.rv-bad { background: #fdecec; color: #c63333; }
.rv-author { font-size: 12px; color: var(--muted); font-weight: 600; }
.rv-card-top { flex-wrap: wrap; }
.rv-prod { font-size: 10.5px; color: #5a4e7a; background: #f1eef8; border-radius: 20px; padding: 1px 8px; margin-left: auto; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-text { font-size: 13px; line-height: 1.5; color: var(--ink, #25232b); white-space: pre-wrap; }

/* ── product cards ──────────────────────────────────────────────────────── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.prod-card { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s; }
.prod-card:hover { box-shadow: 0 6px 22px rgba(40,30,70,.10); transform: translateY(-2px); border-color: #d9d4e6; }
.prod-card.is-out { opacity: .55; }
.prod-thumb { height: 150px; background: #f6f5f9; display: flex; align-items: center; justify-content: center; }
.prod-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.prod-thumb.noimg::after { content: '📦'; font-size: 30px; opacity: .4; }
.prod-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.prod-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; color: var(--ink, #25232b); text-decoration: none; }
a.prod-name:hover { color: var(--purple-deep); text-decoration: underline; }
.prod-price { font-size: 12.5px; font-weight: 700; color: var(--purple-deep); }
.prod-claims { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.prod-claim { font-size: 10.5px; line-height: 1.4; padding: 2px 7px; border-radius: 20px; background: #f1eef8; color: #5a4e7a; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.prod-foot { margin-top: auto; padding-top: 8px; }
.prod-scope { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 20px; border: 1px solid var(--border); background: #fff; color: var(--muted); cursor: pointer; transition: all .12s; }
.prod-scope:hover { border-color: #cfc8e0; }
.prod-scope.on { background: #eafaf0; border-color: #b9e6cb; color: #1b8a4b; }

/* ── add-persona control + source badge ─────────────────────────────────── */
.persona-add-bar { border: 1px dashed var(--border-strong, #cfc8e0); border-radius: 12px; padding: 12px 14px; background: var(--bg-soft, #faf9fc); }
.persona-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.persona-src { font-size: 10.5px; font-weight: 700; color: #5a4e7a; background: #f1eef8; border-radius: 20px; padding: 1px 8px; margin-left: auto; white-space: nowrap; }

/* ── product tags: which in-scope product a persona / comment appeals to ───── */
.prod-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.prod-tag { font-size: 10.5px; font-weight: 700; color: #4a3d78; background: #ece7fb; border: 1px solid #d9d0f4; border-radius: 20px; padding: 1px 8px; white-space: nowrap; }
.prod-tag-both { color: var(--neon-ink, #2c2a1a); background: var(--neon, #d8fb37); border-color: rgba(0,0,0,.12); }
.prod-tag-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #7a7391); margin-bottom: 4px; }
.prod-tag-edit { display: flex; gap: 6px; flex-wrap: wrap; }
.prod-toggle { font-size: 11px; font-weight: 600; color: #5a4e7a; background: transparent; border: 1px solid var(--border-strong, #cfc8e0); border-radius: 20px; padding: 2px 10px; cursor: pointer; transition: background var(--speed, .15s) ease, color var(--speed, .15s) ease, border-color var(--speed, .15s) ease; }
.prod-toggle:hover { border-color: #b9adde; background: #f6f3ff; }
.prod-toggle.on { color: var(--neon-ink, #2c2a1a); background: var(--neon, #d8fb37); border-color: rgba(0,0,0,.14); }
.prod-toggle:disabled { opacity: .55; cursor: default; }
.prod-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.prod-filter-chip { font-size: 12px; font-weight: 600; color: var(--muted, #7a7391); background: transparent; border: 1px solid var(--border-strong, #cfc8e0); border-radius: 20px; padding: 3px 12px; cursor: pointer; transition: background var(--speed, .15s) ease, color var(--speed, .15s) ease, border-color var(--speed, .15s) ease; }
.prod-filter-chip:hover { border-color: #b9adde; color: var(--text, #131118); }
.prod-filter-chip.active { color: var(--purple-deep, #3a2d6b); background: var(--purple-light, #ece7fb); border-color: var(--border-purple, #d9d0f4); font-weight: 700; }

/* verbatim phrase bank — copy-ready exact customer phrases */
.phrase-bank { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.phrase-chip { font-size: 11.5px; font-style: italic; color: #2c2a1a; background: #fbfde8; border: 1px solid #e4ee9a; border-radius: 8px; padding: 2px 8px; cursor: copy; line-height: 1.45; text-align: left; transition: background var(--speed, .15s) ease, border-color var(--speed, .15s) ease; }
.phrase-chip:hover { background: var(--neon, #d8fb37); border-color: rgba(0,0,0,.14); }

/* ── per-client analytics: client switcher dropdown ───────────────────────── */
.cn-back { display: inline-block; margin: 0 0 8px; padding: 0 0.85rem; font-size: 12px; color: var(--muted); text-decoration: none; }
.cn-back:hover { color: var(--text); }
.client-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cl-switch { position: relative; margin: 0 0 12px; }
.cl-switch-btn { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-card); cursor: pointer; text-align: left; transition: border-color var(--speed) ease; }
.cl-switch-btn:hover { border-color: var(--border-strong); }
.cl-switch-name { font-weight: 650; font-size: 14px; color: var(--text); line-height: 1.15; }
.cl-switch-sub { font-size: 11px; color: var(--muted); }
.cl-switch-caret { margin-left: auto; color: var(--muted); }
.cl-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: var(--bg-card); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; padding: 5px; }
.cl-menu button { width: 100%; text-align: left; padding: 8px 10px; border: none; background: none; border-radius: var(--radius-xs); cursor: pointer; font-size: 13.5px; color: var(--text); }
.cl-menu button:hover { background: var(--bg-soft); }
.cl-menu button.active { background: var(--purple-light); color: var(--purple-deep); font-weight: 600; }
.rep-emoji { display: inline-block; width: 18px; text-align: center; margin-right: 2px; }

/* ── Briefs ── */
.brief-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.brief-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; position: sticky; top: 0; background: var(--bg-elev); z-index: 1; }
.brief-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.brief-cell { width: 100%; min-width: 90px; border: 1px solid transparent; border-radius: var(--radius-xs); padding: 4px 6px; font-family: var(--font-sans); font-size: 13px; line-height: 1.4; resize: vertical; background: transparent; color: var(--text); box-shadow: none; }
.brief-cell:hover { border-color: var(--border); }
.brief-cell:focus { border-color: var(--neon-deep); background: var(--bg-soft); outline: none; box-shadow: none; }
.brief-row.block-hook td { background: color-mix(in srgb, var(--neon) 7%, transparent); }
.brief-row.block-cta td { background: color-mix(in srgb, var(--purple) 6%, transparent); }
/* translation columns sit beside their English source, tinted so the pairing reads */
.brief-table th.th-trans { color: var(--purple); }
.brief-table td.td-trans { background: color-mix(in srgb, var(--purple) 5%, transparent); }
.brief-cell-trans { color: var(--text); }
.brief-cell-trans::placeholder { color: var(--purple); opacity: .5; }
/* drag-to-resize columns (editor only; the read-only share table keeps auto layout) */
.brief-table.resizable { table-layout: fixed; }
.brief-table.resizable .brief-cell { min-width: 0; }
.brief-table.resizable th { overflow: hidden; text-overflow: ellipsis; }
.col-resize { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; user-select: none; touch-action: none; z-index: 2; }
.col-resize::after { content: ''; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 1px; background: var(--border-strong); opacity: 0; transition: opacity .12s; }
.col-resize:hover::after, .col-resize.dragging::after { opacity: 1; background: var(--neon-deep); width: 2px; }
body.col-resizing { cursor: col-resize !important; user-select: none; }

/* ── motion safety ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── knowledge base ──────────────────────────────────────────────────────── */
.kb-list { display: flex; flex-direction: column; }
.kb-cat { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.kb-cat:first-child { margin-top: 4px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kb-card { text-align: left; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 15px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed); display: flex; flex-direction: column; gap: 8px; font-family: inherit; }
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-purple); }
.kb-card h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1.25; }
.kb-sum { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.kb-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--muted); margin-top: auto; }

.kb-article { max-width: 760px; }
.kb-art-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.kb-art-head .kb-meta { margin-top: 0; }
.kb-article .aud-md { font-size: 15.5px; line-height: 1.72; color: var(--text-dim); }
.kb-article .aud-md h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); margin: 6px 0 14px; line-height: 1.15; }
.kb-article .aud-md h4 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin: 30px 0 10px; }
.kb-article .aud-md h5 { font-size: 15px; font-weight: 700; color: var(--text); margin: 20px 0 6px; }
.kb-article .aud-md p { margin: 12px 0; }
.kb-article .aud-md ul, .kb-article .aud-md ol { margin: 10px 0 14px; padding-left: 22px; }
.kb-article .aud-md li { margin: 5px 0; }
.kb-article .aud-md strong { color: var(--text); }
.kb-article .aud-tbl { font-size: 13.5px; display: block; overflow-x: auto; max-width: 100%; }
.kb-article .aud-tbl td, .kb-article .aud-tbl th { padding: 8px 11px; vertical-align: top; }
