/* ============================================================
   propcertify-os — Lavender Slate design system.
   Tokens and layout rules below are copied as-is from the source
   design system (globals.css); only unused rules were left out.
   ============================================================ */

/* ── Lavender Slate tokens ──────────────────────────────────────────── */
:root {
  /* surfaces */
  --ls-bg: #eceaf3;
  --ls-bg-grad: #e5e2ee;
  --ls-panel: #ffffff;
  --ls-panel-2: #f4f3fb;
  --ls-panel-hi: #eae7f4;
  --ls-line: #ddd9e8;
  --ls-line-soft: #e7e4f1;

  /* ink */
  --ls-ink: #1c1925;
  --ls-ink-dim: #45414f;
  --ls-ink-mute: #6f6a7e;
  --ls-ink-faint: #9a95a6;

  /* signal colors — semantics are fixed, never recolor distress */
  --ls-fire: #c12a1c;
  --ls-fire-bg: rgba(193, 42, 28, 0.1);
  --ls-permit: #2a52b0;
  --ls-permit-bg: rgba(42, 82, 176, 0.1);
  --ls-signal: #7a34c8;
  --ls-signal-bg: rgba(122, 52, 200, 0.1);
  --ls-good: #1f8a4d;
  --ls-good-bg: rgba(31, 138, 77, 0.12);
  --ls-warn: #b3791f;

  /* accent — primary action */
  --ls-accent: #5a32c0;
  --ls-accent-ink: #ffffff;
  --ls-accent-bg: rgba(90, 50, 192, 0.12);

  /* geometry */
  --ls-r-sm: 8px;
  --ls-r: 12px;
  --ls-r-lg: 18px;
  --ls-r-pill: 999px;

  --ls-shadow: 0 1px 2px rgba(22, 18, 40, 0.04), 0 6px 20px rgba(22, 18, 40, 0.07);
  --ls-shadow-lg: 0 2px 6px rgba(22, 18, 40, 0.06), 0 20px 48px rgba(22, 18, 40, 0.13);

  /* typography */
  --ls-font: "Schibsted Grotesk", system-ui, sans-serif;
  --ls-mono: "JetBrains Mono", ui-monospace, monospace;

  /* density (regular default) */
  --ls-gap: 16px;
  --ls-pad: 18px;
  --ls-row: 14px;
}

/* Lavender Slate page wrapper */
.ls-root {
  font-family: var(--ls-font);
  color: var(--ls-ink);
  background: radial-gradient(1200px 700px at 80% -10%, rgba(90, 50, 192, 0.06), transparent 60%),
    linear-gradient(180deg, var(--ls-bg), var(--ls-bg-grad));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Table row hover (can't inline :hover) */
.ls-tbl-row {
  cursor: pointer;
  transition: background .12s;
}
.ls-tbl-row:hover {
  background: var(--ls-panel-2);
}

/* Keyframes */
@keyframes ls-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ── Shared page chrome ─────────────────────────────────────────────── */
.ls-page {
  padding: var(--ls-gap);
}
.ls-page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--ls-gap);
  flex-wrap: wrap;
}
.ls-page-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ls-ink);
  font-family: var(--ls-font);
}
.ls-ph-sp {
  flex: 1;
}

/* ── Filter rail + discovery layout ─────────────────────────────────── */
.ls-discover {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: var(--ls-gap);
  align-items: start;
}
.ls-frail {
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  border-radius: var(--ls-r);
  padding: 4px;
  position: sticky;
  top: 68px; /* below topbar */
}
.ls-frail-sec {
  padding: 13px 13px 6px;
}
.ls-frail-sec h4 {
  margin: 0 0 11px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ls-ink-faint);
  font-weight: 700;
  font-family: var(--ls-font);
}
.ls-frail-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ls-ink-dim);
  transition: background .12s;
  font-family: var(--ls-font);
}
.ls-frail-opt:hover {
  background: var(--ls-panel-2);
  color: var(--ls-ink);
}
.ls-frail-sel {
  color: var(--ls-ink);
}
.ls-frail-ct {
  margin-left: auto;
  font-family: var(--ls-mono);
  font-size: 11px;
  color: var(--ls-ink-faint);
}
.ls-frail-divider {
  height: 1px;
  background: var(--ls-line-soft);
  margin: 4px 8px;
}
.ls-fbox {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--ls-line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all .12s;
}
.ls-fbox-on {
  background: var(--ls-accent);
  border-color: var(--ls-accent);
}

