:root {
  --bg: #0a0a0a;
  --panel: #111111;
  --panel-2: #161616;
  --card: #1a1a1a;
  --border: #1f1f1f;
  --border-2: #2a2a2a;
  --text: #ffffff;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --blue: #2563eb;
  --brand: #7c3aed;
  --brand-2: #a78bfa;
  --accent: #22d3ee;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.app { display: flex; height: 100vh; }

/* ===================== SIDEBAR ===================== */
.sidebar { width: 256px; min-width: 256px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-header { padding: 22px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sidebar-header h1 { font-size: 20px; font-weight: 600; margin: 0; white-space: nowrap; }
.sidebar-header p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.sidebar-toggle { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.sidebar-toggle:hover { background: var(--border); color: #fff; }

.sidebar-project { margin: 4px 16px 8px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; width: calc(100% - 32px); font-family: inherit; text-align: left; color: inherit; }
.sidebar-project:hover { background: rgba(255,255,255,0.06); border-color: var(--border-2); }
.sidebar-project-logo { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--blue)); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.sidebar-project-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar-project-label { font-size: 9.5px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; color: var(--muted-2); }
.sidebar-project-domain { font-size: 13px; font-weight: 600; color: #fff; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-project-chevron { color: var(--muted-2); flex-shrink: 0; }

.sidebar-nav { flex: 1; padding: 12px 16px; overflow-y: auto; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.nav-item:hover { background: var(--border); color: #fff; }
.nav-item.active { background: var(--blue); color: #fff; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item span { flex: 1; }
.nav-item-lock { width: 14px; height: 14px; margin-left: auto; opacity: .6; color: var(--brand-2); }
.nav-locked { color: var(--muted); }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }
.darkmode-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.darkmode-row:hover { border-color: var(--border-2); color: var(--text); }
.dm-toggle { width: 34px; height: 18px; border-radius: 999px; background: var(--border-2); position: relative; flex-shrink: 0; }
.dm-knob { position: absolute; top: -3px; left: -2px; font-size: 13px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px 2px; }
.user-avatar { width: 34px; height: 34px; border-radius: 999px; background: linear-gradient(135deg, var(--blue), var(--accent)); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; }
.user-meta small { font-size: 11px; color: var(--muted); }

/* ===================== MAIN ===================== */
.main { flex: 1; height: 100vh; overflow-y: auto; }
.view { display: none; }
.view.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar { display: flex; gap: 26px; padding: 0 40px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 600; padding: 18px 2px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-family: inherit; }
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-2); border-bottom-color: var(--brand-2); }
.tab.locked { color: var(--muted-2); cursor: default; }
.tab-lock { opacity: .7; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 30px 40px 4px; }
.page-title { font-size: 30px; font-weight: 600; margin: 0; }
.page-subtitle { color: var(--muted); margin: 6px 0 0; max-width: 760px; }
.view > .page-title { padding: 30px 40px 0; }
.view > .page-subtitle { padding: 0 40px; }
.view > .card, .view > #audit-out, .view > #search-out { margin-left: 40px; margin-right: 40px; }
.placeholder { padding: 30px 40px; }

/* buttons + forms */
.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-family: inherit; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.grid { display: grid; gap: 14px; }
.row { display: flex; align-items: center; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
input[type=text] { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 14px; font-family: inherit; }
input[type=text]:focus { outline: none; border-color: var(--brand); }
.notice { border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 8px; }
.notice.ok { background: rgba(34,197,94,.12); color: #86efac; }
.notice.err { background: rgba(239,68,68,.12); color: #fca5a5; }

/* ===================== PROJECT CARDS ===================== */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 22px 40px 60px; }
.project-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; cursor: pointer; transition: border-color .15s, transform .15s; }
.project-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.project-card.is-active { border-color: rgba(124,58,237,.6); box-shadow: 0 0 0 1px rgba(124,58,237,.35); }
.pc-pill { position: absolute; top: 16px; right: 18px; display: inline-flex; align-items: center; gap: 5px; background: rgba(124,58,237,.22); color: var(--brand-2); border: 1px solid rgba(124,58,237,.4); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 4px 9px; border-radius: 999px; }
.pc-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.project-card.is-active .pc-top { margin-top: 24px; } /* clear the "current project" pill */
.pc-folder { width: 40px; height: 40px; border-radius: 10px; background: rgba(37,99,235,.15); color: #60a5fa; display: grid; place-items: center; flex-shrink: 0; }
.pc-folder svg { width: 20px; height: 20px; }
.pc-name { font-size: 16px; font-weight: 600; margin: 0; }
.pc-date { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.pc-next { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.25); }
.pc-next.done { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.3); }
.pc-next-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--brand-2); text-transform: uppercase; letter-spacing: .3px; }
.pc-next.done .pc-next-head { color: var(--good); }
.pc-track { height: 4px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.pc-fill { height: 100%; background: var(--brand); border-radius: 4px; }
.pc-next.done .pc-fill { background: var(--good); }
.pc-sep { height: 1px; background: var(--border); margin: 0 0 16px; }
/* Shopify-style setup checklist — one row per module, DONE / TO-DO */
.pc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-step { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 9px 10px; cursor: pointer; color: var(--text); font-family: inherit; font-size: 13.5px; transition: background .12s, border-color .12s; }
.pc-step:hover { background: var(--panel-2); border-color: var(--border); }
.pc-step-ic { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--panel-2); border: 1.5px solid var(--border-2); color: transparent; }
.pc-step.done .pc-step-ic { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.5); color: var(--good); }
.pc-step-label { flex: 1; min-width: 0; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-step.done .pc-step-label { color: var(--muted); }
.pc-step-badge { flex-shrink: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 999px; background: rgba(124,58,237,.14); color: var(--brand-2); }
.pc-step.done .pc-step-badge { background: rgba(34,197,94,.14); color: var(--good); }
.pc-step-arrow { flex-shrink: 0; color: var(--muted); opacity: 0; transition: opacity .12s, transform .12s; }
.pc-step:hover .pc-step-arrow { opacity: 1; transform: translateX(2px); }

/* ===================== AUDIT + SEARCH shared ===================== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat .n { font-size: 26px; font-weight: 600; }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.section-h { font-size: 15px; font-weight: 600; margin: 26px 0 10px; }
.spinner { color: var(--muted); font-size: 13px; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 46px; align-items: center; gap: 10px; }
.bar-row .name { font-size: 13px; color: var(--muted); }
.bar-track { height: 22px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; }
.bar-row .v { text-align: right; font-size: 13px; }

.matrix { display: grid; grid-template-columns: 100px repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.matrix .col-head { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: center; padding-bottom: 4px; }
.matrix .row-head { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; }
.cell { border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 78px; display: flex; flex-direction: column; gap: 3px; }
.cell.empty { background: repeating-linear-gradient(45deg, #101013, #101013 6px, #0c0c0e 6px, #0c0c0e 12px); border-style: dashed; }
.cell .emoji { font-size: 16px; }
.cell .aname { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.cell .meta { font-size: 11px; color: var(--muted); margin-top: auto; }
.cell .empty-lbl { margin: auto; font-size: 11px; color: #55555c; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.chip.jtbd { background: rgba(124,58,237,.18); color: var(--brand-2); }
.chip.own { background: rgba(96,165,250,.14); color: #93c5fd; }
.chip.Functional { background: rgba(96,165,250,.16); color: #93c5fd; }
.chip.Emotional { background: rgba(167,139,250,.16); color: #c4b5fd; }
.chip.Social { background: rgba(236,72,153,.16); color: #f9a8d4; }
.chip.Evergreen { background: rgba(34,197,94,.15); color: #86efac; }
.chip.Seasonal { background: rgba(245,158,11,.15); color: #fbbf24; }
.chip.Growing { background: rgba(34,211,238,.15); color: #67e8f9; }
.chip.Declining { background: rgba(239,68,68,.15); color: #fca5a5; }
.pain { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pain .meter { width: 80px; height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.pain .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--warn), var(--bad)); }
.pain .txt strong { display: block; }
.pain .txt small { color: var(--muted); }

/* ===================== ONBOARDING WIZARD ===================== */
.onb-top { position: relative; display: flex; align-items: center; justify-content: center; padding: 26px 40px; border-bottom: 1px solid var(--border); background: #0d0d0f; }
.onb-back { position: absolute; left: 40px; background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.onb-back:hover { color: #fff; }
.onb-label { font-size: 14px; color: var(--muted); }
.onb-skip { position: absolute; right: 40px; background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.onb-skip:hover { color: #fff; }
.onb-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--border); }
#onb-progress-fill { height: 100%; background: var(--blue); border-radius: 0 3px 3px 0; transition: width .25s ease; }
.onb-body { display: flex; justify-content: center; padding: 56px 40px 80px; }
.onb-content { width: 100%; max-width: 900px; }
.onb-content h2 { font-size: 30px; font-weight: 600; margin: 0 0 8px; }
.onb-content .sub { color: var(--muted); margin: 0 0 28px; }
.onb-input { width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); font-size: 15px; font-family: inherit; }
.onb-input:focus { outline: none; border-color: var(--blue); }
.onb-continue { width: 100%; justify-content: center; margin-top: 26px; padding: 13px; }

.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.option-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 26px 16px; text-align: center; cursor: pointer; transition: .15s; }
.option-card:hover { border-color: var(--brand); background: var(--card); }
.option-card.selected { border-color: var(--blue); background: rgba(37,99,235,.1); }
.option-card .oc-emoji { font-size: 26px; margin-bottom: 10px; }
.option-card .oc-title { font-size: 15px; font-weight: 600; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.chip-btn:hover { border-color: var(--border-2); }
.chip-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.onb-addbox { margin-top: 18px; padding: 16px; border-radius: 12px; background: rgba(124,58,237,.07); border: 1px solid rgba(124,58,237,.28); }
.onb-addbox label { color: #c4b5fd; font-size: 12px; margin-bottom: 8px; }
.onb-addbox .row { gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.tag .x { cursor: pointer; color: var(--muted); }
.tag .x:hover { color: #fff; }

.ai-card { margin-top: 18px; padding: 18px; border-radius: 14px; background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.3); }
.ai-card .ai-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.ai-card .ai-badge { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), #ec4899); display: grid; place-items: center; font-size: 12px; }
.ai-card .ai-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ai-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(124,58,237,.15); border: 1px solid rgba(167,139,250,.35); color: #ddd; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; }
.ai-chip .x { cursor: pointer; opacity: .7; } .ai-chip .x:hover { opacity: 1; }
.warn-box { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.4); display: flex; gap: 10px; }
.warn-box strong { color: var(--warn); display: block; margin-bottom: 2px; }
.warn-box span { color: #fbbf24; font-size: 12.5px; line-height: 1.5; }

.onb-check { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.onb-check input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.onb-check:hover span { color: var(--text); }
.info-box { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.4); display: flex; gap: 12px; animation: fade .2s ease; }
.info-box .ib-ico { flex-shrink: 0; margin-top: 1px; }
.info-box strong { color: #93c5fd; display: block; margin-bottom: 3px; font-size: 13.5px; }
.info-box span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.soc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--panel-2); }
/* Fixed dark tile (both themes) so white AND coloured brand logos stay visible. */
.soc-ico { width: 34px; height: 34px; border-radius: 9px; background: #17171d; border: 1px solid rgba(255,255,255,.06); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.soc-meta { flex: 1; min-width: 0; }
.soc-meta .p { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.soc-meta .h { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-actions { display: flex; gap: 6px; }
.soc-btn { border: 1px solid var(--border-2); background: transparent; color: var(--muted); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.soc-btn.confirm.on { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.5); color: #86efac; }
.soc-btn.skip.on { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.4); color: #fca5a5; }

/* ===================== DOMAIN AUDIT STEPPER ===================== */
/* ── shared horizontal-nav grammar (audit stepper + BKS tabs): same height,
   same 12px/700/.06em uppercase type, same soft-pill active state ── */
.steps-bar { display: flex; align-items: center; gap: 6px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--border); height: 52px; overflow-x: auto; }
.step-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.step-item:hover { background: rgba(255, 255, 255, .045); }
.step-item:hover .step-name { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); transition: color .15s; }
.step-item.active { background: rgba(37, 99, 235, .16); }
.step-circle { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 700; background: transparent; border: 1px solid var(--border-2); color: var(--muted-2); transition: .15s; }
.step-circle.done { border-color: rgba(37, 99, 235, .55); color: #60a5fa; }
.step-circle.current { background: var(--blue); border-color: var(--blue); color: #fff; }
.step-name { font-size: 11.5px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--muted-2); }
.step-item.active .step-name { color: #fff; }
.da-body { padding: 24px 40px 80px; }
.da-run { gap: 8px; max-width: 560px; margin-bottom: 22px; }
.da-placeholder { border: 1px dashed var(--border-2); border-radius: 14px; padding: 44px 32px; text-align: center; color: var(--muted); }
.da-placeholder h3 { color: var(--text); margin: 0 0 8px; font-size: 17px; }
.da-placeholder p { margin: 0 auto; max-width: 480px; line-height: 1.55; }
.da-soon { display: inline-block; margin-top: 14px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--brand-2); background: rgba(124,58,237,.14); border: 1px solid rgba(124,58,237,.3); padding: 4px 10px; border-radius: 999px; }

/* ===================== SCOPED DOMAIN BAR (project-scoped audit) ===================== */
.da-domain-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin-bottom: 8px; flex-wrap: wrap; }
.ddb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ddb-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(37,99,235,.15); color: #60a5fa; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.ddb-label { font-size: 10px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; color: var(--muted-2); }
.ddb-domain { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ddb-right { display: flex; align-items: center; gap: 12px; }
.ddb-last { font-size: 12px; color: var(--muted); }
.ddb-hint { font-size: 12px; color: var(--muted-2); margin: 0 2px 20px; }
.ddb-hint strong { color: var(--muted); }
.market-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: rgba(37,99,235,.12); border: 1px solid rgba(37,99,235,.35); color: #93c5fd; }
.scope-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; padding: 9px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border-2); white-space: nowrap; }

/* ===================== KEYWORDS STEP (Domain Audit) ===================== */
.stat .n.neg { color: var(--bad); }
.stat .n.small { font-size: 20px; line-height: 1.25; }
.stat .sub-blue { color: #60a5fa; font-size: 13px; font-weight: 600; margin-top: 2px; }
.await-pill { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--brand-2); background: rgba(124,58,237,.14); border: 1px solid rgba(124,58,237,.3); padding: 3px 9px; border-radius: 999px; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.card-head p { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.pill-badge { font-size: 12px; font-weight: 600; color: #60a5fa; background: rgba(37,99,235,.15); border: 1px solid rgba(37,99,235,.35); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.stat .n.pos { color: var(--good); }
.chart-toggle { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 2px; }
.chart-toggle button { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.chart-toggle button.on { background: var(--blue); color: #fff; }
.ai-tag { font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--brand), #ec4899); padding: 4px 11px; border-radius: 999px; white-space: nowrap; box-shadow: 0 0 12px rgba(124,58,237,.35); }
.ai-tag.off { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border-2); box-shadow: none; cursor: help; }

/* clickable donut legend rows */
.legend-row.clickable { cursor: pointer; border-radius: 8px; padding: 7px 8px; margin: 0 -8px; }
.legend-row.clickable:hover { background: var(--panel-2); }
.legend-row.clickable .lr-arrow { color: var(--muted-2); font-size: 12px; margin-left: 6px; }

/* keyword-list modal */
.kw-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 100; animation: fade .15s ease; }
.kw-modal { background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; width: min(680px, 92vw); max-height: 82vh; display: flex; flex-direction: column; box-shadow: 0 18px 60px rgba(0,0,0,.55); }
.kw-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.kw-modal-head h3 { font-size: 17px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.kw-modal-head p { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.kw-modal-close { background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; flex-shrink: 0; }
.kw-modal-close:hover { color: #fff; }
.kw-modal-body { overflow-y: auto; padding: 6px 22px 18px; }
.kw-modal-body table { margin-top: 0; }

/* ===================== SOCIAL MONITORING ===================== */
.sm-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.sm-seg { height: 100%; cursor: pointer; transition: filter .15s; min-width: 0; }
.sm-seg:hover { filter: brightness(1.25); }
.sm-topic { cursor: pointer; transition: border-color .15s, transform .15s; }
.sm-topic:hover { border-color: var(--border-2); transform: translateY(-2px); }
.sm-comment { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.sm-comment .chip { flex-shrink: 0; margin-top: 2px; }
.smc-body { min-width: 0; }
.smc-text { font-size: 13.5px; line-height: 1.5; }
.smc-meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.smc-meta a { color: #60a5fa; text-decoration: none; margin-left: 4px; }

/* by-channel cards */
.sm-chan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.sm-chan { cursor: pointer; transition: border-color .15s, transform .15s; }
.rv-ext { color: var(--muted); text-decoration: none; font-size: 14px; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--border); flex-shrink: 0; transition: color .15s, border-color .15s; }
.rv-ext:hover { color: #60a5fa; border-color: var(--border-2); }
.sm-chan:hover { border-color: var(--border-2); transform: translateY(-2px); }
.sm-chan .sm-bar { margin-top: 12px; }

/* language detection */
.sm-lang { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.sm-lang-list { flex: 1; min-width: 260px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 28px; }
.sm-lang-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.sm-lang-row:hover { background: var(--panel-2); }
.sm-lang-name { flex: 1; }
.sm-lang-row b { font-size: 13.5px; }

/* recent posts carousel */
.sm-carousel { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.sm-post { flex: 0 0 170px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.sm-post:hover { border-color: var(--border-2); transform: translateY(-2px); }
.sm-post-img { position: relative; height: 150px; background: linear-gradient(135deg, #1b1b2f, #0f172a); }
.sm-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-post-plat { position: absolute; top: 8px; left: 8px; font-size: 14px; background: rgba(0,0,0,.55); border-radius: 6px; padding: 2px 5px; }
.sm-post-body { padding: 10px 12px 12px; }
.sm-post-title { font-size: 12px; line-height: 1.4; height: 34px; overflow: hidden; }
.sm-post-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* pain map */
.mapbub circle { transition: fill-opacity .15s; }
.mapbub:hover circle { fill-opacity: 1; }

/* project history modal */
.ph-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--border); border-radius: 8px; }
.ph-row.clickable { cursor: pointer; }
.ph-row.clickable:hover { background: var(--panel-2); }

/* behavioral keyword search (prototype design) */
.bks-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); height: 52px; padding: 0 28px; background: var(--panel); }
.bks-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bks-topbar .btn { flex-shrink: 0; }
.bks-tab { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; white-space: nowrap; }
/* start page: result tabs locked until a research runs */
.bks-tabs-locked .bks-tab { opacity: .35; cursor: not-allowed; pointer-events: none; }
.bks-tab.on { color: #fff; background: rgba(37, 99, 235, .16); }
.bks-tab:hover:not(.on) { color: var(--text); background: rgba(255, 255, 255, .045); }
#bks-new { margin-bottom: 8px; }
.bks-hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .bks-hero { grid-template-columns: 1fr; } }
.bks-soon p { max-width: 560px; }
.bks-trend-ph { display: flex; align-items: center; justify-content: center; height: 190px; font-size: 44px; opacity: .25; }
.bks-src { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 6px 12px; cursor: pointer; font-family: inherit; }
.bks-src.on { background: #4c6ef5; border-color: #4c6ef5; color: #fff; }
.bks-src.off { opacity: .45; cursor: not-allowed; }
.bks-info { background: rgba(76, 110, 245, .1); border: 1px solid rgba(76, 110, 245, .3); border-radius: 12px; padding: 14px 16px; font-size: 12.5px; line-height: 1.6; color: var(--text); margin-bottom: 14px; }
.bks-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; align-items: start; }
@media (max-width: 1000px) { .bks-two { grid-template-columns: 1fr; } }
.bks-hist { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-bottom: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.bks-hist:hover { background: var(--panel-2); }
.bks-bubble.dim { opacity: .18; }
.bks-bubble rect { transition: opacity .15s; }
.bks-donut { display: flex; align-items: center; gap: 12px; }
.bks-donut-l { font-size: 12.5px; font-weight: 700; line-height: 1.5; }
.bks-donut-l span { font-weight: 400; color: var(--muted); font-size: 11.5px; }

/* bks — communities + social signals (sample UI previews) */
.bks-com-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
@media (max-width: 1000px) { .bks-com-grid { grid-template-columns: 1fr; } }
.bks-emotions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; font-size: 13px; }
.bks-emotions b { float: right; }
.bks-painrow { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 10px; }
.bks-thread { display: flex; gap: 14px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.bks-bars { display: flex; gap: 18px; align-items: flex-end; justify-content: space-around; padding: 18px 4px 6px; min-height: 210px; }
.bks-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; justify-content: flex-end; }
.bks-bar { width: 34px; border-radius: 7px 7px 3px 3px; }
.bks-bar-val { font-size: 12px; font-weight: 800; }
.bks-bar-name { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 104px; }
.bks-bar-name img { flex-shrink: 0; border-radius: 3px; }
.bks-stack { display: flex; flex-direction: column-reverse; width: 40px; height: 150px; border-radius: 7px; overflow: hidden; }
.bks-stack div { display: flex; align-items: center; justify-content: center; }
.bks-stack span { font-size: 9.5px; font-weight: 700; color: #0a0a0a; }
.bks-dive { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 1000px) { .bks-dive { grid-template-columns: 1fr; } }
.bks-dive-row { display: flex; gap: 14px; align-items: center; padding: 15px 18px; cursor: default; }
.bks-dive-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.sig-thumbstrip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 6px; scrollbar-width: thin; }
.sig-thumbstrip a { position: relative; flex: 0 0 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.sig-thumbstrip img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.sig-thumbstrip a:hover img { transform: scale(1.06); }
.sig-thumb-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.5); }
.sig-mini { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

/* brand mentions (macro-step 4) */
.bm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: stretch; }
.bm-grid > .card:first-child { display: flex; flex-direction: column; }
@media (max-width: 1100px) { .bm-grid { grid-template-columns: 1fr; } }
/* dropdown filters */
.bm-dd-row { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.bm-dd { position: relative; }
.bm-dd-btn { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; padding: 9px 14px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 8px; transition: border-color .15s; }
.bm-dd-btn:hover { border-color: var(--border-2); }
.bm-dd-btn.active { border-color: #4c6ef5; box-shadow: inset 0 0 0 1px #4c6ef5; }
.bm-dd-label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.bm-dd-caret { color: var(--muted); font-size: 11px; }
.bm-dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 320px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; box-shadow: 0 14px 44px rgba(0,0,0,.5); max-height: 264px; overflow-y: auto; /* ~6 rows visible, scroll for the rest (user ask) */ }
.bm-dd-item { width: 100%; background: none; border: 0; border-radius: 8px; color: var(--text); font-size: 13px; padding: 9px 10px; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 9px; text-align: left; }
.bm-dd-item:hover { background: var(--panel-2); }
.bm-dd-check { width: 14px; color: #4c6ef5; font-weight: 800; flex-shrink: 0; }
.bm-dd-name { flex: 1; font-weight: 600; }
.bm-dd-count { color: var(--muted); font-size: 12px; }
.bm-feed { display: grid; gap: 10px; }
.bm-item { display: flex; gap: 14px; background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--border-2); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.bm-item:hover { border-color: var(--border-2); transform: translateY(-1px); }
.bm-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 18px; flex-shrink: 0; padding-top: 2px; }
.bm-icon span { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; }
.bm-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); border: 1px solid var(--border); align-self: center; }
.bm-thumb.fav { object-fit: contain; padding: 10px; } /* favicons: don't stretch */
.bm-overview { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 2px; }
.bm-overview-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bm-body { min-width: 0; flex: 1; }
.bm-head { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.bm-title { font-size: 13px; font-weight: 600; margin-top: 5px; }
.bm-snippet { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 5px; }
.bm-src { display: flex; align-items: center; gap: 8px; padding: 6px 6px; font-size: 12.5px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.bm-src:hover, .bm-sent-row:hover { background: var(--panel-2); }
.bm-pie:hover { filter: brightness(1.15); }
.bm-src-name { flex: 0 0 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-src-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.bm-src-bar div { height: 100%; border-radius: 4px; }

/* project details modal (view + edit onboarding answers) */
.pc-gear { flex-shrink: 0; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s, color .15s; }
.project-card { position: relative; }
.project-card:hover .pc-gear { opacity: 1; }
.pc-gear:hover { color: #fff; }
.pd-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.pd-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pd-value { font-size: 14px; line-height: 1.5; }
.pd-input { width: 100%; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); font-size: 13.5px; padding: 8px 10px; font-family: inherit; }
.pd-input:focus { outline: none; border-color: #4c6ef5; }
.pd-note { font-size: 11.5px; color: #fbbf24; margin-top: 5px; }
.pd-social-row { display: flex; gap: 8px; margin-bottom: 8px; }
.pd-social-row .pd-plat { flex: 0 0 130px; }
#pd-add-social { margin-top: 2px; }

/* top keywords bar chart */
.kw-chart { display: flex; align-items: flex-end; gap: 10px; height: 300px; padding: 8px 4px 88px; }
.kwc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; cursor: pointer; }
.kwc-val { font-size: 10px; font-weight: 700; color: var(--text); margin-bottom: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kwc-bar { width: 72%; max-width: 54px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #3b82f6, #1d4ed8); transition: .15s; }
.kwc-col:hover .kwc-bar, .kwc-col.sel .kwc-bar { background: linear-gradient(180deg, #60a5fa, #2563eb); box-shadow: 0 0 0 1px rgba(96,165,250,.5); }
/* keyword labels sit fully BELOW the baseline, fanning down-left so they never cross the bars */
.kwc-label { position: absolute; top: calc(100% + 6px); right: 50%; transform-origin: top right; transform: rotate(-35deg); font-size: 10.5px; color: var(--muted); white-space: nowrap; max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
.kwc-detail { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 2x2 breakdown grid */
.kw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut-box { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.donut-box svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center .big { font-size: 26px; font-weight: 800; }
.donut-center .lbl { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legend-row .lr-val { margin-left: auto; color: var(--muted); }
.intent-panel { flex: 1; min-width: 190px; display: grid; gap: 10px; }
.intent-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.intent-item.hot { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.45); }
.intent-item.clickable { cursor: pointer; transition: .15s; }
.intent-item.clickable:hover { border-color: var(--border-2); filter: brightness(1.15); }
.intent-item .ii-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.intent-item .ii-title { font-weight: 700; font-size: 14px; }
.intent-item .ii-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.intent-item .ii-num { margin-left: auto; text-align: right; }
.intent-item .ii-num .pct { font-size: 20px; font-weight: 800; }
.intent-item .ii-num .kw { font-size: 11.5px; color: var(--muted); }
.demo-bar-row { display: grid; grid-template-columns: 52px 1fr 44px; gap: 12px; align-items: center; padding: 7px 0; }
.demo-bar-row .db-lbl { font-size: 13px; color: var(--muted); }
.demo-bar-row .db-track { height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.demo-bar-row .db-fill { height: 100%; border-radius: 6px; }
.demo-bar-row .db-val { text-align: right; font-size: 13px; font-weight: 600; }

/* keywords table */
.kw-table-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.kw-table-head .tk { font-size: 17px; font-weight: 700; }
.kw-table-head .tk span { color: #60a5fa; }
.kw-table-head p { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.rank-badge { display: inline-block; min-width: 34px; text-align: center; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); }
.rank-badge.top { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.45); color: #4ade80; }
.rank-badge.mid { background: rgba(37,99,235,.12); border-color: rgba(37,99,235,.45); color: #60a5fa; }
.serp-chip { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; padding: 3px 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); }
td.url a { color: #60a5fa; text-decoration: none; font-size: 12.5px; }
td.url a:hover { text-decoration: underline; }

@media (max-width: 1000px) { .project-grid { grid-template-columns: repeat(2,1fr); } .stats { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 680px) { .project-grid { grid-template-columns: 1fr; } .option-grid { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ===================== ASK TRENDIBLE — chat panel (spec §2–§10) ===================== */
.assist {
  flex-shrink: 0; width: clamp(420px, 36vw, 860px); height: 100vh;
  background: #111111; border-left: 1px solid #1f1f1f; z-index: 60;
  overflow: hidden; transition: width .24s ease, min-width .24s ease;
}
.assist.collapsed { width: 0; min-width: 0; border-left: none; }
/* anti-squish: inner wrapper keeps its width and slides off-screen */
.assist-inner {
  width: clamp(420px, 36vw, 860px); margin-left: auto; height: 100%;
  display: flex; flex-direction: column;
}

/* §3 header */
.assist-head {
  padding: 16px 18px 14px; border-bottom: 1px solid #1f1f1f;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.assist-head-l { min-width: 0; }
.assist-title-row { display: flex; align-items: center; gap: 8px; }
.assist-logo {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: inline-flex; align-items: center; justify-content: center;
}
.assist-title { font-size: 14.5px; font-weight: 700; letter-spacing: .2px; color: #f3f4f6; }
.assist-ctx {
  margin-top: 7px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; max-width: 340px;
  background: rgba(124,58,237,.12); border: 1px solid rgba(124,58,237,.28); color: #a78bfa;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.assist-ctx #assist-ctx-text { overflow: hidden; text-overflow: ellipsis; }
.assist-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.8);
}
.assist-collapse {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: #0a0a0a; border: 1px solid #1f1f1f; color: #9ca3af;
  display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
}
.assist-collapse:hover { background: #1f1f1f; color: #fff; }

/* §4 message list */
.assist-list {
  flex: 1; overflow-y: auto; padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
}
.as-msg { display: flex; gap: 9px; align-items: flex-start; }
.as-msg.user { flex-direction: row-reverse; }
.as-ava {
  width: 27px; height: 27px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
}
.as-msg.bot .as-ava { background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; }
.as-msg.user .as-ava { background: #1f2937; color: #cbd0e0; border: 1px solid #374151; }
.as-bub {
  padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6;
  max-width: 82%; overflow-wrap: break-word; min-width: 0;
}
.as-msg.bot .as-bub {
  background: #1a1a1a; border: 1px solid #262626; color: #e5e7eb;
  border-top-left-radius: 4px;
}
.as-msg.user .as-bub { background: #2563eb; color: #fff; border-top-right-radius: 4px; }
/* context divider */
.as-div { display: flex; align-items: center; gap: 10px; }
.as-div::before, .as-div::after { content: ""; flex: 1; height: 1px; background: #1f1f1f; }
.as-div span {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: #6b7280; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* typing indicator */
.as-typing { display: inline-flex; gap: 5px; align-items: center; padding: 3px 0; }
.as-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #7c3aed;
  animation: asTyping 1.2s ease-in-out infinite;
}
.as-typing i:nth-child(2) { animation-delay: .18s; }
.as-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes asTyping {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* §5 suggested chips */
/* module scope chips + web-search toggle */
.assist-scopebar { padding: 8px 14px 4px; border-bottom: 1px solid #1a1a1a; }
.as-scope-row { display: flex; flex-wrap: wrap; gap: 5px; }
.as-scope-web { margin-top: 6px; }
.as-scope, .as-web {
  border-radius: 999px; padding: 4px 9px; font-size: 9.5px; font-weight: 700; letter-spacing: .3px;
  line-height: 1.2; cursor: pointer; transition: all .15s; font-family: inherit;
  border: 1px solid var(--border-2); background: transparent; color: var(--muted-2);
}
.as-scope:hover:not([disabled]), .as-web:hover { border-color: var(--accent); color: #a5f3fc; }
.as-scope.on { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.5); color: #67e8f9; }
.as-scope.empty { opacity: .38; cursor: not-allowed; }
.as-web.on { background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.55); color: #86efac; }

.assist-chips { padding: 6px 16px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.assist-chip {
  border-radius: 999px; padding: 6px 11px; font-size: 11px; font-weight: 600; line-height: 1.3;
  cursor: pointer; transition: all .15s; font-family: inherit;
  border: 1px solid rgba(124,58,237,.35); background: rgba(124,58,237,.08); color: #c4b5fd;
}
.assist-chip:hover { background: rgba(124,58,237,.22); color: #e9d5ff; border-color: rgba(124,58,237,.6); }

/* §6 input bar */
.assist-inputbar {
  border-top: 1px solid #1f1f1f; padding: 12px 16px 16px;
  display: flex; gap: 8px;
}
.assist-inputbar input {
  flex: 1; padding: 10px 13px; border-radius: 10px; font-size: 12.5px; font-family: inherit;
  background: #0a0a0a; border: 1px solid #262626; color: #f3f4f6; min-width: 0;
}
.assist-inputbar input::placeholder { color: #6b7280; }
.assist-inputbar input:focus { outline: none; border-color: #7c3aed; }
.assist-send {
  width: 38px; height: 38px; border-radius: 10px; border: none; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: grid; place-items: center; cursor: pointer; transition: filter .15s;
}
.assist-send:hover { filter: brightness(1.12); }

/* §8 S2 — FAB */
.assist-fab {
  display: none; position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  box-shadow: 0 8px 24px rgba(124,58,237,.45);
  place-items: center; transition: transform .15s;
}
.assist-fab.show { display: grid; }
.assist-fab:hover { transform: scale(1.07); }

/* §8 S3 — mobile drawer */
@media (max-width: 900px) {
  .assist {
    position: fixed; top: 0; right: 0; height: 100vh;
    width: min(360px, 92vw) !important; min-width: 0 !important;
    transform: translateX(105%); transition: transform .25s ease;
    box-shadow: -14px 0 44px rgba(0,0,0,.5); border-left: 1px solid #1f1f1f;
  }
  .assist.open { transform: translateX(0); }
  .assist-inner { width: 100%; min-width: 0; }
  .assist-fab { display: grid; }
}

/* Audience-archetype source filters (search / reviews / mentions / comments) */
.ma-src { border: 1px solid var(--border-2); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.ma-src:hover:not(.na) { color: var(--text); border-color: var(--brand); }
.ma-src.on { background: rgba(124,58,237,.16); color: #c4b5fd; border-color: rgba(124,58,237,.5); }
.ma-src.na { opacity: .45; cursor: not-allowed; }
body.light-mode .ma-src.on { background: rgba(124,58,237,.1); color: #5b21b6; }

/* §10 light theme (keyed off body.light-mode) */
/* AI suggestion chips: the default #ddd text is unreadable on the pale-purple chip in light mode → readable dark violet. */
body.light-mode .ai-chip { color: #5b21b6; background: rgba(124,58,237,.10); border-color: rgba(124,58,237,.4); }
body.light-mode .ai-chip .x { color: #6d28d9; }
body.light-mode .assist { background: #ffffff; border-left-color: #e5e7eb; }
body.light-mode .assist-head { border-bottom-color: #e5e7eb; }
body.light-mode .assist-title { color: #111827; }
body.light-mode .assist-ctx { background: rgba(124,58,237,.07); border-color: rgba(124,58,237,.22); color: #7c3aed; }
body.light-mode .assist-collapse { background: #f9fafb; border-color: #e5e7eb; }
body.light-mode .assist-collapse:hover { background: #f3f4f6; }
body.light-mode .as-msg.bot .as-bub { background: #f8f9fc; border-color: #e5e7eb; color: #374151; }
body.light-mode .as-msg.user .as-ava { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
body.light-mode .as-div::before, body.light-mode .as-div::after { background: #e5e7eb; }
body.light-mode .as-div span { color: #9ca3af; }
body.light-mode .assist-chip { background: rgba(124,58,237,.06); color: #7c3aed; border-color: rgba(124,58,237,.28); }
body.light-mode .assist-chip:hover { background: rgba(124,58,237,.14); }
body.light-mode .assist-inputbar { border-top-color: #e5e7eb; }
body.light-mode .assist-inputbar input { background: #f9fafb; border-color: #e5e7eb; color: #111827; }
/* open drawer: lift the FAB clear of the input bar (it remains the toggle) */
@media (max-width: 900px) {
  .assist.open + .assist-fab { bottom: 84px; }
}

/* ===== Brand Mentions: language chips + auto-scrolling top-10 feed ===== */
.bm-langs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.bm-lang { cursor: pointer; font-family: inherit; transition: border-color .15s, color .15s; }
.bm-lang:hover { border-color: var(--brand-2); color: #e9d5ff; }
.bm-autoscroll { flex: 1 1 auto; min-height: 440px; max-height: 620px; overflow: hidden; position: relative; /* ~6 cards in view — the marquee scrolls the rest (user ask: don't cover the page) */ }
/* soft fade at the viewport edges so the loop reads as continuous */
.bm-autoscroll::before, .bm-autoscroll::after {
  content: ""; position: absolute; left: 0; right: 0; height: 26px; z-index: 2; pointer-events: none;
}
.bm-autoscroll::before { top: 0; background: linear-gradient(var(--card), transparent); }
.bm-autoscroll::after { bottom: 0; background: linear-gradient(transparent, var(--card)); }
.bm-scrollwrap { animation: bmScroll linear infinite; }
.bm-autoscroll:hover .bm-scrollwrap { animation-play-state: paused; }
@keyframes bmScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); } /* list is duplicated → -50% = one full pass */
}
@media (prefers-reduced-motion: reduce) { .bm-scrollwrap { animation: none; } }

/* ===== Social carousel: swipe/drag + auto-advance ===== */
.sm-carousel { cursor: grab; scroll-behavior: smooth; user-select: none; }
.sm-carousel.dragging { cursor: grabbing; scroll-behavior: auto; }
.sm-carousel.dragging .sm-post { pointer-events: none; }
.sm-carousel .sm-post img { -webkit-user-drag: none; }

/* bm-grid responds to the ACTUAL audit pane width (the chat panel can squeeze
   the main pane while the window stays wide — media queries can't see that) */
.da-body { container-type: inline-size; width: 100%; }
@container (max-width: 1100px) { .bm-grid { grid-template-columns: 1fr; } }

/* ===== Zonal tonality: the assistant lives on violet-tinted surfaces =====
   Colour-only hierarchy: the DATA pane stays pure neutral black (charts and
   chips keep maximum pop), while every chat surface shifts a few degrees
   toward the assistant's violet at very low saturation — same lightness
   ladder, different temperature. The eye separates the two zones instantly
   without reading borders. */
.assist { background: #14111d; border-left-color: rgba(124, 58, 237, .22); }
.assist-head { border-bottom-color: rgba(124, 58, 237, .14); }
.assist-collapse { background: #0e0b16; border-color: #2b2440; }
.assist-collapse:hover { background: #241d33; }
.as-msg.bot .as-bub { background: #1b1626; border-color: rgba(124, 58, 237, .2); }
.as-div::before, .as-div::after { background: rgba(124, 58, 237, .16); }
.assist-inputbar { border-top-color: rgba(124, 58, 237, .14); }
.assist-inputbar input { background: #0e0b16; border-color: #2b2440; }

/* ===================== LIGHT MODE ===================== */
/* The app is variable-driven, so light mode is mostly a remap: same accent
   hues (blue/brand/status colours), inverted neutral ladder. Below the remap:
   targeted fixes for surfaces/text that hardcode dark assumptions. */
body.light-mode {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --panel-2: #f5f6f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
}
/* translucent-white surfaces become translucent-black */
body.light-mode .sidebar-project { background: rgba(0, 0, 0, .03); }
body.light-mode .sidebar-project:hover { background: rgba(0, 0, 0, .06); }
/* onboarding: dark top band + option cards must follow the light theme */
body.light-mode .onb-top { background: var(--panel); }
body.light-mode .option-card:hover { background: var(--panel-2); }
/* "#fff on hover" only works on dark hovers */
body.light-mode .sidebar-toggle:hover,
body.light-mode .nav-item:hover,
body.light-mode .onb-back:hover,
body.light-mode .onb-skip:hover,
body.light-mode .tag .x:hover { color: var(--text); }
body.light-mode .sidebar-project-domain,
body.light-mode .user-meta strong { color: var(--text); }
/* pastel accent text (tuned for dark surfaces) darkens to its 700-shade */
body.light-mode .notice.ok { color: #15803d; }
body.light-mode .notice.err { color: #b91c1c; }
body.light-mode [style*="color:#86efac"] { color: #15803d !important; }
body.light-mode [style*="color:#fca5a5"] { color: #b91c1c !important; }
body.light-mode [style*="color:#93c5fd"] { color: #1d4ed8 !important; }
body.light-mode [style*="color:#60a5fa"] { color: #1d4ed8 !important; }
body.light-mode [style*="color:#c4b5fd"], body.light-mode [style*="color:#a5b4fc"],
body.light-mode [style*="color:#e9d5ff"], body.light-mode [style*="color:#a78bfa"] { color: #6d28d9 !important; }
body.light-mode [style*="color:#fbbf24"] { color: #b45309 !important; }
body.light-mode [style*="color:#cbd5e1"] { color: #475569 !important; }
body.light-mode [style*="color:#4ade80"] { color: #15803d !important; }
body.light-mode [style*="color:#67e8f9"] { color: #0e7490 !important; }
body.light-mode [style*="color:#f9a8d4"] { color: #be185d !important; }
/* class-level pastel text in components */
body.light-mode .market-chip, body.light-mode .pill-badge { color: #374151; }
body.light-mode .ai-tag { color: #6d28d9; }
/* chat panel light values already defined in the spec block above (§10) */
/* dark-gradient post-image placeholders read muddy on white */
body.light-mode .sm-post-img { background: linear-gradient(135deg, #e5e7eb, #f3f4f6); }
/* marquee edge fades must match the light card surface */
body.light-mode .bm-autoscroll::before { background: linear-gradient(var(--card), transparent); }
body.light-mode .bm-autoscroll::after { background: linear-gradient(transparent, var(--card)); }
body.light-mode [style*="color:#34d399"] { color: #047857 !important; }
body.light-mode [style*="color:#94a3b8"] { color: #64748b !important; }
body.light-mode [style*="color:#6ee7b7"] { color: #047857 !important; }
body.light-mode [style*="color:#22d3ee"] { color: #0e7490 !important; }

/* light-mode nav pills */
body.light-mode .step-item:hover, body.light-mode .bks-tab:hover:not(.on), body.light-mode .gap-tab:hover:not(.active) { background: rgba(0, 0, 0, .045); }
body.light-mode .step-item.active, body.light-mode .bks-tab.on, body.light-mode .gap-tab.active { background: rgba(37, 99, 235, .10); }
body.light-mode .step-item.active .step-name, body.light-mode .bks-tab.on, body.light-mode .gap-tab.active { color: #1d4ed8; }
body.light-mode .step-circle.done { color: #1d4ed8; }

/* connectors */
.cx-row { display: flex; align-items: center; gap: 16px; }
.cx-row .cx-form { display: none; }

/* per-source AI briefing (context + instructions) */
@keyframes cxPulse { 0% { transform: scale(1); opacity: .35; } 70% { transform: scale(2.2); opacity: 0; } 100% { opacity: 0; } }
.aff-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s; }
.aff-chip:hover { border-color: #7c3aed; background: rgba(124, 58, 237, .08); }
.cx-custom-card { transition: border-color .15s, background .15s; }
.cx-custom-card:hover { border-color: #7c3aed !important; background: rgba(124, 58, 237, .06) !important; }
.cx-brief { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.cx-brief > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text); list-style: none; user-select: none; }
.cx-brief > summary::-webkit-details-marker { display: none; }
.cx-brief > summary::before { content: '▸'; display: inline-block; margin-right: 6px; color: var(--muted); transition: transform .15s; }
.cx-brief[open] > summary::before { transform: rotate(90deg); }
.cx-brief-hint { font-size: 11.5px; color: var(--muted); margin: 8px 0 10px; line-height: 1.5; }
.cx-brief-label { display: block; font-size: 11px; font-weight: 700; color: var(--text); margin: 8px 0 4px; }
.cx-brief-label span { font-weight: 500; color: var(--muted); }
.cx-brief textarea, .cx-brief2-panel textarea { width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 12.5px; font-family: inherit; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.cx-brief textarea:focus, .cx-brief2-panel textarea:focus { outline: none; border-color: #7c3aed; }
.cx-brief-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
/* redesigned briefing: add-button / edit+delete icons, manual (non-<details>) toggle */
.cx-brief2 { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.cx-brief2-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-brief-add { border: 1px dashed var(--border-2); background: transparent; color: var(--text); font-weight: 700; font-size: 12px; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s; }
.cx-brief-add:hover { border-color: #7c3aed; background: rgba(124, 58, 237, .06); }
.cx-brief-set { font-size: 12.5px; font-weight: 700; color: var(--text); }
.cx-brief-icon { border: 1px solid var(--border); background: var(--panel-2); border-radius: 7px; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--text); padding: 3px 9px; line-height: 1.4; font-family: inherit; transition: background .15s; }
.cx-brief-icon:hover { background: var(--panel); }
.cx-brief-del:hover { border-color: #ef4444; color: #ef4444; }
.cx-brief2-panel { margin-top: 10px; }

/* Language-fit crawled-pages modal — theme-safe rows (no inline colours) */
.lfp-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 14px 0 4px; position: sticky; top: -20px; background: var(--panel); padding: 6px 0 4px; }
.lfp-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; text-decoration: none; font-size: 13px; color: var(--text); border: 1px solid transparent; }
.lfp-row:hover { background: var(--panel-2); border-color: var(--border); }
.lfp-ext { color: var(--blue); flex-shrink: 0; font-size: 12px; }
.lfp-path { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lfp-host { color: var(--muted); font-size: 11.5px; flex-shrink: 0; margin-left: auto; }

/* ── Campaigns (Domain Audit step 4) — ad gallery ── */
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* marquee gallery — rows auto-scroll slowly, alternating direction */
.cmp-marquees { display: flex; flex-direction: column; gap: 14px; }
.cmp-marquee {
  overflow: hidden; width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3.5%, #000 96.5%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 3.5%, #000 96.5%, transparent 100%);
}
.cmp-marquee-track { display: flex; gap: 14px; width: max-content; will-change: transform; }
.cmp-marquee:hover .cmp-marquee-track { animation-play-state: paused; }
.cmp-marquee-track .cmp-card { flex: 0 0 240px; width: 240px; animation: none; } /* no per-card slide-in inside a marquee */
.cmp-marq-left { animation: cmpMarqLeft linear infinite; }
.cmp-marq-right { animation: cmpMarqRight linear infinite; }
@keyframes cmpMarqLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes cmpMarqRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .cmp-marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
  .cmp-marquee-track { animation: none !important; }
}
.cmp-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; animation: cmpInRight .5s cubic-bezier(.22,.61,.36,1) both; animation-delay: calc(var(--cmp-i, 0) * 55ms); }
.cmp-card:nth-child(even) { animation-name: cmpInLeft; }
@keyframes cmpInRight { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes cmpInLeft { from { opacity: 0; transform: translateX(-46px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cmp-card { animation: none; } }
.cmp-thumb { width: 100%; height: 150px; object-fit: cover; background: var(--bg); display: block; }
.cmp-thumb-contain { object-fit: contain; padding: 6px; box-sizing: border-box; }
.cmp-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--muted); opacity: .5; }

/* layered thumbnail: text tile (base) + poster image (over) + video play badge */
.cmp-thumb-wrap { position: relative; width: 100%; height: 150px; overflow: hidden; background: var(--bg); }
.cmp-thumb-wrap > .cmp-thumb { position: absolute; inset: 0; margin: 0; }
.cmp-thumb-over { z-index: 1; }
.cmp-thumb-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 13px 13px 14px; box-sizing: border-box;
  background: linear-gradient(140deg, color-mix(in srgb, var(--cmp-c) 16%, var(--panel)) 0%, var(--panel) 78%);
}
.cmp-thumb-text-badge { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.cmp-thumb-text-body {
  font-size: 12.5px; line-height: 1.42; font-weight: 600; color: var(--text);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}
.cmp-thumb-play {
  position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; padding-left: 3px; box-sizing: border-box; pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.cmp-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cmp-top { display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-badge { font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.cmp-live { background: rgba(34, 197, 94, .15); color: #4ade80; }
body.light-mode .cmp-live { color: #15803d; }
.cmp-ended { background: rgba(148, 163, 184, .15); color: var(--muted); }
.cmp-fmt { background: rgba(148, 163, 184, .1); color: var(--muted); }
.cmp-text { font-size: 12.5px; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.cmp-targeting { font-size: 11px; color: var(--muted); background: rgba(148, 163, 184, .08); border-radius: 8px; padding: 5px 8px; }
.cmp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }

/* ── Audience Gap — Share of Search & Voice ── */
.gap-select { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; }
.gap-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .gap-cards { grid-template-columns: 1fr; } }
.gap-metric-label { font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.gap-metric-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin: 4px 0 6px; display: flex; align-items: baseline; gap: 10px; }
.gap-metric-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.gap-mini { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.gap-mini-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; color: var(--muted); }
.gap-mini-row.me { color: var(--text); font-weight: 700; }
.gap-mini-note { margin-top: 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.gap-delta { font-size: 13px; font-weight: 700; color: var(--muted); }
.gap-delta.up { color: #4ade80; } .gap-delta.down { color: #f87171; }
body.light-mode .gap-delta.up { color: #15803d; } body.light-mode .gap-delta.down { color: #b91c1c; }
.gap-verdict { margin-bottom: 14px; font-size: 13.5px; line-height: 1.6; }
.gap-verdict-badge { font-weight: 800; margin-bottom: 6px; }
.gap-row { padding: 9px 0; border-bottom: 1px solid var(--border); }
.gap-row:last-child { border-bottom: none; }
.gap-row-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.gap-rank { font-size: 11px; font-weight: 800; color: var(--muted); width: 24px; }
.gap-name { font-size: 13px; font-weight: 600; flex: 1; color: var(--muted); }
.gap-row.me .gap-name { color: var(--text); }
.gap-you { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--accent, #6366f1); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.gap-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gap-bar { position: relative; height: 12px; border-radius: 6px; background: rgba(148,163,184,.12); overflow: hidden; }
.gap-bar-solid { position: absolute; top: 0; left: 0; bottom: 0; background: #64748b; border-radius: 6px 0 0 6px; }
.gap-row.me .gap-bar-solid { background: var(--accent, #6366f1); }
.gap-bar-hatch { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(148,163,184,.55) 0 4px, transparent 4px 8px); }
.gap-row.me .gap-bar-hatch { background: repeating-linear-gradient(45deg, rgba(99,102,241,.55) 0 4px, transparent 4px 8px); }
.gap-overlap { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.gap-src-row { display: grid; grid-template-columns: 190px 90px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }
@media (max-width: 700px) { .gap-src-row { grid-template-columns: 1fr 1fr; } }
.gap-src-name { font-weight: 600; }
.gap-src-items { color: var(--muted); font-variant-numeric: tabular-nums; }
.gap-src-bar { height: 8px; border-radius: 4px; background: rgba(148,163,184,.12); overflow: hidden; }
.gap-src-bar > div { height: 100%; background: #4ade80; border-radius: 4px; }
body.light-mode .gap-src-bar > div { background: #16a34a; }
.gap-src-pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.gap-src-pct.low { color: #fbbf24; }
#view-audience-gap .card { margin-bottom: 14px; }
.gap-src-note { font-size: 11px; color: var(--muted); margin: -2px 0 6px; padding-left: 2px; line-height: 1.5; }

/* ── Audience Gap charts ── */
.gap-chart-row { display: flex; align-items: center; gap: 18px; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; flex-wrap: wrap; }
.gap-donut-wrap { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.gap-donut { width: 150px; height: 150px; }
.gap-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.gap-donut-big { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.gap-donut-sub { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.gap-legend { flex: 1; min-width: 170px; }
.gap-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; color: var(--muted); }
.gap-legend-row.me { color: var(--text); font-weight: 700; }
.gap-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.gap-legend-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-legend-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.gap-hist { display: flex; gap: 14px; align-items: flex-end; justify-content: space-around; padding: 6px 4px 0; }
.gap-hist-col { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.gap-hist-val { font-size: 12.5px; font-weight: 800; }
.gap-hist-val.low { color: #fbbf24; }
.gap-hist-bar { width: 100%; max-width: 74px; height: 120px; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; background: rgba(148,163,184,.08); }
.gap-hist-unplaced { background: repeating-linear-gradient(45deg, rgba(148,163,184,.35) 0 4px, transparent 4px 8px); }
.gap-hist-placed { background: #4ade80; }
.gap-hist-placed.low { background: #fbbf24; }
body.light-mode .gap-hist-placed { background: #16a34a; }
body.light-mode .gap-hist-placed.low { background: #d97706; }
.gap-hist-label { font-size: 11px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.25; }
.gap-hist-items { font-size: 10.5px; color: var(--muted); }
@media (max-width: 700px) { .gap-hist { flex-wrap: wrap; } .gap-hist-col { flex: 0 0 40%; } }

/* ── Audience Gap module tabs + keyword lists ── */
/* same horizontal-nav grammar as the audit stepper + BKS tabs (see
   .step-item / .bks-tab): 12px/700/.06em uppercase, soft blue pill active */
.gap-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.gap-tab { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; white-space: nowrap; }
.gap-tab.active { color: #fff; background: rgba(37, 99, 235, .16); }
.gap-tab:hover:not(.active) { color: var(--text); background: rgba(255, 255, 255, .045); }
.gap-hist-win { background: #6366f1; }
.gap-kw-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(60px, 1fr) 82px minmax(150px, 1.4fr); gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.gap-kw-row:last-child { border-bottom: none; }
.gap-kw-q { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-vol { height: 8px; border-radius: 4px; background: rgba(148,163,184,.12); overflow: hidden; }
.gap-vol > div { height: 100%; background: #38bdf8; border-radius: 4px; }
body.light-mode .gap-vol > div { background: #0284c7; }
.gap-kw-vol { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: 11.5px; }
.gap-kw-vs { font-size: 11px; color: var(--muted); text-align: right; }
.gap-pos { display: inline-block; padding: 1px 6px; border-radius: 999px; background: rgba(148,163,184,.14); font-weight: 700; font-size: 10.5px; }
.gap-pos.good { background: rgba(74,222,128,.16); color: #4ade80; }
body.light-mode .gap-pos.good { color: #15803d; }
@media (max-width: 760px) { .gap-kw-row { grid-template-columns: 1fr 70px; } .gap-kw-vs, .gap-vol { display: none; } }

/* ── Channel adoption matrix ── */
.gap-matrix-scroll { overflow-x: auto; }
.gap-matrix { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 520px; }
.gap-matrix th { text-align: center; padding: 6px 6px 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.gap-matrix th.me { color: var(--text); }
.gap-matrix th .gap-legend-dot { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.gap-matrix-you { font-size: 9px; letter-spacing: .08em; color: var(--accent, #6366f1); }
.gap-matrix-group td { padding: 12px 4px 5px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--border); }
.gap-matrix-label { padding: 6px 8px 6px 4px; color: var(--text); font-weight: 600; white-space: nowrap; }
.gap-ch-ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; background: #fff; box-shadow: inset 0 0 0 1px var(--border); margin-right: 8px; vertical-align: -5px; flex-shrink: 0; font-size: 12px; line-height: 1; }
.gap-ch-ico img { display: block; }
.gap-matrix-cell { text-align: center; padding: 7px 6px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); min-width: 62px; }
.gap-matrix-cell.me { outline: 1px solid color-mix(in srgb, var(--accent, #6366f1) 45%, transparent); outline-offset: -1px; }
.gap-matrix-crown { font-size: 10px; }
.gap-matrix tbody tr:not(.gap-matrix-group):hover td { filter: brightness(1.12); }

/* ── Venn card (Gaps & Overlaps) ── */
.venn-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
@media (max-width: 800px) { .venn-cols { grid-template-columns: 1fr; } }
.venn-col-h { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.venn-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.venn-item:last-child { border-bottom: none; }
.venn-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.venn-item b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }

/* ── auth gate ── */
.auth-gate { position: fixed; inset: 0; z-index: 3000; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-gate[hidden] { display: none; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 30px 28px; }
.auth-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input { padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit; }
.auth-card input:focus { outline: none; border-color: var(--accent, #6366f1); }
.auth-err { color: #f87171; font-size: 12.5px; margin: 10px 0 0; }
body.light-mode .auth-err { color: #b91c1c; }
.auth-note { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.user-menu { position: fixed; z-index: 3100; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px; min-width: 220px; box-shadow: 0 12px 34px rgba(0,0,0,.3); }
.user-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.user-menu button:hover { background: rgba(148,163,184,.12); }
.user-menu .um-invite { font-size: 11.5px; color: var(--muted); padding: 8px 10px; border-top: 1px solid var(--border); margin-top: 4px; word-break: break-all; }

/* ── Paid·Owned·Earned mix ── */
.poe-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr minmax(90px, 130px); gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.poe-row:last-of-type { border-bottom: none; }
.poe-row .poe-name { font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poe-row.me .poe-name { color: var(--text); }
.poe-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(148,163,184,.1); }
.poe-nums { text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── info icon + hover tooltip ── */
.gap-info { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: help; color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 2px; vertical-align: 1px; }
.gap-info::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 8px); z-index: 500; width: 300px; max-width: 74vw; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12px; font-weight: 400; line-height: 1.55; letter-spacing: normal; text-transform: none; box-shadow: 0 12px 30px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; }
.gap-info:hover::after, .gap-info:focus::after { opacity: 1; visibility: visible; }
.venn-hit:hover { filter: brightness(1.25); }

/* ── language-fit crawl modal ── */
.lf-load-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 30px 22px; width: min(480px, 90vw); text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.4); animation: fade .15s ease; }
.lf-load-orbit { position: relative; width: 56px; height: 56px; margin: 0 auto; }
.lf-load-orbit span { position: absolute; inset: 0; border: 3px solid transparent; border-top-color: #6366f1; border-radius: 50%; animation: lfSpin 1.1s linear infinite; }
.lf-load-orbit span:nth-child(2) { inset: 8px; border-top-color: #8b5cf6; animation-duration: 1.7s; animation-direction: reverse; }
.lf-load-orbit span:nth-child(3) { inset: 16px; border-top-color: #a78bfa; animation-duration: 2.3s; }
@keyframes lfSpin { to { transform: rotate(360deg); } }
.lf-load-phase { font-size: 13px; font-weight: 600; margin-top: 6px; min-height: 18px; }
.lf-load-bar { height: 6px; border-radius: 999px; background: rgba(148,163,184,.18); margin: 12px 0 8px; overflow: hidden; }
.lf-load-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#6366f1,#a78bfa); transition: width .6s ease; position: relative; }
.lf-load-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent); animation: lfShimmer 1.4s linear infinite; }
@keyframes lfShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.lf-load-detail { font-size: 11px; color: var(--muted); min-height: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-load-note { font-size: 11px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
body.light-mode .lf-load-card { box-shadow: 0 24px 60px rgba(15,23,42,.18); }

/* ── topic venn rows ── */
.topic-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.topic-row:last-child { border-bottom: none; }
.topic-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.topic-counts { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.topic-quote { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--border); line-height: 1.5; }
.topic-src { font-size: 10.5px; color: #818cf8; text-decoration: none; white-space: nowrap; font-style: normal; }
.topic-src:hover { text-decoration: underline; }

/* ── explore macro-view grid ── */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.exp-funnels { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.exp-funnel { min-width: 0; }
.exp-stage { margin-bottom: 8px; }
.exp-stage-bar { height: 22px; margin: 0 auto 3px; transition: width .3s ease; clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%); border-radius: 3px; }
.exp-stage-lbl { font-size: 10.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── POE vertical histogram ── */
.poe-hist { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; margin: 6px 0 4px; }
.poe-hist-group { flex: 1 1 100px; min-width: 96px; text-align: center; padding: 8px 4px 6px; border-radius: 10px; }
.poe-hist-group.me { background: rgba(99,102,241,.07); box-shadow: inset 0 0 0 1px rgba(99,102,241,.35); }
.poe-hist-cols { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 130px; }
.poe-hist-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 22px; height: 100%; }
.poe-hist-val { font-size: 9.5px; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.poe-hist-bar { width: 100%; border-radius: 4px 4px 0 0; transition: height .3s ease; }
.poe-hist-name { font-size: 11.5px; font-weight: 700; margin-top: 6px; }
.poe-hist-counts { font-size: 9.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.poe-hist-col { cursor: pointer; }
.poe-hist-col:hover .poe-hist-bar { filter: brightness(1.25); }
.exp-stage { cursor: pointer; }
.exp-stage:hover .exp-stage-bar { filter: brightness(1.25); }

/* ── keyword intent funnel (domain audit) ── */
.intent-funnel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 4px; }
.if-stage { clip-path: polygon(0 0, 100% 0, 91% 100%, 9% 100%); text-align: center; padding: 14px 10px; cursor: pointer; transition: filter .15s ease; min-width: 220px; }
.if-stage:hover { filter: brightness(1.12); }
.if-name { font-weight: 800; font-size: 16px; letter-spacing: .03em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.if-stats { font-size: 11.5px; color: rgba(255,255,255,.92); margin-top: 3px; font-variant-numeric: tabular-nums; }
body.light-mode .if-name, body.light-mode .if-stats { color: #fff; }

/* ── social topics histogram ── */
.sm-hist { display: flex; gap: 14px; align-items: flex-end; overflow-x: auto; padding-bottom: 4px; }
.sm-hist-col { flex: 1 0 96px; max-width: 150px; text-align: center; cursor: pointer; }
.sm-hist-col:hover .sm-hist-stack { filter: brightness(1.15); }
.sm-hist-val { font-size: 11px; font-weight: 700; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.sm-hist-track { height: 190px; display: flex; align-items: flex-end; justify-content: center; }
.sm-hist-stack { width: 38px; display: flex; flex-direction: column; border-radius: 7px 7px 0 0; overflow: hidden; transition: height .3s ease; }
.sm-hist-lbl { font-size: 10.5px; color: var(--muted); margin-top: 6px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.brand-logo { border-radius: 4px; display: block; }

/* ── social: pie + channel histogram in one row ── */
.sm-duo { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .sm-duo { grid-template-columns: 1fr; } }

/* ── 3D pain map legend ── */
.pm3d-pain { display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.pm3d-pain:hover { background: rgba(148,163,184,.1); }
.pm3d-rank { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #0a0a0a; }
/* single-brand pain: no repeated "1" — a small neutral dot instead */
.pm3d-rank-solo { width: 9px; height: 9px; margin: 0 5.5px; opacity: .55; }

/* ===== Coupled layout (2026-07-22): chat + data split the screen equally,
   the nav rail auto-collapses when chat is open, reopens when chat closes,
   and reopening the rail by hand reflows (shrinks) the chat, not the data. */
.sidebar { transition: width .22s ease, min-width .22s ease; }
.sidebar.collapsed { width: 64px; min-width: 64px; }
.sidebar.collapsed .sidebar-header-main,
.sidebar.collapsed .sidebar-project-meta,
.sidebar.collapsed .sidebar-project-chevron,
.sidebar.collapsed .sidebar-nav .nav-item > span,
.sidebar.collapsed .nav-item-lock,
.sidebar.collapsed .darkmode-row > span,
.sidebar.collapsed .user-meta { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 22px 0; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-project { justify-content: center; margin: 4px 8px 8px; width: calc(100% - 16px); padding: 9px 0; }
.sidebar.collapsed .sidebar-nav { padding: 12px 8px; }
.sidebar.collapsed .sidebar-nav .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-footer { padding: 14px 8px; }
.sidebar.collapsed .darkmode-row,
.sidebar.collapsed .user-row { justify-content: center; }

/* desktop only — on the ≤900px drawer the chat overlays, so no split */
@media (min-width: 901px) {
  .app.chat-open .main { flex: 1 1 0; min-width: 0; }
  .app.chat-open .assist:not(.collapsed) { flex: 1 1 0; width: auto; min-width: 360px; }
  .app.chat-open .assist:not(.collapsed) .assist-inner { width: 100%; margin-left: 0; }
}

/* ============ ONBOARDING — unify accent to the brand purple ============ */
#view-onboarding .btn-primary { background: var(--brand); }
#view-onboarding .option-card.selected { border-color: var(--brand); background: rgba(124,58,237,.12); }
#view-onboarding .chip-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
#onb-progress-fill { background: var(--brand); }

/* market search + dropdown */
.mkt-search { position: relative; }
.mkt-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--card); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); max-height: 280px; overflow-y: auto; padding: 6px; }
.mkt-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; background: transparent; border: 0; color: var(--text); font-family: inherit; font-size: 14.5px; text-align: left; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.mkt-opt:hover { background: var(--panel-2); }
.mkt-en { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: var(--brand-2); background: rgba(124,58,237,.14); padding: 2px 7px; border-radius: 999px; }
.mkt-soon { padding: 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.mkt-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.coming { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--brand-2); background: rgba(124,58,237,.14); border: 1px solid rgba(124,58,237,.3); padding: 2px 8px; border-radius: 999px; }

/* connect-internal (post-setup) CTAs */
.connect-cta-grid { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 6px; }
.connect-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px 18px; cursor: pointer; font-family: inherit; color: var(--text); transition: border-color .15s, transform .1s; }
.connect-cta:hover { border-color: var(--brand); transform: translateY(-1px); }
.connect-cta .cc-ic { font-size: 26px; flex-shrink: 0; width: 46px; height: 46px; display: grid; place-items: center; background: rgba(124,58,237,.1); border-radius: 11px; }
.connect-cta .cc-body { flex: 1; min-width: 0; }
.connect-cta .cc-t { font-size: 15.5px; font-weight: 700; }
.connect-cta .cc-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.connect-cta .cc-arrow { font-size: 22px; color: var(--muted); flex-shrink: 0; }

/* between-step interstitial — a moving "brain forming" moment (~2s) */
.onb-forming { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; text-align: center; animation: onbFadeIn .3s ease; }
.onb-forming-brain { font-size: 92px; line-height: 1; animation: brainForm 1.3s ease-in-out infinite; }
@keyframes brainForm {
  0%   { transform: scale(.9)  translateY(6px)  rotate(-4deg); filter: drop-shadow(0 0 8px  rgba(124,58,237,.28)); }
  50%  { transform: scale(1.1) translateY(-8px) rotate(4deg);  filter: drop-shadow(0 0 36px rgba(124,58,237,.7)); }
  100% { transform: scale(.9)  translateY(6px)  rotate(-4deg); filter: drop-shadow(0 0 8px  rgba(124,58,237,.28)); }
}
@keyframes onbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.onb-forming-title { font-size: 21px; font-weight: 700; margin-top: 26px; }
.onb-forming-sub { font-size: 13.5px; color: var(--muted); margin-top: 7px; }

/* ── Onboarding: fit the viewport, keep the CTA visible, never crop ── */
#view-onboarding.active { display: flex; flex-direction: column; height: 100vh; }
.onb-top { flex-shrink: 0; }
.onb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 40px 16px; }
.onb-content h2 { font-size: 23px; margin: 0 0 4px; }
.onb-content .sub { margin: 0 0 15px; }
.option-grid { gap: 11px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.option-card { padding: 12px 12px; }
.option-card .oc-emoji { font-size: 21px; margin-bottom: 4px; }
.option-card .oc-title { font-size: 13px; line-height: 1.25; }
.onb-addbox { margin-top: 12px; padding: 12px 14px; }
/* CTA sticks to the bottom of the scroll area — always visible, no scroll needed */
.onb-continue { position: sticky; bottom: 0; margin-top: 14px; padding: 12px; box-shadow: 0 -12px 22px -8px rgba(0,0,0,.55); }

/* ── Onboarding reminder banner (shown until the tester creates their own project) ── */
.onb-reminder { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 11px 24px;
  background: linear-gradient(90deg, rgba(124,58,237,.24), rgba(37,99,235,.15)); border-bottom: 1px solid rgba(124,58,237,.45); }
.onb-reminder-brain { font-size: 22px; line-height: 1; animation: brainForm 1.6s ease-in-out infinite; }
.onb-reminder-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.onb-reminder .btn { flex-shrink: 0; white-space: nowrap; }

/* ── "DEMO" tag on the shared showcase project card ── */
.pc-demo-tag { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .6px; padding: 2px 6px; border-radius: 5px;
  background: rgba(124,58,237,.2); color: #c4b5fd; border: 1px solid rgba(124,58,237,.42); vertical-align: middle; margin-left: 6px; }
/* Owner-only "publish as demo" toggle on a project card. */
.pc-demo-btn { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--muted); cursor: pointer; font-family: inherit; white-space: nowrap; flex-shrink: 0; }
.pc-demo-btn:hover { border-color: var(--brand); color: var(--text); }
.pc-demo-btn.on { background: rgba(124,58,237,.2); border-color: rgba(124,58,237,.5); color: #c4b5fd; }
.pc-demo-btn:disabled { opacity: .5; cursor: default; }

/* ═══ Galaxy + telescope loader — a fun observatory scene for long waits ═══ */
.galaxy-loader { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 40px 20px; }
.gx-scene { position: relative; width: 180px; height: 180px; }
/* twinkling star field */
.gx-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .25; animation: gxTwinkle 2.6s ease-in-out infinite; }
.gx-stars i:nth-child(1){ top:8%;  left:16%; animation-delay:0s }
.gx-stars i:nth-child(2){ top:20%; left:78%; animation-delay:.5s }
.gx-stars i:nth-child(3){ top:64%; left:8%;  animation-delay:1s }
.gx-stars i:nth-child(4){ top:14%; left:48%; animation-delay:1.4s }
.gx-stars i:nth-child(5){ top:82%; left:70%; animation-delay:.3s }
.gx-stars i:nth-child(6){ top:38%; left:90%; animation-delay:1.8s }
.gx-stars i:nth-child(7){ top:72%; left:38%; animation-delay:.9s }
.gx-stars i:nth-child(8){ top:30%; left:6%;  animation-delay:2.1s }
.gx-stars i:nth-child(9){ top:52%; left:60%; animation-delay:1.2s }
@keyframes gxTwinkle { 0%,100%{ opacity:.2; transform:scale(.8) } 50%{ opacity:1; transform:scale(1.35) } }
/* central spiral galaxy */
.gx-core { position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(124,58,237,0), rgba(124,58,237,.6), rgba(37,99,235,.55), rgba(236,72,153,.45), rgba(124,58,237,0));
  filter: blur(1.5px); box-shadow: 0 0 24px 7px rgba(124,58,237,.5), 0 0 46px 14px rgba(37,99,235,.22);
  transform: translate(-50%,-50%); animation: gxSpin 6s linear infinite; }
.gx-core::after { content: ''; position: absolute; inset: 34%; border-radius: 50%; background: #fff; box-shadow: 0 0 14px 5px rgba(255,255,255,.85); }
@keyframes gxSpin { from { transform: translate(-50%,-50%) rotate(0) } to { transform: translate(-50%,-50%) rotate(360deg) } }
/* orbits + planets */
.gx-orbit { position: absolute; top: 50%; left: 50%; border-radius: 50%; border: 1px solid rgba(148,163,184,.16); transform: translate(-50%,-50%); }
.gx-o1 { width: 88px;  height: 88px;  animation: gxSpin 3.6s linear infinite; }
.gx-o2 { width: 128px; height: 128px; animation: gxSpin 6s linear infinite reverse; }
.gx-o3 { width: 168px; height: 168px; animation: gxSpin 9.5s linear infinite; }
.gx-planet { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.gx-planet.p1 { background: radial-gradient(circle at 30% 30%, #a78bfa, #6d28d9); box-shadow: 0 0 9px rgba(167,139,250,.85); }
.gx-planet.p2 { width: 8px; height: 8px; background: radial-gradient(circle at 30% 30%, #7dd3fc, #1d4ed8); box-shadow: 0 0 9px rgba(96,165,250,.85); }
.gx-planet.p3 { width: 7px; height: 7px; background: radial-gradient(circle at 30% 30%, #f9a8d4, #db2777); box-shadow: 0 0 9px rgba(249,168,212,.8); }
/* the telescope, scanning the sky */
.gx-telescope { position: absolute; bottom: -2px; left: -4px; width: 62px; height: 62px; transform-origin: 62% 82%; animation: gxScan 5.5s ease-in-out infinite; }
@keyframes gxScan { 0%,100%{ transform: rotate(-7deg) } 50%{ transform: rotate(5deg) } }
.gx-text { font-size: 13.5px; color: var(--muted); text-align: center; max-width: 440px; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .gx-core, .gx-orbit, .gx-telescope, .gx-stars i { animation: none } }

/* ── Admin (owner) tables + activity feed ── */
.adm-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.adm-tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.adm-tbl tr:last-child td { border-bottom: 0; }
.adm-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: rgba(148,163,184,.15); color: var(--muted); text-transform: capitalize; }
.adm-pill.owner { background: rgba(124,58,237,.2); color: #c4b5fd; }
.adm-feat { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: rgba(37,99,235,.13); color: #93c5fd; margin: 2px 4px 2px 0; white-space: nowrap; }
.adm-feat b { color: #fff; }
.adm-feed-row { display: grid; grid-template-columns: 92px 210px 1fr 88px; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.adm-feed-row:last-child { border-bottom: 0; }
.adm-feed-t { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.adm-feed-u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-feed-f { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-feed-ms { text-align: right; color: #22c55e; font-variant-numeric: tabular-nums; }
.adm-feed-ms.err { color: #f87171; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .onb-forming-brain { animation: none; } }

/* skip warning modal */
.onb-warn { max-width: 440px; text-align: center; padding: 28px 26px; }
.onb-warn-brain { font-size: 44px; margin-bottom: 8px; }
.onb-warn .row { text-align: left; }

/* Behavioral-archetype graph — each branch floats gently, out of sync, so the
   map feels alive. Motion only; the data/positions are unchanged. Pauses on
   hover so nodes are easy to click. */
@keyframes ontFloat {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(2.5px, -5px); }
  50%  { transform: translate(0, -10px); }
  75%  { transform: translate(-2.5px, -5px); }
  100% { transform: translate(0, 0); }
}
.ont-branch { animation: ontFloat var(--fdur, 7s) ease-in-out var(--fdel, 0s) infinite; transform-box: fill-box; transform-origin: center; will-change: transform; }
.ont-branch:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ont-branch { animation: none; } }

/* Audience Gap — review pain cluster map */
.pain-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pain-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); cursor: pointer; font-family: inherit; transition: border-color .12s, background .12s; }
.pain-chip:hover { border-color: var(--brand); }
.pain-cloud { display: flex; flex-wrap: wrap; gap: 18px 12px; align-items: flex-start; }
.pain-bubble { width: 118px; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.pain-dot { border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; transition: transform .12s; }
.pain-bubble:hover .pain-dot { transform: scale(1.07); }
.pain-lbl { font-size: 10.5px; line-height: 1.28; text-align: center; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* theme-grouped view */
.pain-bucket { margin-top: 18px; }
.pain-bucket-h { font-size: 13.5px; font-weight: 800; }
.pain-bucket-h span { color: var(--muted); font-weight: 500; }
.pain-bucket-sub { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; }
.pain-theme { padding: 9px 0; border-top: 1px solid var(--border); }
.pain-theme-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.pain-theme-brands { display: flex; gap: 6px; flex-wrap: wrap; }
.pain-mchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); cursor: pointer; font-family: inherit; }
.pain-mchip:hover { filter: brightness(1.12); }
.pain-mchip.you { box-shadow: 0 0 0 1.5px currentColor inset; font-weight: 800; }
.tc-row { cursor: pointer; border-radius: 8px; padding: 6px 8px; }
.tc-row:hover { background: var(--panel-2); }
.tm-member { display: block; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; margin-bottom: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; font-family: inherit; line-height: 1.4; }
.tm-member:hover { border-color: var(--border-2); }

/* Audience Gap — socials: engagement score + per-channel sentiment×volume */
.soc-eng { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); background: rgba(124,58,237,.12); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.soc-eng b { color: var(--brand-2); font-size: 12.5px; }
.soc-chan-h { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); margin: 12px 0 6px; }
.soc-chan-h span { text-transform: none; letter-spacing: 0; margin-left: 6px; color: var(--muted); font-size: 10px; }
.soc-chans { display: flex; flex-direction: column; gap: 6px; }
.soc-chan { display: flex; align-items: center; gap: 8px; }
.soc-chan-name { flex-shrink: 0; width: 80px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.soc-chan-name img { border-radius: 3px; flex-shrink: 0; }
.soc-chan-track { flex: 1; min-width: 0; height: 9px; }
.soc-chan-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; min-width: 6px; }
.soc-chan-bar span { display: block; }
.soc-chan-vol { flex-shrink: 0; width: 62px; text-align: right; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===================== MY AUDIENCE — archetype library + personas ===================== */
.ma-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .ma-grid { grid-template-columns: 1fr; } }
.ma-arch { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-top: 1px solid var(--border); }
.ma-arch:first-of-type { border-top: none; padding-top: 4px; }
.ma-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ma-addbtn { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); cursor: pointer; font-family: inherit; transition: border-color .12s, background .12s, color .12s; }
.ma-addbtn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-2); }
.ma-addbtn.in { color: var(--good); border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.1); cursor: default; }
.ma-addbtn.newp { border-style: dashed; color: var(--brand-2); }
.ma-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); }
.ma-chip-x { cursor: pointer; opacity: .55; font-weight: 800; }
.ma-chip-x:hover { opacity: 1; color: #ef4444; }
.ma-name { border-radius: 4px; }
.ma-name:hover { background: var(--panel-2) !important; }
.ma-name:focus { outline: none; box-shadow: inset 0 -2px 0 var(--brand); }

/* persona framework — attributes on the card */
.ma-attrs { display: flex; flex-direction: column; gap: 5px; margin: 2px 0 12px; }
.ma-attr { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.ma-attr span { display: inline-block; min-width: 92px; color: var(--muted); font-weight: 700; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; margin-right: 4px; }

/* persona create/edit modal */
.ma-field { margin-bottom: 12px; }
.ma-field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.ma-field .onb-input { font-size: 14px; padding: 10px 12px; }
.ma-field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ma-more-toggle { background: none; border: none; color: var(--brand-2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 0 4px; }
.ma-more-toggle:hover { text-decoration: underline; }
.ma-suggest-wrap { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.ma-suggest-head { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.ma-suggest-head span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.ma-suggest-empty { font-size: 12px; color: var(--muted); padding: 10px 0; }
#ma-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 260px; overflow-y: auto; }
.ma-suggest-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; transition: border-color .12s, background .12s; }
.ma-suggest-row:hover { border-color: var(--border-2); }
.ma-suggest-row.on { border-color: var(--brand); background: rgba(124,58,237,.08); }
.ma-suggest-row input { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.ma-suggest-main { min-width: 0; line-height: 1.35; }
.ma-suggest-name { font-size: 13px; font-weight: 700; }
.ma-suggest-sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-match { font-size: 10px; font-weight: 700; color: var(--brand-2); background: rgba(124,58,237,.12); padding: 1px 6px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.ma-match.strong { color: var(--good); background: rgba(34,197,94,.14); }


/* ── My Audience — persona agent (2026-07) ─────────────────────────────── */
.ma-lead{font-size:12.5px;color:var(--muted);margin:0 0 16px;max-width:760px;line-height:1.55;}
.ma-lead b{color:var(--text);font-weight:600;}
.ma-graph-card{padding:16px 16px 4px;margin-bottom:18px;}
.ma-graph-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:2px;flex-wrap:wrap;}
.ma-graph-head b{font-size:14px;}
.ma-graph-head span{font-size:11.5px;color:var(--muted);}

.ma-merge{text-align:center;margin:22px auto 26px;max-width:760px;}
.ma-merge-btn{width:100%;border:0;cursor:pointer;border-radius:14px;padding:16px 22px;font-size:14.5px;font-weight:700;
  color:#fff;background:linear-gradient(120deg,var(--brand),var(--blue));
  box-shadow:0 12px 34px -14px rgba(124,58,237,.75),0 0 0 1px rgba(167,139,250,.25) inset;
  transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;line-height:1.3;}
.ma-merge-btn:hover:not(:disabled){transform:translateY(-1px);filter:brightness(1.06);box-shadow:0 16px 40px -12px rgba(124,58,237,.9);}
.ma-merge-btn:disabled{opacity:.7;cursor:default;}
.ma-merge-sub{font-size:11.5px;color:var(--muted);margin-top:11px;line-height:1.55;}
.ma-merge-sub b{color:var(--brand-2);font-weight:600;}

.ma-progress{padding:18px 20px;display:flex;flex-direction:column;gap:11px;}
.ma-pstep{display:flex;align-items:center;gap:10px;font-size:12.5px;color:var(--muted);opacity:0;animation:maFade .5s ease forwards;}
.ma-pdot{width:8px;height:8px;border-radius:50%;background:var(--brand-2);box-shadow:0 0 10px var(--brand-2);animation:maPulse 1.1s ease-in-out infinite;}
@keyframes maFade{to{opacity:1;}}
@keyframes maPulse{0%,100%{opacity:.4;transform:scale(.85);}50%{opacity:1;transform:scale(1.15);}}
.ma-empty{padding:18px 20px;color:var(--muted);font-size:13px;}

.ma-personas-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:6px 0 14px;}
.ma-personas-head b{font-size:15px;}
.ma-personas-head span{font-size:12px;color:var(--muted);}
.ma-personas-head a{color:var(--brand-2);}
.ma-pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px;}

.pa-card{position:relative;background:var(--card);border:1px solid var(--border);border-radius:16px;padding:18px 18px 16px;overflow:hidden;}
.pa-card::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--pc,#6366f1);opacity:.85;}
.pa-top{display:flex;gap:13px;align-items:center;}
.pa-av{width:56px;height:56px;border-radius:50%;flex-shrink:0;background:var(--panel-2);border:2px solid var(--border-2);}
.pa-id{min-width:0;}
.pa-name{font-size:15.5px;font-weight:700;color:var(--text);line-height:1.2;}
.pa-tag{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.4;}
.pa-meta{display:flex;flex-wrap:wrap;gap:6px;margin:13px 0 7px;font-size:10.5px;}
.pa-meta>span{color:var(--muted);background:var(--panel-2);border:1px solid var(--border);border-radius:999px;padding:3px 9px;font-family:ui-monospace,monospace;}
.pa-src.int{color:var(--brand-2);border-color:rgba(167,139,250,.35);background:rgba(124,58,237,.12);}
.pa-src.pub{color:var(--muted-2);}
.pa-card .sm-bar{margin:2px 0 4px;}

.pa-attrs{margin-top:12px;display:flex;flex-direction:column;gap:11px;}
.pa-attr-h{font-size:10.5px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-bottom:5px;}
.pa-attr ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:5px;}
.pa-attr li{font-size:11.5px;color:var(--text);background:var(--panel-2);border:1px solid var(--border);border-radius:7px;padding:3px 9px;line-height:1.35;}
.pa-noattr{font-size:12px;color:var(--muted-2);font-style:italic;}

.pa-evbox{margin-top:15px;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:12px 13px;}
.pa-evbox-h{font-size:11.5px;font-weight:700;color:var(--text);margin-bottom:9px;display:flex;flex-wrap:wrap;align-items:baseline;gap:7px;}
.pa-evbox-h span{font-size:10px;font-weight:400;color:var(--muted-2);}
.pa-ev{display:flex;gap:9px;align-items:flex-start;padding:7px 0;border-top:1px solid var(--border);}
.pa-ev:first-of-type{border-top:0;padding-top:0;}
.pa-ev-tag{flex-shrink:0;font-family:ui-monospace,monospace;font-size:8.5px;letter-spacing:.05em;text-transform:uppercase;padding:2px 6px;border-radius:5px;margin-top:1px;}
.pa-ev-tag.internal{color:var(--brand-2);background:rgba(124,58,237,.14);border:1px solid rgba(167,139,250,.3);}
.pa-ev-tag.public{color:var(--muted);background:var(--panel-2);border:1px solid var(--border);}
.pa-ev-body{min-width:0;}
.pa-ev-body p{margin:0;font-size:12px;color:var(--text);line-height:1.45;}
.pa-ev-src{font-size:10px;color:var(--muted-2);}
.pa-ev-src a{color:var(--muted);}
.pa-ev-empty{font-size:11.5px;color:var(--muted-2);}
@media(max-width:640px){.ma-pgrid{grid-template-columns:1fr;}}


/* persona actions / export / edit modal */
.ma-personas-head{justify-content:space-between;}
.ma-ph-l{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;}
.ma-exp{display:flex;gap:8px;flex-shrink:0;}
.ma-exp .btn-sm{font-size:11.5px;}
.pa-actions{margin-left:auto;display:flex;gap:6px;align-self:flex-start;}
.pa-actions button{width:28px;height:28px;border-radius:8px;border:1px solid var(--border);background:var(--panel-2);color:var(--muted);cursor:pointer;font-size:13px;line-height:1;display:grid;place-items:center;transition:all .14s ease;}
.pa-actions button:hover{color:var(--text);border-color:var(--border-2);background:var(--panel);}
.pa-actions .pa-del:hover{color:var(--bad);border-color:rgba(239,68,68,.4);}
.pe-hint{font-size:11px;color:var(--muted-2);margin:2px 0 12px;line-height:1.5;}
.pe-ta{resize:vertical;min-height:52px;font-family:inherit;line-height:1.5;}
.pe-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px;}
