﻿:root {
  --bg:       #F5F6F8;
  --surface:  #FFFFFF;
  --elevated: #F0F2F5;
  --border:   #E2E5EA;
  --border2:  #CDD1D9;
  --accent:   #2563EB;
  --accent-d: #1D4ED8;
  --accent-bg:#EFF6FF;
  --green:    #16A34A;
  --green-bg: #DCFCE7;
  --red:      #DC2626;
  --red-bg:   #FEE2E2;
  --orange:   #EA580C;
  --muted:    #6B7280;
  --text:     #111827;
  --text2:    #374151;
  --sans:     'Inter', system-ui, sans-serif;
  --r:        8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.65; min-height: 100vh; overflow: hidden; }

.app { display:flex; height:100vh; }

/* ── Sidebar ── */
.sidebar { width:300px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; overflow-y:auto; }

.logo { padding:20px 20px 16px; border-bottom:1px solid var(--border); }
.logo-mark { font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--accent); margin-bottom:4px; }
.logo-title { font-size:18px; font-weight:700; line-height:1.2; color:var(--text); }
.logo-sub { font-size:12px; color:var(--muted); margin-top:3px; }
.mode-switch { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin-top:12px; padding:3px; background:var(--elevated); border:1px solid var(--border); border-radius:8px; }
.mode-btn { border:0; background:transparent; color:var(--muted); border-radius:6px; padding:6px 8px; font-size:12px; font-weight:700; cursor:pointer; transition:background 150ms, color 150ms, box-shadow 150ms; }
.mode-btn:hover { color:var(--text2); }
.mode-btn.active { background:var(--surface); color:var(--accent); box-shadow:0 1px 2px rgba(17,24,39,.08); }

/* Tabs */
.tab-nav { display:flex; border-bottom:1px solid var(--border); }
.tab-btn { flex:1; padding:12px 8px; background:none; border:none; color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; transition:color 150ms, border-color 150ms; }
.tab-btn.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab-btn:hover:not(.active) { color:var(--text); }

.tab-pane { display:none; }
.tab-pane.active { display:block; }

/* Section */
.s-sec { padding:16px 18px; border-bottom:1px solid var(--border); }
.s-lbl { font-size:11px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--text2); margin-bottom:12px; }

/* Fields */
.field { margin-bottom:10px; }
.field:last-child { margin-bottom:0; }
label { display:block; font-size:13px; font-weight:500; color:var(--text2); margin-bottom:5px; }
input[type=text], input[type=number], input[type=password], input[type=search], textarea {
  width:100%; background:var(--surface); border:1.5px solid var(--border2); border-radius:var(--r);
  color:var(--text); font-family:var(--sans); font-size:14px; padding:8px 11px; outline:none;
  transition:border-color 200ms, box-shadow 200ms; }
input:focus, textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
textarea { resize:vertical; min-height:80px; }

/* Auto-expanding description textareas */
.bp-textarea, .prod-textarea {
  field-sizing: content; /* Chrome 123+, Edge 123+ — no JS needed */
  min-height: 60px;
  resize: none;
  overflow: hidden;
}

.input-key { position:relative; }
.input-key input { padding-right:34px; }
.key-toggle { position:absolute; right:9px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--muted); cursor:pointer; padding:3px; line-height:0; transition:color 150ms; }
.key-toggle:hover { color:var(--accent); }

.key-status { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); margin-top:5px; }
.dot { width:7px; height:7px; border-radius:50%; background:var(--border2); transition:background 300ms; }
.dot.saved { background:var(--green); }

.row2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }

/* Toggle */
.toggle-row { display:flex; align-items:center; justify-content:space-between; padding:8px 0; }
.toggle-label { font-size:13px; color:var(--text2); }
.toggle { position:relative; display:inline-block; width:36px; height:20px; }
.toggle input { opacity:0; width:0; height:0; }
.slider { position:absolute; inset:0; cursor:pointer; background:var(--border2); border-radius:20px; transition:background 200ms; }
.slider::before { content:''; position:absolute; width:14px; height:14px; border-radius:50%; background:#fff; left:3px; top:3px; transition:transform 200ms; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .slider { background:var(--accent); }
.toggle input:checked + .slider::before { transform:translateX(16px); }

/* Presets */
.presets { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:8px; }
.preset { background:var(--elevated); border:1.5px solid var(--border); border-radius:20px; color:var(--text2); font-size:12px; font-weight:500; padding:4px 10px; cursor:pointer; transition:all 150ms; }
.preset:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-bg); }

/* Buttons */
.btn-primary { width:100%; background:var(--accent); color:#fff; border:none; border-radius:var(--r); font-size:14px; font-weight:600; padding:11px 16px; cursor:pointer; transition:background 150ms,box-shadow 150ms,transform 100ms; box-shadow:0 1px 4px rgba(37,99,235,.3); display:flex; align-items:center; justify-content:center; gap:7px; }
.btn-primary:hover { background:var(--accent-d); box-shadow:0 4px 12px rgba(37,99,235,.35); }
.btn-primary:active { transform:translateY(1px); }
.btn-primary:disabled { background:var(--border2); color:var(--muted); cursor:not-allowed; box-shadow:none; }
.btn-ghost { width:100%; background:transparent; color:var(--accent); border:1.5px solid var(--accent); border-radius:var(--r); font-size:13px; font-weight:500; padding:8px; cursor:pointer; margin-top:6px; transition:background 150ms; display:flex; align-items:center; justify-content:center; gap:6px; }
.btn-ghost:hover { background:var(--accent-bg); }
.btn-stop { width:100%; background:transparent; color:var(--red); border:1.5px solid var(--red); border-radius:var(--r); font-size:13px; font-weight:500; padding:8px; cursor:pointer; margin-top:6px; transition:background 150ms; display:none; }
.btn-stop:hover { background:var(--red-bg); }

.error-banner { background:var(--red-bg); border:1.5px solid #FECACA; border-radius:var(--r); color:var(--red); font-size:13px; padding:10px 12px; margin-bottom:10px; display:none; }

/* DB filters */
.filter-bar { display:flex; flex-direction:column; gap:8px; }
.filter-chips { display:flex; flex-wrap:wrap; gap:5px; }
.filter-bar select { width:100%; border:1.5px solid var(--border); border-radius:var(--r); padding:7px 10px; font-size:14px; font-family:var(--sans); color:var(--text); background:var(--surface); outline:none; cursor:pointer; appearance:auto; }
.filter-bar select:focus { border-color:var(--accent); }
.filter-collapse-head { display:flex; align-items:center; justify-content:space-between; cursor:pointer; padding:6px 0 2px; user-select:none; }
.filter-collapse-head:hover .s-lbl { color:var(--accent); }
.filter-field-wrap { display:flex; flex-direction:column; gap:3px; }
.filter-field-label { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.filter-field-wrap select { width:100%; border:1.5px solid var(--border); border-radius:var(--r); padding:6px 8px; font-size:13px; font-family:var(--sans); color:var(--text); background:var(--surface); outline:none; cursor:pointer; }
.filter-field-wrap select:focus { border-color:var(--accent); }
.filter-field-active .filter-field-label { color:var(--accent); }
.filter-field-active select { border-color:var(--accent); background:var(--accent-bg); color:var(--accent); font-weight:600; }
.chip { background:var(--elevated); border:1.5px solid var(--border); border-radius:20px; color:var(--text2); font-size:12px; font-weight:500; padding:4px 10px; cursor:pointer; transition:all 150ms; }
.chip.active { border-color:var(--accent); color:var(--accent); background:var(--accent-bg); }
.chip:hover:not(.active) { border-color:var(--border2); color:var(--text); }

.db-stats { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:16px 18px; border-bottom:1px solid var(--border); }
.db-stat { background:var(--elevated); border:1px solid var(--border); border-radius:var(--r); padding:10px 12px; }
.db-stat-val { font-size:20px; font-weight:700; line-height:1; color:var(--text); }
.db-stat-val.amber { color:var(--orange); }
.db-stat-val.green { color:var(--green); }
.db-stat-lbl { font-size:11px; color:var(--muted); margin-top:3px; }

/* ── Main panel ── */
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }

/* Terminal */
.terminal-wrap { background:var(--surface); border-bottom:1px solid var(--border); }
.terminal-header { display:flex; align-items:center; justify-content:space-between; padding:9px 18px; border-bottom:1px solid var(--border); }
.terminal-title { font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); display:flex; align-items:center; gap:7px; }
.pulse { width:7px; height:7px; border-radius:50%; background:var(--border2); transition:background 300ms; }
.pulse.active { background:var(--green); animation:pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }
.progress-bar-wrap { height:3px; background:var(--elevated); }
.progress-bar { height:100%; background:var(--accent); width:0%; transition:width 300ms; }
.terminal { font-family:'Courier New', monospace; font-size:12px; color:#374151; background:#F9FAFB; padding:12px 18px; height:130px; overflow-y:auto; line-height:1.7; }
.terminal .ll { color:var(--muted); }
.terminal .ll:last-child { color:var(--text); font-weight:500; }
.terminal .le { color:var(--red); }
.terminal .ld { color:var(--green); font-weight:600; }
.terminal .lm { color:var(--muted); }

/* Stats bar */
.stats-bar { display:flex; border-bottom:1px solid var(--border); flex-shrink:0; background:var(--surface); }
.stat { flex:1; padding:14px 18px; border-right:1px solid var(--border); }
.stat:last-child { border-right:none; }
.stat-val { font-size:22px; font-weight:700; line-height:1; color:var(--text); }
.stat-val.amber { color:var(--orange); }
.stat-lbl { font-size:11px; color:var(--muted); margin-top:3px; }

/* Results table area */
.results-area { flex:1; display:flex; overflow:hidden; }
.table-wrap { flex:1; overflow:auto; }
.table-header { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg); z-index:10; }
.table-title { font-size:13px; font-weight:600; color:var(--text2); }
.table-header-tools { display:flex; align-items:center; gap:8px; min-width:0; }
.table-lead-search { width:min(320px, 34vw); height:32px; display:flex; align-items:center; gap:7px; padding:0 10px; border:1.5px solid var(--border); border-radius:var(--r); background:var(--surface); color:var(--muted); transition:border-color 150ms, box-shadow 150ms; }
.table-lead-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-bg); color:var(--accent); }
.table-lead-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--text); font:inherit; font-size:13px; }
.table-lead-search input::placeholder { color:var(--muted); }
.btn-dl { background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r); color:var(--text2); font-size:13px; font-weight:500; padding:6px 14px; cursor:pointer; transition:all 150ms; text-decoration:none; display:inline-flex; align-items:center; gap:5px; }
.btn-dl:hover { border-color:var(--accent); color:var(--accent); }

