/* adintel design system. Tokens first, then primitives, then page components. Light by default, dark via
   Light by default like Adspo; dark only via the explicit toggle (data-theme). 4px grid. */
:root {
  color-scheme: light; /* native controls (date, checkbox, file) follow the app theme, not the OS dark mode */
  accent-color: var(--accent);
  --bg: #fafaf8; --surface: #ffffff; --surface-2: #f4f3ef; --line: #e9e7e2; --line-strong: #d8d5ce;
  --text: #1a1a1a; --text-2: #454441; --muted: #6b6963; --accent: #ea580c; --accent-hover: #c2410c; --accent-soft: #fff2ea;
  --win: #16a34a; --win-soft: #e8f8ee; --warn: #d97706; --warn-soft: #fff4e0; --danger: #dc2626; --danger-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(20,18,14,.05), 0 10px 30px -18px rgba(20,18,14,.18);
  --radius: 16px; --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sidebar: 228px;
}
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #222220; --line: #2b2b29; --line-strong: #3a3a37;
  --text: #f2f1ee; --text-2: #c2c0bb; --muted: #8d8b86; --accent: #f97316; --accent-hover: #fb923c; --accent-soft: #3a2314;
  --win: #4ade80; --win-soft: #14301f; --warn: #fbbf24; --warn-soft: #3a2a0f; --danger: #f87171; --danger-soft: #3b1a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); } a.link:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; } h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; } h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text-2); letter-spacing: .02em; text-transform: none; }
