:root {
  --ink: #0b1830;
  --ink-2: #4a5873;
  --ink-3: #8592a8;
  --surface: #f2f5fa;
  --card: #ffffff;
  --line: #dce3ee;
  --brand: #2747f5;
  --brand-ink: #1a33c2;
  --brand-tint: #e8ecff;
  --mint: #6ff0c0;
  --clean: #0e9f6e;
  --clean-tint: #e3f6ee;
  --unver: #c98a04;
  --unver-tint: #fbf1d9;
  --bad: #d8452e;
  --bad-tint: #fce9e5;
  --queue: #c9d2e0;
  --display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 15px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(24px, 4vw, 32px); }
h2 { font-size: 18px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.boot { padding: 48px; text-align: center; color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---- top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; }
.top-in { max-width: 1160px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.05; display: block; }
.brand span { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #9fb0d0; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: #c5d0e6; padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.08); }
.nav a.on { color: #fff; background: rgba(255, 255, 255, 0.14); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: #c5d0e6; font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { background: none; border: 0; color: #c5d0e6; font: inherit; font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.linkbtn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

main { max-width: 1160px; margin: 0 auto; padding: 28px 20px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin-top: 6px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }

/* ---- buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #b9c4d6; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.sm { min-height: 32px; padding: 4px 11px; font-size: 13px; border-radius: 8px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 15px var(--body); }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linkbtn2 { background: none; border: 0; padding: 0; margin-top: 12px; color: var(--ink-2); font: 13px var(--body); text-decoration: underline; cursor: pointer; }
.err { color: var(--bad); font-size: 14px; margin: 8px 0; min-height: 20px; }

/* ---- sign in */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate-art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; }
.gate-art h1 { font-size: clamp(30px, 4.4vw, 52px); max-width: 12em; }
.gate-art h1 em { font-style: normal; color: var(--mint); }
.gate-art p { color: #a9b7d3; max-width: 34em; }
.demo-rail { display: grid; grid-template-columns: repeat(18, 1fr); gap: 5px; max-width: 460px; }
.demo-rail i { aspect-ratio: 1; border-radius: 4px; background: rgba(255, 255, 255, 0.1); animation: sort 5.4s infinite; }
@keyframes sort { 0%, 20% { background: rgba(255, 255, 255, 0.1); } 35% { background: var(--brand); } 55%, 100% { background: var(--c, var(--clean)); } }
.gate-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.gate-form form { width: 100%; max-width: 360px; }
.gate-form h2 { font-size: 24px; margin-bottom: 6px; }
.gate-form .muted { margin-bottom: 22px; }
.gate-form .btn { width: 100%; }

/* ---- lists */
.lrow { display: grid; grid-template-columns: minmax(0, 1.6fr) 110px minmax(120px, 1fr) 90px; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); color: inherit; }
.lrow:first-of-type { border-top: 0; }
a.lrow:hover { text-decoration: none; background: #fafbfe; }
.lrow .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.run { background: var(--brand-tint); color: var(--brand-ink); }
.pill.run::before { animation: pulse 1.2s infinite; }
.pill.ok { background: var(--clean-tint); color: #0a7450; }
.pill.warn { background: var(--unver-tint); color: #8a5e00; }
.pill.off { background: var(--surface); color: var(--ink-3); }
.pill.bad { background: var(--bad-tint); color: #a8301d; }
@keyframes pulse { 50% { opacity: 0.25; } }
.bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--queue); }
.bar i { display: block; height: 100%; transition: width 0.6s ease; }
.bar .c { background: var(--clean); }
.bar .u { background: var(--unver); }
.bar .b { background: var(--bad); }
.empty { text-align: center; padding: 40px 16px; }
.empty p { margin: 8px 0 18px; }

/* ---- upload and mapping */
.drop { display: block; border: 2px dashed #b9c4d6; border-radius: var(--r); padding: 44px 20px; text-align: center; background: #fff; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--brand); background: var(--brand-tint); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop b { font-family: var(--display); font-size: 20px; display: block; margin-bottom: 4px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
th { background: var(--surface); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.pick { background: var(--brand-tint); }
th.pick { color: var(--brand-ink); box-shadow: inset 0 -2px 0 var(--brand); }
.progress { height: 10px; border-radius: 99px; background: var(--queue); overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.3s; }

/* ---- list page: stages, rail, bins */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.stage { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid transparent; }
.stage b { display: block; font-size: 13px; }
.stage span { font-size: 12px; color: var(--ink-2); font-family: var(--mono); }
.stage.now { background: var(--brand-tint); border-color: var(--brand); }
.stage.now b { color: var(--brand-ink); }
.stage.past b::after { content: " ✓"; color: var(--clean); }
.rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.rail i { aspect-ratio: 1; border-radius: 3px; background: var(--queue); transition: background 0.5s; }
.rail i.s1 { background: #9fb1ff; animation: pulse 1.4s infinite; }
.rail i.s2 { background: var(--brand); animation: pulse 1.4s infinite; }
.rail.big { grid-template-columns: repeat(auto-fill, minmax(8px, 1fr)); gap: 2px; }
.rail.few { display: flex; }
.rail.few i { flex: 1; aspect-ratio: auto; height: 26px; border-radius: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.activity { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 13px; }
.bins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.bin { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--k); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bin h3 { font-size: 15px; }
.bin .n { font: 500 30px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.bin .pct { font-size: 12px; color: var(--ink-2); font-family: var(--mono); }
.bin p { font-size: 13px; color: var(--ink-2); flex: 1; }
.bin .btn { margin-top: 8px; }
.bin .pct.likely { color: var(--clean); font-weight: 500; min-height: 0; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 13px/1.5 var(--mono); resize: vertical; }
textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input[type="file"] { font: 14px var(--body); max-width: 100%; }
.bin.clean { --k: var(--clean); }
.bin.unver { --k: var(--unver); }
.bin.bad { --k: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; }

/* ---- checker card */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--ink-3); }
.dot.online { background: var(--clean); box-shadow: 0 0 0 4px var(--clean-tint); }
.dot.starting { background: var(--brand); animation: pulse 1.2s infinite; }
.dot.blocked { background: var(--bad); }
.state { font-family: var(--display); font-weight: 700; font-size: 17px; display: flex; align-items: center; margin-bottom: 6px; }

/* ---- team */
.person { padding: 14px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person.offp .name { color: var(--ink-3); text-decoration: line-through; }
.person-main { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.person .name { font-weight: 600; }
.person-meta { margin-top: 6px; }
.tags { gap: 6px; }
details.manage { margin-top: 8px; }
details.manage summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); width: fit-content; }
details.manage .row { margin-top: 10px; gap: 8px; }
.logwrap { max-height: 420px; overflow: auto; }
.logwrap th { position: sticky; top: 0; }
tr.warnrow td { background: var(--unver-tint); }
pre.creds { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; margin: 12px 0 16px; }
.card h2 + p.small { margin: -6px 0 12px; }

/* ---- dialog and toasts */
dialog { border: 0; border-radius: 14px; padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(11, 24, 48, 0.3); color: var(--ink); }
dialog::backdrop { background: rgba(11, 24, 48, 0.5); }
dialog h2 { margin-bottom: 14px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(11, 24, 48, 0.25); }
.toast.bad { background: var(--bad); }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; }
  .gate-art { padding: 28px 20px; min-height: 0; }
  .gate-art .demo-rail { display: none; }
}
@media (max-width: 640px) {
  .top-in { gap: 10px; padding: 10px 14px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .who { display: none; }
  main { padding: 20px 14px 56px; }
  .card { padding: 16px; }
  .lrow { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .lrow .bar { grid-column: 1 / -1; }
  .lrow .rows { display: none; }
  .bins { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .head .btn { width: 100%; }
}
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; } .tile .tn { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ================= Lead Finder additions ================= */
.top-in { max-width: 1320px; }
main { max-width: 1320px; }
.hint { font-size: 13px; color: var(--ink-2); }
.grow { flex: 1; min-width: 0; }
input[type="number"], input[type="search"], textarea.plain { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 15px var(--body); }
input[type="number"]:focus, input[type="search"]:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input[type="range"] { width: 100%; accent-color: var(--brand); }
select { min-height: 42px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: 500 13px var(--body); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.chip.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-ink); }
.find { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.find .side { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow: auto; }
#map { height: 420px; border: 1px solid var(--line); border-radius: var(--r); background: #e8edf5; z-index: 0; }
.mapbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; }
.places { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.places li { padding: 8px 12px; font-size: 13px; cursor: pointer; border-top: 1px solid var(--line); background: #fff; }
.places li:first-child { border-top: 0; }
.places li:hover { background: var(--brand-tint); }
.stat { display: inline-flex; flex-direction: column; padding: 8px 14px; border-radius: 10px; background: var(--surface); min-width: 92px; }
.stat b { font: 500 22px/1.15 var(--mono); }
.stat span { font-size: 12px; color: var(--ink-2); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.working { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--brand-tint); border-radius: 10px; color: var(--brand-ink); font-size: 14px; margin-top: 14px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(39, 71, 245, 0.25); border-top-color: var(--brand); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 0; }
.filters .check { gap: 6px; font-size: 13px; }
.filters select, .filters input[type="search"] { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; }
td.name { font-weight: 600; max-width: 280px; }
td.mono, th.mono { font-family: var(--mono); font-size: 12px; }
.tablewrap.tall { max-height: 560px; overflow: auto; }
.tablewrap th { position: sticky; top: 0; z-index: 1; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface); color: var(--ink-2); }
.tag.ok { background: var(--clean-tint); color: #0a7450; }
.tag.warn { background: var(--unver-tint); color: #8a5e00; }
.tag.bad { background: var(--bad-tint); color: #a8301d; }
.prow { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(70px, 0.5fr)) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.prow:first-of-type { border-top: 0; }
.prow .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .num { font: 500 18px var(--mono); }
.prow .lab { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.step b { font-family: var(--display); display: block; margin-bottom: 4px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--body); margin-bottom: 8px; }
.crawlstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.logbox { font: 12px/1.6 var(--mono); background: var(--ink); color: #c5d0e6; border-radius: 10px; padding: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.map-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.opts { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.opts summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); padding: 6px 0; width: fit-content; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
dialog.wide { width: min(640px, calc(100vw - 32px)); }
.mapcol { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.mapcol label { flex: 0 0 140px; font-size: 13px; font-weight: 600; }
@media (max-width: 1000px) {
  .find { grid-template-columns: 1fr; }
  .find .side { position: static; max-height: none; }
  .prow { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
}

/* Page where Claude asks to connect (served by the Worker itself) */
.oauth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.oauth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.oauth-card h1 { font-size: 24px; margin-bottom: 12px; }
.oauth-note { color: var(--ink-2); margin: 0 0 18px; }
.oauth-row { display: flex; gap: 10px; margin-top: 20px; }

/* validator lists on the project page */
.vlist { display: grid; }
.vitem { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.vitem:first-child { border-top: 0; padding-top: 0; }
.vitem:last-child { padding-bottom: 0; }
.vitem .vhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vitem .progress { margin: 2px 0 0; }

/* Connect Claude screen */
.copyrow { display: flex; gap: 10px; }
.copyfield { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; }
ol.howto { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.toolrow { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.toolrow:first-child { border-top: 0; padding-top: 0; }
.conn { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.conn:first-child { border-top: 0; padding-top: 0; }
ul.tryl { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.45; font-size: 14px; }
@media (max-width: 720px) { .copyrow { flex-direction: column; } .conn { flex-direction: column; align-items: flex-start; } }

/* ---- project page: full width and colored stat tiles */
main.wide, .top.wide .top-in { max-width: none; padding-left: 32px; padding-right: 32px; }
.tgroups { display: flex; flex-direction: column; gap: 22px; margin: 8px 0 22px; }
.thead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 2px 8px; }
.thead h3 { display: flex; align-items: center; gap: 8px; font: 700 13px var(--body); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink); }
.thead h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--a, var(--brand)); }
.mix { display: flex; gap: 3px; height: 9px; margin: 0 0 12px; border-radius: 99px; overflow: hidden; background: var(--queue); }
.mix i { display: block; min-width: 4px; background: var(--a); }
.tiles { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 16px 18px 14px 22px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(145deg, var(--t) 0%, #fff 82%); color: var(--ink); font: inherit; text-align: left; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--a); }
button.tile { cursor: pointer; }
button.tile:hover { transform: translateY(-2px); border-color: var(--a); box-shadow: 0 8px 20px rgba(11, 24, 48, 0.1); }
.tile[aria-pressed="true"] { border-color: var(--a); box-shadow: 0 0 0 2px var(--a); }
.tile .tl { font: 600 12px/1.3 var(--body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--d); }
.tile .tn { font: 700 36px/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile .ts { font-size: 13px; color: var(--ink-2); }
.tile .tb { display: block; width: 100%; height: 5px; margin-top: 10px; border-radius: 99px; background: rgba(11, 24, 48, 0.08); overflow: hidden; }
.tile .tb i { display: block; height: 100%; border-radius: 99px; background: var(--a); }
.tile.zero { opacity: 0.6; }
.ltable { scroll-margin-top: 70px; }
.t-blue { --a: #2747f5; --d: #1a33c2; --t: #e8ecff; }
.t-violet { --a: #7c3aed; --d: #5b21b6; --t: #f1eaff; }
.t-cyan { --a: #0891b2; --d: #0e6f8a; --t: #def5fa; }
.t-pink { --a: #db2777; --d: #a21a5a; --t: #fde7f1; }
.t-orange { --a: #ea580c; --d: #b4400a; --t: #ffeedd; }
.t-green { --a: #0e9f6e; --d: #0a7450; --t: #e3f6ee; }
.t-lime { --a: #65a30d; --d: #4a7a0a; --t: #eef8d9; }
.t-amber { --a: #d99a06; --d: #8a5e00; --t: #fbf1d9; }
.t-red { --a: #d8452e; --d: #a8301d; --t: #fce9e5; }
.t-slate { --a: #64748b; --d: #475569; --t: #eceff4; }
@media (max-width: 640px) { main.wide, .top.wide .top-in { padding-left: 14px; padding-right: 14px; } }

/* ================================================================================================
   NexaEra Leads: the combined app. One frame (menu on the left), one look for leads and validation.
   Everything above is the two apps' original component styling; this layer re-dresses it.
   ================================================================================================ */
:root {
  --ink: #0a1530;
  --ink-2: #47556f;
  --ink-3: #8390a6;
  --surface: #f3f5fa;
  --line: #e1e6f0;
  --line-2: #cfd7e6;
  --night: #080f24;
  --night-2: #101b3a;
  --r: 14px;
  --shadow-1: 0 1px 2px rgba(10, 21, 48, 0.05), 0 10px 28px -18px rgba(10, 21, 48, 0.22);
  --shadow-2: 0 2px 4px rgba(10, 21, 48, 0.06), 0 18px 40px -20px rgba(10, 21, 48, 0.32);
}
body { background: var(--surface); font-feature-settings: "ss01"; }
::selection { background: #cfd8ff; }

/* ---- frame */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.content { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px 14px; color: #c9d3ea; overflow-y: auto;
  background: radial-gradient(120% 60% at 0% 0%, rgba(39, 71, 245, 0.34) 0%, rgba(39, 71, 245, 0) 62%), linear-gradient(180deg, var(--night-2) 0%, var(--night) 100%); }
.sidebar .brand { padding: 2px 8px 18px; }
.sidebar .brand svg { width: 38px; height: 38px; }
.sidebar .brand b { font-size: 19px; }
.sidebar .brand span { color: var(--mint); letter-spacing: 0.2em; font-weight: 600; }
.menu { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.menu-group { display: flex; flex-direction: column; gap: 2px; }
.menu-title { padding: 0 10px 6px; font: 600 11px var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: #6f7fa6; }
.menu a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #c9d3ea; font-weight: 500; font-size: 14.5px; line-height: 1.25; transition: background 0.12s, color 0.12s; }
.menu a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.menu a.on { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.menu a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mint); }
.menu .ico { display: inline-flex; width: 20px; height: 20px; flex: none; color: #8fa0c8; }
.menu a.on .ico, .menu a:hover .ico { color: var(--mint); }
.menu .ico svg { width: 20px; height: 20px; }
.me { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 4px 10px; align-items: center; margin-top: 12px; padding: 12px 10px 4px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #2747f5, #6f8bff); color: #fff; font: 700 13px var(--display); }
.me-text b { display: block; color: #fff; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { display: block; font-size: 11.5px; color: #8fa0c8; }
.me-actions { grid-column: 1 / -1; display: flex; gap: 2px; margin-left: -4px; }
.sidebar .linkbtn { color: #a9b6d6; font-size: 12.5px; }
.top { display: none; position: sticky; top: 0; z-index: 30; background: var(--night); }
.top .brand span { color: var(--mint); }
.menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; }
.menu-toggle svg { width: 22px; height: 22px; }
main { max-width: 1280px; margin: 0 auto; padding: 34px 36px 72px; }
main.wide { max-width: none; padding-left: 36px; padding-right: 36px; }

/* ---- page head */
.head { margin-bottom: 26px; align-items: flex-end; }
.head h1 { font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.025em; }
.head p.muted { max-width: 68ch; }

/* ---- cards, buttons, fields */
.card { border-color: var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-1); }
.card h2 { letter-spacing: -0.015em; }
.btn { border-color: var(--line-2); border-radius: 10px; box-shadow: 0 1px 1px rgba(10, 21, 48, 0.04); transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.btn:hover { border-color: #aab6cf; background: #fbfcff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #3557ff 0%, #2242ea 100%); border-color: #2242ea; box-shadow: 0 1px 1px rgba(10, 21, 48, 0.1), 0 6px 14px -6px rgba(39, 71, 245, 0.6); }
.btn.primary:hover { background: linear-gradient(180deg, #2c4df5 0%, #1a37d0 100%); border-color: #1a37d0; }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-tint); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea { border-color: var(--line-2); transition: border-color 0.12s, box-shadow 0.12s; }
input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="search"]:hover, select:hover { border-color: #aab6cf; }
input:focus, select:focus, textarea:focus, input[type="number"]:focus, input[type="search"]:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(39, 71, 245, 0.18); }
.field span { color: var(--ink); }
.chip { border-color: var(--line-2); }

/* ---- tables */
.tablewrap { border-color: var(--line); border-radius: 12px; background: #fff; }
table { font-size: 13.5px; }
th { background: #f6f8fc; color: var(--ink-2); font: 600 11.5px var(--body); letter-spacing: 0.07em; text-transform: uppercase; padding-top: 10px; padding-bottom: 10px; box-shadow: inset 0 -1px 0 var(--line); }
td { padding-top: 9px; padding-bottom: 9px; border-bottom-color: #eef1f7; }
tbody tr:hover td { background: #f7f9ff; }
tr.warnrow:hover td { background: var(--unver-tint); }
td a { color: var(--brand-ink); }
.tag { padding: 2px 9px; }
.pill { padding: 4px 11px; }

/* ---- rows of projects and lists */
.prow, .lrow { padding: 16px 10px; margin: 0 -10px; border-radius: 12px; transition: background 0.12s; }
.prow:hover, a.lrow:hover { background: #f6f8fe; }
.prow .name, .lrow .name { font-size: 15.5px; }
.prow a.name { color: var(--ink); }
.prow a.name:hover { color: var(--brand-ink); text-decoration: none; }
.prow .num { font-weight: 500; }

/* ---- the three steps on the projects page: a real sequence, drawn as one line */
.steps { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.step { border: 0; border-radius: 0; background: none; padding: 18px 20px; position: relative; }
.step + .step { border-left: 1px solid var(--line); }
.step .n { background: var(--brand-tint); color: var(--brand-ink); width: 26px; height: 26px; font-weight: 700; }

/* ---- stats, tiles */
.stats { align-items: stretch; }
.stat { background: #f6f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.stat b { font-weight: 600; }
.tile { border-radius: 16px; box-shadow: var(--shadow-1); }
.tile .clock { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.tile .clock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.tile .clock.open { color: #0a7450; font-weight: 600; }
.tile .clock.open::before { background: var(--clean); box-shadow: 0 0 0 3px var(--clean-tint); }

/* ---- time zones */
.tz { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 9px; border-radius: 99px; background: #eef1ff; color: #2a3aa8; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tz i { font: 500 10.5px var(--mono); font-style: normal; color: #5a67c4; }
.zonebox { flex: 1 1 260px; min-width: 240px; }
.zonebox > span { margin-bottom: 6px; }
.zones { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.zone { padding: 4px 10px; font-size: 12.5px; background: #fff; }
.chip.zone b { font: 500 12px var(--mono); margin-left: 2px; }

/* ---- find leads */
.find .side { top: 20px; max-height: calc(100vh - 40px); box-shadow: var(--shadow-1); }
#map { border-radius: var(--r); box-shadow: var(--shadow-1); height: 440px; }
.ltable { scroll-margin-top: 16px; }

/* ---- validation list page */
.stage { border-radius: 12px; background: #f6f8fc; border-color: var(--line); }
.bin { border-radius: var(--r); box-shadow: var(--shadow-1); }
.drop { border-radius: 18px; border-color: var(--line-2); padding: 56px 20px; background: linear-gradient(180deg, #fff, #f8faff); transition: border-color 0.12s, background 0.12s; }
.activity { background: #f6f8fc; border: 1px solid var(--line); }

/* ---- dialogs and toasts */
dialog { border-radius: 18px; padding: 26px; box-shadow: 0 30px 80px -20px rgba(8, 15, 36, 0.55); }
dialog::backdrop { background: rgba(8, 15, 36, 0.55); backdrop-filter: blur(3px); }
.toast { border-radius: 12px; box-shadow: var(--shadow-2); }

/* ---- sign in */
.gate-art { background: radial-gradient(90% 70% at 0% 0%, rgba(39, 71, 245, 0.5) 0%, rgba(39, 71, 245, 0) 60%), linear-gradient(160deg, var(--night-2), var(--night)); }
.gate-art .brand span { color: var(--mint); letter-spacing: 0.2em; font-weight: 600; }
.gate-art h1 { max-width: 13em; letter-spacing: -0.03em; }
.gate-flow { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 0; counter-reset: flow; max-width: 30em; }
.gate-flow li { counter-increment: flow; position: relative; padding: 9px 0 9px 44px; color: #dbe3f6; font-weight: 500; }
.gate-flow li::before { content: counter(flow); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); color: var(--mint); font: 600 13px var(--mono); }
.gate-flow li + li::after { content: ""; position: absolute; left: 14px; top: -10px; height: 16px; width: 1px; background: rgba(255, 255, 255, 0.25); }
.gate-form { background: #fff; }
.oauth-card { border-radius: 18px; box-shadow: var(--shadow-2); }

/* ---- small screens: the menu slides in from the left */
@media (max-width: 960px) {
  .app { display: block; }
  .top { display: block; }
  .top-in { max-width: none; padding: 10px 16px; gap: 12px; flex-wrap: nowrap; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: var(--shadow-2); }
  .sidebar.open { transform: none; }
  main, main.wide { padding: 22px 16px 60px; }
  .find .side { position: static; max-height: none; }
  .steps { grid-template-columns: 1fr; }
  .step + .step { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .gate-flow { display: none; }
  .prow, .lrow { margin: 0; padding: 14px 4px; }
}
.filters select { max-width: 280px; }
.filters .hint.grow { white-space: nowrap; }
