/* =====================================================================
   Pinellas Leads
   White & grey surfaces, ink type, colour reserved for meaning:
   lead type (violation / permit / foreclosure / rental), score, status.
   ===================================================================== */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --sunken: #f4f4f5;
  --hover: #f4f4f5;
  --line: #ebebed;
  --line-2: #e0e0e4;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;

  --violation: #e5484d;   --violation-ink: #ce2c31;  --violation-soft: #feebec;
  --permit: #3e63dd;      --permit-ink: #3451b2;     --permit-soft: #edf2fe;
  --foreclosure: #f5a524; --foreclosure-ink: #a35200; --foreclosure-soft: #fff4d5;
  --rental: #8e4ec6;      --rental-ink: #7a3fb0;     --rental-soft: #f7edfe;
  --good: #30a46c;        --good-ink: #18794e;       --good-soft: #e9f6ef;
  --mid: #f5a524;         --mid-ink: #a35200;        --mid-soft: #fff4d5;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04), 0 2px 8px -2px rgba(24, 24, 27, .06);
  --shadow-lg: 0 1px 3px rgba(24, 24, 27, .06), 0 12px 32px -8px rgba(24, 24, 27, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --rail: 76px;
  --list: 384px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink); }
p { margin: 0 0 .5rem; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 1.375rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: .9rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: #e4e4e7; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 16px 8px; background: var(--bg); border-right: 1px solid var(--line); z-index: 30;
}
.rail-logo { margin-bottom: 14px; }
.logo-mark {
  display: inline-block; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); position: relative;
  box-shadow: var(--shadow-sm);
}
.logo-mark::before, .logo-mark::after {
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; top: 13.5px;
}
.logo-mark::before { left: 8px; background: var(--violation); box-shadow: 9px 0 0 var(--permit); }
.logo-mark::after { left: 26px; top: 13.5px; width: 0; height: 0; }
.rail-link {
  width: 60px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px;
  border-radius: var(--r); color: var(--muted); font-size: 10.5px; font-weight: 500; transition: background .15s, color .15s;
}
.rail-link:hover { background: var(--hover); color: var(--ink); }
.rail-link.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.rail-fill { flex: 1; }
.rail-user {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin: 6px 0;
  background: var(--surface); border: 1px solid var(--line-2); font-weight: 600; font-size: 13px;
}
.shell-main { min-width: 0; }

/* ---------------------------------------------------------------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit;
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { color: #fff; background: #27272a; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-xs); }
.btn.secondary:hover { background: var(--sunken); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.ghost:hover { background: var(--hover); color: var(--ink); box-shadow: none; }
.btn.sm, .btn.small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; height: 42px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; flex: none;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 0 12px; height: 38px; max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 104px; padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(24, 24, 27, .07); }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 11px center;
}
input[type=checkbox] { height: auto; accent-color: var(--ink); width: 16px; height: 16px; }

/* ---------------------------------------------------------------- tags & scores */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.pill.subtle { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.kind-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.kind-pill.k-violation, .lead-avatar.k-violation { background: var(--violation-soft); color: var(--violation-ink); }
.kind-pill.k-permit, .lead-avatar.k-permit { background: var(--permit-soft); color: var(--permit-ink); }
.kind-pill.k-foreclosure, .lead-avatar.k-foreclosure { background: var(--foreclosure-soft); color: var(--foreclosure-ink); }
.kind-pill.k-rental, .lead-avatar.k-rental { background: var(--rental-soft); color: var(--rental-ink); }

.score-chip { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--muted); }
.score-chip.high { background: var(--good-soft); color: var(--good-ink); }
.score-chip.mid { background: var(--mid-soft); color: var(--mid-ink); }

.ring {
  --p: 50; --c: var(--faint); flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--sunken) 0);
  animation: ring-in .7s var(--ease) both;
}
.ring::before { content: ""; grid-area: 1 / 1; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); }
.ring span { grid-area: 1 / 1; position: relative; font-weight: 700; font-size: 15px; }
.ring.high { --c: var(--good); }
.ring.mid { --c: var(--mid); }
.ring.big { width: 72px; height: 72px; }
.ring.big::before { width: 60px; height: 60px; }
.ring.big span { font-size: 20px; }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes ring-in { from { --p: 0; } }