@media (max-width: 1180px) {
  .ls-discover {
    grid-template-columns: 1fr;
  }
  .ls-frail {
    display: none;
  }
}
@media (max-width: 720px) {
  .ls-page {
    padding: 12px;
  }
  .ls-page-head h1 {
    font-size: 20px;
  }
}

/* ── Lead card (Board view) ─────────────────────────────────────────── */
.ls-lead-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  background: linear-gradient(180deg, var(--ls-panel-2), var(--ls-panel));
  border: 1px solid var(--ls-line);
  border-radius: var(--ls-r-lg);
  padding: var(--ls-pad);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .16s cubic-bezier(0.2, 0.7, 0.3, 1), border-color .16s, box-shadow .16s;
  font-family: var(--ls-font);
}
.ls-lead-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--cat, var(--ls-accent));
}
.ls-lead-card:hover {
  transform: translateY(-2px);
  border-color: var(--ls-ink-faint);
  box-shadow: var(--ls-shadow-lg);
}

/* Section header */
.ls-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 2px 14px;
}
.ls-sec-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ls-ink);
  font-family: var(--ls-font);
}
.ls-sec-count {
  font-family: var(--ls-mono);
  font-size: 12px;
  color: var(--ls-ink-mute);
  background: var(--ls-panel-2);
  border: 1px solid var(--ls-line-soft);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ── Shell / chrome ────────────────────────────────────────────────── */
.ls-shell {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
}
.ls-shell-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Rail nav */
.ls-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  background: linear-gradient(180deg, var(--ls-panel), var(--ls-bg-grad));
  border-right: 1px solid var(--ls-line-soft);
  z-index: 30;
  overflow: visible;
}
.ls-rail-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  margin-bottom: 14px;
  object-fit: contain;
  flex-shrink: 0;
}
.ls-rail-spacer {
  flex: 1;
}
.ls-rail-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ls-ink-mute);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.ls-rail-btn:hover {
  color: var(--ls-ink);
  background: var(--ls-panel-2);
}
.ls-rail-active {
  color: var(--ls-ink) !important;
  background: var(--ls-panel-hi) !important;
  border-color: var(--ls-line) !important;
}
.ls-rail-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 9px;
  background: var(--ls-accent);
}
.ls-rail-tip {
  position: absolute;
  left: 56px;
  white-space: nowrap;
  background: var(--ls-panel-hi);
  border: 1px solid var(--ls-line);
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ls-ink);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: all .14s ease;
  z-index: 40;
  box-shadow: var(--ls-shadow);
  font-family: var(--ls-font);
}
.ls-rail-btn:hover .ls-rail-tip {
  opacity: 1;
  transform: translateX(0);
}

/* Topbar */
.ls-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--ls-line-soft);
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(236, 234, 243, 0.82);
  backdrop-filter: blur(14px);
  font-family: var(--ls-font);
  flex-shrink: 0;
}
.ls-greet {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ls-ink);
  white-space: nowrap;
}
.ls-terr {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ls-panel);
  border: 1px solid var(--ls-line);
  border-radius: var(--ls-r-pill);
  padding: 7px 8px 7px 13px;
  cursor: pointer;
  transition: border-color .15s;
  flex-shrink: 0;
}
.ls-terr:hover {
  border-color: var(--ls-ink-faint);
}
.ls-terr-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--ls-good);
  box-shadow: 0 0 0 3px var(--ls-good-bg);
  flex-shrink: 0;
}
.ls-terr-nm {
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-ink);
}
.ls-terr-ch {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--ls-panel-2);
  display: grid;
  place-items: center;
  color: var(--ls-ink-mute);
}
.ls-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(140deg, #4a9eb5, #6b4fbb);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--ls-font);
}

