/* Unsited: minimal dark theme.
   Palette: neutral graphite, off-white for primary actions, muted clay and ochre for lead heat.
   No gradients, no glows. */
:root {
  --bg: #0e0f11;
  --bg-2: #121316;
  --surface: #16171a;
  --surface-2: #1b1c20;
  --raised: #222327;
  --line: #2a2b30;
  --line-2: #202125;
  --ink: #ededee;
  --ink-2: #c2c3c7;
  --muted: #8b8c92;
  --faint: #626369;
  --accent: #ededee;            /* primary actions: off-white */
  --accent-2: #a9b4a3;          /* quiet sage for small highlights */
  --grad: #ededee;              /* kept as a solid color: no gradients */
  --accent-ink: #0e0f11;
  --accent-soft: rgba(237, 237, 238, .08);
  --link: #c9cfc4;
  --hot: #d8907a;               /* muted clay */
  --hot-soft: rgba(216, 144, 122, .12);
  --warm: #cdb27e;              /* muted ochre */
  --warm-soft: rgba(205, 178, 126, .12);
  --cold: #84868d;
  --cold-soft: rgba(132, 134, 141, .12);
  --ok: #8fb59a;
  --ok-soft: rgba(143, 181, 154, .12);
  --star: #cdb27e;
  --glass: rgba(22, 23, 26, .78);
  --shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 16px 40px -24px rgba(0, 0, 0, .7);
  --radius: 8px;
  --display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font: 'Geist', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
  --line-strong: #4a4b51;
  --line-hover: #5a5b62;
  --line-3: #3a3b41;
  --accent-hover: #ffffff;
  --soft-ink: #8f9097;
  --check: #cfd0d3;
  --nav-bg: rgba(14, 15, 17, .78);
  --side-bg: rgba(14, 15, 17, .7);
  --chip-bg: rgba(22, 23, 26, .8);
  --card-glass: rgba(22, 23, 26, .92);
  --tint: rgba(237, 237, 238, .04);
  --topo: rgba(237, 237, 238, .06);
  --selection: rgba(237, 237, 238, .22);
  --pulse: #f2b8a4;
  --shadow-c: rgba(0, 0, 0, .8);
  --logo-dot: #d8662f;
  color-scheme: dark;
}