p { margin: 0 0 8px; } pre { white-space: pre-wrap; font: inherit; margin: 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--muted); }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.brandmark { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; font-weight: 750; font-size: 16px; letter-spacing: -0.02em; }
.brandmark .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #8b5cf6); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); } .nav a.active svg { opacity: 1; }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.nav-section { margin-top: 14px; padding: 0 10px 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sidebar .spacer { flex: 1; }
.space-switch { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.space-switch select { width: 100%; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.userbox .who { min-width: 0; line-height: 1.2; } .userbox .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .who span { font-size: 11px; color: var(--muted); }
.topbar { display: none; }
.content { min-width: 0; padding: 24px 28px 48px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-100%); transition: transform .2s ease; z-index: 40; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; display: none; } .scrim.open { display: block; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar .brandmark { padding: 0; font-size: 15px; }
  .content { padding: 16px 16px 40px; }
}

/* ---- primitives ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); } .btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; } .btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 9px; font-size: 12px; } .btn.icon { padding: 7px; }
.btn svg { width: 16px; height: 16px; }
.input, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=date], input[type=time], input[type=datetime-local], input[type=month], select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 10px; min-height: 36px; outline: none; }
textarea, textarea.input { border-radius: 12px; padding: 10px 12px; resize: vertical; min-height: 72px; line-height: 1.45; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
label.field { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.field-row { margin-bottom: 14px; } .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel + .panel, .stack > * + * { margin-top: 14px; }
.panel h3 { margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); font-weight: 500; margin: 2px 4px 2px 0; line-height: 18px; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; } .pill .dot.on { background: var(--win); }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.win { background: var(--win-soft); color: var(--win); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.scaled { font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-size: 10px; }
.pill.own { background: var(--win-soft); color: var(--win); border-color: transparent; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-size: 10px; }
.pill.aimade { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
table { width: 100%; border-collapse: collapse; } td, th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; } th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; } tr:last-child td { border-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; } .kpi .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi .delta { font-size: 12px; font-weight: 600; margin-left: 6px; } .delta.up { color: var(--win); } .delta.down { color: var(--warn); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.alertbox { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.alertbox.error { background: var(--danger-soft); color: var(--danger); } .alertbox.ok { background: var(--win-soft); color: var(--win); } .alertbox.info { background: var(--accent-soft); color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 13px; opacity: 0; transition: all .2s; z-index: 100; pointer-events: none; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(92vw, 420px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog .dlg { padding: 20px; } dialog .dlg h2 { margin-bottom: 12px; } dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); font-weight: 500; cursor: pointer; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-color: var(--accent); }
.tabpanel { display: none; } .tabpanel.active { display: block; }
.score { font-weight: 650; } .score.likely_winner { color: var(--win); } .score.strong_signal { color: var(--warn); } .score.testing, .score.weak, .score.insufficient_data { color: var(--muted); }
.meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--accent); }
.meter.likely_winner > i { background: var(--win); } .meter.strong_signal > i { background: var(--warn); }

/* ---- filters ---- */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filterbar .search { flex: 1 1 260px; position: relative; }
.filterbar .search input { padding-left: 34px; }
.filterbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.filterbar select, .filterbar input[type=number] { width: auto; min-width: 140px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; }
.chip a { opacity: .7; font-weight: 700; } .chip a:hover { opacity: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg a, .seg button { padding: 7px 12px; background: var(--surface); color: var(--text-2); border: 0; cursor: pointer; font-weight: 500; }
.seg a + a, .seg button + button { border-left: 1px solid var(--line); }
.seg .active { background: var(--accent-soft); color: var(--accent); }

/* ---- creative cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .ccard .brandline .pill { display: none; } }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } .ccard .brandline .pill { display: inline-flex; } }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ccard .media { aspect-ratio: 4/5; background: #0b0d12; position: relative; display: block; overflow: hidden; }
.ccard .media img, .ccard .media video { width: 100%; height: 100%; object-fit: cover; }
.ccard .media .textad { padding: 16px; color: #d6dae3; font-size: 13px; line-height: 1.45; height: 100%; overflow: hidden; background: linear-gradient(160deg, #1b1f2a, #0b0d12); }
.ccard .badge { position: absolute; top: 8px; left: 8px; background: rgba(8,10,14,.72); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; backdrop-filter: blur(4px); }
.ccard .badge.r { left: auto; right: 8px; }
.ccard .badge.b { top: auto; bottom: 8px; left: 8px; }
.ccard .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ccard .play i { width: 40px; height: 40px; border-radius: 50%; background: rgba(8,10,14,.6); display: grid; place-items: center; color: #fff; }
.ccard .play svg { width: 18px; height: 18px; margin-left: 2px; }
.ccard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.ccard .brandline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ccard .brandline img { width: 18px; height: 18px; border-radius: 50%; }
.ccard .brandline a { color: var(--text-2); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .hook { font-weight: 600; font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.ccard .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.ccard .meta .score { font-size: 12px; }
.ccard .actions { display: flex; gap: 6px; margin-top: 2px; }
.ccard .actions .btn { flex: 1; }
.saved-pill { font-size: 11px; color: var(--win); font-weight: 600; }

/* hooks view */
.hooks { display: flex; flex-direction: column; gap: 10px; }
.hookrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 12px; }
.hookrow .thumb { width: 56px; height: 70px; border-radius: 8px; overflow: hidden; background: #0b0d12; }
.hookrow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hookrow .q { font-size: 15px; font-weight: 600; line-height: 1.35; }
.hookrow .q::before { content: "\201C"; color: var(--accent); margin-right: 2px; } .hookrow .q::after { content: "\201D"; color: var(--accent); }
.hookrow .sub { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) { .hookrow { grid-template-columns: 48px 1fr; } .hookrow > :last-child { grid-column: 2; } }

/* brand list */
.brandrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; }
.brandrow img, .brandrow .ph { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.brandrow .ph { display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.brandrow .nm { font-weight: 650; font-size: 15px; } .brandrow .sub { color: var(--muted); font-size: 12px; }

/* detail */
.detail { display: grid; grid-template-columns: minmax(300px, 460px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr !important; } } /* beats the inline 1fr 1fr on settings pages */
.detail .media { position: sticky; top: 20px; }
.detail .media img, .detail .media video { width: 100%; border-radius: var(--radius); background: #000; border: 1px solid var(--line); }
.detail .media .textad { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.transcript .seg { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 4px 0; }
.transcript .seg .t { color: var(--muted); font-family: var(--mono); font-size: 11px; padding-top: 3px; }
.transcript .seg.hookseg .x { color: var(--accent); font-weight: 600; }
.copyblock { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.55; }
.breadcrumb { color: var(--muted); font-size: 12px; margin-bottom: 10px; } .breadcrumb a:hover { color: var(--text); }

/* auth */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.authcard { width: min(100%, 400px); padding: 28px; }
.authcard .brandmark { padding: 0 0 18px; justify-content: center; font-size: 18px; }
.authcard h1 { font-size: 20px; margin-bottom: 4px; } .authcard .lead { color: var(--muted); margin-bottom: 18px; }
.authcard .btn.primary { width: 100%; padding: 10px; }
.authcard .foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 16px; }

/* share page */
.sharewrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.sharehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

.pager { display: flex; justify-content: center; gap: 10px; margin-top: 24px; align-items: center; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px; }


/* ---- Adspo-style additions ---- */
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--accent-hover); text-transform: uppercase; margin-bottom: 6px; }
.eyebrow::before { content: "[ "; } .eyebrow::after { content: " ]"; }
.ribbon { position: absolute; top: 10px; left: -6px; background: var(--win); color: #fff; font-weight: 700; font-size: 12px; padding: 4px 12px; border-radius: 999px; transform: rotate(-6deg); box-shadow: 0 2px 6px rgba(0,0,0,.25); letter-spacing: -0.01em; }
.ccard { border-radius: var(--radius); }
.ccard .media { aspect-ratio: 4/5; background: var(--surface-2); }
.ccard .brandline .av { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); overflow: hidden; flex: none; }
.ccard .brandline .av img { width: 100%; height: 100%; object-fit: cover; }
.ccard .data { display: flex; flex-wrap: wrap; gap: 0; }
.ccard .meta { font-family: var(--mono); font-size: 11.5px; }
.ccard select { border-radius: 999px; }
.filterbar .search input { border-radius: 999px; padding-left: 36px; }
.filterbar select { border-radius: 999px; font-size: 13px; }
.statlist { display: flex; flex-direction: column; gap: 6px; }
.statrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-family: var(--mono); font-size: 11px; }
.statrow .lbl { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.statrow .n { color: var(--text); } .statrow .n::before { content: "• "; color: var(--win); }
.statrow .pct { min-width: 44px; text-align: right; color: var(--muted); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.quote { font-family: var(--mono); font-size: 11.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 6px; display: block; }
.quote::before { content: "\201C"; } .quote::after { content: "\201D"; }
.quote:hover { border-color: var(--accent); }
.brandhero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 18px; }
.brandhero .logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 30px; font-weight: 700; color: var(--muted); }
.brandhero h1 { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: 0; }
.brandhero .verified { color: #3b82f6; vertical-align: middle; }
.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1000px) { .dash { grid-template-columns: 1fr 1fr; } } @media (max-width: 640px) { .dash { grid-template-columns: 1fr; } }
.dash .panel h3 { margin-bottom: 8px; }
.bignum { font-family: var(--mono); font-size: 15px; font-weight: 600; } .bignum .d { font-size: 11px; font-weight: 500; margin-left: 8px; }
.sparkbar { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 10px; } .sparkbar i { flex: 1; background: var(--win-soft); border-radius: 3px 3px 0 0; min-height: 3px; } .sparkbar i.hi { background: var(--win); }
.sharebanner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-family: var(--mono); font-size: 11.5px; margin-bottom: 16px; }
.winner-tag { color: var(--win); font-weight: 700; }
.sidebar { background: var(--bg); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); } .nav a.active svg { color: var(--accent); opacity: 1; }
.brandmark .dot { background: var(--text); border-radius: 6px; } :root[data-theme="dark"] .brandmark .dot { background: var(--accent); }