/* Mobile bottom nav */
.ls-mobnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--ls-line);
  align-items: stretch;
  padding: 0 6px;
}
.ls-mob-btn {
  flex: 1;
  background: none;
  color: var(--ls-ink-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--ls-font);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: color .14s;
  border: none;
}
.ls-mob-btn:hover {
  color: var(--ls-ink);
}
.ls-mob-active {
  color: var(--ls-ink);
}
.ls-mob-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 99px;
  background: var(--ls-accent);
}
.ls-mob-fab {
  flex: 0 0 auto;
  align-self: center;
  width: 50px;
  height: 50px;
  margin: 0 4px;
  border-radius: 15px;
  background: var(--ls-accent);
  color: white;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(90, 50, 192, 0.4);
}

/* Responsive */
@media (max-width: 720px) {
  .ls-shell {
    grid-template-columns: 1fr;
  }
  .ls-rail {
    display: none;
  }
  .ls-mobnav {
    display: flex;
  }
  .ls-shell-main {
    padding-bottom: 62px;
  }
  .ls-topbar {
    padding: 11px 15px;
  }
  .ls-greet {
    font-size: 16px;
  }
}

/* ── Vitals grid — 4-up > 1180, 2-up 720–1180, 2-up ≤720 ────────────── */
.ls-vitals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--ls-gap);
  margin-bottom: var(--ls-gap);
}
@media (max-width: 1180px) {
  .ls-vitals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── LeadCard mobile — stack with full-width action ─────────────────── */
@media (max-width: 720px) {
  .ls-lead-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .ls-lead-actions {
    grid-column: 1 / -1;
    flex-direction: row !important;
    align-items: center;
  }
  .ls-lead-actions > button:first-child {
    flex: 1;
  }
  /* Generous tap targets */
  .ls-mob-btn {
    min-height: 44px;
  }
  .ls-rail-btn {
    min-height: 44px;
  }
}

/* Thin scrollbar globally */
*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--ls-line);
}

/* ============================================================
   Components. The source components set these as inline styles;
   the values are the same, moved into classes.
   ============================================================ */

/* ── Base ───────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}
/* Author display rules must not beat the hidden attribute. */
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font-family: var(--ls-font);
}

/* ── Sign-in screen (login page) ────────────────────────────────────── */
.ls-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--ls-font);
}
.ls-login-head {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--ls-line-soft);
}
.ls-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ls-ink);
}
.ls-brand span {
  color: var(--ls-accent);
}
.ls-login-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.ls-login-card {
  width: 100%;
  max-width: 380px;
}
.ls-login-card h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ls-ink);
  margin: 0;
}
.ls-login-card p {
  font-size: 13px;
  color: var(--ls-ink-mute);
  margin-top: 4px;
}

/* ── Form fields (login page inputs) ────────────────────────────────── */
.ls-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ls-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ls-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ls-ink);
  font-family: var(--ls-font);
  outline: none;
  background: var(--ls-panel);
}
textarea.ls-input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
input[type="file"].ls-input {
  height: auto;
  padding: 8px 12px;
}
.ls-submit {
  height: 42px;
  background: var(--ls-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--ls-font);
  margin-top: 4px;
}
.ls-submit:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.ls-err {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ls-fire);
  background: rgba(220, 50, 47, 0.07);
  padding: 8px 10px;
  border-radius: 6px;
}
.ls-ok {
  font-size: 12px;
  color: var(--ls-good);
}
.ls-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Rail brand mark (in place of the logo image) ───────────────────── */
.ls-rail-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  margin-bottom: 14px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--ls-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--ls-font);
}
.ls-rail-btn {
  background: none;
}