.status-tag { font-size: 11.5px; font-weight: 500; color: var(--muted); text-transform: capitalize; }
.status-tag.contacted, .status-tag.quoted { color: var(--permit-ink); }
.status-tag.won { color: var(--good-ink); font-weight: 600; }
.status-tag.lost, .status-tag.not_relevant { color: var(--faint); text-decoration: line-through; }

/* ================================================================ leads app */
body.app { overflow: hidden; }
.leads-app { display: grid; grid-template-columns: var(--list) minmax(0, 1fr); height: 100vh; }

/* ---------- list pane ---------- */
.list-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.list-head { padding: 20px 16px 0; }
.list-title { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; min-width: 0; }
.count-badge { height: 22px; padding: 0 8px; border-radius: 999px; background: var(--sunken); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; color: var(--ink-2); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-stats div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
.mini-stats strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.2; }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
.search-row { display: flex; gap: 8px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); color: var(--faint); transition: border-color .15s, box-shadow .15s, background .15s; }
.search-box:focus-within { background: var(--surface); border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(24, 24, 27, .07); }
.search-box input { border: 0; background: transparent; height: 38px; padding: 0; flex: 1; min-width: 0; box-shadow: none; }

.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--ease); }
.drawer.open { grid-template-rows: 1fr; }
.drawer-inner { overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer.open .drawer-inner { padding-top: 10px; }
.drawer-inner select, .drawer-inner input[type=date] { width: 100%; height: 36px; font-size: 13px; }
.drawer-inner .check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); grid-column: 1 / -1; }
.drawer-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }

.segments { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; border-bottom: 1px solid var(--line); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.segments::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.seg:hover { background: var(--sunken); }
.seg em { font-style: normal; color: var(--faint); font-weight: 500; }
.seg i { width: 7px; height: 7px; border-radius: 50%; }
.seg-violation i { background: var(--violation); } .seg-permit i { background: var(--permit); }
.seg-foreclosure i { background: var(--foreclosure); } .seg-rental i { background: var(--rental); }
.seg.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg.active em { color: rgba(255, 255, 255, .6); }

.lead-list { list-style: none; margin: 0; padding: 6px 8px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.lead {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 11px 10px; border-radius: var(--r);
  position: relative; color: var(--ink); transition: background .15s;
  animation: rise .35s var(--ease) both; animation-delay: calc(min(var(--i, 0), 12) * 22ms);
}
.lead + .lead, li + li > .lead { margin-top: 1px; }
.lead:hover { background: var(--hover); }
.lead.active { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line-2); }
.lead.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); animation: grow-y .25s var(--ease); }
.lead-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.lead-avatar.sm { width: 30px; height: 30px; border-radius: 9px; }
.lead-main { min-width: 0; display: grid; gap: 2px; }
.lead-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.lead-addr { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead.unviewed .lead-addr { font-weight: 650; }
.lead-when { font-size: 12px; color: var(--faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.lead.unviewed .lead-when::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--permit); }
.lead-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-gist { color: var(--muted); }
.lead-row.meta { font-size: 12px; color: var(--faint); }
.list-more { padding: 10px; text-align: center; }
.list-empty { padding: 32px 24px; text-align: center; color: var(--muted); }
.list-empty p { max-width: 280px; margin: 0 auto; }
.list-empty strong { color: var(--ink); display: block; margin-bottom: 4px; }
.list-empty a { text-decoration: underline; }
.empty-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--sunken); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }

/* ---------- folders, selection, menus ---------- */
.folder-switch {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%; padding: 6px 10px 6px 8px; margin: -6px 0 0 -8px;
  border: 0; background: transparent; border-radius: var(--r); cursor: pointer; color: var(--ink); font: inherit;
  transition: background .15s;
}
.folder-switch:hover, .folder-switch[aria-expanded="true"] { background: var(--hover); }
.folder-switch h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-switch .chev { color: var(--muted); transition: transform .2s var(--ease); }
.folder-switch[aria-expanded="true"] .chev { transform: rotate(180deg); }
.folder-switch > .icon { color: var(--muted); }
.list-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.folder-note { font-size: 12.5px; color: var(--muted); margin: -6px 4px 14px; line-height: 1.45; }