.btn.ghost.danger { border-color: transparent; color: var(--danger); } .btn.ghost.danger:hover { background: var(--danger-soft); }

/* =====================================================================================================
   Design system v2: depth, glass and motion. Layered on top of the Adspo-style base above.
   Rules: only transform/opacity animate; every effect is removed under prefers-reduced-motion;
   glass never carries body text without a solid fallback colour behind it.
   ===================================================================================================== */
:root {
  --glass: rgba(255,255,255,.72); --glass-strong: rgba(255,255,255,.88); --glass-line: rgba(255,255,255,.65);
  --shadow-1: 0 1px 1px rgba(20,18,14,.04), 0 2px 6px rgba(20,18,14,.05), 0 12px 32px -18px rgba(20,18,14,.22);
  --shadow-2: 0 2px 4px rgba(20,18,14,.06), 0 10px 24px -8px rgba(234,88,12,.18), 0 28px 60px -28px rgba(20,18,14,.35);
  --glow-accent: rgba(234,88,12,.22); --glow-violet: rgba(124,58,237,.16); --glow-win: rgba(22,163,74,.22);
  --grad-accent: linear-gradient(135deg, #ff7a2f 0%, #ea580c 55%, #c2410c 100%);
  --grad-text: linear-gradient(135deg, #1a1a1a 0%, #4a4a48 100%);
}
:root[data-theme="dark"] {
  --glass: rgba(26,26,25,.62); --glass-strong: rgba(26,26,25,.86); --glass-line: rgba(255,255,255,.08);
  --shadow-1: 0 1px 1px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.35), 0 16px 40px -20px rgba(0,0,0,.8);
  --shadow-2: 0 2px 4px rgba(0,0,0,.4), 0 12px 28px -8px rgba(249,115,22,.28), 0 36px 70px -30px rgba(0,0,0,.9);
  --glow-accent: rgba(249,115,22,.28); --glow-violet: rgba(139,92,246,.22); --glow-win: rgba(74,222,128,.22);
  --grad-text: linear-gradient(135deg, #f2f1ee 0%, #b8b6b0 100%);
}

/* ambient background: two soft colour fields + fine grain, fixed so it feels like a surface under the UI */
body { position: relative; isolation: isolate; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -10%, var(--glow-accent), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, var(--glow-violet), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, var(--glow-win), transparent 60%),
    var(--bg); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: .35; }

/* glass surfaces */
.sidebar, .topbar { background: var(--glass); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); border-color: var(--glass-line); }
.panel, .card, .kpi, .ccard, dialog { background: var(--glass-strong); backdrop-filter: blur(10px) saturate(130%); -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-line); border-color: color-mix(in srgb, var(--line) 80%, transparent); }
.panel, .kpi { transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
.panel:hover, .kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-line); }