/* ── Button (Button.jsx) ────────────────────────────────────────────── */
.ls-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--ls-font);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--ls-accent);
  color: var(--ls-accent-ink);
  box-shadow: 0 4px 14px rgba(90, 50, 192, 0.28);
  transition: all .14s;
  white-space: nowrap;
  text-decoration: none;
}
.ls-btn-ghost {
  border: 1px solid var(--ls-line);
  background: var(--ls-panel);
  color: var(--ls-ink-dim);
  box-shadow: none;
}
.ls-btn-sm {
  font-size: 12px;
  padding: 6px 11px;
}
.ls-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
/* Call (LeadCard / LeadDrawerContent) */
.ls-btn-call {
  background: #1f8a4d;
  color: #fff;
  box-shadow: none;
}

/* ── Signal chip (SignalChip.jsx) ───────────────────────────────────── */
.ls-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--ls-r-pill);
  border: 1px solid var(--fg);
  color: var(--fg);
  background: var(--bg);
  white-space: nowrap;
  font-family: var(--ls-font);
  --fg: var(--ls-signal);
  --bg: var(--ls-signal-bg);
}
.ls-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
  flex-shrink: 0;
}
.ls-chip-fire {
  --fg: var(--ls-fire);
  --bg: var(--ls-fire-bg);
}
.ls-chip-permit {
  --fg: var(--ls-permit);
  --bg: var(--ls-permit-bg);
}
.ls-chip-signal {
  --fg: var(--ls-signal);
  --bg: var(--ls-signal-bg);
}
.ls-chip-good {
  --fg: var(--ls-good);
  --bg: var(--ls-good-bg);
}

/* ── Filter chip (FilterChip.jsx) ───────────────────────────────────── */
.ls-fchips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--ls-gap);
}
.ls-fchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--ls-r-pill);
  cursor: pointer;
  transition: all .14s;
  background: var(--ls-panel);
  border: 1px solid var(--ls-line);
  color: var(--ls-ink-dim);
  font-family: var(--ls-font);
}
.ls-fchip-on {
  background: var(--ls-panel-hi);
  border-color: var(--ls-ink-faint);
  color: var(--ls-ink);
}
.ls-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ls-fchip-ct {
  font-family: var(--ls-mono);
  font-size: 11px;
  color: var(--ls-ink-faint);
}

/* ── Score ring (ScoreRing.jsx) ─────────────────────────────────────── */
.ls-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.ls-ring {
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--col) var(--pct), var(--ls-line-soft) 0);
}
.ls-ring > span {
  position: absolute;
  inset: calc(var(--size) * 0.075);
  border-radius: 50%;
  background: var(--ls-panel);
  display: grid;
  place-items: center;
  font-family: var(--ls-mono);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ls-ink);
  font-size: var(--fs);
}
.ls-ring-label {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-ink-mute);
  white-space: nowrap;
  font-family: var(--ls-font);
}

/* ── Stat card (StatCard.jsx) ───────────────────────────────────────── */
.ls-stat {
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  border-radius: var(--ls-r);
  padding: var(--ls-pad);
  box-shadow: var(--ls-shadow);
  font-family: var(--ls-font);
}
.ls-stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ls-ink-mute);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ls-stat-label i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.ls-stat-value {
  font-family: var(--ls-mono);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 10px;
  line-height: 1;
  color: var(--ls-ink);
}
.ls-stat-delta {
  font-size: 11.5px;
  margin-top: 8px;
  color: var(--ls-ink-mute);
}

/* ── Lead card body (LeadCard.jsx) ──────────────────────────────────── */
.ls-lc-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ls-lc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ls-rank {
  margin-left: auto;
  font-family: var(--ls-mono);
  font-size: 12px;
  color: var(--ls-ink-faint);
}
.ls-lc-addr {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ls-ink);
}
.ls-lc-meta {
  font-size: 12px;
  color: var(--ls-ink-mute);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ls-lc-why {
  font-size: 12.5px;
  color: var(--ls-ink-mute);
  line-height: 1.45;
}
.ls-lc-owner {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-ink);
}
.ls-lead-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  flex-shrink: 0;
}
.ls-empty {
  padding: 40px;
  text-align: center;
  color: var(--ls-ink-faint);
  font-family: var(--ls-font);
}

