/* Prime Buys Radar — light manager theme */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e8ecf3;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --accent: #c0392b;
  --accent-hover: #a5332a;
  --accent-soft: #fde8e6;
  --good: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #2563eb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 2px 8px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08), 0 4px 8px rgba(16, 24, 40, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --c-new: #3b82f6;
  --c-contacted: #f59e0b;
  --c-interested: #a855f7;
  --c-meeting: #10b981;
  --c-client: #06b6d4;
  --c-lost: #ef4444;

  --c-hot: #dc2626;
  --c-warm: #f59e0b;
  --c-cold: #94a3b8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── APP SHELL ──────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "nav topbar"
    "nav main";
  height: 100vh;
}

/* ─── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.topbar .subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topbar-spacer { flex: 1; }

.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang-toggle button { border: 0; background: transparent; padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; letter-spacing: 0.5px; }
.lang-toggle button.active { background: var(--accent); color: #fff; }

.topbar-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 12px; color: var(--text-muted); background: var(--surface-2); }
.topbar-status .spinner { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── NAV RAIL ───────────────────────────────────────────────── */
.navrail {
  grid-area: nav;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 0.5px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(192,57,43,0.25); }
.brand-name { font-size: 15px; font-weight: 600; }
.brand-tag { font-size: 11px; color: var(--text-muted); }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border: none; background: transparent;
  text-align: left; width: 100%;
  font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link .nav-emoji { font-size: 18px; }