.lead-li { position: relative; }
.lead-li.leaving { animation: leave .32s var(--ease) forwards; overflow: hidden; }
@keyframes leave { to { opacity: 0; transform: translateX(-12px); max-height: 0; margin: 0; padding: 0; } }
.lead-li .lead { max-height: 200px; }
.lead-check {
  position: absolute; left: 10px; top: 11px; width: 38px; height: 38px; z-index: 2; border-radius: 11px;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.lead-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lead-check span {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--faint); background: var(--surface);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.lead-check input:checked + span { background: var(--ink); border-color: var(--ink); }
.lead-check input:checked + span::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.lead-check input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.lead-li:hover .lead-check, .lead-check:focus-within, .lead-list.selecting .lead-check { opacity: 1; background: var(--sunken); }
.lead-li:hover .lead-avatar, .lead-list.selecting .lead-avatar { opacity: 0; }
.lead-li.checked .lead { background: var(--sunken); }
.lead-avatar { transition: opacity .15s; }

.list-head { position: relative; }
/* Sits over the type pills so the list never shifts under the cursor while selecting. */
.bulk-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 55px; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--ink); color: #fff;
  animation: fade-in .15s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
.bulk-bar[hidden] { display: none; }
.bulk-bar strong { font-weight: 600; font-size: 13px; }
.bulk-actions { margin-left: auto; display: flex; gap: 6px; }
.bulk-bar .btn.secondary { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.bulk-bar .btn.secondary:hover { background: rgba(255,255,255,.18); }
.bulk-bar .icon-btn { background: transparent; border-color: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }

.menu {
  position: fixed; z-index: 2000; min-width: 240px; max-width: 320px; max-height: min(480px, 70vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; animation: menu-in .16s var(--ease);
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-label { font-size: 11.5px; color: var(--faint); padding: 8px 10px 4px; font-weight: 500; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent;
  border-radius: 9px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; color: var(--ink); }
.menu-item.current { background: var(--sunken); font-weight: 600; }
.menu-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item em { font-style: normal; color: var(--faint); font-size: 12.5px; }
.menu-item .icon { color: var(--muted); }
.menu-item.danger { color: var(--violation-ink); }
.menu-row { display: flex; align-items: center; border-radius: 9px; }
.menu-row:hover { background: var(--hover); }
.menu-row .menu-item:hover { background: transparent; }
.menu-row .tools { display: none; gap: 2px; padding-right: 4px; }
.menu-row:hover .tools, .menu-row:focus-within .tools { display: flex; }
.tool-btn { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 7px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.tool-btn:hover { background: var(--surface); color: var(--ink); }
.menu-form { display: flex; gap: 6px; padding: 6px; }
.menu-form input { flex: 1; height: 34px; font-size: 13px; min-width: 0; }
.menu-confirm { padding: 10px; font-size: 13px; }
.menu-confirm p { margin: 0 0 10px; color: var(--ink-2); }
.menu-confirm .row { display: flex; gap: 6px; justify-content: flex-end; }
.menu-error { color: var(--violation-ink); font-size: 12.5px; padding: 0 10px 6px; }

.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2100; display: grid; gap: 8px; justify-items: center; }
.toast-live {
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff; padding: 10px 12px 10px 16px;
  border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: fade-up .25s var(--ease);
}
.toast-live button { background: rgba(255,255,255,.12); border: 0; color: #fff; font: inherit; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.toast-live button:hover { background: rgba(255,255,255,.22); }
.toast-live.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress-row label { font-size: 13px; color: var(--muted); }
.progress-row select { height: 32px; font-size: 13px; }
.rail-link { position: relative; }
.rail-badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--violation); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }

/* ---------- workspace ---------- */
.workspace { position: relative; overflow-y: auto; min-height: 0; background: var(--surface); scroll-behavior: smooth; }
.map-stage { position: relative; height: clamp(340px, 52vh, 620px); background: var(--sunken); }
.map { position: absolute; inset: 0; z-index: 0; }
.map-legend {
  position: absolute; top: 16px; right: 64px; /* clear of Google's fullscreen button */ z-index: 500; display: flex; gap: 12px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm); font-size: 12px; color: var(--ink-2);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.violation { background: var(--violation); } .dot.permit { background: var(--permit); }
.dot.foreclosure { background: var(--foreclosure); } .dot.rental { background: var(--rental); }
.map-note {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 500; max-width: min(460px, calc(100% - 32px));
  padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-sm); font-size: 12.5px; color: var(--ink-2); text-align: center;
}
.map-note[hidden] { display: none; }
.map-back { position: absolute; top: 14px; left: 14px; z-index: 500; display: none; }

.map-card-slot { position: absolute; left: 24px; bottom: 28px; z-index: 600; width: min(540px, calc(100% - 48px)); pointer-events: none; }
.lead-card {
  pointer-events: auto; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 16px 18px 16px;
  animation: card-in .4s var(--ease) both;
}
.lead-card-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lead-card-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lead-card-title h2 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.lead-card-title p { margin: 2px 0 0; color: var(--muted); }
.lead-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lead-card-actions select { height: 32px; font-size: 13px; border-radius: 9px; font-weight: 500; }

/* map markers */
.mk { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(24, 24, 27, .35); transition: transform .2s var(--ease); cursor: pointer; }
.mk.violation { background: var(--violation); } .mk.permit { background: var(--permit); }
.mk.foreclosure { background: var(--foreclosure); } .mk.rental { background: var(--rental); }
.mk:hover { transform: scale(1.35); }
.mk.sel { transform: scale(1.5); box-shadow: 0 0 0 6px rgba(24, 24, 27, .12), 0 2px 8px rgba(24, 24, 27, .35); }
.mk.sel::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid currentColor; animation: pulse 1.8s ease-out infinite; }
.mk.violation.sel { color: var(--violation); } .mk.permit.sel { color: var(--permit); }
.mk.foreclosure.sel { color: var(--foreclosure); } .mk.rental.sel { color: var(--rental); }
.leaflet-container { font: inherit; background: var(--sunken); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-sm) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-zoom a { color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .7) !important; }
.leaflet-tooltip.mk-tip { border: 0; border-radius: 9px; box-shadow: var(--shadow-lg); padding: 6px 10px; font: 500 12.5px/1.35 "Geist", sans-serif; color: var(--ink); }
.leaflet-tooltip.mk-tip::before { display: none; }
.mk-tip small { display: block; color: var(--muted); font-weight: 400; }
/* Google Maps dots: centred on the point, tooltip above on hover. */
.gmk { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.gmk.on-top, .gmk:hover { z-index: 1000; }
.gmk .mk-tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s var(--ease); background: var(--surface, #fff); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 6px 10px; font: 500 12.5px/1.35 "Geist", sans-serif; color: var(--ink); }
.gmk:hover .mk-tip { opacity: 1; }
.leaflet-top.leaflet-left { top: auto; bottom: 0; left: auto; right: 0; }
.leaflet-top.leaflet-left .leaflet-control-zoom { margin: 0 16px 92px 0; }

/* ---------- detail (under the map) ---------- */
.detail { padding: 4px 32px 48px; position: relative; }
.detail > * { animation: fade-up .35s var(--ease) both; }
.workspace.loading .detail > *, .workspace.loading .lead-card { opacity: .35; transition: opacity .15s; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.fact { padding: 14px 16px 14px 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact + .fact { padding-left: 16px; border-left: 1px solid var(--line); }
.fact span { font-size: 12px; color: var(--muted); }
.fact strong { font-size: 1.05rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact em { font-style: normal; font-size: 12px; color: var(--faint); }

.why-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--bg); color: var(--ink-2); margin-bottom: 8px; }
.why-line .icon { color: var(--foreclosure); margin-top: 2px; }
.why-line strong { color: var(--ink); font-weight: 600; }

.body-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0 44px; }
.block { padding: 20px 0; border-bottom: 1px solid var(--line); }
.col > .block:last-child { border-bottom: 0; }
.block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--ink); }
.block h3 .icon { color: var(--faint); }
.lede { font-size: 15px; color: var(--ink); margin: 0 0 14px; line-height: 1.5; }
.code-ref { display: inline-block; background: var(--violation-soft); color: var(--violation-ink); border-radius: 9px; padding: 6px 10px; margin: 0 6px 10px 0; font-weight: 500; font-size: 13px; }
dl.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 9px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.person { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.person .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-weight: 600; color: var(--ink-2); flex: none; }
.person .avatar.square { border-radius: 11px; }
.person-name { font-weight: 600; }
.person .push { margin-left: auto; }
.hint { font-size: 12.5px; color: var(--faint); margin: 12px 0 0; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-weight: 500; color: var(--ink-2); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more summary::before { content: "+"; width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; background: var(--sunken); font-size: 13px; transition: transform .2s; }
details.more[open] summary::before { content: "–"; }
details.more dl { margin-top: 12px; font-size: 13px; }

.save-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.saved { display: inline-flex; align-items: center; gap: 4px; color: var(--good-ink); font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(2px); transition: opacity .2s, transform .2s; }
.saved.show { opacity: 1; transform: none; }

.fit { display: grid; gap: 10px; }
.fit-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 28px; align-items: center; gap: 10px; font-size: 13px; }
.fit-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-name em { font-style: normal; color: var(--faint); margin-left: 6px; font-size: 12px; }
.fit-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.fit-bar span { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--faint); animation: bar-in .8s var(--ease) both; }
.fit-row.direct .fit-bar span { background: var(--ink); }
.fit-row.related .fit-bar span { background: #a1a1aa; }
.fit-row.work .fit-bar span { background: var(--line-2); }
.fit-val { text-align: right; color: var(--muted); font-size: 12px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.timeline li { position: relative; padding: 0 0 14px; display: grid; gap: 1px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px var(--surface); }
.timeline li.k-violation::before { background: var(--violation); } .timeline li.k-permit::before { background: var(--permit); }
.timeline li.k-foreclosure::before { background: var(--foreclosure); } .timeline li.k-rental::before { background: var(--rental); }
.t-date { font-size: 12px; color: var(--faint); }
.t-title { font-weight: 500; }
.t-desc { color: var(--muted); }
.t-status { font-size: 12px; color: var(--ink-2); }

/* overview */
.overview-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0 18px; }
.overview-head h2 { font-size: 1.5rem; letter-spacing: -.025em; }
.overview-head p { margin: 2px 0 0; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini-list a { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 10px; transition: background .15s; }
.mini-list a:hover { background: var(--hover); }
.mini-list strong { display: block; font-weight: 500; }
.mini-list em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.pipeline { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--sunken); margin-bottom: 14px; }
.pipeline span { min-width: 6px; animation: bar-in .8s var(--ease) both; }
.st-new { background: #d4d4d8; } .st-contacted { background: var(--permit); } .st-quoted { background: var(--rental); }
.st-won { background: var(--good); } .st-lost { background: var(--violation); } .st-not_relevant { background: #a1a1aa; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-list li i { width: 9px; height: 9px; border-radius: 3px; }
.legend-list li strong { margin-left: auto; font-weight: 600; }
.legend-list a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

/* ================================================================ standard pages */
main.page { max-width: 1200px; margin: 0 auto; padding: 32px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; letter-spacing: -.025em; }
.page-head .muted, .page-head p { margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); padding: 18px 20px; }
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 960px) { .grid.two { grid-template-columns: 1.5fr 1fr; } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-xs); }
.stat .n { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--bg); }
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 6px 8px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.chip.cat { background: var(--sunken); color: var(--ink); }
.chip.direct { background: var(--permit-soft); color: var(--permit-ink); }
.chip.related { background: var(--mid-soft); color: var(--mid-ink); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.ok { color: var(--good-ink); font-weight: 600; } .bad { color: var(--violation-ink); font-weight: 600; }
pre.sms { white-space: pre-wrap; background: var(--bg); padding: 10px 12px; border-radius: 10px; margin: 6px 0 0; font: inherit; font-size: 13px; border: 1px solid var(--line); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px 20px; margin: 0 0 16px; background: var(--surface); box-shadow: var(--shadow-xs); }
legend { font-weight: 600; padding: 0 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; }
.checks label { display: flex; gap: 10px; align-items: center; min-height: 34px; padding: 0 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.checks label:hover { background: var(--bg); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 500; font-size: 13px; }
.inline { display: flex; gap: 10px; align-items: center; }
.group-title { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 2px; grid-column: 1 / -1; }
.alert { background: var(--violation-soft); color: var(--violation-ink); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-weight: 500; }
.error { background: var(--violation-soft); color: var(--violation-ink); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.lead-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mode-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.mode-option:hover { background: var(--bg); }
.mode-option:has(input:checked) { border-color: var(--ink); background: var(--bg); }
.mode-option input { margin-top: 3px; accent-color: var(--ink); }
.mode-option strong { display: block; font-size: 14px; }
.mode-option small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }

.billing-banner { padding: 10px 14px; font-size: 13px; line-height: 1.45; border-radius: 10px; margin-bottom: 16px; }
.list-pane > .billing-banner { margin: 12px 12px 0; }
.billing-banner.trial { background: var(--permit-soft); color: var(--permit-ink); }
.billing-banner.expired { background: var(--mid-soft); color: var(--mid-ink); }
.billing-banner a { color: inherit; font-weight: 600; }
.billing-fields { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 12px; }
.billing-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.billing-pill.trial { background: var(--permit-soft); color: var(--permit-ink); }
.billing-pill.paid { background: var(--good-soft); color: var(--good-ink); }
.billing-pill.expired { background: var(--mid-soft); color: var(--mid-ink); }

.auth-legal { margin-top: 10px; font-size: 12px; color: var(--faint); text-align: center; }
.auth-legal a, .auth-card .consent a { color: inherit; text-decoration: underline; }
body.legal { background: var(--surface); }
.legal-page { max-width: 720px; margin: 0 auto; padding: 40px 24px 64px; line-height: 1.65; }
.legal-page .auth-brand { color: var(--ink); text-decoration: none; margin-bottom: 32px; }
.legal-page h1 { font-size: 1.9rem; letter-spacing: -.03em; margin-bottom: 4px; }
.legal-page h2 { font-size: 1.05rem; margin: 28px 0 8px; }
.legal-page p, .legal-page li { color: var(--ink-2); font-size: 14.5px; }
.legal-page ul { padding-left: 20px; }
.legal-page li + li { margin-top: 6px; }
.legal-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.legal-foot a { color: inherit; }

/* ---------- marketing admin ---------- */
.nowrap { white-space: nowrap; }
.inline.wrap { flex-wrap: wrap; }
.inline.check { gap: 8px; margin: 2px 0 14px; font-size: 13.5px; cursor: pointer; }
.card.narrow { max-width: 680px; }
.alert.soft { background: var(--mid-soft); color: var(--mid-ink); }
.chip.bad-chip { background: var(--violation-soft); color: var(--violation-ink); font-weight: 600; }
.chip.warn-chip { background: var(--mid-soft); color: var(--mid-ink); font-weight: 600; }
.status-pill { display: inline-flex; height: 22px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--ink-2); }
.status-pill.sending { background: var(--mid-soft); color: var(--mid-ink); }
.status-pill.sent { background: var(--good-soft); color: var(--good-ink); }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); }
.segmented a { padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.segmented a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); font-weight: 500; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px 2px 12px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; background: var(--sunken); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 14px; border-bottom-right-radius: 4px; }
.bubble.out.ai { background: #3f3f46; }
.bubble.out.keyword { background: var(--line-2); color: var(--ink); }
.bubble.failed { outline: 2px solid var(--violation); }
.b-text { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.b-meta { font-size: 11.5px; opacity: .65; margin-top: 4px; }
.reply-box { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.reply-box textarea { min-height: 44px; }
.reply-box input { flex: 1; }
.reply-box.test { border-top: 1px dashed var(--line-2); }
.consent-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.consent-row .small { margin-top: 2px; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 1000; background: var(--ink); color: #fff; padding: 11px 16px;
  border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toast 3.6s var(--ease) both;
}

/* ---------- auth ---------- */
body.auth { background: var(--surface); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-card { width: min(380px, calc(100% - 48px)); margin: auto; animation: fade-up .5s var(--ease) both; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 40px; }
.auth-card h1 { font-size: 1.85rem; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-card > p { margin-bottom: 26px; }
.auth-card input { width: 100%; height: 42px; }
.auth-card.signup { width: min(440px, calc(100% - 48px)); padding: 32px 0; }
.auth-card .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-card .field .hint { margin: 0; }
.auth-card .consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 12px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.auth-card .consent input { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.auth-card .alert div + div { margin-top: 4px; }
.auth-switch { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--ink); font-weight: 500; }
@media (max-width: 480px) { .auth-card .field-row { grid-template-columns: 1fr; gap: 0; } }
.auth-side {
  margin: 12px; border-radius: 24px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 36px;
  background:
    radial-gradient(circle at 22% 30%, var(--violation) 0 5px, transparent 6px),
    radial-gradient(circle at 64% 22%, var(--permit) 0 5px, transparent 6px),
    radial-gradient(circle at 48% 55%, var(--permit) 0 5px, transparent 6px),
    radial-gradient(circle at 78% 62%, var(--foreclosure) 0 5px, transparent 6px),
    radial-gradient(circle at 33% 72%, var(--rental) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 40%, var(--violation) 0 5px, transparent 6px),
    linear-gradient(transparent 31px, var(--line) 32px) 0 0 / 32px 32px,
    linear-gradient(90deg, transparent 31px, var(--line) 32px) 0 0 / 32px 32px,
    var(--bg);
}
.auth-quote { background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-radius: var(--r-xl); padding: 20px 22px; box-shadow: var(--shadow-lg); max-width: 420px; }
.auth-stat strong { display: block; font-size: 1.25rem; letter-spacing: -.02em; }
.auth-stat span { color: var(--muted); }
.auth-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }
.auth-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ---------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes bar-in { from { width: 0; } }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); } }
.skeleton { background: linear-gradient(90deg, var(--sunken) 25%, #fafafa 50%, var(--sunken) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- responsive */
@media (min-width: 1600px) {
  :root { --list: 420px; }
  .detail { padding: 4px 48px 56px; }
  .body-grid { gap: 0 64px; }
}
@media (max-width: 1180px) {
  :root { --list: 340px; }
  .detail { padding: 4px 24px 40px; }
  .body-grid { grid-template-columns: 1fr; }
  .col.side { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .lead-check { opacity: 1; background: transparent; width: 28px; height: 28px; left: auto; right: 14px; top: auto; bottom: 10px; }
  .lead-li:hover .lead-avatar { opacity: 1; }
  .lead-list.selecting .lead-avatar { opacity: 1; }
  .toast-host { bottom: 84px; width: calc(100% - 32px); }
  .menu { left: 12px !important; right: 12px; max-width: none; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: calc(64px + env(safe-area-inset-bottom)); width: auto;
    flex-direction: row; justify-content: space-around; padding: 6px 8px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); border-right: 0; border-top: 1px solid var(--line);
  }
  .rail-logo, .rail-fill, .rail-user { display: none; }
  .rail-link { width: auto; flex: 1; max-width: 88px; }
  .leads-app { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 64px); height: calc(100dvh - 64px); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .list-pane { border-right: 0; }
  .workspace {
    position: fixed; inset: 0 0 64px 0; z-index: 40; transform: translateX(100%); transition: transform .35s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .leads-app.has-selection .workspace { transform: none; }
  .map-back { display: inline-grid; }
  .map-stage { height: auto; background: var(--surface); }
  .map { position: relative; inset: auto; height: 44vh; min-height: 260px; }
  .map-legend { display: none; }
  .map-card-slot { position: relative; left: auto; bottom: auto; width: auto; margin: -40px 12px 0; }
  .lead-card { padding: 14px 16px; border-radius: var(--r-lg); }
  .lead-card-title h2 { font-size: 1.3rem; }
  .leaflet-top.leaflet-left .leaflet-control-zoom { margin-bottom: 52px; }
  .detail { padding: 4px 16px 32px; }
  .fact + .fact { border-left: 0; padding-left: 0; }
  .facts { grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
  main.page { padding: 20px 16px 96px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .toast { left: 16px; right: 16px; bottom: 80px; }
  .leaflet-top.leaflet-left .leaflet-control-zoom { margin-bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- inbox day groups */
.day-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 8px;
  padding: 10px 18px 6px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line);
}
.day-head span { font-weight: 400; color: var(--muted); }

/* ---------------------------------------------------------------- admin: users */
.link-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--sunken); }
.link-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.sms-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.sms-pill.on { background: var(--good-soft); color: var(--good-ink); }
.sms-pill.waiting, .sms-pill.not_invited { background: var(--mid-soft); color: var(--mid-ink); }
.sms-pill.opted_out { background: var(--violation-soft); color: var(--violation-ink); }
.import-errors { margin: 0; padding-left: 18px; color: var(--violation-ink); font-size: 13.5px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--faint); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notice { padding: 10px 12px; border-radius: var(--r-sm); background: var(--good-soft); color: var(--good-ink); font-size: 13.5px; margin-bottom: 12px; }