/* ── Filter rail checkbox (FBox) ────────────────────────────────────── */
.ls-fbox svg {
  width: 10px;
  height: 10px;
}

/* ── Drawer (Drawer.jsx) ────────────────────────────────────────────── */
.ls-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}
.ls-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.ls-drawer-panel {
  position: relative;
  width: min(480px, 92vw);
  height: 100%;
  overflow-y: auto;
  background: var(--ls-bg);
  border-left: 1px solid var(--ls-line);
  box-shadow: var(--ls-shadow-lg);
  animation: ls-slide-in .26s cubic-bezier(0.2, 0.7, 0.3, 1);
  font-family: var(--ls-font);
}
.ls-drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--ls-line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--ls-bg);
  z-index: 2;
}
.ls-drawer-title {
  font-size: 13px;
  font-family: var(--ls-mono);
  color: var(--ls-ink-mute);
  font-weight: 500;
}
.ls-drawer-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--ls-panel);
  border: 1px solid var(--ls-line);
  color: var(--ls-ink-mute);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
}
.ls-drawer-body {
  padding: 22px;
}

/* ── Drawer content (LeadDrawerContent.jsx) ─────────────────────────── */
.ls-dc {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: var(--ls-font);
}
.ls-dc-head {
  display: flex;
  gap: 16px;
  align-items: center;
}
.ls-dc-addr {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ls-ink);
  line-height: 1.2;
}
.ls-dc-sub {
  font-size: 13px;
  color: var(--ls-ink-mute);
  margin-top: 4px;
}
.ls-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ls-fact {
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  border-radius: 10px;
  padding: 11px 13px;
}
.ls-fact-k {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-ink-faint);
  font-weight: 700;
}
.ls-fact-v {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--ls-ink);
  overflow-wrap: anywhere;
}
.ls-mono {
  font-family: var(--ls-mono);
}
.ls-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ls-sec-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-ink-faint);
  font-weight: 700;
}
.ls-panel {
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ls-panel-split {
  border-top: 1px solid var(--ls-line-soft);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ls-owner-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--ls-ink);
  letter-spacing: -0.01em;
}
.ls-phone {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-phone svg {
  color: var(--ls-accent);
  flex-shrink: 0;
}
.ls-phone-dnc svg {
  color: var(--ls-warn);
}
.ls-phone-num {
  font-size: 13px;
  font-family: var(--ls-mono);
  font-weight: 600;
  color: var(--ls-ink);
  flex: 1;
}
.ls-tag {
  font-size: 10px;
  color: var(--ls-ink-faint);
  background: var(--ls-line-soft);
  border-radius: 4px;
  padding: 2px 6px;
}
.ls-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ls-tags .ls-tag {
  font-size: 10px;
  color: var(--ls-ink-mute);
  padding: 2px 7px;
  font-weight: 600;
}
.ls-score {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--ls-mono);
  color: var(--ls-ink-faint);
}
.ls-score-good {
  color: var(--ls-good);
}
.ls-score-warn {
  color: var(--ls-warn);
}
.ls-dnc {
  font-size: 10px;
  color: var(--ls-warn);
  font-weight: 700;
}
.ls-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ls-ink-mute);
  padding: 2px;
  display: grid;
  place-items: center;
}
.ls-call-sm {
  padding: 4px 10px;
  border-radius: 7px;
  text-decoration: none;
  background: var(--ls-panel-2);
  color: var(--ls-ink-mute);
  border: 1px solid var(--ls-line);
  font-size: 12px;
  font-weight: 700;
}
.ls-call-sm-good {
  background: var(--ls-good-bg);
  color: var(--ls-good);
  border-color: rgba(31, 138, 77, 0.22);
}
.ls-email {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-email svg {
  color: var(--ls-accent);
  flex-shrink: 0;
}
.ls-email a {
  font-size: 12.5px;
  color: var(--ls-accent);
  text-decoration: none;
  font-family: var(--ls-mono);
  flex: 1;
  overflow-wrap: anywhere;
}
.ls-rec-k {
  font-size: 11px;
  color: var(--ls-ink-faint);
  margin-bottom: 2px;
}
.ls-rec-v {
  font-size: 13px;
  color: var(--ls-ink);
  line-height: 1.4;
}
.ls-absentee {
  font-size: 11px;
  color: var(--ls-accent);
  margin-top: 4px;
  font-weight: 600;
}
.ls-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ls-kv span:first-child {
  font-size: 12px;
  color: var(--ls-ink-mute);
  flex-shrink: 0;
}
.ls-kv span:last-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-ink);
  text-align: right;
}
.ls-why {
  font-size: 13.5px;
  color: var(--ls-ink-dim);
  line-height: 1.55;
  padding: 10px 13px;
  background: var(--ls-panel-2);
  border: 1px solid var(--ls-line-soft);
  border-left: 2px solid var(--cat, var(--ls-accent));
  border-radius: var(--ls-r-sm);
  white-space: pre-wrap;
}
.ls-photo {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--ls-line-soft);
  display: block;
}
.ls-tl-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-ink-faint);
  font-weight: 700;
  margin-bottom: 12px;
}
.ls-tl-row {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}
.ls-tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ls-tl-rail i {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  flex-shrink: 0;
  margin-top: 3px;
  background: var(--col);
}
.ls-tl-rail b {
  width: 2px;
  flex: 1;
  background: var(--ls-line);
  margin-top: 4px;
}
.ls-tl-txt {
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-ink);
}
.ls-tl-t {
  font-family: var(--ls-mono);
  font-size: 11px;
  color: var(--ls-ink-mute);
  margin-top: 2px;
}
.ls-dc-foot {
  display: flex;
  gap: 10px;
  padding-top: 6px;
  flex-wrap: wrap;
}
.ls-dc-foot > * {
  flex: 1;
}
.ls-file {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-file svg {
  color: var(--ls-accent);
  flex-shrink: 0;
}
.ls-file a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-ink);
  text-decoration: none;
  flex: 1;
  overflow-wrap: anywhere;
}