/* ─── MAIN ───────────────────────────────────────────────────── */
.main {
  grid-area: main;
  overflow: auto;
  background: var(--bg);
  position: relative;
}
.page { padding: 28px 32px; min-height: 100%; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-header h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.page-header .spacer { flex: 1; }
.hidden-page { display: none !important; }

/* ─── DASHBOARD ──────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dash-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.dash-tile .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.dash-tile .value { font-size: 32px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.dash-tile .sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.dash-tile.accent .value { color: var(--accent); }
.dash-tile.hot    { border-color: #fecaca; background: #fff5f5; }
.dash-tile.hot .label { color: var(--c-hot); }
.dash-tile.hot .value { color: var(--c-hot); }

.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-section h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dash-section h3 .muted-count { font-weight: 400; color: var(--text-muted); font-size: 13px; }
.dash-section .empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; }

.brief-card {
  background: linear-gradient(135deg, #fff, #fef5f4);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.brief-card .brief-date { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.brief-card h2 { margin: 8px 0 12px; font-size: 20px; font-weight: 600; }
.brief-card ul { margin: 12px 0 0; padding-left: 22px; }
.brief-card li { margin-bottom: 6px; line-height: 1.5; }

.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-feed li:last-child { border-bottom: none; }
.activity-feed .act-time { color: var(--text-dim); font-size: 11px; white-space: nowrap; width: 80px; flex-shrink: 0; }
.activity-feed .act-body { flex: 1; color: var(--text); }
.activity-feed .act-body strong { color: var(--text); }
.activity-feed .act-by { color: var(--text-muted); font-size: 11px; margin-left: 6px; }
.industry-watch-list {
  display: grid;
  gap: 12px;
}
.activity-feed.industry-watch-list li {
  border-bottom: 0;
  padding: 0;
}
.industry-watch-note {
  display: block !important;
  padding: 14px 16px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: var(--radius-sm);
  background: #eff6ff;
}
.industry-watch-note div {
  display: grid;
  gap: 4px;
}
.industry-watch-note strong {
  font-size: 13px;
  color: #1e3a8a;
}
.industry-watch-note span {
  color: #315177;
  font-size: 12px;
  line-height: 1.45;
}
.industry-watch-card {
  display: grid !important;
  gap: 12px !important;
  padding: 15px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.industry-watch-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.industry-watch-top strong {
  font-size: 14px;
  color: var(--text);
}
.industry-watch-top a {
  color: var(--text);
  text-decoration: none;
}
.industry-watch-top a:hover {
  color: var(--accent);
}
.industry-watch-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.industry-watch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.industry-watch-field {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.industry-watch-field.wide {
  grid-column: 1 / -1;
}
.industry-watch-field span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.industry-watch-field p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}
.industry-watch-field small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}
.industry-watch-actions {
  display: flex;
  justify-content: flex-end;
}
.external-signal-summary {
  margin: -2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.external-signal-actions {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}
.external-signal-actions li { margin: 3px 0; }

.hot-leads-list { display: grid; gap: 10px; }
.hot-lead-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color 0.12s; cursor: pointer; }
.hot-lead-row:hover { border-color: var(--accent); }
.hot-lead-row .hl-score { font-weight: 700; color: var(--c-hot); font-size: 18px; width: 38px; text-align: center; }
.hot-lead-row .hl-name { flex: 1; font-weight: 500; }
.hot-lead-row .hl-hook { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.churn-list, .task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.churn-list li, .task-list li { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.churn-list li .warn-tag { background: #fff1ea; color: var(--warn); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.task-list li .task-due { font-size: 11px; color: var(--text-muted); }
.task-list li input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ─── RADAR MAP PAGE ─────────────────────────────────────────── */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: calc(100vh - 64px);
  background: var(--bg);
}
.map-container { position: relative; overflow: hidden; }
#map { height: 100%; width: 100%; }
.map-toolbar {
  position: absolute; top: 16px; left: 16px; z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  max-width: calc(100% - 32px);
  font-size: 13px;
}
.map-toolbar .legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.map-toolbar button {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.map-toolbar button:hover { background: #f3f4f6; }
.map-toolbar button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.map-toolbar button.primary:hover { background: #a33223; }
.map-toolbar .toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.map-count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Pin name labels — hidden at low zoom, shown when map container gets .show-labels */
.pbr-pin-label { opacity: 0; visibility: hidden; transition: opacity 0.15s ease; }
.leaflet-container.show-labels .pbr-pin-label { opacity: 1; visibility: visible; }
.pbr-pin-wrap:hover .pbr-pin-label { opacity: 1; visibility: visible; z-index: 10; }
.pbr-pin-wrap:hover { z-index: 10000 !important; }

.prospects-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pp-header { padding: 18px 22px 12px; border-bottom: 1px solid var(--border); }
.pp-header h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.pp-header h2 .muted-count { font-weight: 400; color: var(--text-muted); }
.pp-map-summary {
  margin: -6px 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}
.pp-controls { display: flex; gap: 8px; align-items: center; }
.pp-controls select, .pp-controls input {
  padding: 7px 10px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; font-size: 12px;
}
.pp-controls select { flex: 0 0 130px; }
.pp-controls input { flex: 1; }
.pp-list { flex: 1; overflow: auto; padding: 4px 0; }
.pp-card {
  padding: 14px 22px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative;
  transition: background 0.1s;
}
.pp-card:hover { background: var(--surface-2); }
.pp-card.active { background: var(--accent-soft); border-left: 3px solid var(--accent); padding-left: 19px; }
.pp-card .name-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.pp-card .pp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; background: var(--text-dim); }
.pp-card .pp-dot.s-new { background: var(--c-new); }
.pp-card .pp-dot.s-contacted { background: var(--c-contacted); }
.pp-card .pp-dot.s-interested { background: var(--c-interested); }
.pp-card .pp-dot.s-meeting { background: var(--c-meeting); }
.pp-card .pp-dot.s-client { background: var(--c-client); }
.pp-card .pp-dot.s-lost { background: var(--c-lost); }
.pp-card .pp-name { font-weight: 600; font-size: 14px; line-height: 1.3; flex: 1; }
.pp-card .pp-addr { font-size: 12px; color: var(--text-muted); margin: 0 0 10px 20px; line-height: 1.45; }
.pp-card .pp-meta { font-size: 11px; color: var(--text-muted); margin: -4px 0 6px 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.pp-card .pp-meta .stars { color: #f59e0b; }
.pp-card .pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 20px; }
.pp-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.pp-chip.phone   { background: #dbeafe; color: #1e40af; }
.pp-chip.email   { background: #d1fae5; color: #047857; }
.pp-chip.site    { background: #ede9fe; color: #6d28d9; }
.pp-chip.je-menu { background: #fff1ea; color: #d97706; }
.pp-chip.google  { background: #fef3c7; color: #92400e; }
.pp-chip.missing { background: transparent; color: var(--text-muted); border: 1px dashed var(--border-strong); }
.pp-chip.missing:hover { border-color: var(--accent); color: var(--accent); }
.pp-tools { position: absolute; top: 10px; right: 12px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.1s; }
.pp-card:hover .pp-tools { opacity: 1; }
.pp-tool {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  padding: 4px 8px; border-radius: 6px; font-size: 11px; cursor: pointer;
}
.pp-tool:hover { border-color: var(--accent); color: var(--accent); }

/* Source badge on cards */
.badge-src { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; letter-spacing: 0.3px; }
.badge-src.fsa     { background: #cffafe; color: #0e7490; }
.badge-src.osm     { background: var(--surface-3); color: var(--text-muted); }
.badge-src.justeat { background: #fff1ea; color: #c2410c; }
.badge-src.apify   { background: #dcfce7; color: #15803d; }
.badge-src.google  { background: #dbeafe; color: #1d4ed8; }
.badge-src.yelp    { background: #fee2e2; color: #b91c1c; }
.badge-src.foursquare { background: #ede9fe; color: #6d28d9; }
.badge-src.multi-source { background: #f3f4f6; color: #374151; }

/* AI score chip on cards */
.ai-score-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: 2px; cursor: pointer; }
.ai-score-chip.hot  { background: #fee2e2; color: var(--c-hot); }
.ai-score-chip.warm { background: #ffedd5; color: #c2410c; }
.ai-score-chip.cold { background: var(--surface-3); color: var(--text-muted); }
.ai-score-chip.pending { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-muted); }
.ai-score-chip.pending:hover { border-color: var(--accent); color: var(--accent); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  border: 0; padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.soft { background: var(--surface-2); color: var(--text); border: 1px solid transparent; }
.btn.soft:hover { background: var(--surface-3); }
.btn.danger { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }
.btn.danger:hover { background: #fee2e2; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ─── CARDS (scrape/insights/etc.) ───────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card-grid.wide { grid-template-columns: 1fr; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card .muted { margin: 0 0 16px; font-size: 12px; color: var(--text-muted); }
.card label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.card small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.card input, .card select, .card textarea {
  width: 100%; padding: 9px 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; margin-top: 4px;
}
.card input:focus, .card select:focus, .card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset-grid button {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.12s;
}
.preset-grid button:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }

.source-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.source-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.source-health-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
  min-width: 0;
}
.source-health-card.ready { border-color: #bbf7d0; background: #f0fdf4; }
.source-health-card.missing { border-color: #fed7aa; background: #fff7ed; }
.source-health-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.source-health-top strong { font-size: 13px; }
.source-health-top span {
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}
.source-health-meta,
.source-health-usage,
.source-health-error {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 6px;
}
.source-health-error { color: var(--bad); overflow-wrap: anywhere; }
.source-preview-wrap { max-height: 460px; }
.source-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  margin: 2px 3px 2px 0;
  white-space: nowrap;
}
.source-chip.google { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.source-chip.yelp { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.source-chip.foursquare { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.source-chip.apify { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.source-warning {
  display: block;
  color: var(--warn);
  margin-top: 5px;
}
.fit-score {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  padding: 3px 9px;
}
.dup-warn { color: var(--warn); font-weight: 700; }
.ok-text { color: var(--good); font-weight: 700; }
.evidence-drawer { width: 680px; }
.evidence-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.evidence-field-row,
.evidence-email,
.evidence-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}
.evidence-field-row span,
.evidence-field-row small,
.evidence-item small,
.evidence-email span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}
.evidence-list,
.evidence-email-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.evidence-item div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.evidence-item p {
  margin: 5px 0;
  color: var(--text);
  font-size: 12px;
}
.evidence-item a {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  margin-top: 4px;
}
.evidence-email.needsReview { border-color: #fed7aa; background: #fff7ed; }

@media (max-width: 1100px) {
  .source-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .source-card-head { flex-direction: column; align-items: stretch; }
  .source-health-grid,
  .evidence-field-grid { grid-template-columns: 1fr; }
}

.log {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 12px; color: var(--text-muted);
  max-height: 300px; overflow: auto; white-space: pre-wrap;
}
.log .ok { color: var(--good); }
.log .err { color: var(--bad); }

/* ─── STATUS PILLS ────────────────────────────────────────────── */
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.status-new        { background: #dbeafe; color: #1e40af; }
.status-contacted  { background: #fef3c7; color: #92400e; }
.status-interested { background: #ede9fe; color: #6d28d9; }
.status-meeting    { background: #d1fae5; color: #065f46; }
.status-client     { background: #cffafe; color: #0e7490; }
.status-lost       { background: #fee2e2; color: #991b1b; }

/* ─── MODAL + DRAWER ─────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.4); display: grid; place-items: center; z-index: 2000; backdrop-filter: blur(2px); }
.modal-body { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; width: 460px; max-width: 90vw; box-shadow: var(--shadow-lg); }
.modal-body h2 { margin: 0 0 18px; font-size: 18px; font-weight: 600; }
.modal-body label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; padding: 9px 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; margin-top: 4px;
}
.modal-body .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-body .row .btn.danger { margin-right: auto; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 500px; max-width: 95vw; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1500; transform: translateX(0); transition: transform 0.2s; }
.drawer.hidden { display: block !important; transform: translateX(100%); pointer-events: none; }
.drawer-body { height: 100%; overflow: auto; padding: 24px 28px; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.drawer h3 { margin: 20px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.drawer .drawer-text { margin: 0; font-size: 14px; line-height: 1.55; }
.drawer ul { margin: 4px 0; padding-left: 20px; }
.drawer li { margin-bottom: 4px; font-size: 13px; line-height: 1.45; }

.company-drawer { width: 620px; }
.company-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.company-card-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px;
  margin-bottom: 14px;
}
.company-card-section h3 { margin-top: 0; }
.company-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.company-detail-grid > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
  padding: 11px 12px;
}
.company-detail-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .45px;
}
.company-detail-grid strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.company-score-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.company-score-row > span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.company-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.company-candidates span {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}
.company-activity {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.company-activity li {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  margin: 0;
  padding: 10px 11px;
}
.company-activity strong,
.company-activity span,
.company-activity small {
  display: block;
}
.company-activity strong { color: var(--text); font-size: 12px; text-transform: capitalize; }
.company-activity span { color: var(--text-muted); font-size: 12px; margin-top: 3px; }
.company-activity small { color: var(--text-dim); font-size: 11px; margin-top: 4px; }

@media (max-width: 720px) {
  .company-detail-grid,
  .company-score-row { grid-template-columns: 1fr; }
}

.score-row {
  display: flex; align-items: center; gap: 20px;
  padding: 18px; background: var(--surface-2);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.score-big { font-size: 48px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.03em; }
.score-big small { font-size: 17px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.score-meta { font-size: 13px; }
.score-meta > div { margin: 5px 0; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.tag.hot    { background: #fee2e2; color: var(--c-hot); }
.tag.warm   { background: #ffedd5; color: #c2410c; }
.tag.cold   { background: var(--surface-3); color: var(--text-muted); }
.tag.high   { background: #d1fae5; color: #065f46; }
.tag.medium { background: #ffedd5; color: #c2410c; }
.tag.low    { background: #dbeafe; color: #1e40af; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ─── TABLE (prospects list page) ────────────────────────────── */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 12px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  position: sticky; top: 0; z-index: 1;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: var(--surface-2); }

.sort-head {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
.sort-head span {
  display: inline-flex;
  min-width: 10px;
  color: var(--text-dim);
  font-size: 12px;
}
.sort-head:hover,
.sort-head.active { color: var(--text); }
.sort-head:focus-visible,
.company-name-btn:focus-visible,
.missing-data-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.company-name-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.company-name-btn:hover { color: var(--accent); text-decoration: underline; }

.missing-data-btn {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.missing-data-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.missing-data-btn.compact {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 11px;
}
.missing-data-btn[disabled] { opacity: .55; cursor: progress; }

.candidate-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}
.candidate-cell span {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.candidate-cell small {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.list-toolbar { display: flex; gap: 10px; padding: 16px 0; align-items: center; }
.list-toolbar input, .list-toolbar select {
  padding: 8px 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px;
}
.list-toolbar input { flex: 1; max-width: 360px; }

/* ─── COMPETITOR / INSIGHTS CARDS ────────────────────────────── */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.comp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.comp-card h3 { margin: 0 0 4px; font-size: 15px; }
.comp-card .region { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.comp-card .headline { font-size: 13px; line-height: 1.5; color: var(--text); margin: 10px 0; }
.comp-card .comp-list { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-muted); }
.comp-card .comp-list li { margin: 3px 0; }
.comp-card .comp-foot { margin-top: 14px; font-size: 11px; color: var(--text-dim); display: flex; justify-content: space-between; }

/* --- Competitor Watch full suite -------------------------------- */
.cw-dashboard-panel { border-color: #cbd5e1; }
.cw-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.cw-section-head h3 { margin: 0 0 4px; font-size: 15px; }
.cw-section-head p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.cw-actions, .cw-top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-top-actions { justify-content: flex-end; margin: -8px 0 14px; }
.cw-mini-grid, .cw-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.cw-mini-kpi, .cw-kpi {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  min-width: 0;
}
.cw-mini-kpi span, .cw-kpi span { display: block; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.cw-mini-kpi strong, .cw-kpi strong { display: block; margin-top: 4px; font-size: 22px; color: var(--text); overflow-wrap: anywhere; }
.cw-mini-kpi small, .cw-kpi small { display: block; margin-top: 4px; color: var(--text-dim); font-size: 11px; overflow-wrap: anywhere; }
.cw-dashboard-findings { display: grid; gap: 8px; margin-top: 12px; }
.cw-compact-finding {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}
.cw-compact-finding strong { min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-compact-finding small { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.cw-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.cw-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cw-tab.active { background: var(--accent); color: #fff; }
.cw-panel { display: block; }
.cw-two-col {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
}
.cw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.cw-card h3 { margin: 0 0 10px; font-size: 15px; }
.cw-form { display: grid; gap: 10px; }
.cw-form label { display: grid; gap: 5px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.cw-form input, .cw-form textarea, .cw-form select, .cw-filter-bar select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 13px;
}
.cw-form textarea { resize: vertical; }
.cw-target-list, .cw-finding-list, #cwOverviewTargets, #cwOverviewFindings, #cwPriceList, #cwAnomalyList, #cwProductList, #cwReportList, #cwDiscoveryList {
  display: grid;
  gap: 10px;
}
.cw-target, .cw-finding, .cw-product, .cw-price-row, .cw-report-row, .cw-discovery-row {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 13px;
  min-width: 0;
}
.cw-target-head, .cw-finding-top, .cw-report-row, .cw-discovery-row, .cw-price-row, .cw-product {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cw-target h3, .cw-finding h3 { margin: 0 0 3px; font-size: 14px; }
.cw-target p { margin: 0; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.cw-target-meta, .cw-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.cw-target-meta span, .cw-socials a, .cw-category, .cw-status {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  text-decoration: none;
}
.cw-status.ok { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.cw-status.error, .cw-status.missing_url { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.cw-status.blocked { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.cw-latest { color: var(--text-muted); font-size: 12px; line-height: 1.45; margin-bottom: 10px; }
.cw-severity {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.cw-severity.high { background: #fee2e2; color: #991b1b; }
.cw-severity.medium { background: #ffedd5; color: #9a3412; }
.cw-severity.low { background: #e0f2fe; color: #075985; }
.cw-finding { display: grid; gap: 8px; }
.cw-finding-top { justify-content: flex-start; align-items: center; }
.cw-finding-top time { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.cw-finding p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.cw-finding pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: 12px;
}
.cw-action-note {
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
}
.cw-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
}
.cw-price-row, .cw-product, .cw-report-row, .cw-discovery-row { align-items: center; }
.cw-price-row strong, .cw-product strong, .cw-report-row strong, .cw-discovery-row strong { min-width: 0; overflow-wrap: anywhere; }
.cw-price-row span, .cw-product span, .cw-report-row span, .cw-discovery-row span { color: var(--text-muted); font-size: 12px; min-width: 0; }
.cw-price-row em, .cw-product em { font-style: normal; font-weight: 700; color: var(--text); white-space: nowrap; }
.cw-price-row small { color: var(--text-dim); font-size: 11px; }
.anomaly-high { border-color: #fecaca; background: #fff7f7; }
.anomaly-medium { border-color: #fed7aa; background: #fff7ed; }
.cw-matrix-wrap { overflow: auto; }
.cw-matrix { min-width: 720px; }
.cw-matrix th, .cw-matrix td { white-space: nowrap; }
.cw-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 14px;
  font-size: 13px;
  background: var(--surface-2);
}

.cw-visual-status {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  max-width: 260px;
  overflow-wrap: anywhere;
}
.cw-visual-status.online { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.cw-visual-status.offline { background: #fef3c7; border-color: #fde68a; color: #92400e; }
#cwVisualJobs, #cwVisualTargets {
  display: grid;
  gap: 10px;
}
.cw-visual-job, .cw-visual-target {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 13px;
  min-width: 0;
}
.cw-visual-job {
  display: grid;
  gap: 10px;
}
.cw-visual-job p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.cw-visual-artifacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.cw-visual-artifacts a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
}
.cw-visual-artifacts img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cw-visual-target {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 1fr) minmax(140px, .8fr) auto;
  gap: 12px;
  align-items: center;
}
.cw-visual-target strong,
.cw-visual-target span,
.cw-visual-last {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cw-visual-target > div:first-child {
  display: grid;
  gap: 3px;
}
.cw-visual-target > div:first-child span,
.cw-visual-last {
  color: var(--text-muted);
  font-size: 12px;
}

.cw-run-explainer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.15fr);
  gap: 14px;
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(192, 57, 43, 0.06), rgba(37, 99, 235, 0.05)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.cw-run-copy {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}
.cw-eyebrow {
  width: max-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cw-run-copy h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.cw-run-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.cw-run-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.cw-run-steps div,
.cw-live-example,
.cw-example-note {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 11px 12px;
}
.cw-run-steps strong,
.cw-live-example strong,
.cw-example-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
}
.cw-run-steps span,
.cw-live-example span,
.cw-example-note span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.cw-live-example {
  grid-column: 1 / -1;
  background: #f8fafc;
}
.cw-live-example small,
.cw-example-note small {
  display: block;
  margin-top: 5px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
}
.cw-example-note {
  margin: 0 0 12px;
  border-color: #dbe3ee;
  background: #f8fafc;
}
.cw-run-result {
  display: grid;
  gap: 2px;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
}
.cw-run-result strong {
  color: #166534;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cw-run-result span {
  color: #315c43;
  font-size: 12px;
  line-height: 1.4;
}
.cw-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cw-chip-row span {
  display: inline-flex;
  width: auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* ─── LEAFLET OVERRIDES (light popups) ───────────────────────── */
.leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { font-size: 13px; line-height: 1.5; }
.leaflet-popup-content strong { color: var(--text); }
.pbr-pin-wrap, .pbr-hq-wrap { background: transparent !important; border: none !important; }

/* ─── UTILITIES ──────────────────────────────────────────────── */
.muted { color: var(--text-muted); }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Outreach Studio */
.outreach-layout {
  display: grid;
  grid-template-columns: 300px minmax(520px, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.outreach-panel,
.outreach-detail,
.outreach-preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.outreach-panel,
.outreach-preview-panel { padding: 18px; position: sticky; top: 18px; }
.outreach-detail { padding: 18px; min-height: 520px; }
.outreach-panel-head h3 { margin: 0; font-size: 15px; }
.outreach-panel-head p { margin: 4px 0 14px; color: var(--text-muted); font-size: 12px; }
.outreach-panel label,
.outreach-box label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.outreach-panel input,
.outreach-panel select,
.outreach-box input,
.outreach-box textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  margin-top: 5px;
}
.outreach-box textarea { resize: vertical; line-height: 1.45; }
.outreach-check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 14px;
}
.outreach-check input,
.outreach-products input,
.prospect-select,
#selectAllProspects { width: 15px; height: 15px; accent-color: var(--accent); }
.outreach-products {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
}
.outreach-products label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  font-weight: 500;
  color: var(--text);
}
.outreach-actions,
.row-actions,
.kit-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.outreach-actions { margin-top: 14px; }
.kit-list-wrap { margin-top: 20px; }
.kit-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.kit-list-item {
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.kit-list-item:hover,
.kit-list-item.active { border-color: var(--accent); background: var(--accent-soft); }
.kit-list-item strong,
.kit-list-item span,
.kit-list-item em { display: block; }
.kit-list-item strong { font-size: 13px; }
.kit-list-item span { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.kit-list-item em { color: var(--text-dim); font-size: 11px; margin-top: 3px; font-style: normal; }
.kit-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}
.kit-head h3 { margin: 0; font-size: 20px; }
.kit-head p { margin: 4px 0 0; color: var(--text-muted); }
.kit-status {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.kit-status.status-approved,
.kit-status.status-image_done { background: #d1fae5; color: #065f46; }
.kit-status.status-needs_review,
.kit-status.status-image_error { background: #fee2e2; color: #991b1b; }
.kit-status.status-edited,
.kit-status.status-image_requested { background: #fef3c7; color: #92400e; }
.outreach-tabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.outreach-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--surface);
}
.outreach-box h4 { margin: 0 0 10px; font-size: 14px; }
.outreach-box p { margin: 0 0 10px; color: var(--text-muted); }
.outreach-box ul { margin: 8px 0; padding-left: 18px; }
.fit-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip-row { margin-top: 8px; }
.meta-chip-row.small .fit-chip { font-size: 10px; padding: 4px 7px; }
.fit-chip {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
}
.fit-chip.good { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.fit-chip.avoid { background: #f9fafb; color: var(--text-muted); border-style: dashed; }
.leaflet-block-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.leaflet-block-list li {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.leaflet-block-list strong,
.leaflet-block-list span { display: block; }
.leaflet-block-list span { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.warn-list { color: var(--bad); }
.mini-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mini-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.kit-footer-actions {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.empty-state.compact { min-height: 70px; padding: 12px; }
.outreach-preview-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.outreach-preview {
  overflow: auto;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}
.pb-preview-sheet {
  width: min(100%, 310px);
  min-height: 440px;
  margin: 0 auto;
  background: #fffdf7;
  color: #16251e;
  border: 1px solid #d8c58b;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  font-family: Inter, sans-serif;
}
.pb-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #12362c;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.pb-preview-top small { color: #efd886; font-size: 9px; font-weight: 600; text-align: right; }
.pb-preview-hero {
  min-height: 120px;
  padding: 18px 16px;
  background: linear-gradient(135deg, #fbf3dc, #ffffff);
  border-bottom: 1px solid #eadba9;
}
.pb-preview-kicker {
  margin: 0 0 6px;
  color: #a66319;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
}
.pb-preview-hero h2 { margin: 0; font-size: 22px; line-height: 1.1; }
.pb-preview-hero p { margin: 8px 0 0; color: #536052; font-size: 12px; }
.pb-preview-local {
  margin: 12px 14px 0;
  padding: 8px 10px;
  background: #edf7f1;
  border-left: 3px solid #16734f;
  font-size: 11px;
}
.pb-preview-products {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}
.pb-preview-product {
  padding: 9px;
  border: 1px solid #ece3c5;
  background: #fff;
}
.pb-preview-product strong,
.pb-preview-product span { display: block; }
.pb-preview-product span { margin-top: 3px; color: #6b705f; font-size: 10px; }
.pb-preview-cta {
  margin: 0 14px 14px;
  padding: 12px;
  background: #12362c;
  color: #fff;
}
.pb-preview-cta strong,
.pb-preview-cta span { display: block; }
.pb-preview-cta span { margin-top: 5px; color: #efd886; font-size: 9px; }
.outreach-image-box {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.image-status {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
}
.image-status.is-running {
  border-color: #f4c95d;
  background: #fff8df;
}
.image-status.is-done {
  border-color: #86efac;
  background: #ecfdf5;
}
.image-status.is-error {
  border-color: #fecaca;
  background: #fff1f2;
}
.image-status span,
.image-status small { color: var(--text-muted); }
.image-progress {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #f4c95d;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff8df, #ffffff);
  font-size: 12px;
}
.image-progress strong,
.image-progress span { display: block; }
.image-progress span {
  margin-top: 3px;
  color: var(--text-muted);
  line-height: 1.35;
}
.image-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #fde68a;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}
.image-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.image-steps span {
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
.image-steps span.done {
  background: #ecfdf5;
  color: #047857;
}
.image-steps span.active {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}
.generated-image-wrap {
  display: grid;
  gap: 10px;
}
.generated-image-wrap img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.generated-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.browser-agent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.browser-agent-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.browser-chat-card,
.browser-guided,
.browser-agent-live,
.browser-results-panel,
.browser-agent-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.browser-agent-history { padding: 18px; position: sticky; top: 18px; }
.browser-chat-card {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(27, 94, 80, 0.08), rgba(239, 216, 134, 0.08)),
    var(--surface);
}
.browser-chat-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}
.browser-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #12362c;
  color: #efd886;
  font-weight: 800;
  letter-spacing: 0;
}
.browser-chat-head h3 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.2;
}
.browser-chat-head p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}
.browser-agent-live { padding: 18px; min-height: 470px; }
.browser-chat-card label,
.browser-guided label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.browser-chat-card input,
.browser-chat-card select,
.browser-chat-card textarea,
.browser-guided select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.browser-chat-card textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.5;
  font-size: 14px;
  border-color: var(--border-strong);
}
.browser-chat-card textarea:focus,
.browser-chat-card select:focus,
.browser-guided select:focus {
  outline: 3px solid rgba(27, 94, 80, 0.14);
  border-color: var(--accent);
}
.browser-context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.browser-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}
.browser-prompt-chips button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.browser-prompt-chips button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.browser-chat-actions,
.browser-guided-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.browser-chat-actions .btn.primary { min-width: 190px; }
.browser-agent-note {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #f3d08a;
  border-radius: var(--radius-sm);
  background: #fff8e6;
  color: #7c4a03;
  font-size: 12px;
  line-height: 1.45;
}
.browser-guided {
  padding: 0;
  overflow: hidden;
}
.browser-guided summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.browser-guided summary::-webkit-details-marker { display: none; }
.browser-guided summary span {
  color: var(--text);
  font-weight: 800;
}
.browser-guided summary small {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}
.browser-guided summary::after {
  content: "Show";
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}
.browser-guided[open] summary::after { content: "Hide"; }
.browser-guided-grid {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.browser-guided-grid label { margin-top: 14px; margin-bottom: 0; }
.browser-job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.browser-job-head h3 { margin: 4px 0; font-size: 19px; }
.browser-job-head p { margin: 0; color: var(--text-muted); font-size: 12px; }
.browser-status {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.browser-status.running,
.browser-status.approval_required { background: #fff7d6; color: #946200; }
.browser-status.completed { background: #dcfce7; color: #166534; }
.browser-status.failed,
.browser-status.cancelled,
.browser-status.approval_rejected { background: #fee2e2; color: #991b1b; }
.browser-approval {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #f5bd70;
  border-radius: var(--radius-sm);
  background: #fff8e6;
}
.browser-approval span,
.browser-summary { color: var(--text-muted); line-height: 1.5; }
.browser-artifact-section {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.browser-artifact-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
}
.browser-artifacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.browser-artifacts.compact {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}
.browser-artifact-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.browser-artifact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.browser-artifact-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
}
.browser-artifacts.compact .browser-artifact-card {
  padding: 6px;
}
.browser-artifacts.compact .browser-artifact-card img {
  aspect-ratio: 4 / 3;
}
.browser-artifact-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}
.browser-file-icon {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.browser-artifact-more {
  align-self: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.browser-live-preview {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #b7d4c8;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(27, 94, 80, 0.08), rgba(255, 255, 255, 0.92));
}
.browser-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.browser-live-head h4 {
  margin: 0 0 4px;
  font-size: 13px;
}
.browser-live-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}
.browser-live-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
}
.browser-live-preview.waiting .browser-live-head span {
  background: #fff7d6;
  color: #946200;
}
.browser-live-frame {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 10px, #eef2f7 10px, #eef2f7 20px);
}
.browser-live-frame img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #fff;
}
.browser-live-preview.waiting .browser-live-frame::after {
  content: "Waiting for live browser image...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  background: rgba(248, 250, 252, 0.72);
}
.browser-results-panel {
  padding: 18px;
}
.browser-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.browser-results-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.browser-results-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.browser-results-list {
  display: grid;
  gap: 10px;
}
.browser-result-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.browser-result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.browser-result-top h4 {
  margin: 3px 0;
  font-size: 15px;
}
.browser-result-top small,
.browser-result-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.browser-result-card p {
  margin: 0;
}
.browser-event-log {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: 520px;
  overflow: auto;
}
.browser-event {
  display: grid;
  grid-template-columns: 70px 90px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
}
.browser-event span { color: var(--text-muted); }
.browser-event strong { color: var(--accent); }
.browser-event p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.browser-job-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}
.browser-job-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.browser-job-item:hover,
.browser-job-item.active { border-color: var(--accent); background: var(--accent-soft); }
.browser-job-item span,
.browser-job-item small { color: var(--text-muted); font-size: 12px; }
.ok { color: var(--good); }
.err { color: var(--bad); }

.map-sweep-status {
  max-width: 360px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-sweep-status.ok { background: #dcfce7; color: #166534; }
.map-sweep-status.warn { background: #fef3c7; color: #92400e; }
.map-sweep-status.err { background: #fee2e2; color: #991b1b; }

/* AI Customer Service */
.cs-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.cs-main { display: grid; gap: 16px; min-width: 0; }
.cs-side { display: grid; gap: 16px; position: sticky; top: 18px; }
.cs-live-card {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr);
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.cs-live-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  padding: 26px;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, 0.94), rgba(39, 51, 70, 0.96)),
    #111827;
  color: #fff;
}
.cs-live-copy .mini-label { color: #f8d8cf; }
.cs-live-copy h3 {
  margin: 8px 0 12px;
  max-width: 520px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
}
.cs-live-copy p {
  max-width: 520px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 15px;
  line-height: 1.55;
}
.cs-live-board {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
}
.cs-live-state {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.cs-live-state small {
  grid-column: 2;
  color: var(--text-muted);
  line-height: 1.35;
}
.cs-live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .16);
}
.cs-live-dot.listen {
  background: #16a34a;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, .15);
  animation: csPulse 1.4s ease-in-out infinite;
}
.cs-live-dot.busy {
  background: #2563eb;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, .15);
}
.cs-live-dot.err {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(220, 38, 38, .13);
}
@keyframes csPulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.22); opacity: 1; }
}
.cs-live-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.cs-talk-button {
  min-height: 58px;
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: #111827;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(17, 24, 39, .22);
}
.cs-talk-button.active {
  background: #b91c1c;
  box-shadow: 0 14px 26px rgba(185, 28, 28, .22);
}
.cs-talk-icon {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-size: 11px;
  letter-spacing: 0;
}
.cs-hero-card,
.cs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.cs-hero-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(192, 57, 43, 0.08), rgba(37, 99, 235, 0.06)),
    var(--surface);
}
.cs-orb {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-weight: 800;
}
.cs-hero-card h3 { margin: 3px 0 5px; font-size: 22px; line-height: 1.2; }
.cs-hero-card p { margin: 0; color: var(--text-muted); }
.cs-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
}
.cs-card { padding: 18px; }
.cs-card label {
  display: block;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.cs-card input,
.cs-card select,
.cs-card textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px;
  font: inherit;
}
.cs-card textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.cs-live-board textarea {
  min-height: 78px;
}
.cs-card input:focus,
.cs-card select:focus,
.cs-card textarea:focus {
  outline: 3px solid rgba(192, 57, 43, 0.12);
  border-color: var(--accent);
}
.cs-upload-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 12px;
}
.cs-record-timer {
  width: max-content;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.cs-sample-list,
.cs-list {
  display: grid;
  gap: 8px;
}
.cs-sample-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 0;
}
.cs-sample {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.cs-sample strong,
.cs-sample span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}
.cs-sample span { color: var(--text-muted); font-size: 12px; }
.cs-sample audio { width: 100%; height: 34px; }
.cs-consent {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  color: var(--text) !important;
  font-weight: 600 !important;
  line-height: 1.35;
}
.cs-consent input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.cs-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
}
.cs-transcript {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}
.cs-turn {
  max-width: 82%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.cs-turn span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.cs-turn p { margin: 0; line-height: 1.45; }
.cs-turn small { color: var(--warn); font-size: 11px; line-height: 1.35; }
.cs-turn.caller {
  justify-self: start;
  background: var(--surface);
}
.cs-turn.assistant {
  justify-self: end;
  background: #fff7ed;
  border-color: #fed7aa;
}
.cs-list-item,
.cs-call-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
}
.cs-call-item {
  display: grid;
  cursor: pointer;
}
.cs-list-item strong,
.cs-call-item strong { font-size: 13px; }
.cs-list-item span,
.cs-call-item span,
.cs-list-item small,
.cs-call-item small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.cs-call-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cs-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cs-prompt-chips button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.cs-prompt-chips button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cs-advanced {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cs-advanced summary {
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 800;
}
.cs-advanced .cs-card {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .cs-live-dot.listen,
  .image-spinner { animation: none; }
}

/* Insights */
.insights-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.insights-hero h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  line-height: 1.2;
}
.insights-hero .muted { margin: 0; color: var(--text-muted); }
.insights-radius {
  min-width: 170px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: right;
}
.insights-radius strong { font-size: 24px; line-height: 1; }
.insights-radius span,
.insights-radius small { color: var(--text-muted); font-size: 12px; }
.insights-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.insight-kpi {
  display: grid;
  gap: 3px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.insight-kpi span,
.insight-kpi small { color: var(--text-muted); font-size: 12px; }
.insight-kpi strong { font-size: 24px; line-height: 1; }
.insights-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.insights-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.insights-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.insights-panel h3 {
  margin: 0;
  font-size: 15px;
}
.insight-bar-row { display: grid; gap: 6px; margin-bottom: 12px; }
.insight-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.insight-bar-top span { color: var(--text-muted); white-space: nowrap; }
.insight-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.insight-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.insights-mini-bars {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.insights-list { display: grid; gap: 8px; }
.insight-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.insight-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.insight-item span { display: grid; gap: 2px; min-width: 0; }
.insight-item strong,
.insight-item small { overflow-wrap: anywhere; }
.insight-item small { color: var(--text-muted); font-size: 12px; }
.insight-item em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}
.insight-action {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.insight-action.high { border-color: #fecaca; background: #fef2f2; }
.insight-action.medium { border-color: #fed7aa; background: #fff7ed; }
.insight-action.low { border-color: #bfdbfe; background: #eff6ff; }
.insight-action span,
.insights-empty { color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.insight-digest-actions {
  margin-top: 12px;
  font-size: 12px;
}

/* Settings: Knowledge Bank */
.knowledge-card {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}
.kb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.kb-head h3 { margin: 2px 0 4px; font-size: 18px; }
.kb-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.kb-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.kb-meta-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.kb-meta-grid span {
  color: var(--text-muted);
  font-size: 11px;
}
.kb-meta-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.kb-status {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
}
.kb-status.ok { border-color: #bbf7d0; background: #f0fdf4; color: var(--good); }
.kb-status.err { border-color: #fecaca; background: #fef2f2; color: var(--bad); }
.kb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
}
.kb-tab {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.kb-tab:hover { background: var(--surface-2); color: var(--text); }
.kb-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.kb-panel {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.kb-form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kb-panel label {
  display: grid;
  gap: 5px;
  margin: 0;
}
.kb-panel textarea {
  resize: vertical;
  line-height: 1.45;
}
.kb-asset-section {
  display: grid;
  gap: 12px;
}
.kb-section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.kb-section-title > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.kb-section-title strong { color: var(--text); font-size: 14px; }
.kb-material-toolbar,
.kb-material-upload {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.kb-material-toolbar label,
.kb-material-upload label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.kb-material-toolbar input,
.kb-material-toolbar select,
.kb-material-upload input,
.kb-material-upload select,
.kb-material-upload textarea,
.kb-asset-detail input,
.kb-asset-detail select,
.kb-asset-detail textarea {
  min-width: 0;
  width: 100%;
}
.kb-material-upload {
  grid-template-columns: minmax(210px, 1.2fr) minmax(130px, 0.7fr) minmax(160px, 1fr) minmax(150px, 1fr) auto;
  align-items: stretch;
}
.kb-material-upload .kb-upload-wide {
  grid-column: span 2;
}
.kb-file-drop {
  min-height: 78px;
  justify-content: center;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.kb-file-drop input {
  font-size: 12px;
}
.kb-material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}
.kb-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}
.kb-asset {
  position: relative;
  display: grid;
  grid-template-rows: 92px auto auto;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.kb-asset:hover,
.kb-asset.active {
  border-color: var(--accent);
  background: #fff;
  text-decoration: none;
}
.kb-asset.active {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.kb-asset-thumb,
.kb-file-icon {
  width: 100%;
  height: 92px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface);
}
.kb-file-icon {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-weight: 800;
}
.kb-asset strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.kb-asset span {
  color: var(--text-muted);
  font-size: 11px;
}
.kb-asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kb-asset-pill {
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: white;
  font-size: 10px;
  font-weight: 800;
}
.kb-asset-detail {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.kb-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.kb-preview img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.kb-preview iframe {
  width: 100%;
  height: 260px;
  border: 0;
  background: white;
}
.kb-preview .kb-file-icon {
  width: 100%;
  height: 180px;
  border-radius: 0;
}
.kb-detail-head {
  display: grid;
  gap: 4px;
}
.kb-detail-head strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}
.kb-detail-head span {
  color: var(--text-muted);
  font-size: 11px;
}
.kb-detail-form {
  display: grid;
  gap: 9px;
}
.kb-detail-form label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.kb-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kb-note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kb-note-chip {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.kb-json {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}
.kb-json summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.kb-json textarea {
  margin-top: 10px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .outreach-layout { grid-template-columns: 280px 1fr; }
  .outreach-preview-panel { grid-column: 1 / -1; position: static; }
  .browser-agent-layout { grid-template-columns: 1fr; }
  .browser-agent-history { grid-column: 1 / -1; position: static; }
  .cs-shell { grid-template-columns: 1fr; }
  .cs-side { position: static; }
  .cs-live-card { grid-template-columns: 1fr; }
  .cs-live-copy { min-height: 260px; }
  .insights-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "nav"
      "topbar"
      "main";
    height: auto;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
  }
  .navrail {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px;
    gap: 6px;
    max-width: 100vw;
  }
  .brand { display: none; }
  .nav-link {
    flex: 1 1 126px;
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    gap: 7px;
    white-space: normal;
    line-height: 1.2;
  }
  .nav-link span:last-child {
    overflow-wrap: anywhere;
  }
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    height: auto;
    padding: 12px 14px;
    gap: 8px;
  }
  .topbar > div:first-child { min-width: 0; }
  .topbar-spacer { display: none; }
  .lang-toggle { margin-left: auto; }
  .main { overflow-x: hidden; }
  .page { padding: 18px 14px; }
  .page-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .page-header .spacer { display: none; }
  .page-header > .muted { flex-basis: 100%; overflow-wrap: anywhere; }
  .outreach-layout,
  .outreach-tabs-grid,
  .card-grid,
  .preset-grid,
  .two-col,
  .browser-agent-layout,
  .cs-grid,
  .cs-two,
  .industry-watch-grid,
  .insights-layout,
  .insights-kpis,
  .kb-meta-grid,
  .kb-form-grid.two,
  .kb-material-toolbar,
  .kb-material-upload,
  .kb-material-layout,
  .cw-run-explainer,
  .cw-run-steps,
  .cw-two-col,
  .cw-mini-grid,
  .cw-kpi-grid,
  .cw-filter-bar { grid-template-columns: 1fr; }
  .kb-material-upload .kb-upload-wide { grid-column: auto; }
  .cw-section-head,
  .kb-head,
  .kb-section-title,
  .cw-target-head,
  .cw-report-row,
  .cw-discovery-row,
  .cw-visual-target,
  .cw-price-row,
  .cw-product { flex-direction: column; align-items: stretch; }
  .cw-visual-target { grid-template-columns: 1fr; }
  .cw-compact-finding { grid-template-columns: 1fr; }
  .cw-compact-finding strong { white-space: normal; }
  .outreach-panel,
  .browser-agent-history { position: static; }
  .cs-hero-card { grid-template-columns: 1fr; }
  .cs-live-copy,
  .cs-live-board { padding: 18px; }
  .cs-live-actions { display: grid; grid-template-columns: 1fr; }
  .cs-turn { max-width: 100%; }
  .browser-context-row { grid-template-columns: 1fr; }
  .browser-chat-head { grid-template-columns: 1fr; }
  .browser-chat-actions .btn.primary { min-width: 0; }
  .browser-guided summary { align-items: flex-start; }
  .browser-guided summary small { text-align: left; }
  .browser-event { grid-template-columns: 1fr; }
  .browser-result-top { flex-direction: column; align-items: stretch; }
  .browser-live-head { flex-direction: column; align-items: stretch; }
  .browser-artifacts { grid-template-columns: 1fr; }
  .insights-hero { flex-direction: column; }
  .insights-radius { text-align: left; }
  .kb-asset-grid { max-height: none; }
  .kb-asset-detail { position: static; }
}