/* buttons with a glossy top edge and a press state */
.btn.primary { background: var(--grad-accent); border: 0; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 16px -6px var(--glow-accent), 0 1px 2px rgba(0,0,0,.15); }
.btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 22px -6px var(--glow-accent); }
.btn { transition: transform .12s ease, box-shadow .2s ease, background .2s ease, filter .2s ease; }
.btn:active { transform: translateY(0) scale(.98); }
.btn.danger:hover { box-shadow: 0 8px 20px -8px rgba(220,38,38,.35); }
.pill { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 1px rgba(0,0,0,.04); }
:root[data-theme="dark"] .pill { box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }

/* headline numbers and titles: gradient ink */
h1, .kpi .v, .bignum { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .v .delta, .bignum .d { -webkit-text-fill-color: initial; color: inherit; background: none; }
.kpi .v .delta.up { color: var(--win); } .kpi .v .delta.down { color: var(--warn); }

/* creative cards: 3D tilt + sheen. JS sets --rx/--ry (deg) and --mx/--my (%) per card */
.grid { perspective: 1100px; }
.ccard { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; will-change: transform; }
.ccard:hover { transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px) scale(1.012); box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-line); }
.ccard .media { transform: translateZ(18px); border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; }
.ccard .media::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255,255,255,.22), transparent 45%); }
.ccard:hover .media::after { opacity: 1; }
.ccard .media img, .ccard .media video { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ccard:hover .media img, .ccard:hover .media video { transform: scale(1.04); }
.ccard .body { transform: translateZ(10px); }
.ribbon { transform: rotate(-6deg) translateZ(30px); background: linear-gradient(135deg, #34d399, #16a34a); box-shadow: 0 6px 16px -6px var(--glow-win), 0 1px 0 rgba(255,255,255,.35) inset; }
.ribbon::after { content: ""; position: absolute; left: 6px; bottom: -5px; border: 5px solid transparent; border-top-color: #0f6a33; border-left-color: #0f6a33; filter: brightness(.9); }
.ccard .play i { background: rgba(8,10,14,.55); backdrop-filter: blur(6px); box-shadow: 0 8px 24px -8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .3s; }
.ccard:hover .play i { transform: scale(1.08); }

/* No entrance animation on lists: every click reloads the page, and a staggered reveal made 24 cards take ~1.6s to
   appear. Content the user asked for shows at once; motion is kept for what the user causes (drawer, hover). */

/* bento-ish dashboard: first tile is the hero */
.dash .panel:first-child { grid-row: span 1; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--glass-strong)), var(--glass-strong) 60%); }
.dash .panel:first-child .bignum { font-size: 22px; }
.kpis .kpi:first-child { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--glass-strong)), var(--glass-strong) 65%); }
.sparkbar i { background: linear-gradient(180deg, color-mix(in srgb, var(--win) 35%, transparent), color-mix(in srgb, var(--win) 12%, transparent)); }
.sparkbar i.hi { background: linear-gradient(180deg, #4ade80, var(--win)); box-shadow: 0 0 14px var(--glow-win); }

/* brand hero: orbit ring + slow float */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.brandhero { position: relative; }
.brandhero .logo { position: relative; box-shadow: 0 18px 40px -18px rgba(0,0,0,.45), 0 0 0 6px var(--glass-strong), 0 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent); animation: float 7s ease-in-out infinite; }
.brandhero::before { content: ""; position: absolute; top: -22px; left: 50%; width: 140px; height: 140px; margin-left: -70px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 70%, var(--glow-accent) 85%, transparent 100%); filter: blur(8px); animation: spin 14s linear infinite; }