/* ── Select (map page year selector) ────────────────────────────────── */
.ls-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--ls-panel);
  border: 1px solid var(--ls-line);
  border-radius: 8px;
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  font-family: var(--ls-font);
  font-weight: 600;
  color: var(--ls-ink);
  cursor: pointer;
  outline: none;
  box-shadow: var(--ls-shadow);
  background-image: linear-gradient(45deg, transparent 50%, var(--ls-ink-mute) 50%),
    linear-gradient(135deg, var(--ls-ink-mute) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* ── Map page (map/page.jsx) ────────────────────────────────────────── */
.ls-page-sub {
  font-size: 13px;
  color: var(--ls-ink-mute);
  margin: 3px 0 0;
  font-family: var(--ls-font);
}
.ls-layers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ls-layer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--ls-font);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--ls-line);
  background: var(--ls-panel);
  color: var(--ls-ink-mute);
  transition: all 0.15s;
}
.ls-layer i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ls-line);
  flex-shrink: 0;
  transition: background 0.15s;
}
.ls-layer-on {
  border-color: color-mix(in srgb, var(--c) 38%, transparent);
  background: color-mix(in srgb, var(--c) 7%, transparent);
  color: var(--c);
}
.ls-layer-on i {
  background: var(--c);
}
.ls-layer-sep {
  width: 1px;
  height: 24px;
  background: var(--ls-line);
  margin: 0 4px;
}
.ls-map-card {
  height: 420px;
  margin-bottom: var(--ls-gap);
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  border-radius: var(--ls-r-lg);
  box-shadow: var(--ls-shadow);
  overflow: hidden;
  position: relative;
}
.ls-map-card #map {
  position: absolute;
  inset: 0;
}
.ls-legend {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  gap: 6px;
}
.ls-legend span {
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--ls-mono);
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ls-legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