table { width:100%; border-collapse:collapse; }
thead { position:sticky; top:49px; z-index:9; }
th { background:var(--elevated); font-size:12px; font-weight:600; color:var(--muted); padding:10px 14px; text-align:left; border-bottom:1px solid var(--border); white-space:nowrap; }
td { padding:10px 14px; border-bottom:1px solid var(--border); vertical-align:top; font-size:14px; background:var(--surface); }
tr.clickable { cursor:pointer; }
tr.clickable:hover td { background:#F0F4FF; }
tr.selected td { background:#EFF6FF; }

.score-badge { display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; width:38px; height:24px; border-radius:6px; }
.sh { background:var(--red-bg); color:var(--red); }
.sm { background:#FEF3C7; color:var(--orange); }
.sl { background:var(--elevated); color:var(--muted); }

.flag-pill { display:inline-block; font-size:11px; font-weight:500; padding:2px 7px; border-radius:4px; margin:1px 2px 1px 0; }
.flag-pill.flag-bad  { background:#FEF3C7; color:#92400E; border:1px solid #FDE68A; }
.flag-pill.flag-good { background:#DCFCE7; color:#166534; border:1px solid #86EFAC; }
.flag-pill.no_website { background:var(--red-bg); color:#991B1B; border-color:#FECACA; }
.flag-pill.single_language { background:#EFF6FF; color:#1E40AF; border-color:#BFDBFE; }

.cell-name { font-weight:600; color:var(--text); font-size:14px; }
.cell-addr { font-size:12px; color:var(--muted); margin-top:1px; }
.cell-link { color:var(--accent); text-decoration:none; font-size:13px; }
.cell-link:hover { text-decoration:underline; }
.cell-phone { font-size:13px; color:var(--text2); white-space:nowrap; }
.cell-signal { font-size:12px; color:var(--text2); line-height:1.5; max-width:200px; }
.rating { display:flex; align-items:center; gap:3px; font-size:13px; }
.star { color:#F59E0B; }
.sent-badge { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; color:var(--green); }

.empty-state { text-align:center; padding:60px 20px; color:var(--muted); }
.empty-icon { font-size:36px; margin-bottom:10px; opacity:.3; }
.empty-title { font-size:15px; font-weight:600; margin-bottom:6px; color:var(--text2); }
.empty-sub { font-size:13px; }

/* ── Profile panel ── */
.profile-panel {
  width:0; flex-shrink:0; overflow:hidden;
  background:var(--surface); border-left:0 solid var(--border);
  transition:width 300ms cubic-bezier(.4,0,.2,1), border-width 0ms 300ms;
  display:flex; flex-direction:row; position:relative;
}
.profile-panel.open {
  width:380px; border-left-width:1px;
  transition:width 300ms cubic-bezier(.4,0,.2,1);
}
.profile-resize-handle {
  width:5px; flex-shrink:0; cursor:col-resize;
  background:transparent; position:absolute; left:0; top:0; bottom:0; z-index:10;
}
.profile-resize-handle:hover, .profile-resize-handle.dragging { background:var(--accent); opacity:.4; }
.profile-inner { flex:1; min-width:0; display:flex; flex-direction:column; height:100%; overflow-y:auto; }

.pp-header { display:flex; align-items:flex-start; justify-content:space-between; padding:18px 18px 14px; border-bottom:1px solid var(--border); }
.pp-name { font-size:18px; font-weight:700; line-height:1.3; margin-bottom:4px; }
.pp-addr { font-size:13px; color:var(--muted); line-height:1.5; }
.pp-close { background:none; border:none; color:var(--muted); cursor:pointer; padding:4px; line-height:0; transition:color 150ms; flex-shrink:0; margin-left:8px; border-radius:4px; }
.pp-close:hover { color:var(--text); background:var(--elevated); }

.pp-score { padding:14px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:14px; }
.pp-score-big { font-size:36px; font-weight:700; line-height:1; }
.pp-score-big.sh { color:var(--red); }
.pp-score-big.sm { color:var(--orange); }
.pp-score-big.sl { color:var(--muted); }
.pp-score-label { font-size:12px; color:var(--muted); }
.pp-flags { display:flex; flex-wrap:wrap; gap:4px; margin-top:8px; }

.pp-section { padding:14px 18px; border-bottom:1px solid var(--border); }
.pp-section-title { font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-bottom:10px; }
.pp-row { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; gap:8px; }
.pp-row:last-child { margin-bottom:0; }
.pp-key { font-size:14px; color:var(--muted); white-space:nowrap; }
.pp-val { font-size:14px; font-weight:500; color:var(--text); text-align:right; word-break:break-all; }
.pp-val a { color:var(--accent); text-decoration:none; }
.pp-val a:hover { text-decoration:underline; }

/* Email sent checkbox */
.pp-action { padding:16px 18px; border-bottom:1px solid var(--border); }
.checkbox-row { display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.checkbox-row input[type=checkbox] { display:none; }
.custom-cb { width:20px; height:20px; border-radius:5px; border:2px solid var(--border2); background:var(--surface); flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:all 200ms; }
.custom-cb svg { opacity:0; transition:opacity 150ms; }
.checkbox-row input:checked ~ .custom-cb { background:var(--green); border-color:var(--green); }
.checkbox-row input:checked ~ .custom-cb svg { opacity:1; }
.checkbox-row.status-row { margin-top:8px; }
.cb-label { font-size:14px; font-weight:500; color:var(--text); }
.cb-date { font-size:12px; color:var(--muted); margin-top:4px; }

.pp-notes { padding:14px 18px; flex:1; display:flex; flex-direction:column; gap:8px; }
.pp-notes textarea { flex:1; min-height:100px; }
.btn-save { background:var(--elevated); border:1.5px solid var(--border); border-radius:var(--r); color:var(--text2); font-size:13px; font-weight:500; padding:8px 14px; cursor:pointer; transition:all 150ms; width:100%; }
.btn-save:hover { border-color:var(--accent); color:var(--accent); }
.btn-save.saved { border-color:var(--green); color:var(--green); background:var(--green-bg); }

/* Scrollbar */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:var(--elevated); }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--muted); }

/* ── Lists ── */
.lists-section { padding:14px 18px; border-bottom:1px solid var(--border); }
.lists-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.btn-new-list { background:var(--accent-bg); border:1.5px solid #93C5FD; color:var(--accent); font-size:12px; font-weight:700; cursor:pointer; padding:6px 14px; border-radius:7px; display:flex; align-items:center; gap:5px; transition:all 150ms; font-family:var(--sans); }
.btn-new-list:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
.list-item { display:flex; align-items:center; justify-content:space-between; padding:7px 10px; border-radius:var(--r); cursor:pointer; transition:background 150ms; gap:6px; margin-bottom:2px; }
.list-item:hover { background:var(--elevated); }
.list-item.active { background:var(--accent-bg); }
.list-item-name { font-size:13px; font-weight:500; color:var(--text); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list-item.active .list-item-name { color:var(--accent); }
.list-item-count { font-size:12px; color:var(--muted); background:var(--elevated); border-radius:10px; padding:1px 7px; flex-shrink:0; }
.list-item.active .list-item-count { background:var(--accent); color:#fff; }
.list-item-del { background:none; border:none; color:var(--border2); cursor:pointer; padding:2px; line-height:0; border-radius:3px; flex-shrink:0; transition:color 150ms; }
.list-item-del:hover { color:var(--red); }
.list-all { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:var(--r); cursor:pointer; font-size:13px; font-weight:500; color:var(--muted); margin-bottom:2px; transition:background 150ms; }
.list-all:hover { background:var(--elevated); color:var(--text); }
.list-all.active { color:var(--text2); font-weight:600; }
.list-all .list-item-count { background:var(--border); }
.list-all.active .list-item-count { background:var(--accent); color:#fff; }
.new-list-form { display:none; margin-top:8px; gap:6px; }
.new-list-form.open { display:flex; }
.new-list-form input { flex:1; }
.btn-add-list-ok { background:var(--accent); color:#fff; border:none; border-radius:var(--r); padding:7px 12px; font-size:13px; font-weight:600; cursor:pointer; }

/* Add-to-list dropdown */
.atl-wrap { position:relative; display:inline-block; }
.atl-btn { background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r); color:var(--text2); font-size:13px; font-weight:500; padding:6px 12px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:all 150ms; white-space:nowrap; }
.atl-btn:hover { border-color:var(--accent); color:var(--accent); }
.atl-dropdown { position:absolute; right:0; top:calc(100% + 4px); background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r); box-shadow:0 4px 16px rgba(0,0,0,.1); z-index:100; min-width:180px; padding:4px 0; display:none; }
.atl-dropdown.open { display:block; }
.atl-option { padding:8px 14px; font-size:13px; color:var(--text); cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:8px; transition:background 150ms; }
.atl-option:hover { background:var(--elevated); }
.atl-option .in-list { color:var(--green); font-size:11px; font-weight:600; }
.atl-divider { height:1px; background:var(--border); margin:4px 0; }
.atl-new { padding:8px 14px; font-size:12px; color:var(--accent); cursor:pointer; font-weight:600; }
.atl-new:hover { background:var(--accent-bg); }
.atl-empty { padding:8px 14px; font-size:12px; color:var(--muted); }

/* existing badge in search results */
.existing-badge { display:inline-flex; align-items:center; gap:3px; font-size:11px; color:var(--muted); background:var(--elevated); border-radius:4px; padding:1px 6px; margin-left:5px; }

/* inline list manager in profile */
.pp-list-row { display:flex; align-items:center; gap:6px; padding:6px 0; border-bottom:1px solid var(--border); }
.pp-list-row:last-child { border-bottom:none; }
.pp-list-row-name { flex:1; font-size:13px; font-weight:500; color:var(--text); }
.pp-list-row-name.in-list { color:var(--accent); }
.pp-list-in-badge { font-size:11px; color:var(--green); font-weight:600; background:var(--green-bg); border-radius:4px; padding:1px 6px; }
.pp-list-action { background:var(--elevated); border:1.5px solid var(--border); border-radius:6px; color:var(--text2); font-size:11px; font-weight:500; padding:4px 8px; cursor:pointer; white-space:nowrap; transition:all 150ms; }
.pp-list-action:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-bg); }
.pp-list-action.move { border-color:var(--border); }
.pp-list-action.move:hover { border-color:var(--orange); color:var(--orange); background:#FFF7ED; }
.pp-list-action.remove { border-color:var(--border); }
.pp-list-action.remove:hover { border-color:var(--red); color:var(--red); background:var(--red-bg); }
.pp-list-new { display:flex; gap:6px; margin-top:8px; }
.pp-list-new input { flex:1; }
.pp-list-new button { background:var(--accent); color:#fff; border:none; border-radius:var(--r); padding:6px 12px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }

/* ── Preset cards ── */
.preset-card { background:var(--surface); border:2px solid var(--border); border-radius:10px; padding:16px 18px; margin-bottom:10px; transition:border-color 150ms,box-shadow 150ms; }
.preset-card.default { border-color:var(--accent); background:var(--accent-bg); box-shadow:0 0 0 4px rgba(37,99,235,.07); }
.preset-card-head { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.preset-card-name { font-size:15px; font-weight:700; color:var(--text); flex:1; }
.preset-default-badge { font-size:11px; font-weight:700; color:var(--accent); background:#DBEAFE; border:1.5px solid #93C5FD; border-radius:5px; padding:2px 8px; text-transform:uppercase; letter-spacing:.05em; white-space:nowrap; }
.preset-card-desc { font-size:13px; color:var(--text2); margin-bottom:10px; line-height:1.5; }
.preset-card-meta { font-size:12px; color:var(--muted); font-weight:500; margin-bottom:10px; }
.preset-card-actions { display:flex; gap:6px; }

/* ── Preset editor modal ── */
.rules-table { width:100%; border-collapse:collapse; font-size:13px; }
.rules-table th { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; padding:6px 8px; text-align:left; border-bottom:2px solid var(--border); background:var(--elevated); }
.rules-table td { padding:6px 8px; border-bottom:1px solid var(--border); vertical-align:middle; }
.rules-table tr:last-child td { border-bottom:none; }
.rules-table input[type=text], .rules-table input[type=number], .rules-table select { width:100%; border:1.5px solid var(--border); border-radius:5px; padding:5px 7px; font-size:12px; color:var(--text); background:var(--surface); font-family:var(--sans); outline:none; }
.rules-table input:focus, .rules-table select:focus { border-color:var(--accent); }
.rules-table input[type=number] { width:56px; }
.rule-enable-toggle { width:32px; height:18px; position:relative; display:inline-block; cursor:pointer; }
.rule-enable-toggle input { opacity:0; width:0; height:0; }
.ret-slider { position:absolute; inset:0; background:var(--border2); border-radius:18px; transition:background 200ms; }
.ret-slider::before { content:''; position:absolute; width:12px; height:12px; border-radius:50%; background:#fff; left:3px; top:3px; transition:transform 200ms; }
.rule-enable-toggle input:checked + .ret-slider { background:var(--accent); }
.rule-enable-toggle input:checked + .ret-slider::before { transform:translateX(14px); }
.btn-add-rule { background:var(--elevated); border:1.5px dashed var(--border2); border-radius:var(--r); color:var(--accent); font-size:13px; font-weight:500; padding:8px 14px; cursor:pointer; width:100%; margin-top:8px; transition:all 150ms; }
.btn-add-rule:hover { background:var(--accent-bg); border-color:var(--accent); }

/* ── List preset tag ── */
.list-preset-tag { font-size:10px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:3px; cursor:pointer; }
.list-preset-tag:hover { color:var(--accent); }
.list-preset-select { display:none; position:absolute; right:0; top:100%; background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r); box-shadow:0 4px 16px rgba(0,0,0,.1); z-index:200; min-width:180px; padding:4px 0; }
.list-preset-select.open { display:block; }
.list-item-wrap { position:relative; }
.lps-item { padding:8px 12px; font-size:13px; color:var(--text); cursor:pointer; transition:background 150ms; display:flex; align-items:center; gap:6px; }
.lps-item:hover { background:var(--elevated); }
.lps-item.active { color:var(--accent); font-weight:600; }
.lps-none { padding:8px 12px; font-size:12px; color:var(--muted); }

/* ── Scrape progress toast ── */
.scrape-toast { position:fixed; bottom:80px; right:20px; background:var(--text); color:#fff; border-radius:12px; padding:14px 16px; width:300px; box-shadow:0 8px 32px rgba(0,0,0,.3); z-index:600; display:none; }
.scrape-toast.visible { display:block; }
.st-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.st-title { font-size:13px; font-weight:600; }
.st-cancel { background:none; border:none; color:rgba(255,255,255,.6); cursor:pointer; font-size:12px; padding:0; }
.st-cancel:hover { color:#fff; }
.st-bar-wrap { height:4px; background:rgba(255,255,255,.2); border-radius:2px; margin-bottom:6px; }
.st-bar { height:100%; background:var(--accent); border-radius:2px; transition:width 300ms; width:0%; }
.st-text { font-size:11px; color:rgba(255,255,255,.7); line-height:1.5; }

/* ── Profile edit mode ── */
.pp-toolbar { display:flex; gap:6px; padding:10px 18px; border-bottom:1px solid var(--border); background:var(--elevated); }
.btn-pp { background:var(--elevated); border:2px solid var(--border2); border-radius:7px; color:var(--text); font-size:12px; font-weight:600; padding:7px 14px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:all 150ms; white-space:nowrap; font-family:var(--sans); }
.btn-pp:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-bg); }
.btn-pp.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-pp.primary:hover { background:var(--accent-d); }
.btn-pp.danger:hover { border-color:var(--red); color:var(--red); background:var(--red-bg); }

/* ── Toast notifications ── */
.toast { position:fixed; bottom:24px; right:24px; z-index:9999; background:var(--text); color:#fff; font-size:13px; font-weight:500; border-radius:10px; padding:11px 18px; max-width:360px; box-shadow:0 4px 20px rgba(0,0,0,.25); opacity:0; transform:translateY(8px); transition:opacity 250ms, transform 250ms; pointer-events:none; }
.toast.toast-show { opacity:1; transform:translateY(0); }
.toast.toast-success { background:#22c55e; }
.toast.toast-error { background:var(--red,#ef4444); }
.toast.toast-info { background:var(--accent); }

/* ── Social Platforms settings ── */
.sp-row { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--border); }
.sp-row:last-child { border-bottom:none; }
.sp-enabled input { accent-color:var(--accent); cursor:pointer; }
.sp-domain { font-family:'Courier New',monospace; font-size:12px; color:var(--text); flex:1; min-width:0; }
.sp-field-badge { font-size:11px; font-weight:600; background:var(--accent-bg); color:var(--accent); border-radius:4px; padding:2px 7px; white-space:nowrap; }
.sp-label { font-size:12px; color:var(--muted); min-width:70px; }
.sp-del { background:none; border:none; cursor:pointer; color:var(--muted); padding:4px; border-radius:4px; display:flex; }
.sp-del:hover { color:var(--red,#ef4444); background:var(--red-bg,#fef2f2); }
.sp-add-form { display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
.sp-add-form input { border:1.5px solid var(--border2); border-radius:var(--r); padding:8px 10px; font-size:13px; background:var(--surface); color:var(--text); outline:none; font-family:var(--sans); }
.sp-add-form input:focus { border-color:var(--accent); }

/* ── Scrape targets checklist ── */
.scrape-targets { display:flex; flex-direction:column; gap:6px; }
.scrape-target-cb { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; color:var(--text); padding:7px 10px; border:1.5px solid var(--border); border-radius:7px; transition:border-color 150ms, background 150ms; }
.scrape-target-cb:hover { border-color:var(--border2); background:var(--elevated); }
.scrape-target-cb input[type=checkbox] { accent-color:var(--accent); width:15px; height:15px; cursor:pointer; flex-shrink:0; }
.scrape-target-cb span { flex:1; font-weight:500; }
.scrape-target-cb small { font-size:10px; color:var(--muted); font-family:'Courier New',monospace; }

.edit-field { margin-bottom:10px; }
.edit-field label { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; display:block; margin-bottom:4px; }
.edit-field input, .edit-field textarea { width:100%; background:var(--surface); border:1.5px solid var(--border2); border-radius:6px; color:var(--text); font-family:var(--sans); font-size:13px; padding:7px 10px; outline:none; transition:border-color 200ms,box-shadow 200ms; }
.edit-field input:focus, .edit-field textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.edit-field textarea { resize:vertical; min-height:60px; }
.edit-row2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ef-computed { font-size:12px; color:var(--muted); background:var(--elevated); border:1.5px dashed var(--border); border-radius:6px; padding:7px 10px; font-family:'Courier New',monospace; user-select:none; }

/* ── Modal ── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:1000; display:none; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal { background:var(--surface); border-radius:12px; box-shadow:0 20px 60px rgba(0,0,0,.2); width:520px; max-width:95vw; max-height:90vh; display:flex; flex-direction:column; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 20px 14px; border-bottom:1px solid var(--border); }
.modal-title { font-size:16px; font-weight:700; color:var(--text); }
.modal-close { background:none; border:none; color:var(--muted); cursor:pointer; padding:4px; line-height:0; border-radius:4px; transition:color 150ms; }
.modal-close:hover { color:var(--text); background:var(--elevated); }
.modal-body { padding:18px 20px; overflow-y:auto; flex:1; }
.modal-body .field { margin-bottom:12px; }
.modal-body .row2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.modal-foot { padding:14px 20px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; }
.btn-modal-cancel { background:var(--elevated); border:1.5px solid var(--border); border-radius:var(--r); color:var(--text2); font-size:13px; font-weight:500; padding:9px 18px; cursor:pointer; transition:all 150ms; }
.btn-modal-cancel:hover { border-color:var(--border2); }
.btn-modal-ok { background:var(--accent); color:#fff; border:none; border-radius:var(--r); font-size:13px; font-weight:600; padding:9px 18px; cursor:pointer; transition:background 150ms; }
.btn-modal-ok:hover { background:var(--accent-d); }
.btn-modal-secondary { background:var(--elevated); border:1.5px solid var(--accent); border-radius:var(--r); color:var(--accent); font-size:13px; font-weight:600; padding:9px 18px; cursor:pointer; transition:all 150ms; }
.btn-modal-secondary:hover { background:var(--accent); color:#fff; }

/* ── Bulk action bar ── */
.bulk-bar { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(80px); background:var(--text); color:#fff; border-radius:12px; padding:12px 16px; display:flex; align-items:center; gap:12px; box-shadow:0 8px 32px rgba(0,0,0,.3); z-index:500; transition:transform 300ms cubic-bezier(.4,0,.2,1), opacity 300ms; opacity:0; pointer-events:none; min-width:360px; }
.bulk-bar.visible { transform:translateX(-50%) translateY(0); opacity:1; pointer-events:all; }
.bulk-count { font-size:13px; font-weight:600; white-space:nowrap; }
.bulk-sep { width:1px; height:20px; background:rgba(255,255,255,.2); }
.bulk-actions { display:flex; gap:6px; flex:1; }
.btn-bulk { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:7px; color:#fff; font-size:12px; font-weight:500; padding:6px 12px; cursor:pointer; transition:background 150ms; white-space:nowrap; }
.btn-bulk:hover { background:rgba(255,255,255,.22); }
.btn-bulk.danger:hover { background:#DC2626; border-color:#DC2626; }
.bulk-close { background:none; border:none; color:rgba(255,255,255,.6); cursor:pointer; padding:4px; line-height:0; border-radius:4px; margin-left:4px; }
.bulk-close:hover { color:#fff; }

/* Bulk list-picker dropdown */
.bulk-list-picker { position:fixed; background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r); box-shadow:0 4px 20px rgba(0,0,0,.15); z-index:600; min-width:200px; padding:4px 0; display:none; }
.bulk-list-picker.open { display:block; }
.bulk-list-picker-item { padding:9px 14px; font-size:13px; color:var(--text); cursor:pointer; transition:background 150ms; }
.bulk-list-picker-item:hover { background:var(--elevated); }
.bulk-list-picker-empty { padding:9px 14px; font-size:12px; color:var(--muted); }

/* ── Checkbox column ── */
.cb-col { width:32px; padding:10px 8px 10px 14px !important; }
.row-cb { width:16px; height:16px; border-radius:4px; border:2px solid var(--border2); appearance:none; cursor:pointer; transition:all 150ms; display:block; flex-shrink:0; }
.row-cb:checked { background:var(--accent); border-color:var(--accent); background-image:url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 5L4 7L8 3' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:center; }
.row-cb:hover:not(:checked) { border-color:var(--accent); }
th.cb-col { background:var(--elevated); }

/* ── Events / Communication history ── */
.pp-events { padding:14px 18px; border-bottom:1px solid var(--border); }
.event-item { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); }
.event-item:last-child { border-bottom:none; }
.event-icon { width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; margin-top:2px; }
.event-icon.email { background:#EFF6FF; }
.event-icon.call  { background:#F0FDF4; }
.event-icon.visit { background:#FFF7ED; }
.event-icon.note  { background:var(--elevated); }
.event-body { flex:1; min-width:0; }
.event-subject { font-size:14px; font-weight:600; color:var(--text); line-height:1.3; }
.event-note { font-size:13px; color:var(--text2); margin-top:2px; line-height:1.5; }
.event-meta { font-size:12px; color:var(--muted); margin-top:3px; }
.email-delivery-summary { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:7px; }
.email-delivery-status { display:inline-flex; align-items:center; min-height:20px; padding:2px 7px; border-radius:5px; font-size:11px; font-weight:700; background:var(--elevated); color:var(--text2); }
.email-delivery-status.success { background:#ECFDF3; color:#15803D; }
.email-delivery-status.warning { background:#FFF7ED; color:#C2410C; }
.email-delivery-status.danger { background:#FEF2F2; color:#B91C1C; }
.email-delivery-metrics { font-size:11px; color:var(--text2); }
.email-delivery-link { font-size:11px; color:var(--accent); text-decoration:none; }
.email-delivery-link:hover { text-decoration:underline; }
.email-delivery-reason { flex-basis:100%; font-size:11px; line-height:1.4; color:var(--red); overflow-wrap:anywhere; }
.event-del { background:none; border:none; color:var(--border2); cursor:pointer; padding:2px; line-height:0; border-radius:3px; flex-shrink:0; align-self:flex-start; margin-top:4px; transition:color 150ms; }
.event-del:hover { color:var(--red); }
.add-event-form { margin-top:10px; padding-top:10px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px; }
.event-type-tabs { display:flex; gap:4px; flex-wrap:wrap; }
.event-type-btn { background:var(--elevated); border:1.5px solid var(--border); border-radius:20px; color:var(--text2); font-size:13px; font-weight:500; padding:5px 12px; cursor:pointer; transition:all 150ms; }
.event-type-btn.active { background:var(--accent-bg); border-color:var(--accent); color:var(--accent); }
.btn-add-event { background:var(--accent); color:#fff; border:none; border-radius:var(--r); font-size:14px; font-weight:600; padding:8px 14px; cursor:pointer; transition:background 150ms; }
.btn-add-event:hover { background:var(--accent-d); }

/* ── Outreach modal ── */
.outreach-modal { width:98vw; max-width:98vw; }
.outreach-modal .modal-body { padding:0; display:flex; flex-direction:column; max-height:88vh; overflow:hidden; }
.outreach-split { display:flex; flex:1; overflow:hidden; min-height:0; }
.outreach-left-col { width:300px; flex-shrink:0; overflow-y:auto; border-right:1px solid var(--border); background:var(--surface); display:flex; flex-direction:column; }
.outreach-lead-panel { padding:14px 16px; }
.outreach-main { flex:1; min-width:0; overflow-y:auto; padding:16px 20px; border-right:1px solid var(--border); }
.outreach-settings { width:0; flex-shrink:0; overflow:hidden; background:#fff; border-left:0 solid var(--border); transition:width 260ms ease; display:flex; flex-direction:column; }
.outreach-settings.open { width:300px; border-left-width:1px; }
.outreach-settings-inner { width:300px; padding:14px 14px; overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:12px; box-sizing:border-box; }
.outreach-settings-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin-bottom:10px; }
.outreach-side-card { background:#fff; border:1px solid var(--border); border-radius:8px; padding:12px; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.outreach-draft-grid { display:grid; grid-template-columns:minmax(0, 2fr) minmax(260px, 1fr); gap:14px; align-items:start; }
.outreach-draft-col { min-width:0; }
.outreach-inline-revision { min-width:0; background:#fff; border:1px solid var(--border); border-radius:8px; padding:12px; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.revision-chat-log { height:210px; max-height:26vh; overflow-y:auto; border:1px solid #dbe4f0; border-radius:10px; background:linear-gradient(180deg,#f8fafc 0%,#eef4ff 100%); padding:10px; display:flex; flex-direction:column; gap:8px; box-sizing:border-box; }
.revision-chat-empty { color:var(--muted); font-size:12px; line-height:1.45; padding:4px 2px; }
.revision-bubble { align-self:flex-end; max-width:92%; background:linear-gradient(135deg,#2563eb,#4f46e5); color:#fff; border-radius:14px 14px 4px 14px; padding:8px 11px; font-size:12px; line-height:1.45; white-space:pre-wrap; word-break:break-word; box-shadow:0 8px 18px rgba(37,99,235,.20); }
.revision-input { margin-top:10px; width:100%; min-height:72px; max-height:130px; resize:none; border:1.5px solid #d3dce9; border-radius:10px; padding:10px 11px; font-size:13px; font-family:var(--sans); color:var(--text); background:#fff; outline:none; line-height:1.45; box-sizing:border-box; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.revision-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.08); }
.revision-actions { display:flex; align-items:center; gap:8px; margin-top:8px; }
.revision-settings-btn { border:none; background:transparent; color:var(--accent); font-size:12px; cursor:pointer; padding:5px 0; }
.revision-send-btn { margin-left:auto; }
.revision-hint { margin-top:8px; color:var(--muted); font-size:11px; line-height:1.45; }
.chat-empty { color:var(--muted); font-size:12px; line-height:1.5; padding:4px 2px; }
.chat-row { display:flex; flex-direction:column; width:100%; gap:5px; }
.chat-row.is-user { align-items:flex-end; }
.chat-row.is-assistant { align-items:flex-start; }
.chat-bubble { max-width:88%; border-radius:15px; padding:9px 11px; font-size:12px; line-height:1.45; white-space:pre-wrap; word-break:break-word; box-shadow:0 8px 20px rgba(15,23,42,.08); }
.chat-row.is-user .chat-bubble { background:linear-gradient(135deg,#2563eb,#4f46e5); color:#fff; border-radius:15px 15px 4px 15px; }
.chat-row.is-assistant .chat-bubble { background:rgba(255,255,255,.94); color:var(--text); border:1px solid #dce5f2; border-radius:15px 15px 15px 4px; }
.action-log { max-width:88%; font-size:11px; line-height:1.45; display:flex; flex-direction:column; gap:3px; padding:7px 9px; border:1px solid #dce5f2; border-radius:10px; background:rgba(255,255,255,.72); color:var(--text2); box-shadow:0 4px 12px rgba(15,23,42,.05); }
.action-log-row { display:flex; align-items:baseline; gap:5px; color:var(--text2); }
.action-log-tool { font-weight:600; color:var(--text2); }
.action-log-ok { color:var(--green); }
.action-log-err { color:var(--red); font-weight:500; }
.chat-send-btn {
  width:42px;
  height:42px;
  flex:0 0 42px;
  border:none;
  border-radius:12px;
  background:linear-gradient(135deg,#2563eb,#4f46e5);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(37,99,235,.24);
  transition:transform 150ms, box-shadow 150ms, opacity 150ms;
}
.chat-send-btn:hover { transform:translateY(-1px); box-shadow:0 10px 22px rgba(37,99,235,.30); }
.chat-send-btn:disabled { opacity:.58; cursor:wait; transform:none; }
.chat-send-btn.is-loading .send-icon { animation:sendPulse 850ms ease-in-out infinite; }
@keyframes sendPulse {
  0%,100% { transform:translateX(0); opacity:1; }
  50% { transform:translateX(3px); opacity:.68; }
}
.om-products-section { padding:0 16px 16px; border-top:1px solid var(--border); padding-top:14px; flex:1; overflow-y:auto; }
.om-products-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin-bottom:10px; }
.om-lang-inline { width:92px; flex-shrink:0; font-size:12px; padding:7px 8px; }
.btn-icon-copy { width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; border:1.5px solid var(--border); border-radius:7px; background:var(--elevated); color:var(--text2); cursor:pointer; transition:all 150ms; flex-shrink:0; }
.btn-icon-copy:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-bg); }
.outreach-toggle-btn { background:var(--elevated); border:1.5px solid var(--border); border-radius:6px; color:var(--muted); font-size:11px; font-weight:500; padding:4px 10px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:all 150ms; white-space:nowrap; }
.outreach-toggle-btn:hover, .outreach-toggle-btn.active { border-color:var(--accent); color:var(--accent); background:var(--accent-bg); }
.outreach-draft-area { border-top:1px solid var(--border); padding:14px 20px; flex-shrink:0; background:var(--surface); }
.outreach-lead-card { background:var(--elevated); border:1px solid var(--border); border-radius:var(--r); padding:12px 14px; margin-bottom:14px; }
.ol-title { font-size:15px; font-weight:700; color:var(--text); margin-bottom:8px; }
.ol-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; }
.ol-grid div { font-size:12px; color:var(--text2); display:flex; gap:6px; flex-wrap:wrap; }
.ol-grid span { color:var(--muted); white-space:nowrap; }
.ol-grid strong { font-weight:500; word-break:break-all; }
.ol-signal { font-size:11px; color:var(--orange); font-weight:500; margin-top:6px; background:#FFF7ED; border-radius:4px; padding:4px 8px; }
.outreach-select { width:100%; border:1.5px solid var(--border2); border-radius:var(--r); padding:8px 10px; font-size:13px; font-family:var(--sans); color:var(--text); background:var(--surface); outline:none; }
.outreach-select:focus { border-color:var(--accent); }
.outreach-status { font-size:13px; padding:6px 0; line-height:1.5; }
.outreach-status.error { color:var(--red); }
.outreach-status.success { color:var(--green); }
.outreach-status.info { color:var(--muted); font-style:italic; }
.outreach-actions { display:flex; gap:8px; margin:10px 0; }
.products-list { display:flex; flex-direction:column; gap:2px; }
.product-row { display:flex; align-items:flex-start; gap:9px; padding:7px 8px; cursor:pointer; border-radius:6px; transition:background 120ms; }
.product-row:hover { background:var(--elevated); }
.product-row input[type=checkbox] { width:16px; height:16px; accent-color:var(--accent); cursor:pointer; flex-shrink:0; margin-top:3px; }
.prod-body { display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.prod-name-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.product-row .prod-label { font-size:13px; font-weight:600; color:var(--text); line-height:1.3; }
.prod-desc-toggle { background:none; border:none; color:var(--accent); font-size:11px; cursor:pointer; padding:0; flex-shrink:0; }
.prod-desc-text { font-size:12px; color:var(--text2); line-height:1.55; white-space:pre-wrap; border-left:2px solid var(--border2); padding-left:8px; margin-top:2px; }

/* ── Outreach preset editor modal ── */
.op-editor-modal { width:980px; max-width:96vw; }
/* ── Reusable Prompt Editor Block ── */
.pe-wrap { display:flex; gap:0; border:2px solid var(--border2); border-radius:8px; overflow:hidden; min-height:200px; box-shadow:0 1px 4px rgba(0,0,0,.06); align-items:stretch; }
.pe-textarea { flex:1; min-width:0; border:none; outline:none; padding:14px 16px; font-size:13px; font-family:'Courier New',monospace; color:var(--text); background:var(--surface); resize:none; line-height:1.7; min-height:200px; box-sizing:border-box; overflow:hidden; field-sizing:content; }
.pe-textarea:focus { background:var(--surface); }
.pe-sidebar { width:220px; flex-shrink:0; background:#F8F9FC; border-left:2px solid var(--border); padding:14px; overflow-y:auto; }
.pe-ph-title { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:var(--text2); margin-bottom:10px; }
.pe-group-title { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin:12px 0 5px; padding-top:10px; border-top:1px solid var(--border2); }
.pe-group-collapsible { display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none; padding:2px 0; border-radius:3px; }
.pe-group-collapsible:hover { color:var(--text2); }
.pe-group-arrow { font-size:10px; transition:transform 150ms; display:inline-block; }
.pe-group-items { }
.pe-group-title:first-of-type { margin-top:0; border-top:none; }
.pe-ph-item { display:flex; flex-direction:column; gap:2px; padding:6px 7px; margin:0 -7px; border-radius:6px; cursor:pointer; transition:background 150ms; }
.pe-ph-item:hover { background:var(--accent-bg); }
.pe-ph-key { font-size:12px; font-weight:700; color:var(--accent); font-family:monospace; }
.pe-ph-desc { font-size:11px; color:var(--text2); }

/* Outreach preset editor */
.op-editor-modal .modal-body { padding:16px 18px; overflow-y:auto; max-height:80vh; }
.op-editor-body { display:flex; flex-direction:column; }
.op-ph-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin-bottom:8px; }
.op-ph-item { display:flex; flex-direction:column; gap:2px; padding:5px 6px; margin:0 -6px; border-radius:4px; cursor:pointer; transition:background 150ms; border-bottom:1px solid var(--border); }
.op-ph-item:last-child { border-bottom:none; }
.op-ph-item:hover { background:var(--border); }
.op-ph-key { font-size:11px; font-weight:600; color:var(--accent); font-family:monospace; }
.op-ph-desc { font-size:10px; color:var(--muted); }
.op-meta-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:18px; }
.op-prompt-label { font-size:13px; font-weight:700; color:var(--text); margin-bottom:8px; letter-spacing:.02em; padding-bottom:6px; border-bottom:2px solid var(--border); }

/* ── Products in Settings ── */
.prod-settings-row { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--border); }
.prod-settings-row:last-child { border-bottom:none; }
.prod-settings-name { flex:1; font-size:13px; color:var(--text); font-weight:500; }
.prod-settings-key { font-size:11px; color:var(--muted); font-family:monospace; background:var(--elevated); border-radius:3px; padding:1px 5px; }
.btn-prod-del { background:none; border:none; color:var(--border2); cursor:pointer; padding:2px; line-height:0; border-radius:3px; transition:color 150ms; }
.btn-prod-del:hover { color:var(--red); }

/* ── Outreach presets in Settings ── */
.op-preset-card { background:var(--surface); border:2px solid var(--border); border-radius:10px; padding:16px 18px; margin-bottom:10px; display:flex; align-items:flex-start; gap:12px; transition:border-color 150ms,box-shadow 150ms; }
.op-preset-info { flex:1; min-width:0; }
.op-preset-name { font-size:15px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:8px; }
.op-preset-desc { font-size:13px; color:var(--text2); margin-top:4px; line-height:1.5; }
.op-preset-actions { display:flex; gap:6px; flex-shrink:0; }

/* ── Outreach modal ── */
.pp-events-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.outreach-lead-card { background:var(--elevated); border:1px solid var(--border); border-radius:var(--r); padding:12px 14px; margin-bottom:14px; }
.ol-title { font-size:16px; font-weight:700; color:var(--text); margin-bottom:8px; }
.ol-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; }
.ol-grid div { min-width:0; }
.ol-grid span { display:block; font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin-bottom:2px; }
.ol-grid strong { display:block; font-size:12px; font-weight:500; color:var(--text2); word-break:break-word; }
.ol-grid a { color:var(--accent); text-decoration:none; }
.ol-grid a:hover { text-decoration:underline; }
.outreach-select { width:100%; border:1.5px solid var(--border2); border-radius:var(--r); padding:8px 10px; font-size:13px; font-family:var(--sans); color:var(--text); background:var(--surface); outline:none; }
.outreach-actions { display:flex; gap:8px; align-items:center; margin:4px 0 12px; }
.outreach-actions .om-lang-inline {
  width: 92px;
  max-width: 92px;
  min-width: 92px;
  height: 36px;
  flex: 0 0 92px;
  padding: 7px 8px;
  font-size: 12px;
}
.outreach-actions .btn-modal-ok,
.outreach-actions .btn-modal-secondary {
  height: 36px;
  white-space: nowrap;
}
.outreach-status { min-height:18px; font-size:12px; color:var(--muted); margin-top:8px; line-height:1.5; }
.outreach-status.success { color:var(--green); }
.outreach-status.error { color:var(--red); }
@media (max-width: 720px) {
  .ol-grid { grid-template-columns:1fr; }
  .outreach-actions { flex-direction:column; align-items:stretch; }
  .outreach-draft-grid { grid-template-columns:1fr; }
}

@media (max-width: 1180px) {
  .outreach-draft-grid { grid-template-columns:1fr; }
  .revision-chat-log { height:180px; max-height:180px; }
}

/* ── Global AI command assistant ── */
.ai-command-bubble {
  position:fixed;
  right:20px;
  bottom:20px;
  width:52px;
  height:52px;
  border:none;
  border-radius:50%;
  background:var(--accent);
  color:#fff;
  box-shadow:0 12px 30px rgba(37,99,235,.32);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:1200;
  transition:transform 150ms, background 150ms, opacity 150ms;
}
.ai-command-bubble:hover { transform:translateY(-1px); background:var(--accent-d); }
.ai-command-bubble.hidden { opacity:0; pointer-events:none; transform:scale(.92); }
.ai-command-panel {
  position:fixed;
  right:20px;
  bottom:20px;
  width:570px;
  max-width:calc(100vw - 32px);
  max-height:min(760px, calc(100dvh - 40px));
  background:rgba(255,255,255,.98);
  border:1px solid #dbe4f0;
  border-radius:14px;
  box-shadow:0 24px 70px rgba(15,23,42,.24);
  display:none;
  flex-direction:column;
  overflow:hidden;
  z-index:1201;
}
.ai-command-panel.open { display:flex; }
.ai-command-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:18px 20px;
  border-bottom:1px solid #dbe4f0;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
}
.ai-command-title { font-size:17px; font-weight:700; color:var(--text); }
.ai-command-subtitle { font-size:13px; color:var(--muted); margin-top:2px; }
.ai-command-head-actions { display:flex; align-items:center; gap:7px; }
.icon-btn {
  width:34px;
  height:34px;
  border:none;
  border-radius:6px;
  color:var(--muted);
  background:transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.icon-btn:hover { background:var(--elevated); color:var(--text); }
.ai-command-log {
  height:465px;
  max-height:58dvh;
  overflow-y:auto;
  padding:18px;
  background:linear-gradient(180deg,#f8fafc 0%,#eef4ff 100%);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.ai-command-compose {
  padding:14px;
  border-top:1px solid #dbe4f0;
  background:#fff;
  display:flex;
  gap:10px;
  align-items:center;
}
.ai-command-compose textarea {
  flex:1;
  min-height:52px;
  max-height:130px;
  resize:none;
  border:1.5px solid #d3dce9;
  border-radius:12px;
  padding:14px 15px;
  font-size:15px;
  line-height:1.42;
  font-family:var(--sans);
  outline:none;
  box-shadow:0 1px 3px rgba(15,23,42,.04);
}
.ai-command-compose textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.08); }
.ai-command-panel .chat-bubble { font-size:14px; padding:11px 13px; border-radius:17px; max-width:84%; }
.ai-command-panel .chat-row.is-user .chat-bubble { border-radius:17px 17px 5px 17px; }
.ai-command-panel .chat-row.is-assistant .chat-bubble { border-radius:17px 17px 17px 5px; }
.ai-command-panel .action-log { max-width:84%; font-size:12px; padding:8px 10px; }
.ai-command-panel .chat-send-btn {
  width:52px;
  height:52px;
  flex-basis:52px;
  border-radius:16px;
}
@media (max-width: 520px) {
  .ai-command-bubble { right:14px; bottom:14px; }
  .ai-command-panel {
    right:8px;
    bottom:8px;
    width:calc(100vw - 16px);
    max-height:calc(100dvh - 16px);
    border-radius:12px;
  }
  .ai-command-log { height:360px; max-height:54dvh; }
  .ai-command-compose { flex-direction:column; align-items:stretch; }
  .ai-command-compose .chat-send-btn { width:100%; }
}

/* ── AI Research ── */
.pp-research { margin:14px 18px; }
.pp-research-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.pp-research-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); }
.btn-ai-research { display:inline-flex; align-items:center; gap:5px; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; border:none; border-radius:6px; font-size:12px; font-weight:600; padding:5px 12px; cursor:pointer; transition:opacity 150ms; }
.btn-ai-research:hover { opacity:.88; }
.btn-ai-research:disabled { opacity:.5; cursor:wait; }
.research-block { background:var(--elevated); border:1px solid var(--border); border-radius:var(--r); overflow:hidden; margin-bottom:10px; }
.research-block-head { display:flex; align-items:center; justify-content:space-between; padding:7px 10px; cursor:pointer; user-select:none; }
.research-block-head:hover { background:var(--border); }
.research-block-label { font-size:12px; font-weight:600; color:var(--text2); text-transform:uppercase; letter-spacing:.05em; }
.research-block-toggle { font-size:14px; color:var(--muted); transition:transform 200ms; }
.research-block-toggle.open { transform:rotate(180deg); }
.research-block-body { padding:8px 10px 10px; font-size:14px; color:var(--text); line-height:1.65; white-space:pre-wrap; word-break:break-word; border-top:1px solid var(--border); display:none; }
.research-block-body.visible { display:block; }
.research-angle { background:linear-gradient(135deg,#f0f4ff,#f5f0ff); border:1px solid #c7d2fe; border-radius:6px; padding:8px 10px; margin-bottom:8px; }
.research-angle-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:#6366f1; margin-bottom:3px; }
.research-angle-value { font-size:15px; font-weight:600; color:#3730a3; }
.research-secondary { font-size:13px; color:#6366f1; margin-top:4px; }
.research-section { margin-bottom:8px; }
.research-section-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:3px; }
.research-section-body { font-size:14px; color:var(--text); line-height:1.6; }
.research-empty { font-size:13px; color:var(--muted); font-style:italic; padding:6px 0; }
.research-status { font-size:12px; color:var(--muted); padding:6px 0; display:flex; align-items:center; gap:6px; }
.research-status.running { color:var(--accent); }
.research-status.error { color:var(--red); }

/* AI Research in outreach lead card */
.ol-research { border-top:1px solid var(--border); margin-top:8px; padding-top:8px; }
.ol-research-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:#6366f1; margin-bottom:4px; }
.ol-research-angle { font-size:13px; font-weight:600; color:#3730a3; margin-bottom:3px; }
.ol-research-desc { font-size:11px; color:var(--text2); line-height:1.5; }

/* AI Research preset editor */
.ar-preset-card { background:var(--surface); border:2px solid var(--border); border-radius:10px; padding:16px 18px; margin-bottom:10px; display:flex; align-items:flex-start; gap:12px; transition:border-color 150ms,box-shadow 150ms; }
.ar-preset-card:hover,.op-preset-card:hover { border-color:var(--border2); box-shadow:0 2px 10px rgba(0,0,0,.07); }
.op-preset-card.is-default,.ar-preset-card.is-default { border-color:var(--accent); background:var(--accent-bg); }
.ar-prompt-textarea { width:100%; min-height:120px; border:1.5px solid var(--border2); border-radius:var(--r); padding:10px 12px; font-size:12px; font-family:'Courier New',monospace; color:var(--text); background:var(--surface); outline:none; resize:none; line-height:1.6; box-sizing:border-box; overflow:hidden; field-sizing:content; }
.ar-prompt-textarea:focus { border-color:var(--accent); }

/* ── Outreach lead panel social rows ── */
.ol-social-row { display:flex; align-items:center; gap:6px; }

/* ── Rule threshold input ── */
.rule-threshold { font-size:12px; text-align:center; border:1.5px solid var(--border2); border-radius:4px; padding:4px 6px; color:var(--text); background:var(--surface); }

/* ── Settings section layout fix ── */
.s-sec .lists-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:14px; padding-bottom:12px; border-bottom:1.5px solid var(--border); }
.s-sec .lists-header .s-lbl { margin:0; }
.s-sec .btn-new-list { flex-shrink:0; }
.s-sec .btn-primary { margin-top:10px; }

/* ── Settings main pane ── */
#main-settings { flex:1; overflow-y:auto; }

/* Settings left nav (in sidebar) */
.settings-nav { display:flex; flex-direction:column; padding:12px 10px; gap:2px; }
.settings-nav-btn { display:flex; align-items:center; gap:9px; padding:9px 12px; border-radius:7px; border:none; background:transparent; color:var(--muted); font-size:13px; font-weight:500; font-family:var(--sans); cursor:pointer; text-align:left; transition:background 150ms, color 150ms; white-space:nowrap; width:100%; }
.settings-nav-btn:hover { background:var(--border); color:var(--text); }
.settings-nav-btn.active { background:var(--accent-bg); color:var(--accent); font-weight:600; }
.settings-nav-btn svg { flex-shrink:0; opacity:.7; }
.settings-nav-btn.active svg { opacity:1; }

/* Settings sections content */
.settings-body { display:flex; flex-direction:column; }
.settings-section { display:none; }
.settings-section.active { display:block; }
.ss-header { font-size:20px; font-weight:700; color:var(--text); padding:22px 24px 16px; border-bottom:2px solid var(--border); margin-bottom:0; }
.ss-empty { padding:40px 24px; color:var(--muted); font-size:13px; }
#main-settings .s-sec { padding:20px 24px; max-width:760px; }
#ss-products .s-sec { max-width:780px; }
#main-settings .field input, #main-settings .field select { max-width:400px; }

/* ── Business profile ── */
.bp-section { margin-bottom:28px; }
.bp-section-title { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; margin-bottom:14px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.bp-fields { display:flex; flex-direction:column; gap:14px; }
.bp-field { display:flex; flex-direction:column; gap:5px; }
.bp-field-label { font-size:12px; font-weight:600; color:var(--text2); }
.bp-input { border:1.5px solid var(--border2); border-radius:7px; padding:9px 12px; font-size:14px; font-family:var(--sans); color:var(--text); background:var(--elevated); outline:none; transition:border-color 150ms, background 150ms; width:100%; box-sizing:border-box; }
.bp-input:focus { border-color:var(--accent); background:var(--surface); }
.bp-textarea { resize:none; overflow:hidden; line-height:1.6; min-height:80px; }

/* ── Product cards ── */
.prod-card { border:1.5px solid var(--border); border-radius:10px; padding:16px 18px; margin-bottom:12px; background:var(--surface); transition:border-color 150ms; }
.prod-card:hover { border-color:var(--border2); }
.prod-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.prod-card-num { font-size:14px; font-weight:600; color:var(--text2); }
.prod-field { margin-bottom:12px; }
.prod-field:last-child { margin-bottom:0; }
.prod-field-label { display:block; font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:5px; }
.prod-field-input { width:100%; border:1.5px solid var(--border2); border-radius:6px; padding:8px 10px; font-size:14px; font-family:var(--sans); color:var(--text); background:var(--elevated); outline:none; transition:border-color 150ms; box-sizing:border-box; }
.prod-field-input:focus { border-color:var(--accent); background:var(--surface); }
.prod-textarea { width:100%; border:1.5px solid var(--border2); border-radius:6px; padding:8px 10px; font-size:13px; font-family:var(--sans); color:var(--text); background:var(--elevated); outline:none; resize:none; line-height:1.6; min-height:70px; transition:border-color 150ms; box-sizing:border-box; overflow:hidden; }
.prod-textarea:focus { border-color:var(--accent); background:var(--surface); }
.pf-del-btn { background:none; border:none; color:var(--border2); cursor:pointer; padding:4px; line-height:0; border-radius:4px; transition:color 150ms; flex-shrink:0; }
.pf-del-btn:hover { color:var(--red); }
.btn-pf-add { display:flex; align-items:center; gap:6px; margin-top:4px; padding:9px 14px; border:1.5px dashed var(--border2); border-radius:8px; background:none; color:var(--muted); font-size:13px; font-family:var(--sans); cursor:pointer; transition:color 150ms, border-color 150ms; }
.btn-pf-add:hover { color:var(--accent); border-color:var(--accent); }

/* ── Prompt editor tabs ─────────────────────────────────────────────────── */
.pe-tab-bar { display:flex; gap:4px; margin-bottom:10px; }
.pe-tab {
  background:var(--elevated); border:2px solid var(--border2);
  border-radius:8px; padding:6px 18px; font-size:13px; font-weight:600;
  color:var(--text2); cursor:pointer; transition:all 150ms; font-family:var(--sans);
}
.pe-tab:hover { border-color:var(--accent); color:var(--accent); }
.pe-tab.pe-tab-active {
  background:var(--accent); border-color:var(--accent);
  color:#fff; box-shadow:0 2px 8px rgba(37,99,235,.25);
}
.pe-preview-bar {
  display:flex; gap:8px; align-items:center; margin-bottom:10px; flex-wrap:wrap;
}
.pe-prod-wrap { position:relative; }
.pe-prev-prod-btn {
  background:var(--elevated); border:1.5px solid var(--border2); border-radius:6px;
  color:var(--text2); font-size:12px; font-weight:600; padding:7px 12px;
  cursor:pointer; white-space:nowrap; transition:all 150ms; font-family:var(--sans);
}
.pe-prev-prod-btn:hover { border-color:var(--accent); color:var(--accent); }
.pe-products-picker {
  position:absolute; top:calc(100% + 4px); left:0; z-index:2001;
  background:var(--surface); border:2px solid var(--border2); border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.12); padding:10px 12px;
  flex-direction:column; gap:6px; min-width:220px;
}
.pe-prod-cb {
  display:flex; align-items:center; gap:8px; cursor:pointer;
  font-size:13px; color:var(--text); padding:3px 0;
}
.pe-prod-cb input { width:14px; height:14px; cursor:pointer; accent-color:var(--accent); }
.pe-lead-autocomplete { position:relative; flex:1; min-width:0; }
.pe-preview-lead-input {
  width:100%; border:1.5px solid var(--border2); border-radius:6px;
  padding:7px 11px; font-size:13px; font-family:var(--sans);
  color:var(--text); background:var(--surface); outline:none;
  transition:border-color 200ms; box-sizing:border-box;
}
.pe-preview-lead-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.pe-lead-dropdown {
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:2000;
  background:var(--surface); border:2px solid var(--border2); border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.12); max-height:220px; overflow-y:auto;
}
.pe-lead-option {
  display:flex; align-items:baseline; gap:8px; padding:9px 12px;
  cursor:pointer; transition:background 100ms; border-bottom:1px solid var(--border);
}
.pe-lead-option:last-child { border-bottom:none; }
.pe-lead-option:hover { background:var(--accent-bg); }
.pe-lead-opt-name { font-size:13px; font-weight:600; color:var(--text); }
.pe-lead-opt-sub { font-size:11px; color:var(--muted); }
.pe-preview-btn {
  background:var(--accent); color:#fff; border:none; border-radius:6px;
  padding:7px 16px; font-size:13px; font-weight:600; cursor:pointer;
  white-space:nowrap; transition:background 150ms; font-family:var(--sans);
}
.pe-preview-btn:hover { background:var(--accent-d); }
.pe-preview-text {
  margin:0; padding:16px 18px; background:var(--surface);
  border:2px solid var(--border2); border-radius:8px;
  font-size:13px; font-family:'Courier New',monospace; color:var(--text);
  white-space:pre-wrap; word-break:break-word; line-height:1.7;
  min-height:300px; box-sizing:border-box; overflow-y:auto;
  box-shadow:0 1px 4px rgba(0,0,0,.06);
}
.ph-val {
  color: #16a34a;
  font-weight: 600;
  background: #f0fdf4;
  border-radius: 3px;
  padding: 0 2px;
}

/* ══════════════════════════════════════
   MOBILE RESPONSIVE  (≤ 768px)
   ══════════════════════════════════════ */

/* Mobile topbar — hidden on desktop */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 900;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
}
.mob-left, .mob-right {
  width: 80px; display: flex; align-items: center; flex-shrink: 0;
}
.mob-right { justify-content: flex-end; }
.mob-menu-btn, .mob-back-btn {
  background: none; border: none; color: var(--text2); cursor: pointer;
  padding: 8px; border-radius: 8px; display: flex; align-items: center;
  gap: 5px; font-size: 14px; font-weight: 600; font-family: var(--sans);
  line-height: 1; flex-shrink: 0; transition: background 150ms; white-space: nowrap;
}
.mob-menu-btn:hover, .mob-back-btn:hover { background: var(--elevated); }
.mob-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  flex: 1; text-align: center; letter-spacing: -.01em;
}

/* Overlay backdrop for sidebar */
.mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 799;
  backdrop-filter: blur(2px);
}
.mobile-overlay.active { display: block; }

@media (max-width: 768px) {
  body { overflow: hidden; }

  /* Show topbar */
  .mobile-topbar { display: flex; }

  /* Push app content below topbar */
  .app { padding-top: 48px; height: 100dvh; flex-direction: row; overflow: hidden; }

  /* ── Sidebar: fixed overlay drawer from left ── */
  .sidebar {
    position: fixed !important;
    top: 48px; left: 0; bottom: 0;
    width: 300px !important;
    z-index: 800;
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    overflow-y: auto;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0,0,0,.2);
  }

  /* ── Main panel: full width ── */
  .main { width: 100%; min-width: 0; }

  /* Hide terminal on mobile — too much space */
  .terminal-wrap { display: none; }

  /* Stats bar: compact */
  .stats-bar { display: none; }

  .sidebar .logo { padding: 14px 16px 12px; }
  .sidebar .logo-title, .sidebar .logo-sub { display: none; }
  .sidebar .mode-switch { margin-top: 8px; }

  /* Prompt editor: stack vertically, move placeholders below */
  .pe-wrap { flex-direction: column; min-height: unset; }
  .pe-textarea { min-height: 180px; }
  .pe-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 200px; overflow-y: auto; }

  /* Preset rules table: better mobile layout */
  .rules-table { font-size: 12px; }
  .rules-table th, .rules-table td { padding: 5px 4px; }
  .rules-table input[type=text] { font-size: 11px; padding: 4px 5px; }
  .rules-table input[type=number] { width: 44px; font-size: 11px; padding: 4px 5px; }

  /* Preset meta grid (name/desc): stack vertically */
  .op-meta-grid { grid-template-columns: 1fr; }

  /* Outreach preset editor: full screen */
  .op-editor-modal .modal-body { padding: 12px 14px; }
  .pe-ph-title { font-size: 10px; }
  .pe-ph-key { font-size: 10px; }
  .pe-ph-desc { font-size: 9px; }

  /* Table: hide less important columns */
  /* col order: cb(1) score(2) name(3) website(4) phone(5) rating(6) flags(7) status(8) signal(9) */
  table thead th:nth-child(4),
  table thead th:nth-child(5),
  table thead th:nth-child(6),
  table tbody td:nth-child(4),
  table tbody td:nth-child(5),
  table tbody td:nth-child(6) { display: none; }

  /* Make table header compact */
  th { padding: 8px 10px; font-size: 11px; }
  td { padding: 10px 10px; font-size: 13px; }
  .cell-name { font-size: 13px; }
  .cell-addr { font-size: 11px; }

  /* ── Profile panel: full-screen overlay from right ── */
  .profile-panel {
    position: fixed !important;
    top: 48px; right: 0; bottom: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    transform: translateX(110%);
    transition: transform 300ms cubic-bezier(.4,0,.2,1) !important;
    border-left: none !important;
    z-index: 750;
    overflow: hidden;
    display: flex !important;
    flex-direction: row;
  }
  .profile-panel.open {
    width: 100vw !important;
    transform: translateX(0) !important;
  }
  .profile-resize-handle { display: none !important; }
  .profile-inner { overflow-y: auto; }

  /* Bigger tap targets in profile */
  .btn-pp { padding: 9px 14px; font-size: 13px; }
  .pp-name { font-size: 16px; }

  /* ── Modals: full screen ── */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  /* Outreach modal: stack panels vertically */
  .outreach-modal { max-height: 100dvh; border-radius: 16px 16px 0 0; }
  .outreach-modal .modal-body { max-height: calc(100dvh - 60px); }
  .outreach-split { flex-direction: column; overflow-y: auto; }
  .outreach-left-col {
    width: 100% !important;
    max-height: 260px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .outreach-lead-panel { padding: 12px 14px; }
  .outreach-main { border-right: none; }
  .outreach-draft-grid { grid-template-columns: 1fr; }
  .outreach-settings.open { width: 100% !important; position: relative; }
  .outreach-settings-inner { width: 100%; }
  .revision-chat-log { height: 180px; max-height: 180px; }
  .outreach-draft-area { padding: 12px 14px; }

  /* Bulk bar: smaller on mobile */
  .bulk-bar {
    min-width: unset;
    width: calc(100vw - 32px);
    flex-wrap: wrap;
    gap: 8px;
    bottom: 16px;
  }
  .bulk-actions { flex-wrap: wrap; gap: 4px; }
  .btn-bulk { font-size: 11px; padding: 5px 10px; }

  /* Scrape toast: full width */
  .scrape-toast { left: 16px; right: 16px; width: auto; bottom: 16px; }

  /* ATL dropdown: larger touch targets */
  .atl-option { padding: 12px 14px; }

  /* Table actions bar */
  .table-header { padding: 10px 12px; }
  .table-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .table-header-tools { flex:0 1 58vw; }
  .table-lead-search { width:100%; }
  .btn-dl { font-size: 12px; padding: 6px 10px; }

  /* Preset modal full screen */
  .op-editor-modal { width: 100vw !important; max-height: 100dvh; border-radius: 16px 16px 0 0; }

  /* Edit field row */
  .edit-row2 { grid-template-columns: 1fr; }
  .modal-body .row2 { grid-template-columns: 1fr; }

  /* Flag pills smaller */
  .flag-pill { font-size: 10px; padding: 1px 5px; }
}

/* ── Lead Contacts ───────────────────────────────────────────────────────── */
.pp-contacts { padding:14px 18px; border-bottom:1px solid var(--border); }
.pp-contacts-head {
  display:flex; align-items:center; justify-content:space-between; cursor:pointer;
  user-select:none;
}
.pp-contacts-head:hover .pp-section-title { color:var(--accent); }
.pp-contacts-toggle {
  display:flex; align-items:center; gap:8px;
}
.pp-contacts-chevron {
  width:16px; height:16px; color:var(--muted); transition:transform .2s;
}
.pp-contacts.open .pp-contacts-chevron { transform:rotate(180deg); }
.pp-contacts-body { margin-top:10px; display:none; flex-direction:column; gap:8px; }
.pp-contacts.open .pp-contacts-body { display:flex; }

.contact-card {
  border:1px solid var(--border); border-radius:8px; padding:10px 12px;
  background:var(--elevated); position:relative;
  display:flex; flex-direction:column; gap:4px;
}
.contact-card-name { font-weight:600; font-size:13px; color:var(--text); }
.contact-card-title { font-size:11px; color:var(--muted); }
.contact-card-row {
  display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text);
}
.contact-card-row a { color:var(--accent); text-decoration:none; }
.contact-card-row a:hover { text-decoration:underline; }
.contact-card-actions {
  position:absolute; top:8px; right:8px; display:flex; gap:4px;
}
.contact-card-btn {
  background:none; border:none; cursor:pointer; padding:2px 4px;
  color:var(--muted); border-radius:4px; transition:background .15s,color .15s;
  display:flex; align-items:center;
}
.contact-card-btn:hover { background:var(--border); color:var(--text); }
.contact-card-notes { font-size:11px; color:var(--muted); font-style:italic; margin-top:2px; }

.btn-add-contact {
  display:flex; align-items:center; gap:6px; font-size:12px;
  color:var(--accent); background:none; border:1px dashed var(--accent);
  border-radius:6px; padding:6px 12px; cursor:pointer; width:100%;
  justify-content:center; transition:background .15s;
}
.btn-add-contact:hover { background:color-mix(in srgb, var(--accent) 8%, transparent); }
.contacts-count-badge {
  font-size:11px; background:var(--accent); color:#fff;
  border-radius:10px; padding:1px 7px; font-weight:600;
}

/* Contact Modal */
#contactModal {
  display:none; position:fixed; inset:0; z-index:1100;
  background:rgba(0,0,0,.45); align-items:center; justify-content:center;
}
#contactModal.open { display:flex; }
.contact-modal-box {
  background:var(--surface); border-radius:12px; padding:24px;
  width:420px; max-width:94vw; max-height:90vh; overflow-y:auto;
  box-shadow:0 8px 32px rgba(0,0,0,.18);
  display:flex; flex-direction:column; gap:14px;
}
.contact-modal-title {
  font-size:15px; font-weight:700; color:var(--text); margin-bottom:2px;
}
.contact-modal-field { display:flex; flex-direction:column; gap:4px; }
.contact-modal-field label { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; }
.contact-modal-field input,
.contact-modal-field textarea {
  border:1px solid var(--border); border-radius:6px; padding:8px 10px;
  font-size:13px; color:var(--text); background:var(--elevated);
  outline:none; transition:border-color .15s;
}
.contact-modal-field input:focus,
.contact-modal-field textarea:focus { border-color:var(--accent); }
.contact-modal-field textarea { resize:vertical; min-height:60px; }
.contact-modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:4px; }
.contact-modal-actions .btn-primary {
  background:var(--accent); color:#fff; border:none; border-radius:7px;
  padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer;
}
.contact-modal-actions .btn-cancel {
  background:var(--elevated); color:var(--text); border:1px solid var(--border);
  border-radius:7px; padding:8px 16px; font-size:13px; cursor:pointer;
}
.contact-modal-actions .btn-danger {
  background:#fee2e2; color:#b91c1c; border:none; border-radius:7px;
  padding:8px 14px; font-size:13px; cursor:pointer; margin-right:auto;
}

/* ════════════════════════════════════════════════════════
   Lead Modal — CRM-style full profile
   ════════════════════════════════════════════════════════ */
#leadModal {
  display:none; position:fixed; inset:0; z-index:900;
  background:rgba(10,15,30,.55); backdrop-filter:blur(3px);
  align-items:center; justify-content:center;
  animation:lmFadeIn .18s ease;
}
#leadModal.open { display:flex; }
@keyframes lmFadeIn { from{opacity:0} to{opacity:1} }

.lm-box {
  width: min(1140px, 96vw);
  height: 88vh;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 32px 96px rgba(0,0,0,.24), 0 0 0 1px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: lmSlideUp .22s cubic-bezier(.4,0,.2,1);
}
@keyframes lmSlideUp { from{transform:translateY(24px);opacity:0} to{transform:none;opacity:1} }

/* Header */
.lm-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 14px; flex-shrink: 0;
}
.lm-header-info { flex: 1; min-width: 0; }
.lm-name { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: 4px; }
.lm-meta { font-size: 13px; color: var(--muted); display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.lm-meta a { color: var(--accent); text-decoration:none; }
.lm-meta a:hover { text-decoration:underline; }
.lm-score-chip {
  display:inline-flex; align-items:center; gap:5px;
  font-size:13px; font-weight:700;
  padding:3px 10px; border-radius:20px;
}
.lm-score-chip.sh { background:#fee2e2; color:#b91c1c; }
.lm-score-chip.sm { background:#fff7ed; color:#c2410c; }
.lm-score-chip.sl { background:var(--elevated); color:var(--muted); }
.lm-header-actions { display:flex; gap:6px; flex-shrink:0; align-items:flex-start; }
.lm-btn {
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:600; padding:7px 13px;
  border-radius:7px; cursor:pointer; border:1.5px solid var(--border);
  background:var(--surface); color:var(--text2); transition:all .15s;
  white-space:nowrap;
}
.lm-btn:hover { border-color:var(--accent); color:var(--accent); }
.lm-btn.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.lm-btn.primary:hover { background:#2563eb; border-color:#2563eb; color:#fff; }
.lm-btn.danger { background:none; color:var(--red); border-color:var(--border); }
.lm-btn.danger:hover { background:#fee2e2; border-color:var(--red); }
.lm-close {
  background:none; border:none; color:var(--muted); cursor:pointer;
  padding:6px; border-radius:8px; line-height:0; transition:all .15s;
}
.lm-close:hover { background:var(--elevated); color:var(--text); }

/* Body layout */
.lm-body { flex:1; display:flex; overflow:hidden; }

/* Left column */
.lm-left {
  width: 288px; flex-shrink:0;
  border-right: 1px solid var(--border);
  overflow-y: auto; display:flex; flex-direction:column;
}
.lm-left-section { padding:14px 18px; border-bottom:1px solid var(--border); }
.lm-left-section:last-child { border-bottom:none; }
.lm-section-title {
  font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); margin-bottom:10px;
}
.lm-row { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:7px; }
.lm-row:last-child { margin-bottom:0; }
.lm-key { font-size:13px; color:var(--muted); white-space:nowrap; flex-shrink:0; }
.lm-val { font-size:13px; font-weight:500; color:var(--text); text-align:right; word-break:break-all; }
.lm-val a { color:var(--accent); text-decoration:none; }
.lm-val a:hover { text-decoration:underline; }
.lm-flags { display:flex; flex-wrap:wrap; gap:4px; }

/* Right column */
.lm-right { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }

/* Tabs */
.lm-tabs {
  display:flex; padding:0 20px; border-bottom:1px solid var(--border);
  flex-shrink:0; gap:0; background:var(--surface);
}
.lm-tab {
  padding:13px 18px; font-size:13px; font-weight:500; color:var(--muted);
  cursor:pointer; border-bottom:2px solid transparent; transition:all .15s;
  display:flex; align-items:center; gap:6px; white-space:nowrap;
  user-select:none;
}
.lm-tab:hover { color:var(--text); }
.lm-tab.active { color:var(--accent); border-bottom-color:var(--accent); font-weight:600; }
.lm-tab-badge {
  font-size:10px; background:var(--accent); color:#fff;
  border-radius:10px; padding:1px 6px; font-weight:700;
}

/* Tab content */
.lm-tab-body { flex:1; overflow-y:auto; padding:22px 26px; }

/* Contacts tab */
.lm-contacts-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:700px) { .lm-contacts-grid { grid-template-columns:1fr; } }
.lm-contact-card {
  border:1px solid var(--border); border-radius:10px; padding:14px 16px;
  background:var(--elevated); position:relative;
  display:flex; flex-direction:column; gap:5px;
  transition:box-shadow .15s;
}
.lm-contact-card:hover { box-shadow:0 2px 12px rgba(0,0,0,.08); }
.lm-contact-card-name { font-weight:600; font-size:14px; color:var(--text); }
.lm-contact-card-title { font-size:12px; color:var(--muted); }
.lm-contact-card-row { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text); }
.lm-contact-card-row a { color:var(--accent); text-decoration:none; }
.lm-contact-card-row a:hover { text-decoration:underline; }
.lm-contact-card-notes { font-size:12px; color:var(--muted); font-style:italic; margin-top:3px; }
.lm-contact-card-edit {
  position:absolute; top:10px; right:10px;
  background:none; border:none; color:var(--muted); cursor:pointer;
  padding:3px; border-radius:4px; line-height:0; transition:all .15s;
}
.lm-contact-card-edit:hover { background:var(--border); color:var(--text); }
.lm-add-contact-btn {
  display:flex; align-items:center; justify-content:center; gap:6px;
  border:2px dashed var(--border2); border-radius:10px; padding:16px;
  color:var(--muted); font-size:13px; cursor:pointer;
  transition:all .15s; background:none;
}
.lm-add-contact-btn:hover { border-color:var(--accent); color:var(--accent); background:color-mix(in srgb, var(--accent) 5%, transparent); }

/* Notes tab */
.lm-notes-area {
  display:flex; flex-direction:column; gap:10px; height:100%;
}
.lm-notes-area textarea {
  flex:1; min-height:200px; resize:vertical; border:1.5px solid var(--border);
  border-radius:10px; padding:14px 16px; font-size:14px; line-height:1.7;
  color:var(--text); background:var(--elevated); outline:none;
  transition:border-color .15s; font-family:var(--sans);
}
.lm-notes-area textarea:focus { border-color:var(--accent); }
.lm-notes-save {
  align-self:flex-end; background:var(--accent); color:#fff; border:none;
  border-radius:8px; padding:9px 22px; font-size:13px; font-weight:600;
  cursor:pointer; transition:background .15s;
}
.lm-notes-save:hover { background:#2563eb; }
.lm-notes-save.saved { background:var(--green); }

/* Events tab */
.lm-event-item {
  display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--border);
}
.lm-event-item:last-of-type { border-bottom:none; }
.lm-event-icon {
  width:30px; height:30px; border-radius:50%; display:flex;
  align-items:center; justify-content:center; font-size:14px;
  background:var(--elevated); flex-shrink:0;
}
.lm-event-body { flex:1; min-width:0; }
.lm-event-subject { font-size:13px; font-weight:600; color:var(--text); margin-bottom:2px; }
.lm-event-note { font-size:13px; color:var(--text2); line-height:1.5; }
.lm-event-meta { font-size:11px; color:var(--muted); margin-top:4px; }
.lm-event-del {
  background:none; border:none; color:var(--muted); cursor:pointer;
  padding:4px; border-radius:4px; align-self:flex-start;
}
.lm-event-del:hover { color:var(--red); }
.lm-add-event { margin-top:16px; display:flex; flex-direction:column; gap:8px; }
.lm-event-type-tabs { display:flex; gap:4px; flex-wrap:wrap; }
.lm-event-type-btn {
  padding:5px 12px; border-radius:6px; font-size:12px; font-weight:500;
  cursor:pointer; border:1.5px solid var(--border); background:var(--surface);
  color:var(--text2); transition:all .15s;
}
.lm-event-type-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.lm-add-event input, .lm-add-event textarea {
  border:1.5px solid var(--border); border-radius:8px; padding:9px 12px;
  font-size:13px; color:var(--text); background:var(--elevated); outline:none;
  transition:border-color .15s;
}
.lm-add-event input:focus, .lm-add-event textarea:focus { border-color:var(--accent); }
.lm-btn-add-event {
  align-self:flex-start; background:var(--accent); color:#fff; border:none;
  border-radius:8px; padding:9px 20px; font-size:13px; font-weight:600;
  cursor:pointer;
}

/* Research tab */
.lm-research-head { display:flex; justify-content:flex-end; margin-bottom:14px; }

/* Edit mode in modal */
.lm-edit-overlay {
  position:absolute; inset:0; background:var(--surface);
  z-index:10; display:none; flex-direction:column; overflow:hidden;
}
.lm-edit-overlay.open { display:flex; }
.lm-edit-header {
  padding:16px 24px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  font-size:15px; font-weight:700; color:var(--text);
}
.lm-edit-body { flex:1; overflow-y:auto; padding:20px 24px; }
.lm-edit-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.lm-edit-full { grid-column:1/-1; }
.lm-edit-field { display:flex; flex-direction:column; gap:5px; }
.lm-edit-field label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.lm-edit-field input, .lm-edit-field textarea {
  border:1.5px solid var(--border); border-radius:8px; padding:9px 12px;
  font-size:13px; color:var(--text); background:var(--elevated); outline:none;
  transition:border-color .15s;
}
.lm-edit-field input:focus, .lm-edit-field textarea:focus { border-color:var(--accent); }
.lm-edit-field textarea { resize:vertical; }
.lm-edit-footer {
  padding:14px 24px; border-top:1px solid var(--border);
  display:flex; gap:8px; justify-content:flex-end;
}

/* Sidebar "expand" button */
.pp-expand-btn {
  background:none; border:1.5px solid var(--border); border-radius:7px;
  color:var(--muted); cursor:pointer; padding:5px 9px; line-height:0;
  transition:all .15s; display:flex; align-items:center;
}
.pp-expand-btn:hover { border-color:var(--accent); color:var(--accent); }

/* ════════════════════════════════════════════
   DUPLICATE BADGE & MERGE
   ════════════════════════════════════════════ */

/* Badge in table row */
.dup-badge {
  display:inline-flex; align-items:center; gap:4px;
  background:#fef2f2; color:#dc2626; border:1.5px solid #fca5a5;
  border-radius:5px; font-size:10px; font-weight:700; letter-spacing:.05em;
  padding:2px 7px; cursor:pointer; flex-shrink:0;
}
.dup-badge svg { width:11px; height:11px; flex-shrink:0; }

/* Badge in sidebar / modal header */
.dup-alert {
  display:flex; align-items:center; gap:8px;
  background:#fef2f2; border:1.5px solid #fca5a5; border-radius:8px;
  padding:8px 12px; margin:8px 14px 0; color:#991b1b; font-size:12px; font-weight:500;
}
.dup-alert svg { width:15px; height:15px; flex-shrink:0; }
.dup-alert-link { color:#dc2626; font-weight:700; cursor:pointer; text-decoration:underline; margin-left:4px; }

/* Merge button — reuses .lm-btn but distinct color */
.btn-merge {
  background:#fff7ed; border:1.5px solid #fed7aa; color:#c2410c;
  border-radius:7px; font-size:12px; font-weight:600; padding:6px 12px;
  cursor:pointer; transition:all .15s; display:inline-flex; align-items:center; gap:5px;
}
.btn-merge:hover { background:#ffedd5; border-color:#fb923c; }

/* ── Merge modal ── */
#mergeModal {
  display:none; position:fixed; inset:0; z-index:1100;
  background:rgba(0,0,0,.45); align-items:center; justify-content:center;
}
#mergeModal.open { display:flex; }
.merge-box {
  background:var(--surface); border-radius:14px;
  box-shadow:0 24px 60px rgba(0,0,0,.22);
  width:min(560px,95vw); max-height:85vh;
  display:flex; flex-direction:column; overflow:hidden;
}
.merge-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px 14px; border-bottom:1px solid var(--border);
}
.merge-head-title { font-size:15px; font-weight:700; color:var(--text); }
.merge-close {
  background:none; border:none; color:var(--muted); cursor:pointer;
  width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center;
  transition:all .15s;
}
.merge-close:hover { background:var(--elevated); color:var(--text); }
.merge-body { padding:16px 20px; overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:12px; }
.merge-search-wrap { position:relative; }
.merge-search {
  width:100%; background:var(--elevated); border:1.5px solid var(--border2);
  border-radius:8px; padding:9px 12px 9px 36px; font-size:13px;
  color:var(--text); font-family:var(--sans); outline:none; box-sizing:border-box;
  transition:border-color .15s;
}
.merge-search:focus { border-color:var(--accent); }
.merge-search-icon {
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  color:var(--muted); pointer-events:none; width:15px; height:15px;
}
.merge-results { display:flex; flex-direction:column; gap:6px; min-height:60px; }
.merge-result-item {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px; border:1.5px solid var(--border); border-radius:8px;
  cursor:pointer; transition:all .15s; background:var(--surface);
}
.merge-result-item:hover { border-color:var(--accent); background:var(--accent-bg); }
.merge-result-item.selected { border-color:var(--accent); background:var(--accent-bg); }
.merge-result-name { font-size:13px; font-weight:600; color:var(--text); }
.merge-result-meta { font-size:11px; color:var(--muted); margin-top:2px; }
.merge-result-score { font-size:11px; font-weight:700; padding:2px 7px; border-radius:4px; flex-shrink:0; }
.merge-no-results { font-size:13px; color:var(--muted); text-align:center; padding:20px 0; }
.merge-preview {
  background:var(--elevated); border-radius:8px; padding:12px 14px;
  font-size:12px; color:var(--text2); display:none;
}
.merge-preview.visible { display:block; }
.merge-preview-title { font-weight:700; color:var(--text); margin-bottom:6px; font-size:12px; }
.merge-preview-row { display:flex; gap:8px; padding:3px 0; }
.merge-preview-key { color:var(--muted); min-width:80px; flex-shrink:0; }
.merge-preview-val { color:var(--text); font-weight:500; }
.merge-preview-val.gain { color:var(--green); }
.merge-foot {
  padding:14px 20px; border-top:1px solid var(--border);
  display:flex; justify-content:flex-end; gap:8px;
}
.merge-btn-cancel {
  background:var(--elevated); border:1.5px solid var(--border); border-radius:7px;
  color:var(--text2); font-size:13px; font-weight:500; padding:8px 16px; cursor:pointer;
}
.merge-btn-confirm {
  background:#dc2626; border:none; border-radius:7px; color:#fff;
  font-size:13px; font-weight:600; padding:8px 20px; cursor:pointer;
  transition:background .15s; display:flex; align-items:center; gap:6px;
}
.merge-btn-confirm:hover { background:#b91c1c; }
.merge-btn-confirm:disabled { background:var(--muted); cursor:not-allowed; }