/* alerts and brand rows get the lift too */
.alertrow, .brandrow, .hookrow { transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
.alertrow:hover, .brandrow:hover, .hookrow:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-line); }
.nav a { transition: background .2s, color .2s, transform .15s; } .nav a:active { transform: scale(.98); }
.nav a.active { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--glass-line), 0 6px 16px -10px var(--glow-accent); }
.brandmark .dot { background: var(--grad-accent); box-shadow: 0 6px 16px -6px var(--glow-accent), inset 0 1px 0 rgba(255,255,255,.4); }
.seg { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.seg .active { background: var(--grad-accent); color: #fff; }
.eyebrow { text-shadow: 0 0 18px var(--glow-accent); }
.toast { background: var(--glass-strong); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-line); box-shadow: var(--shadow-2); }
dialog::backdrop { background: rgba(20,18,14,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* keep the glass legible on phones and honour reduced motion */
@media (max-width: 900px) { .sidebar { background: var(--glass-strong); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ccard, .ccard:hover { transform: none !important; }
  .panel:hover, .kpi:hover, .alertrow:hover, .brandrow:hover, .hookrow:hover { transform: none; }
}

/* ---- Spyder-style brand tabs (Phase 1) ---- */
.subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 18px; overflow-x: auto; }
.subnav a { padding: 9px 13px; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; }
.subnav a:hover { color: var(--text); } .subnav a.active { color: var(--accent); border-color: var(--accent); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; } .legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .sw.launched { background: var(--accent); } .legend .sw.retired { background: var(--muted); } .legend .sw.line { height: 3px; background: var(--win); }
.legend .sw.evergreen { background: var(--win); border-radius: 50%; } .legend .sw.breakout { background: var(--warn); border-radius: 50%; } .legend .sw.none { background: var(--accent); border-radius: 50%; } .legend .sw.ended { background: var(--muted); border-radius: 50%; opacity: .5; }
svg.velocity { width: 100%; height: 160px; display: block; } svg.velocity .axis { stroke: var(--line-strong); stroke-width: 1; }
svg.velocity .launched { fill: var(--accent); } svg.velocity .retired { fill: var(--muted); opacity: .7; }
svg.velocity .active { fill: none; stroke: var(--win); stroke-width: 2; stroke-linejoin: round; }
.rankcard { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); transition: transform .2s, box-shadow .2s; }
.rankcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.rankcard .thumb { aspect-ratio: 4/5; background: var(--surface-2); position: relative; overflow: hidden; }
.rankcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; } .rankcard .thumb .textad { padding: 10px; font-size: 11px; line-height: 1.4; }
.rankcard .thumb .tag { position: absolute; top: 6px; left: 6px; margin: 0; } .rankcard.winner { outline: 2px solid var(--win); }
.rankcard .meta { padding: 6px 8px; font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }
.mini { width: 36px; height: 45px; border-radius: 6px; background: var(--surface-2); overflow: hidden; flex: none; display: inline-block; } .mini img { width: 100%; height: 100%; object-fit: cover; }
.scatter { position: relative; height: 320px; margin: 10px 28px 22px 34px; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.scatter .dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; margin: -6px 0 0 -6px; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.scatter .dot.evergreen { background: var(--win); } .scatter .dot.breakout { background: var(--warn); } .scatter .dot.ended { opacity: .45; }
.scatter .dot:hover { transform: scale(1.5); z-index: 2; }
.scatter .ylab { position: absolute; left: -32px; top: -6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); } .scatter .ylab.bottom { top: auto; bottom: -6px; }
.scatter .xlab { position: absolute; bottom: -20px; left: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); } .scatter .xlab.right { left: auto; right: 0; }
details.analytics summary { cursor: pointer; } details.analytics .dash { grid-template-columns: repeat(3, 1fr); }
details.cohort { padding: 12px 14px; } details.cohort summary { cursor: pointer; list-style: none; } details.cohort summary::-webkit-details-marker { display: none; }
.cohort-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.lpwrap { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 16px; align-items: start; } @media (max-width: 900px) { .lpwrap { grid-template-columns: 1fr; } }
.lplist { display: flex; flex-direction: column; gap: 8px; } .lprow { display: flex; gap: 10px; align-items: center; padding: 10px 12px; } .lprow.active { outline: 2px solid var(--accent); }
.lprow .url { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shots { display: grid; grid-template-columns: 3fr 1fr; gap: 14px; } @media (max-width: 700px) { .shots { grid-template-columns: 1fr; } }
.shots figure { margin: 0; } .shots figcaption { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.shots img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.gantt { overflow-x: auto; } .gaxis { position: relative; height: 18px; margin-left: 150px; }
.gaxis span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.grow-row { display: grid; grid-template-columns: 150px 1fr; gap: 0; align-items: center; border-top: 1px solid var(--line); }
.glabel { padding: 6px 8px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.gtrack { position: relative; height: 26px; } .gtrack > i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); }
.gbar { position: absolute; top: 5px; height: 16px; border-radius: 4px; background: var(--accent); min-width: 3px; display: flex; align-items: center; padding: 0 6px; overflow: hidden; }
.gbar.ended { background: var(--muted); opacity: .75; } .gbar.clipped { border-radius: 0 4px 4px 0; }
.gbar span { font-family: var(--mono); font-size: 10px; color: #fff; white-space: nowrap; }
.gbar:hover { filter: brightness(1.1); z-index: 2; }
.dash.ov-top { grid-template-columns: 1.2fr 2fr; } .dash.ov-mid { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .dash.ov-top, .dash.ov-mid, details.analytics .dash { grid-template-columns: 1fr; } .scatter { margin-left: 30px; } }

/* ---- feed (new creatives across followed brands, grouped by day) ---- */
.feed-day + .feed-day { margin-top: 26px; }
.feed-day-head { display: flex; align-items: baseline; gap: 10px; font-size: 15px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ---- swipe file: Ad Details drawer, tags, ratings, comments, presets, folders ---- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(20, 18, 14, .35); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -24px 0 60px rgba(0,0,0,.18); transform: translateX(104%); transition: transform .32s cubic-bezier(.2,.8,.2,1); z-index: 61; overflow-y: auto; overscroll-behavior: contain; }
.drawer.open { transform: none; }
.drawer-body { padding: 14px 18px 32px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; background: var(--surface); padding: 6px 0 10px; z-index: 2; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.drawer-head .brandline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drawer-head .av { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; overflow: hidden; }
.drawer-head .av img { width: 100%; height: 100%; object-fit: cover; }
.drawer-media { background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; max-height: 60vh; }
.drawer-media video, .drawer-media img { max-width: 100%; max-height: 60vh; object-fit: contain; display: block; }
.drawer-media .textad { color: #fff; padding: 24px; white-space: pre-wrap; }
.drawer-title { font-size: 19px; line-height: 1.3; margin: 14px 0 8px; letter-spacing: -.01em; }
.drawer .data { display: flex; flex-wrap: wrap; }
body.drawer-open { overflow: hidden; }
.ccard.current { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .drawer-body { padding: 10px 12px 28px; } .drawer-media { max-height: 45vh; } }

.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--line-strong); cursor: pointer; padding: 0 1px; transition: transform .12s, color .12s; }
.star:hover, .star.on { color: #f59e0b; } .star:hover { transform: scale(1.18); }
.stars:hover .star { color: var(--line-strong); } .stars .star:hover, .stars .star:has(~ .star:hover) { color: #f59e0b; }

.tagpick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.tag { --tag: var(--accent); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .15s; font-family: inherit; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tag); opacity: .45; }
.tag.on { background: color-mix(in srgb, var(--tag) 12%, var(--surface)); border-color: color-mix(in srgb, var(--tag) 45%, var(--line)); color: var(--text); }
.tag.on::before { opacity: 1; } button.tag:hover { border-color: var(--tag); }
.tag.add { border-style: dashed; color: var(--muted); } .tag.add::before { display: none; }
.tag.sm { padding: 1px 8px; font-size: 11px; cursor: default; background: color-mix(in srgb, var(--tag) 10%, var(--surface)); border-color: transparent; }
.swipeline { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.rating { color: #f59e0b; font-size: 12px; letter-spacing: 1px; } .rating i { font-style: normal; color: var(--line-strong); }

.comments { display: grid; gap: 8px; margin-bottom: 10px; }
.comment { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.comment .who { display: flex; align-items: center; gap: 8px; font-size: 12px; } .comment .who .btn { margin-left: auto; }
.comment p { margin: 4px 0 0; font-size: 13.5px; white-space: pre-wrap; }
.commentform { display: flex; gap: 8px; } .commentform input { flex: 1; }

.chips.presets { align-items: center; margin-bottom: 6px; }
.chip.preset a:first-child { color: var(--accent); font-weight: 600; }
.search { position: relative; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.14); z-index: 30; overflow: hidden; }
.suggest a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text); text-decoration: none; font-size: 13px; }
.suggest a:hover { background: var(--surface-2); }

.folder-section { margin-bottom: 26px; }
.folder-head { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; }
.folder-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; } .folder-head h2 svg { width: 18px; height: 18px; color: var(--accent); }
.folder-head .btn { margin-left: auto; }
.row.wrap { flex-wrap: wrap; justify-content: flex-end; }
.sharewrap.wide { max-width: 1280px; }
.sharenote { grid-column: span 1; margin-top: -10px; font-size: 13px; color: var(--text-2); font-style: italic; padding: 0 6px; }

/* Upload your ad dialog (_upload.html) */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 14px; text-align: center; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone b { color: var(--text); }
.dropzone .picked { margin-top: 6px; font-weight: 600; color: var(--text); word-break: break-all; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

/* AI analysis panel (emotion radar, content style, targeting, persona) */
.aipanel { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.aipanel .aihead { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 8px; }
.radarwrap { display: flex; justify-content: center; }
.radar { max-width: 100%; height: auto; }
.radar .ring { fill: none; stroke: var(--line); } .radar .spoke { stroke: var(--line); }
.radar .area { fill: var(--accent); fill-opacity: .22; stroke: var(--accent); stroke-width: 1.5; }
.radar .dot { fill: var(--accent); }
.radar .lbl { font-family: var(--mono); font-size: 9px; fill: var(--muted); letter-spacing: .04em; }
.radar .lbl .n { font-size: 10px; fill: var(--text-2); font-weight: 700; }
.radar .lbl .n.hi { fill: var(--accent); }
.airow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 8px; }
.airow .k, .aibox .k { font-size: 12px; color: var(--muted); }
.aibox { border-radius: 10px; background: var(--accent-soft); padding: 8px 10px; margin-top: 8px; }
.aibox .t { font-size: 12px; font-weight: 650; color: var(--accent); margin-bottom: 4px; }
.aibox .v { background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.45; }

/* plans, trial and onboarding (Phase 2) */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; }
.banner.info { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.banner.warn { background: var(--warn-soft); color: var(--text); border-color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--text); border-color: var(--danger); }
.banner .btn { flex-shrink: 0; }
.sidebar .credits { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-top: 1px solid var(--line); margin-top: 8px; text-decoration: none; color: var(--text); }
.sidebar .credits:hover { background: var(--surface-2); border-radius: var(--radius-sm); }
.checklist { margin-bottom: 16px; }
.checklist .steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; }
.checklist .steps li { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.checklist .steps li.done { border-style: solid; background: var(--win-soft); }
.checklist .steps li .tick { grid-row: 1 / span 2; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--surface); }
.checklist .steps li.done .tick { background: var(--win); color: #fff; border-color: var(--win); }
.checklist .steps li a { font-weight: 600; color: var(--text); text-decoration: none; }
.checklist .steps li.done a { text-decoration: line-through; color: var(--muted); }
.checklist .steps li .help { margin: 0; }
tr.is-current td { background: var(--accent-soft); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

/* ---- Library filter bar: one row, the rest behind "More filters" (UI review Q1) ---- */
.page-head .sub .info { cursor: help; color: var(--muted); margin-left: 2px; }
.filterbar .morebtn { gap: 6px; border-radius: 999px; font-size: 13px; }
.filterbar .morebtn svg { width: 15px; height: 15px; }
.filterbar .morebtn.on { border-color: var(--accent-hover); color: var(--accent-hover); }
.filterbar .morebtn .count { background: var(--accent-hover); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.filterbar > select { min-width: 118px; max-width: 220px; }
.filterbar > .search { flex-basis: 220px; }
.filterbar .morefilters { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.filterbar .morefilters[hidden] { display: none; }

/* ---- ad cards: status + days in the brand line, save and select on hover (UI review Q2, M2) ---- */
.ccard { position: relative; }
.ccard .brandline .status { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.ccard .brandline .status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); } .ccard .brandline .status .dot.on { background: var(--win); }
.savebar { display: inline-flex; align-items: stretch; border-radius: 999px; background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); overflow: hidden; }
.savebar button { background: none; border: 0; color: inherit; font: 600 12.5px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; min-height: 30px; }
.savebar button:hover { background: var(--accent-hover); }
.savebar .savepick { padding: 7px 8px; border-left: 1px solid rgba(255,255,255,.35); }
.savebar svg { width: 15px; height: 15px; }
.savebar .savebtn.saved { background: var(--win); }
.ccard > .savebar { position: absolute; top: 8px; right: 8px; z-index: 4; transform: translateZ(40px); opacity: 0; transition: opacity .12s; }
.ccard > .pick { position: absolute; top: 8px; left: 8px; z-index: 4; transform: translateZ(40px); width: 26px; height: 26px; border-radius: 8px; border: 2px solid #fff; background: rgba(8,10,14,.45); color: transparent; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; }
.ccard > .pick svg { width: 16px; height: 16px; }
.ccard > .pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.ccard:hover > .savebar, .ccard:focus-within > .savebar, .ccard:hover > .pick, .ccard:focus-within > .pick, body.selecting .ccard > .pick, .ccard > .pick[aria-pressed="true"] { opacity: 1; }
.ccard:hover .media .badge:not(.r), body.selecting .ccard .media .badge:not(.r), .ccard:hover .media .badge.r { opacity: 0; }
.ccard.picked { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: none) { .ccard > .savebar { opacity: 1; } }
.hookrow .savebar.inline { flex: none; }

/* board picker menu, shared by the card save button and the selection bar */
.boardmenu { position: fixed; z-index: 120; min-width: 220px; max-width: 300px; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; }
.boardmenu .h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px 4px; }
.boardmenu button { display: flex; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px; font: 500 13px/1.3 var(--font); color: var(--text); cursor: pointer; gap: 8px; }
.boardmenu button:hover, .boardmenu button:focus-visible { background: var(--surface-2); outline: none; }
.boardmenu button .n { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.boardmenu button.new { color: var(--accent-hover); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }

/* selection bar (UI review M2) */
.selbar { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); border-radius: 999px; padding: 6px 6px 6px 16px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); font-size: 13px; font-weight: 600; }
.selbar[hidden] { display: none; }
.selbar .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.selbar .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.selbar kbd { font-family: var(--mono); font-size: 10px; opacity: .7; }

/* command palette and shortcut sheet (UI review M1) */
.sidebar .cmdk-open { display: flex; align-items: center; gap: 8px; width: 100%; margin: 4px 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font: 13px var(--font); cursor: pointer; }
.sidebar .cmdk-open svg { width: 15px; height: 15px; }
.sidebar .cmdk-open kbd, .cmdk kbd, .keys kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--text-2); background: var(--surface-2); }
dialog.cmdk { width: min(620px, calc(100vw - 32px)); padding: 0; margin-top: 12vh; border: 1px solid var(--line); border-radius: var(--radius); }
dialog.cmdk::backdrop { background: rgba(20,18,14,.35); backdrop-filter: blur(2px); }
.cmdk .q { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cmdk .q svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.cmdk .q input { border: 0; background: transparent; font-size: 16px; padding: 4px 0; box-shadow: none; outline: none; }
.cmdk ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk li.h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.cmdk li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.cmdk li a .t { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 52px; }
.cmdk li a[aria-selected="true"] { background: var(--accent-soft); }
.cmdk .foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; } .keys td { padding: 7px 4px; border-bottom: 1px solid var(--line); } .keys td:first-child { white-space: nowrap; width: 1%; padding-right: 16px; }
.keys kbd { margin: 0 2px 0 0; }

/* UI QA 2026-10-22: phone widths. Grid children may shrink below their content, wide tables scroll inside
   their panel instead of widening the page, and long filter chips wrap. */
.detail > * { min-width: 0; }
@media (max-width: 900px) {
  .panel > table { display: block; overflow-x: auto; }
  .rb-chips .pill { white-space: normal; }
}
@media (max-width: 600px) {
  form.row > .grow { flex: 1 1 100%; }           /* invite form: email gets its own line instead of collapsing */
  .taxonomy .pill { white-space: normal; }        /* long persona chips wrap */
  .tabs { overflow-x: auto; }                     /* tab strip scrolls instead of widening the page */
  .detail .panel > .row.between > :first-child { flex: 1 1 100%; } /* creative title above the board picker */
}