/* ── Compact table (CompactTable.jsx) ───────────────────────────────── */
.ls-tbl-card {
  background: var(--ls-panel);
  border: 1px solid var(--ls-line-soft);
  border-radius: var(--ls-r-lg);
  overflow: hidden;
  box-shadow: var(--ls-shadow);
}
.ls-tbl-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ls-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ls-tbl-head span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-ink);
  font-family: var(--ls-font);
}
.ls-tbl-head span:last-child {
  font-size: 12px;
  color: var(--ls-ink-faint);
  font-family: var(--ls-mono);
}
.ls-tbl-scroll {
  overflow-x: auto;
}
.ls-tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ls-font);
}
.ls-tbl th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-ink-mute);
  font-weight: 700;
  padding: 11px 18px;
  border-bottom: 1px solid var(--ls-line);
  background: var(--ls-panel-2);
  white-space: nowrap;
}
.ls-tbl td {
  padding: var(--ls-row) 18px;
  border-bottom: 1px solid var(--ls-line-soft);
  font-size: 13px;
  vertical-align: middle;
}
.ls-tbl tr:last-child td {
  border-bottom: none;
}
.ls-td-main {
  font-weight: 600;
  color: var(--ls-ink);
  font-size: 13px;
}
.ls-td-sub {
  font-size: 11.5px;
  color: var(--ls-ink-mute);
  margin-top: 2px;
}
.ls-td-mono {
  font-family: var(--ls-mono);
  font-size: 12px;
  color: var(--ls-ink-mute);
}

/* ── Map controls sit above the legend on small screens ─────────────── */
.maplibregl-ctrl-top-right {
  z-index: 11;
}

.ls-series-line + .ls-series-line {
  margin-top: 10px;
}

/* Lead drawer: correct the address on site, archive a closed or lost lead. */
.ls-dc-addrbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.ls-dc-addrbox .ls-input {
  min-width: 260px;
}
.ls-dc-edited {
  font-size: 12px;
  color: var(--ls-ink-faint);
}
.ls-dc-warn {
  font-size: 12px;
  color: var(--ls-fire);
}
.ls-dc-keep,
.ls-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ls-ink-soft, var(--ls-ink));
  cursor: pointer;
}
.ls-dc-edit-actions {
  display: flex;
  gap: 8px;
}

/* Lead report: built by printReport() in ui.js, shown only when printing (save as PDF). */
#ls-print-report {
  display: none;
}
@media print {
  body > *:not(#ls-print-report) {
    display: none !important;
  }
  body {
    background: #fff !important;
    overflow: visible !important;
    height: auto !important;
  }
  #ls-print-report {
    display: block;
    color: #1b1930;
    font: 12pt / 1.45 var(--ls-sans, system-ui, sans-serif);
  }
  .ls-pr-head {
    display: flex;
    justify-content: space-between;
    font-size: 9pt;
    color: #5b5870;
    border-bottom: 2px solid #5b35c9;
    padding-bottom: 6pt;
  }
  .ls-pr-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16pt;
    margin-top: 14pt;
  }
  .ls-pr-title h1 {
    font-size: 20pt;
    line-height: 1.2;
    margin: 0;
  }
  .ls-pr-grade {
    font-weight: 700;
    border: 1.5pt solid #1b1930;
    border-radius: 6pt;
    padding: 4pt 10pt;
    white-space: nowrap;
  }
  .ls-pr-sub {
    margin: 6pt 0 0;
    color: #5b5870;
    font-size: 10pt;
  }
  .ls-pr-sec {
    margin-top: 14pt;
    break-inside: avoid;
  }
  .ls-pr-sec h2 {
    font-size: 9pt;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b5870;
    border-bottom: 1px solid #d6d3e4;
    padding-bottom: 3pt;
    margin: 0 0 6pt;
  }
  .ls-pr-sec p {
    margin: 0 0 6pt;
    white-space: pre-wrap;
  }
  .ls-pr-foot {
    margin-top: 24pt;
    font-size: 8pt;
    color: #8a87a0;
    border-top: 1px solid #d6d3e4;
    padding-top: 6pt;
  }
}