/* Light theme: same layout and accents, on warm paper. Chosen in the nav, saved per browser (theme.js). */
:root[data-theme="light"] {
  --bg: #f6f6f3;
  --bg-2: #efefeb;
  --surface: #ffffff;
  --surface-2: #fbfbf9;
  --raised: #ecebe7;
  --line: #dddcd6;
  --line-2: #e8e7e2;
  --line-strong: #b9b8b1;
  --line-hover: #9c9b94;
  --line-3: #cfcec7;
  --ink: #141518;
  --ink-2: #3b3c41;
  --muted: #6a6b71;
  --faint: #95969b;
  --soft-ink: #8a8b90;
  --accent: #141518;
  --accent-hover: #2b2c31;
  --accent-ink: #ffffff;
  --accent-2: #5f7358;
  --grad: #141518;
  --accent-soft: rgba(20, 21, 24, .06);
  --link: #3f5039;
  --hot: #b0614a;
  --hot-soft: rgba(176, 97, 74, .1);
  --warm: #977532;
  --warm-soft: rgba(151, 117, 50, .12);
  --cold: #7a7c82;
  --cold-soft: rgba(122, 124, 130, .12);
  --ok: #4d8458;
  --ok-soft: rgba(77, 132, 88, .12);
  --star: #b28a2e;
  --check: #3b3c41;
  --glass: rgba(255, 255, 255, .86);
  --nav-bg: rgba(246, 246, 243, .82);
  --side-bg: rgba(239, 239, 235, .75);
  --chip-bg: rgba(255, 255, 255, .85);
  --card-glass: rgba(255, 255, 255, .94);
  --tint: rgba(20, 21, 24, .035);
  --topo: rgba(20, 21, 24, .07);
  --selection: rgba(20, 21, 24, .14);
  --pulse: #c06a52;
  --shadow-c: rgba(40, 38, 30, .18);
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 16px 40px -24px rgba(40, 38, 30, .25);
  color-scheme: light;
}
:root[data-theme="light"] .av { color: hsl(var(--h) 22% 30%); background: hsl(var(--h) 18% 92%); box-shadow: inset 0 0 0 1px hsl(var(--h) 14% 82%); }
:root[data-theme="light"] .rays line { stroke-opacity: .5; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.02em; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 12px; background: var(--raised); padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
::selection { background: var(--selection); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .15s, box-shadow .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }
.btn-primary:not(:disabled):active { transform: none; }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-ghost:not(:disabled):hover { border-color: var(--line-strong); background: var(--raised); }
.btn-block { width: 100%; height: 44px; font-size: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--raised); }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: var(--nav-bg); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 11px; }
/* Logo: a window with its top-right corner open and an orange dot in the gap (the missing website),
   and "unsited" with the same orange dot on the i. */
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; color: var(--ink); }
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .mark-dot { fill: var(--logo-dot); stroke: none; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.035em; line-height: 1; }
.i-stem { position: relative; display: inline-block; }
.i-ring {
  position: absolute; left: 50%; top: 0.02em; width: 0.17em; height: 0.17em; transform: translateX(-50%);
  border-radius: 50%; background: var(--logo-dot);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.brand-sub { color: var(--muted); font-size: 13px; padding-left: 11px; border-left: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-box { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user-box #userEmail { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 340px 1fr; min-height: calc(100vh - 60px); }
.sidebar {
  border-right: 1px solid var(--line-2); background: var(--side-bg); padding: 24px 22px 32px;
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
}
.side-title { font-size: 20px; }
.side-help { color: var(--muted); margin: 6px 0 20px; font-size: 13px; }
.side-note { color: var(--faint); font-size: 12px; margin: 16px 0 0; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field em { font-style: normal; font-weight: 500; color: var(--faint); }
.field small { color: var(--faint); font-size: 12px; line-height: 1.45; }
.field input:not([type=range]):not([type=checkbox]), .field select, .field textarea, .filters select {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .filters select:focus {
  outline: none; border-color: var(--line-strong); background: var(--surface);
}
select option { background: var(--surface); color: var(--ink); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-label { display: flex; justify-content: space-between; align-items: baseline; }
.range-label output { font-family: var(--mono); color: var(--ink); font-size: 13px; }
input[type=range] { accent-color: var(--check); width: 100%; }
.checks { gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.check-row input { margin-top: 1px; flex: none; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--check); cursor: pointer; margin: 0; }

.progress { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.progress-bar { height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .35s ease; }
.progress-text { margin: 9px 0 6px; font-size: 12.5px; color: var(--ink-2); word-break: break-word; }

.usage-box { margin-top: 16px; display: grid; gap: 10px; }
.usage-row { font-size: 12px; color: var(--muted); padding: 11px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); }
.usage-row div { display: flex; justify-content: space-between; margin-bottom: 7px; }
.usage-row b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); }
.usage-row .bar { height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; display: block; }
.usage-row .bar i { display: block; height: 100%; background: var(--ok); }
.usage-row .bar i.warn { background: var(--warm); }
.usage-row .bar i.full { background: var(--hot); }

/* ---------- main ---------- */
.main { min-width: 0; padding: 28px 30px 60px; }

/* empty state with topographic map (signature) */
.empty { position: relative; display: grid; place-items: center; min-height: calc(100vh - 150px); overflow: hidden; border-radius: 14px; }
.topo { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--topo); pointer-events: none; }
.empty-inner { position: relative; max-width: 640px; padding: 20px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.empty h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; }
.empty .lede { color: var(--muted); font-size: 16px; margin: 16px 0 30px; max-width: 54ch; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.steps li { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; }
.steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--raised); color: var(--ink-2); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.steps strong { display: block; font-weight: 600; margin-bottom: 3px; }
.steps span { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* results */
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.results-head h1 { font-size: 30px; letter-spacing: -0.03em; font-weight: 700; }
.results-head p { margin: 5px 0 0; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select { width: auto; height: 36px; font-size: 13px; background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 3px; max-width: 100%; overflow-x: auto; }
.seg button { white-space: nowrap; flex: none; border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 5px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--line) inset; }
.seg-full { display: flex; }
.seg-full button { flex: 1; }
.search-box { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); flex: 1; min-width: 180px; color: var(--faint); }
.search-box:focus-within { border-color: var(--line-strong); }
.search-box input { border: 0; background: none; outline: none; width: 100%; font-size: 13px; color: var(--ink); }
.search-box input::placeholder { color: var(--faint); }

.selbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; flex-wrap: wrap;
}
.selbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; cursor: pointer; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow-x: auto; box-shadow: var(--shadow); }
table.leads { width: 100%; border-collapse: collapse; min-width: 900px; }
.leads th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0;
}
.leads td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.leads tbody tr { cursor: pointer; transition: background .12s; }
.leads tbody tr:hover { background: var(--surface-2); }
.leads tbody tr.sel { background: var(--tint); box-shadow: inset 2px 0 0 var(--ink-2); }
.leads tbody tr:last-child td { border-bottom: 0; }
.c-check { width: 44px; }
.c-num { text-align: right !important; white-space: nowrap; }
.c-addr { max-width: 260px; }
.biz { display: flex; align-items: center; gap: 12px; }
.av {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
  color: hsl(var(--h) 18% 76%); background: hsl(var(--h) 8% 17%); box-shadow: inset 0 0 0 1px hsl(var(--h) 10% 28%);
}
.biz-name { font-weight: 600; color: var(--ink); }
.biz-cat { font-size: 12px; color: var(--muted); }
.addr { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.phone { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; color: var(--ink-2); }
.rating { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.rating svg { width: 13px; height: 13px; fill: var(--star); stroke: var(--star); }
.rating small { color: var(--faint); }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag-none, .tag-dead { background: var(--hot-soft); color: var(--hot); }
.tag-social { background: var(--warm-soft); color: var(--warm); }
.tag-own { background: var(--cold-soft); color: var(--cold); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }

/* score: signal-strength bars (signature) */
.score { display: inline-flex; align-items: center; gap: 9px; justify-content: flex-end; }
.score b { font-family: var(--mono); font-weight: 500; font-size: 13px; min-width: 22px; text-align: right; color: var(--ink-2); }
.sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.sig i { width: 4px; border-radius: 1px; background: var(--line); }
.sig i:nth-child(1) { height: 25%; } .sig i:nth-child(2) { height: 50%; } .sig i:nth-child(3) { height: 75%; } .sig i:nth-child(4) { height: 100%; }
.tier-hot .sig i.on { background: var(--tier-hot); }
.tier-warm .sig i.on { background: var(--tier-warm); }
.tier-cold .sig i.on { background: var(--tier-cold); }
.tier-hot b { color: var(--ink); }

.web-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.web-url { font-size: 12px; color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-match { padding: 34px; text-align: center; color: var(--muted); margin: 0; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(4, 6, 10, .6); backdrop-filter: blur(2px); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--bg-2); z-index: 41;
  display: flex; flex-direction: column; border-left: 1px solid var(--line); box-shadow: -30px 0 60px -20px var(--shadow-c);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 24px; letter-spacing: -0.03em; }
.drawer-head .eyebrow { margin-bottom: 6px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 32px; }
.drawer-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.d-section { margin-bottom: 24px; }
.d-section h3 { font-family: var(--font); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 10px; font-weight: 600; }
.d-section p { color: var(--ink-2); margin: 0; }
.score-card { display: flex; gap: 20px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.score-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 86px; }
.score-big { font-family: var(--display); font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
.score-card.tier-hot .score-big { color: var(--hot); }
.score-card.tier-warm .score-big { color: var(--warm); }
.score-col .sig { height: 18px; }
.tier-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.score-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 3px; }
.kv { display: grid; grid-template-columns: 22px 1fr; gap: 11px 8px; align-items: start; }
.kv svg { margin-top: 3px; color: var(--faint); }
.kv a { color: var(--link); text-decoration: none; word-break: break-all; }
.kv a:hover { text-decoration: underline; }
.hours { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.review { padding: 14px; margin-bottom: 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.review-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 6px; }
.review-head strong { font-weight: 600; }
.review p { color: var(--ink-2); font-size: 13px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.photos .btn { grid-column: 1 / -1; }
.scan-box { padding: 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: var(--surface); }
.scan-box dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; margin: 0; }
.scan-box dt { color: var(--faint); }
.scan-box dd { margin: 0; word-break: break-word; color: var(--ink-2); }
.theme-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.theme-list li { font-size: 13px; padding: 11px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.theme-list q { display: block; color: var(--muted); margin-top: 4px; font-size: 12.5px; }
.pitch h4 { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 16px 0 8px; }
.pitch .small { font-size: 12.5px; margin: -4px 0 4px; }
.pitch-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pitch-list li { font-size: 13px; line-height: 1.5; padding: 10px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.pitch-list q { display: block; color: var(--muted); margin-top: 4px; font-size: 12.5px; }
.pitch-opener { display: flex; gap: 12px; align-items: flex-start; padding: 12px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.pitch-opener p { flex: 1; font-size: 13.5px; line-height: 1.55; margin: 0; }
.pitch-opener .btn { flex: none; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(4, 6, 10, .7); backdrop-filter: blur(4px); }
.modal-card {
  width: min(540px, 100%); max-height: calc(100vh - 40px); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 40px 80px -30px var(--shadow-c); display: flex; flex-direction: column; overflow: hidden;
}
.modal-wide { width: min(1260px, 100%); height: calc(100vh - 40px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; }
.settings-form { padding: 20px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
.ad-error { margin: -4px 0 14px; font-size: 13px; color: var(--hot); }

.pm-grid { display: grid; grid-template-columns: 310px 1fr; flex: 1; min-height: 0; }
.pm-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.pm-options { padding: 18px; border-bottom: 1px solid var(--line); }
.pm-options .field:last-of-type { margin-bottom: 14px; }
.pm-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.pm-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; border-radius: var(--radius); cursor: pointer; font-size: 13px; transition: background .12s; }
.pm-list li:hover { background: var(--surface-2); }
.pm-list li.on { background: var(--raised); box-shadow: inset 2px 0 0 var(--ink-2); }
.pm-list .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-list .st { font-size: 11px; color: var(--faint); flex: none; }
.pm-list .st.done { color: var(--ok); }
.pm-list .st.busy { color: var(--ink-2); }
.pm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pm-toolbar strong { display: block; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.pm-toolbar .muted { font-size: 12.5px; }
.pm-actions { display: flex; gap: 8px; }
.pm-output {
  flex: 1; border: 0; resize: none; padding: 20px 22px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  background: var(--bg); color: var(--ink-2); outline: none; min-height: 200px;
}
.lock-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.lock-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; }
.lock-list .lk-email { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lock-list .lk-meta { color: var(--muted); font-size: 12px; }
.lock-list .empty { color: var(--faint); border-style: dashed; justify-content: center; }
.pm-foot-end { display: flex; align-items: center; gap: 14px; }
.aff-note { color: var(--faint); font-size: 11.5px; text-decoration: none; }
.aff-note:hover { color: var(--ink-2); text-decoration: underline; }
.aff-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 2px; margin: 0 0 14px; }
.aff-fields legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.aff-fields legend em { font-style: normal; font-weight: 500; color: var(--faint); }
.aff-fields > small { display: block; color: var(--faint); font-size: 12px; margin-bottom: 12px; }
.pm-foot { display: flex; justify-content: space-between; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); font-size: 12.5px; background: var(--surface); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--raised); color: var(--ink);
  border: 1px solid var(--line); padding: 11px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  box-shadow: 0 20px 40px -15px var(--shadow-c); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .empty-inner > * { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
  .empty-inner > :nth-child(2) { animation-delay: .06s; }
  .empty-inner > :nth-child(3) { animation-delay: .12s; }
  .empty-inner > :nth-child(4) { animation-delay: .18s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .main { padding: 22px 16px 50px; }
  .brand-sub { display: none; }
  .empty { min-height: 0; padding: 30px 0; }
  .steps { grid-template-columns: 1fr; }
  /* One scrolling column on small screens: options, lead list, then the prompt (nothing overlaps). */
  .pm-grid { display: flex; flex-direction: column; overflow-y: auto; }
  .pm-side { border-right: 0; border-bottom: 1px solid var(--line); flex: none; }
  .pm-list { flex: none; max-height: 30vh; }
  .pm-main { flex: none; }
  .pm-output { min-height: 60vh; }
  .modal { padding: 0; }
  .modal-wide { height: 100vh; max-height: 100vh; border-radius: 0; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  .sidebar { padding: 20px 16px 24px; }
  .results-head { flex-direction: column; align-items: flex-start; }
  .pm-actions .btn span { display: none; }
  #settingsBtn span { display: none; }
}

/* ---------- views: search results / saved leads ---------- */
.view-tabs { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.view-tabs button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.view-tabs button:hover { color: var(--ink); }
.view-tabs button.on { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--line) inset; }
.view-tabs .count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.view-tabs .count:empty { display: none; }
.view-tabs .count.due { color: var(--hot); }
.saved-filter { flex: 0 1 280px; }
.saved-empty { padding: 28px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.saved-tag { height: 18px; padding: 0 6px; font-size: 10.5px; margin-left: 6px; vertical-align: 2px; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(176px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; min-height: 160px; transition: border-color .15s, background .15s; }
.col.over { border-color: var(--line-hover); background: var(--surface); }
.col header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13px; }
.col header b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--muted); }
.col-cards { display: grid; gap: 8px; padding: 10px; }
.col-empty { margin: 6px 0; text-align: center; color: var(--faint); font-size: 12.5px; padding: 18px 0; border: 1px dashed var(--line-2); border-radius: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 9px; cursor: grab; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line-3); }
.card:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.card.dragging { opacity: .5; cursor: grabbing; }
.card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-top .av { width: 30px; height: 30px; font-size: 11px; border-radius: 8px; }
.card-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.card-phone { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-decoration: none; }
.card-phone svg { width: 13px; height: 13px; color: var(--faint); }
.card-notes { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-foot .tag svg { width: 12px; height: 12px; }
.card-stage { height: 28px; padding: 0 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--ink-2); margin-left: auto; }

/* ---------- pipeline panel inside the lead panel ---------- */
.pipe-panel { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pipe-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; }
.link-btn.danger { color: var(--hot); text-decoration-color: rgba(216, 144, 122, .4); }

@media (max-width: 960px) { .board { grid-template-columns: repeat(5, 240px); } .saved-filter { flex-basis: 100%; } }

/* ---------- theme switch ---------- */
.theme-btn { width: 36px; height: 36px; flex: none; color: var(--ink-2); }
.theme-btn:hover { color: var(--ink); }
.theme-btn .ic-moon { display: none; }
:root[data-theme="light"] .theme-btn .ic-sun { display: none; }
:root[data-theme="light"] .theme-btn .ic-moon { display: block; }
.hnav .theme-btn { background: transparent; }

/* ---------- app navigation and simple pages (account, site watch) ---------- */
.topbar .brand { text-decoration: none; }
.app-nav { display: flex; gap: 4px; margin-right: auto; margin-left: 28px; }
.app-nav a { height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; transition: color .15s, background .15s; }
.app-nav a:hover { color: var(--ink); }
.app-nav a[aria-current="page"] { color: var(--ink); background: var(--raised); box-shadow: 0 0 0 1px var(--line) inset; }
.page-main { max-width: 760px; margin: 0 auto; padding: 36px 24px 40px; }
.page-main.wide { max-width: 1040px; }
.page-title { font-size: clamp(28px, 4vw, 36px); letter-spacing: -0.035em; font-weight: 700; margin-bottom: 22px; }
.page-lede { color: var(--muted); font-size: 15px; margin: -10px 0 24px; max-width: 64ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 16.5px; letter-spacing: -0.015em; }
.panel-head .btn { text-decoration: none; }
.panel-danger { border-color: color-mix(in srgb, var(--hot) 35%, var(--line)); }
.small { font-size: 13px; line-height: 1.55; margin: 8px 0 0; }
.plan-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.plan-line strong { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.meter { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--ink-2); border-radius: 4px; transition: width .5s ease; }
.meter.full span { background: var(--hot); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 18px; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 260px; margin-bottom: 0; }
.inline-form .btn { height: 40px; }
.stack-form .row-2 { margin-top: 4px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.form-msg { margin: 10px 0 0; font-size: 13px; color: var(--hot); }
.form-msg.ok { color: var(--ok); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--hot) 55%, transparent); color: var(--hot); }
.btn-danger:not(:disabled):hover { background: var(--hot-soft); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 6px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg input:checked + span { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--line) inset; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-line { text-align: center; margin-top: 22px; }
.help-line a { color: var(--link); }
.page-foot { display: flex; justify-content: center; gap: 20px; padding: 10px 24px 36px; font-size: 13px; }
.page-foot a { color: var(--muted); text-decoration: none; }
.page-foot a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .app-nav { margin-left: 8px; }
  .app-nav a { padding: 0 8px; font-size: 13px; }
  .facts { grid-template-columns: 1fr; }
  .page-main { padding: 26px 16px 32px; }
  .topbar .brand-name, .topbar .brand-sub { display: none; }
}

/* site watch */
.site-label-field { flex: 0 1 220px !important; }
.sites { display: grid; gap: 12px; }
.site { padding: 18px 20px; }
.site-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.site-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.site-name strong { font-size: 15.5px; overflow-wrap: anywhere; }
.site-url { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; text-decoration: none; }
.site-url:hover { color: var(--ink); }
.site-url svg { width: 12px; height: 12px; }
.tag-pending { background: var(--cold-soft); color: var(--cold); }
.tag-up { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warm-soft); color: var(--warm); }
.tag-down { background: var(--hot-soft); color: var(--hot); }
.site-body { margin: 12px 0 0; }
.site-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; }
.tag-box { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.tag-box code { flex: 1; background: none; padding: 0; font-size: 12px; overflow-wrap: anywhere; color: var(--ink-2); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.issues li { position: relative; padding-left: 16px; font-size: 13.5px; color: var(--ink-2); }
.issues li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: var(--faint); }
.issues .issue-down::before { background: var(--hot); }
.issues .issue-warning::before { background: var(--warm); }
.ok-line { color: var(--ok); }
.site-events { margin-top: 12px; font-size: 13px; }
.site-events summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.site-events ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; color: var(--ink-2); }
.site-events time { color: var(--faint); }
.ev { font-weight: 600; }
.ev-down { color: var(--hot); } .ev-warning { color: var(--warm); } .ev-recovered { color: var(--ok); } .ev-info { color: var(--muted); }
.site-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.site-foot > span { margin: 0 auto 0 0; }
.sites-empty h2 { font-size: 16px; }
@media (max-width: 720px) {
  .site-facts { grid-template-columns: 1fr 1fr; }
  .site-label-field { flex: 1 1 100% !important; }
}

/* leads left on the plan, under the search button */
.allowance { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.allowance a { color: var(--ink); font-weight: 500; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.allowance.is-out { color: var(--ink-2); }
/* warning that a niche and city usually give few leads */
.area-hint { margin: 10px 0 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); background: var(--accent-soft); }
.user-list select { height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); padding: 0 8px; font-size: 13px; }

/* website style picker in the prompt window */
.pm-style { display: grid; grid-template-columns: auto minmax(0, 260px) 1fr; align-items: center; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.pm-style label { font-weight: 600; color: var(--ink-2); }
.pm-style select { height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); padding: 0 8px; font-size: 13px; min-width: 0; }
.pm-why { grid-column: 1 / -1; margin: 2px 0 0; color: var(--muted); line-height: 1.5; }
@media (max-width: 720px) { .pm-style { grid-template-columns: 1fr; } }

/* ---------- account menu (top right of the app pages) ---------- */
.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 4px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--raised); color: var(--ink); }
.avatar-dot {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px;
  background: var(--ink); color: var(--bg); font: 600 12.5px/1 var(--font);
}
.user-btn .chev { width: 14px; height: 14px; transition: transform .15s; }
.user-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 40px -18px var(--shadow-c);
}
.menu-email { margin: 0; padding: 8px 10px 10px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu [role="menuitem"] {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none; text-align: left; cursor: pointer;
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus-visible { background: var(--raised); color: var(--ink); outline: none; }
.menu [role="menuitem"] svg { width: 16px; height: 16px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.menu [data-theme-toggle] .ic-moon { display: none; }
:root[data-theme="light"] .menu [data-theme-toggle] .ic-sun { display: none; }
:root[data-theme="light"] .menu [data-theme-toggle] .ic-moon { display: block; }

/* ---------- lighter app typography, neutral small labels ---------- */
/* Small text stays gray/white; the clay accent is kept for larger marks (score bars, the logo dot). */
.tag { font-weight: 500; }
.tag-none, .tag-dead { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag-social { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.empty h1 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
.empty .lede { font-size: 15px; }
.results-head h1 { font-size: 26px; font-weight: 600; }
.page-title { font-weight: 600; }
.leads td { padding: 10px 14px; }
.av { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.biz-name { font-weight: 500; }
.check { font-weight: 500; }
.field > span { font-weight: 500; }
.card-name { font-weight: 500; }
.pm-list .nm { font-weight: 500; }
.steps strong { font-weight: 500; }
.score-big { font-weight: 600; }
.avatar-dot.has-photo { background: none; overflow: hidden; }
.avatar-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-email strong { color: var(--ink); font-weight: 500; font-size: 13.5px; }

/* ---------- plans window in the app ---------- */
.plans-modal { width: min(980px, 100%); }
.plans-modal .modal-head { align-items: flex-start; }
.plans-modal-sub { margin: 6px 0 0; font-size: 13.5px; }
.plans-in-app { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 20px 6px; align-items: start; overflow-y: auto; }
.plans-in-app .plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.plans-in-app .plan-rec { border-color: var(--line-strong); background: var(--surface-2); }
.plans-in-app .plan-badge { position: absolute; top: 16px; right: 16px; margin: 0; font-size: 11px; font-weight: 500; color: var(--ink-2); padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; }
.plans-in-app .plan h3 { font-size: 17px; }
.plans-in-app .price { margin: 10px 0 16px; display: flex; align-items: baseline; gap: 4px; }
.plans-in-app .price b { font-family: var(--display); font-size: 34px; letter-spacing: -0.04em; font-weight: 600; }
.plans-in-app .price span { color: var(--muted); }
.plans-in-app ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.plans-in-app li { color: var(--ink-2); font-size: 13.5px; padding-left: 20px; position: relative; }
.plans-in-app li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 9px; height: 5px; border-left: 1.5px solid var(--ok); border-bottom: 1.5px solid var(--ok); transform: rotate(-45deg); }
.plans-modal-msg { padding: 0 20px 16px; }
@media (max-width: 760px) { .plans-in-app { grid-template-columns: 1fr; } }
.tag-outdated { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.field-note { display: block; color: var(--faint); font-size: 12px; line-height: 1.45; margin: -6px 0 15px; }

/* creators (affiliates) in admin Settings */
.aff-item { align-items: flex-start !important; }
.aff-item.paused { opacity: .6; }
.aff-item .lk-meta { margin-top: 3px; }
.aff-item .link-btn { font-weight: 500; font-size: 12.5px; }
.aff-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.aff-actions .btn { height: 30px; font-size: 12.5px; }
.aff-new { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 4px; }

/* ---------- results list and lead drawer (v2) ---------- */
/* Lead tiers read like a traffic light: green hot, yellow warm, red cold. Their own tokens, so site watch's
   "down" red and the logo orange are not affected. */
:root { --tier-hot: #6fbf86; --tier-warm: #e0bf55; --tier-cold: #e07560; }
:root[data-theme="light"] { --tier-hot: #23874a; --tier-warm: #a77d0b; --tier-cold: #c2452f; }

/* the page behind the drawer never scrolls while it is open */
html.drawer-open { overflow: hidden; } /* not body too: that would unstick the top bar and the search panel */
.drawer-body { overscroll-behavior: contain; }

/* summary tiles above the list */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stat b { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; color: var(--ink); }
.stat span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.stat small { font-size: 12px; color: var(--faint); }
.stat-hot { border-color: color-mix(in srgb, var(--tier-hot) 40%, var(--line)); }
.stat-hot b { color: var(--tier-hot); }

/* rows */
table.leads { min-width: 860px; }
.leads td { padding: 14px; }
.leads th { padding: 10px 14px; }
.leads tbody tr:hover .c-go svg { color: var(--ink); transform: translateX(3px); }
.leads .av { width: 38px; height: 38px; border-radius: 10px; font-size: 13.5px; }
.biz-text { min-width: 0; }
.biz-name { font-size: 14px; line-height: 1.3; }
.biz-cat { margin-top: 2px; }
.c-score { width: 176px; }
.c-go { width: 40px; text-align: right; }
.c-go svg { color: var(--faint); transition: transform .15s, color .15s; }
.opp { display: flex; align-items: center; gap: 12px; }
.opp > b { min-width: 30px; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.035em; color: var(--tier-cold); }
.opp.tier-hot > b { color: var(--tier-hot); }
.opp.tier-warm > b { color: var(--tier-warm); }
.opp-side { display: flex; flex-direction: column; gap: 6px; }
.opp-side span { font-size: 11.5px; color: var(--muted); }
.lmeter { display: block; width: 84px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.lmeter i { display: block; height: 100%; border-radius: 3px; background: var(--tier-cold); }
.tier-hot .lmeter i { background: var(--tier-hot); }
.tier-warm .lmeter i { background: var(--tier-warm); }
.rep { display: flex; flex-direction: column; gap: 3px; }
.rep-top { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rep-top svg { width: 13px; height: 13px; fill: var(--star); stroke: var(--star); }
.rep-sub { font-size: 12px; color: var(--muted); }
.contact { display: flex; flex-direction: column; gap: 3px; max-width: 240px; }
.contact .addr { -webkit-line-clamp: 1; }

/* drawer header */
.drawer { width: min(620px, 100vw); }
.drawer-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 14px; align-items: start; padding: 22px 24px 18px; background: var(--surface); }
.dh-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.av-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
.dh-text { min-width: 0; }
.drawer-head h2 { font-size: 26px; line-height: 1.12; }
.dh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dh-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.dh-actions:empty { display: none; }
.btn-sm { height: 32px; padding: 0 11px; gap: 7px; font-size: 12.5px; font-weight: 500; text-decoration: none; }
.btn-sm svg { width: 14px; height: 14px; color: var(--muted); }
.icon-btn-sm { width: 30px; height: 30px; flex: none; }
.icon-btn-sm svg { width: 14px; height: 14px; color: var(--muted); }
.tag-tier { background: transparent; }
.tag-tier.tier-hot { color: var(--tier-hot); background: color-mix(in srgb, var(--tier-hot) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-hot) 45%, transparent); }
.tag-tier.tier-warm { color: var(--tier-warm); background: color-mix(in srgb, var(--tier-warm) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-warm) 45%, transparent); }
.tag-tier.tier-cold { color: var(--tier-cold); background: color-mix(in srgb, var(--tier-cold) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-cold) 45%, transparent); }

/* drawer body */
.drawer-body { padding: 20px 24px 32px; }
.d-section { margin-bottom: 26px; }
.d-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 24px; }
.d-stat { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.d-stat-label { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.d-stat b { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; color: var(--ink); }
.d-stat.tier-hot b { color: var(--tier-hot); }
.d-stat.tier-warm b { color: var(--tier-warm); }
.d-stat.tier-cold b { color: var(--tier-cold); }
.d-stat .lmeter { width: 100%; }
.d-stat small { font-size: 12px; color: var(--muted); }
.stars { position: relative; display: inline-block; align-self: flex-start; white-space: nowrap; }
.stars span { display: block; font-size: 15px; line-height: 1; letter-spacing: 2px; color: var(--line-strong); }
.stars span + span { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--star); } /* filled part, as wide as the rating */
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.why-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.why-list svg { width: 15px; height: 15px; margin-top: 2px; color: var(--ok); stroke-width: 2.4; }

.pitch { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--logo-dot); border-radius: 14px; }
.pitch h3 { color: var(--ink-2); }
.pitch-list li { background: var(--bg-2); }
.pitch-opener { background: var(--raised); border-color: var(--line-strong); }
.pitch-opener p { font-size: 14px; color: var(--ink); }

/* Call prep: facts, ideas and questions for one lead. */
.callkit { margin-top: 14px; }

.info-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.info-row:last-child { border-bottom: 0; }
.info-row > svg { margin-top: 3px; color: var(--faint); }
.info-main { flex: 1; min-width: 0; }
.info-label { display: block; margin-bottom: 2px; font-size: 11.5px; color: var(--muted); }
.info-value { font-size: 13.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.info-value a { color: var(--link); text-decoration: none; }
.info-value a:hover { text-decoration: underline; }
.info-value .tag { margin-left: 6px; vertical-align: 1px; }
.scan-box { border-radius: 12px; }
.d-quote { padding: 12px 14px; font-size: 13.5px; line-height: 1.55; background: var(--surface); border-left: 2px solid var(--line-strong); border-radius: 0 10px 10px 0; }

.hours { overflow: hidden; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.hours li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.hours li:last-child { border-bottom: 0; }
.hours li.today { background: var(--raised); color: var(--ink); font-weight: 500; }
.hours em { margin-left: 6px; font-style: normal; font-size: 11px; color: var(--muted); }

.review { padding: 14px 16px; }
.review-head { justify-content: flex-start; align-items: center; gap: 10px; margin-bottom: 8px; }
.av-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11.5px; }
.review-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.review-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.review p { line-height: 1.55; }

@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .d-stats { grid-template-columns: 1fr 1fr; }
  .d-stats .d-stat:first-child { grid-column: 1 / -1; }
  .drawer-head, .drawer-body { padding-left: 18px; padding-right: 18px; }
}

/* Smooth drawer scrolling: a full-screen backdrop blur has to be redrawn on every scroll frame, so the scrim is a
   plain dark layer instead, and the drawer body scrolls on its own composited layer. */
.scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(4, 6, 10, .72); }
:root[data-theme="light"] .scrim { background: rgba(20, 21, 24, .45); }
.drawer { will-change: transform; }
.drawer-body { contain: content; transform: translateZ(0); }

/* auto-renewal terms under each plan button */
.renew-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); text-align: center; }

/* Pop-up windows (Generate prompt, Settings, plans): while one is open the page behind cannot scroll, scrolling
   inside never spills over to the page, and there is no full-screen blur to redraw on every scroll frame. */
html:has(.modal:not([hidden])) { overflow: hidden; }
.modal { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(4, 6, 10, .78); overscroll-behavior: contain; }
:root[data-theme="light"] .modal { background: rgba(20, 21, 24, .5); }
.modal-card, .modal-card * { overscroll-behavior: contain; }
.pm-list, .pm-output, .settings-form { contain: content; }

/* ---------- dropdowns ----------
   Browsers that support styleable selects get a menu that matches the app; the others keep their own. It is still
   a real <select>, so keyboard, screen readers and phones work as before. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
  .field select { display: flex; }
  select:hover { border-color: var(--line-hover); }
  select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  select::picker-icon { content: ''; flex: none; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .18s; }
  select:open::picker-icon { transform: translateY(2px) rotate(225deg); }
  ::picker(select) {
    margin: 6px 0; padding: 6px; max-height: min(360px, 60vh); overflow-y: auto;
    border: 1px solid var(--line-3); border-radius: 10px; background: var(--surface); color: var(--ink);
    box-shadow: 0 18px 44px -18px var(--shadow-c); font-size: 13.5px; min-width: anchor-size(width);
    opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .14s, display .14s allow-discrete, overlay .14s allow-discrete;
  }
  ::picker(select):popover-open { opacity: 1; transform: none; }
  @starting-style { ::picker(select):popover-open { opacity: 0; transform: translateY(-4px); } }
  select option { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
  select option:hover, select option:focus-visible { background: var(--raised); color: var(--ink); outline: none; }
  select option:checked { color: var(--ink); font-weight: 600; }
  select option::checkmark { content: ''; order: 1; flex: none; width: 7px; height: 13px; margin: -3px 4px 0 auto; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
  select option:not(:checked)::checkmark { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { ::picker(select), select::picker-icon { transition: none; } }

/* Regenerate: the icon turns while a new prompt is written. */
@keyframes regen-spin { to { transform: rotate(360deg); } }
#pmRegen.spinning svg { animation: regen-spin .7s linear infinite; }
#pmRegen.spinning { cursor: progress; }
@media (prefers-reduced-motion: reduce) { #pmRegen.spinning svg { animation: none; opacity: .5; } }

.pm-tip { margin: -8px 0 14px; line-height: 1.5; }

/* first steps: examples above the form, and the next step after a search */
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.examples span { font-size: 12.5px; color: var(--muted); flex-basis: 100%; }
.next-step { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 10px 12px 10px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.next-step p { margin: 0; flex: 1; font-size: 14px; }
@media (max-width: 560px) { .next-step { flex-wrap: wrap; } .next-step p { flex-basis: 70%; } }

/* ---------- smoothness ----------
   One easing for everything that moves, only opacity and transform are animated, and things leave as well as enter. */
:root { --ease: cubic-bezier(.32, .72, 0, 1); }
html { scrollbar-gutter: stable; } /* locking the page behind a drawer must not change its width */

/* The results list: fixed columns, so the browser never measures every row, and rows off screen are not drawn. */
table.leads, .leads thead, .leads tbody { display: block; }
.leads tr { display: grid; grid-template-columns: 44px minmax(0, 2.1fr) 176px minmax(0, 1.4fr) 116px minmax(0, 1.6fr) 44px; align-items: center; }
.leads th, .leads td { width: auto; min-width: 0; }
.leads td { border-bottom: 0; padding: 16px 14px; }
.leads thead tr { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.leads th { border: 0; background: none; position: static; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.leads tbody tr { border-bottom: 1px solid var(--line-2); content-visibility: auto; contain-intrinsic-size: auto 78px; }
.leads tbody tr:last-child { border-bottom: 0; }
.table-wrap { box-shadow: none; }
.rows-end { height: 1px; }

/* Drawer, scrim and pop-up windows */
.drawer { transition: transform .42s var(--ease), visibility 0s .42s; }
.drawer.open { transition: transform .42s var(--ease), visibility 0s; }
.drawer-body > * { animation: soft-in .3s var(--ease) both; }
.scrim, .modal { transition: opacity .28s ease, display .28s allow-discrete; }
.scrim[hidden], .modal[hidden] { opacity: 0; pointer-events: none; }
.modal-card { transition: transform .36s var(--ease); }
.modal[hidden] .modal-card { transform: scale(.97); }
@starting-style {
  .scrim, .modal { opacity: 0; }
  .modal-card { transform: scale(.96) translateY(10px); }
}

/* Views and small controls */
#results, #savedView { animation: soft-in .34s var(--ease); }
@keyframes soft-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.btn, .btn-primary, .icon-btn { transition: background .2s, border-color .2s, color .2s, opacity .2s, transform .2s var(--ease); }
.btn:not(:disabled):active, .btn-primary:not(:disabled):active, .icon-btn:active { transform: scale(.97); }
.seg button, .view-tabs button { transition: color .2s, background .2s; }
.results-head h1 { font-size: 34px; }
.stat { padding: 18px 20px; }
@media (prefers-reduced-motion: reduce) {
  .drawer-body > *, #results, #savedView { animation: none; }
  .btn:not(:disabled):active, .btn-primary:not(:disabled):active, .icon-btn:active { transform: none; }
}

/* On phones each lead is a card instead of a table that scrolls sideways. */
@media (max-width: 720px) {
  table.leads { min-width: 0; }
  .leads thead { display: none; }
  .leads tbody tr { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 10px; padding: 14px 14px 14px 4px; contain-intrinsic-size: auto 150px; }
  .leads td { padding: 0 0 0 10px; }
  .leads td.c-score { width: auto; justify-self: end; }
  .leads .opp-side { display: none; }
  .leads td:nth-child(4) { grid-column: 2; }
  .leads td:nth-child(5) { grid-column: 3; }
  .leads td:nth-child(5) .rep { align-items: flex-end; }
  .leads td:nth-child(6) { grid-column: 2 / -1; }
  .leads td.c-go { display: none; }
}

/* No fades on the rows themselves: while the list scrolls, every row passing under the pointer would start one. */
.leads tbody tr, .c-go svg { transition: none; }
.leads tbody tr:hover .c-go svg { transform: none; }
/* Messages stay clear of the open lead and its buttons. */
html.drawer-open .toast { left: calc((100vw - min(620px, 100vw)) / 2); max-width: calc(100vw - 660px); }
@media (max-width: 1080px) { html.drawer-open .toast { left: 50%; bottom: 92px; max-width: calc(100vw - 32px); } }

/* Prompt buttons wrap on small screens instead of running off the edge, and keep their labels. */
.pm-actions { flex-wrap: wrap; }
@media (max-width: 560px) { .pm-actions .btn span { display: inline; } }

/* ---------- admin Settings window ----------
   "empty" is also the big welcome screen, so list messages must not inherit its full-screen height. */
#settingsModal .modal-card { width: min(680px, 100%); }
.lock-list li.empty { position: static; display: flex; min-height: 0; overflow: visible; border-radius: 8px; padding: 14px 10px; place-items: normal; }
.settings-form { overscroll-behavior: contain; scroll-padding: 16px; }
.settings-form select { min-width: 0; max-width: 100%; }
.settings-form select { white-space: nowrap; width: 100%; overflow: hidden; }
.settings-form selectedcontent { display: block; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aff-new .row-2 > .field:has(#affDeal) { grid-column: 1 / -1; }
.aff-new .row-2:has(#affDeal) { grid-template-columns: 1fr; }
.lock-list li > div { min-width: 0; }
.lk-meta { overflow-wrap: anywhere; }
.settings-form .user-list select { width: auto; flex: none; }

/* First visit: only what, where and the button. "More options" shows the rest. */
.quick-more { display: none; justify-self: start; margin: -4px 0 4px; font-size: 13px; }
#searchForm.is-quick .adv { display: none; }
#searchForm.is-quick .quick-more { display: inline-block; }

/* Founding member offer, above the plans */
.founding { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 20px 16px; padding: 18px 20px; border: 1px solid #e2743b; border-radius: 10px; background: rgba(226, 116, 59, .08); }
.founding[hidden] { display: none; }
.founding h3 { margin: 2px 0 4px; font-size: 19px; }
.founding-tag { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #e2743b; }
.founding-sub { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.founding .btn { flex: none; }
@media (max-width: 640px) { .founding { flex-direction: column; align-items: stretch; } }

/* "Not ready to upgrade?" */
.why-not { margin: 0 20px 20px; font-size: 13.5px; color: var(--ink-2); }
.why-not[hidden] { display: none; }
.why-not summary { cursor: pointer; width: max-content; max-width: 100%; }
.why-not form { display: grid; gap: 8px; margin-top: 10px; }
.why-not form[hidden] { display: none; }
.why-not textarea { width: 100%; resize: vertical; }
.why-not .btn { justify-self: start; }
.why-not-done { margin: 10px 0 0; }
