/* Inter (the CRM's typeface) is loaded via <link> in each page's <head> so it downloads in
 * parallel with this stylesheet — not with an @import, which would chain it behind this file. */

/*
 * SignalRE design tokens — copied from the CRM (CRM-OMS apps/web/src/app/globals.css) so the
 * two apps read as one product: deep navy rail, near-white canvas, white hairline cards and one
 * blue accent. Change a colour here, never as a hex value inside a component.
 */
:root {
  --rail: oklch(0.21 0.035 259);
  --rail-hover: oklch(0.27 0.04 259);
  --rail-active: oklch(0.52 0.19 258);
  --rail-text: oklch(0.72 0.02 259);
  --rail-text-bright: oklch(0.98 0.005 259);

  --canvas: oklch(0.98 0.003 259);
  --card: #ffffff;
  --line: oklch(0.905 0.007 259);
  --line-soft: oklch(0.95 0.005 259);

  --ink: oklch(0.22 0.02 259);
  --ink-soft: oklch(0.46 0.02 259);
  --ink-faint: oklch(0.55 0.015 259);

  --accent: oklch(0.55 0.2 258);
  --accent-hover: oklch(0.5 0.2 258);
  --accent-soft: oklch(0.96 0.02 258);

  --danger: oklch(0.55 0.2 25);
  --danger-soft: oklch(0.96 0.03 25);
  --warn: oklch(0.56 0.15 55);
  --warn-soft: oklch(0.96 0.04 75);
  --good: oklch(0.53 0.14 155);
  --good-soft: oklch(0.95 0.04 155);

  --radius: 12px;
  --shadow: 0 1px 2px oklch(0.22 0.02 259 / 0.05);
  --shadow-pop: 0 10px 30px oklch(0.22 0.02 259 / 0.14);
  --ring: 0 0 0 3px oklch(0.55 0.2 258 / 0.15);

  /* Older names still used by page styles below — aliases of the tokens above. */
  --bg: var(--canvas);
  --surface: var(--card);
  --muted: var(--ink-soft);
  --border: var(--line);
  --primary: var(--accent);
  --primary-dark: var(--accent-hover);
  --success: var(--good);
  --success-bg: var(--good-soft);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* A tailed l and a serifed I, so "1", "l" and "I" never look alike in an address or phone. */
  font-feature-settings: "cv05", "cv08";
}

* { box-sizing: border-box; }
/* The hidden attribute must win over any display rule (e.g. a flex container). */
[hidden] { display: none !important; }
html, body { background: var(--canvas); }
body { margin: 0; color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); }

/* Keyboard users get one clear ring everywhere; mouse clicks do not leave one behind. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Numbers that sit in columns must line up. */
.tnum { font-variant-numeric: tabular-nums; }

/* Line icons (see templates/_icons.html). */
.ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; }
.ico-bold { stroke-width: 2.25; }

/* ---- App shell: two top bars (desktop) + a bottom tab bar (phone) ---- */
.topbar { position: sticky; top: 0; z-index: 30; }
.topbar-dark { display: flex; align-items: center; gap: 16px; background: var(--rail); padding: 10px 20px; }
.tb-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; text-decoration: none; }
.tb-logo { height: 28px; width: auto; display: block; }
.tb-firm { display: flex; align-items: center; min-height: 28px; border-left: 1px solid rgba(255,255,255,.15);
  padding-left: 12px; font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--rail-text); }

.usermenu { position: relative; margin-left: auto; }
.usermenu > summary { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 4px;
  cursor: pointer; list-style: none; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary { background: rgba(255,255,255,.1); }
.avatar { display: flex; width: 32px; height: 32px; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--rail-active); color: #fff; font-size: 12px; font-weight: 600; }
.um-who { display: block; padding-right: 4px; }
.um-name { display: block; font-size: 14px; line-height: 17px; font-weight: 600; color: var(--rail-text-bright); }
.um-role { display: block; font-size: 12px; line-height: 15px; color: var(--rail-text); }
.um-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 232px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px 0; }
.um-head { border-bottom: 1px solid var(--line-soft); padding: 6px 14px 10px; }
.um-pname { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.um-email { margin: 2px 0 0; font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-item { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer;
  padding: 9px 14px; font-size: 14px; color: var(--ink-soft); text-align: left; }
.um-item:hover { background: var(--canvas); color: var(--ink); }

.topnav { display: flex; align-items: center; gap: 4px; background: var(--card); border-bottom: 1px solid var(--line);
  padding: 6px 20px; }
.topnav > a:not(.btn) { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.topnav > a:not(.btn):hover { background: var(--canvas); color: var(--ink); }
.topnav > a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-count { margin-left: 2px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px;
  font-weight: 600; line-height: 16px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.topnav .nav-new { margin-left: auto; height: 32px; padding: 0 12px; font-size: 13px; }

.content { max-width: 1180px; margin: 0 auto; padding: 28px 32px 56px; }
/* Anchored cards (e.g. /leads#lead-12) land below the sticky header, not under it. */
[id] { scroll-margin-top: 120px; }

.phonenav { display: none; }

/* ---- Page header ---- */
.page-head { margin-bottom: 20px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.page-head .sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 20px; }
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.muted { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.cards.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards > .card { margin-bottom: 0; }
.stat { display: flex; flex-direction: column; gap: 4px; }
a.stat { text-decoration: none; color: inherit; transition: background-color .12s; }
a.stat:hover { background: var(--canvas); }
.stat-label { font-size: 13px; color: var(--ink-soft); }
.stat-value { font-size: 26px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--ink-faint); }

/* Dashboard "Needs your attention" list */
.attention-list { list-style: none; margin: 0 -24px -20px; padding: 0; }
.attention-list li { border-top: 1px solid var(--line-soft); }
.attention-list a { display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; }
.attention-list a:hover { background: var(--canvas); }
.attention-list li:last-child a { border-radius: 0 0 var(--radius) var(--radius); }
.att-icon { flex: 0 0 auto; width: 20px; text-align: center; }
.att-text { flex: 1; }
.att-go { color: var(--ink-faint); }
.attention-list a:hover .att-go { color: var(--accent); }

.empty { text-align: center; padding: 48px 24px; }
.empty-mark { font-size: 40px; margin-bottom: 8px; }

/* ---- Forms ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=tel], textarea, select {
  padding: 8px 12px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  background: #fff; color: var(--ink); font-weight: 400;
}
textarea { width: 100%; resize: vertical; line-height: 1.55; }
select { width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:disabled { background: var(--canvas); color: var(--ink-soft); }
/* One quiet chevron on every dropdown, instead of each browser's own arrow. */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c8595' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 1rem; padding-right: 2rem;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input.small { max-width: 120px; }
.full { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; align-items: stretch; }
.inline input { flex: 1; }
.hint { font-size: 12px; color: var(--ink-faint); margin: 12px 0 0; line-height: 1.5; }
.hint.warn { color: var(--warn); }
.quote-box { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.55; background: var(--canvas); }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink);
  margin-top: 10px; cursor: pointer; }
.check input { width: auto; margin: 0; min-height: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.ghost, .btn.back-btn { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover, .btn.back-btn:hover { background: var(--canvas); color: var(--ink); border-color: var(--line); }
.btn.small-btn, .small-btn { height: 32px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
/* A button that's working: its icon spins (e.g. "Fetch new leads" while the inbox is checked). */
.btn.is-busy { cursor: progress; }
.btn.is-busy .ico { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.linktext { background: none; border: none; padding: 0; cursor: pointer; color: var(--accent);
  font-size: 13px; font-weight: 500; }
.linktext:hover { color: var(--accent-hover); text-decoration: underline; }
.linkdel { background: none; border: none; padding: 0; cursor: pointer; font-size: 15px; line-height: 1; opacity: .6; }
.linkdel:hover { opacity: 1; }
.inline-form { margin: 0; }
.copybtn { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink-soft); cursor: pointer; }
.copybtn:hover { background: var(--canvas); color: var(--ink); }

/* ---- Toasts ---- */
.toast { padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; margin-bottom: 20px; }
.toast.info { background: var(--accent-soft); color: oklch(0.42 0.17 258); box-shadow: inset 0 0 0 1px oklch(0.88 0.06 258); }
.toast.warnbox { background: var(--warn-soft); color: oklch(0.45 0.12 55); box-shadow: inset 0 0 0 1px oklch(0.88 0.09 75); }
.toast.success { background: var(--good-soft); color: oklch(0.42 0.12 155); box-shadow: inset 0 0 0 1px oklch(0.86 0.08 155); }

/* ---- Pills ----
   A pale wash with a hairline of the same hue (the CRM's stage pills). Default = green, which
   has always meant "Local / texts OK" in this app. */
.tag, .cls { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 18px;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap; vertical-align: middle;
  background: #ecfdf5; color: #065f46; box-shadow: inset 0 0 0 1px #a7f3d0; }
.tag { margin-left: 4px; }
.tag.type { background: #eef2ff; color: #3730a3; box-shadow: inset 0 0 0 1px #c7d2fe; }
.tag.owner, .tag.referred, .tag.unread { background: #eff6ff; color: #1e40af; box-shadow: inset 0 0 0 1px #bfdbfe; }
.tag.done, .tag.st-voided { background: #f8fafc; color: #334155; box-shadow: inset 0 0 0 1px #e2e8f0; }
.tag.nocov { background: #fff1f2; color: #9f1239; box-shadow: inset 0 0 0 1px #fecdd3; }
.tag.declined { background: #fff7ed; color: #9a3412; box-shadow: inset 0 0 0 1px #fed7aa; }
.tag.st-paid { background: #ecfdf5; color: #065f46; box-shadow: inset 0 0 0 1px #a7f3d0; }
.tag.st-unpaid { background: #fffbeb; color: #78350f; box-shadow: inset 0 0 0 1px #fde68a; }
/* Lead routing status: the dot carries the colour, like the CRM's stage pills. */
.cls::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--dot, #10b981); }
.cls-local { --dot: #10b981; }
.cls-referral { --dot: #2563eb; background: #eff6ff; color: #1e40af; box-shadow: inset 0 0 0 1px #bfdbfe; }
.cls-needs_info { --dot: #f59e0b; background: #fffbeb; color: #78350f; box-shadow: inset 0 0 0 1px #fde68a; }
.cls-unassigned { --dot: #f43f5e; background: #fff1f2; color: #9f1239; box-shadow: inset 0 0 0 1px #fecdd3; }
.new-dot { color: var(--accent); font-size: 10px; vertical-align: middle; }

/* ---- Segmented tabs (Leads: Active / Handled / All) ---- */
.tabs { display: inline-flex; gap: 2px; margin: 0 0 18px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 3px; }
.tabs .tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft); text-decoration: none; }
.tabs .tab:hover { background: var(--canvas); color: var(--ink); }
.tabs .tab.active { background: var(--accent-soft); color: var(--accent); }
.tabs .tab .count { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.tabs .tab.active .count { color: var(--accent); }

/* ---- Leads ---- */
.lead-card { padding: 16px 20px; }
.lead-card.is-handled { opacity: .6; }
.lead-card.has-unread { border-color: oklch(0.8 0.1 258); box-shadow: 0 0 0 1px oklch(0.8 0.1 258) inset, var(--shadow); }
.lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lead-tags .tag { margin-left: 0; }
.lead-body { margin: 10px 0; font-size: 14px; }
.lead-body strong { font-weight: 600; }
.lead-body .muted-sm { display: block; margin-top: 2px; }
.lead-msg { margin-top: 8px; background: var(--canvas); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.route-note { margin-top: 10px; }
.nocov-details { margin-top: 6px; }

/* Lead action row: one button style for every action; the main one ("Open in Quote Builder") in blue. */
.lead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px;
  padding-top: 12px; border-top: 1px solid var(--line-soft); }
.lead-actions details > summary,
.lead-actions .pill-btn,
.lead-actions .open-quote {
  display: inline-flex; align-items: center; gap: 6px; list-style: none; height: 34px; padding: 0 12px;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1;
  color: var(--ink-soft); background: #fff; border: 1px solid var(--line); text-decoration: none;
}
.lead-actions details > summary::-webkit-details-marker { display: none; }
.lead-actions details > summary::marker { content: ""; }
.lead-actions details > summary:hover, .lead-actions .pill-btn:hover { background: var(--canvas); color: var(--ink); }
.lead-actions .nocov-details { margin-top: 0; }
.lead-actions .open-quote { background: var(--accent); border-color: var(--accent); color: #fff; }
.lead-actions .open-quote:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.lead-actions details[open] > summary { background: var(--accent-soft); color: var(--accent); border-color: oklch(0.88 0.06 258); }
.lead-actions .decline-details > summary { color: var(--danger); }
.lead-actions .refer-details > summary { color: var(--accent); }
.lead-actions .del-right { margin-left: auto; }

.edit-details summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 500; }
.edit-details[open] { width: 100%; }
.edit-form { margin-top: 12px; background: var(--canvas); border: 1px solid var(--line-soft); border-radius: 10px; padding: 16px; }

/* Customer message thread (outbound = right/blue, inbound reply = left/white) */
.msg-thread { margin: 6px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; }
.msg-meta { font-size: 11px; color: var(--ink-faint); margin-bottom: 3px; }
.msg-text { font-size: 13px; color: var(--ink); white-space: pre-wrap; line-height: 1.5; }
.msg-out { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.msg-out .msg-meta { text-align: right; }
.msg-in { align-self: flex-start; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 4px; }
.msg-in.unread { box-shadow: inset 0 0 0 1px oklch(0.8 0.1 258), -3px 0 0 0 var(--accent); }

/* Per-lead activity log */
.lead-history .log { list-style: none; margin: 8px 0 0; padding: 0; }
.log-item { display: flex; gap: 9px; padding: 6px 0; align-items: flex-start; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; background: #94a3b8; }
.log-received { background: #4f46e5; }
.log-county { background: #0284c7; }
.log-edited { background: #d97706; }
.log-nocoverage { background: #e11d48; }
.log-handled { background: #059669; }
.log-note { background: #7c3aed; }
.log-message { background: #2563eb; }
.log-reply { background: #0891b2; }
.log-texted { background: #0d9488; }
.log-text { font-size: 13px; color: var(--ink); }
.log-when { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }
.note-form { display: flex; gap: 6px; margin-top: 10px; }
.note-form input { flex: 1; }
.deleted-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.deleted-row:last-child { border-bottom: none; }

/* Address autocomplete */
.ac-wrap { position: relative; }
.ac-wrap input { width: 100%; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); max-height: 240px;
  overflow-y: auto; padding: 4px 0; }
.ac-item { padding: 9px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.ac-item:hover, .ac-item.active { background: var(--accent-soft); }

/* Quote builder map + breakdown */
.map-wrap { margin-top: 14px; }
.route-map { width: 100%; height: 320px; border: 0; border-radius: 10px; display: block; }
.bd-num { width: 110px; text-align: right; padding: 6px 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.bd-table td { vertical-align: middle; }

/* ---- Tables ---- */
.fee-table { width: 100%; border-collapse: collapse; }
.fee-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-soft); padding: 9px 10px;
  background: var(--canvas); border-bottom: 1px solid var(--line); }
.fee-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.fee-table .right, th.right { text-align: right; }
.total-row td { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); border-bottom: none; padding-top: 12px;
  font-variant-numeric: tabular-nums; }
.table-scroll, .table-wrap { overflow-x: auto; }
.history { min-width: 760px; }
.history td { vertical-align: top; }
.muted-sm { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.status-form { margin: 0; }
.status-form select { padding: 5px 30px 5px 8px; min-height: 32px; font-size: 13px; min-width: 150px; }
.accept-cell { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.inline-set { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-set select { padding: 5px 30px 5px 8px; min-height: 32px; font-size: 13px; }
.inline-set input { padding: 5px 8px; min-height: 32px; font-size: 13px; max-width: 130px; }

/* Dashboard: client-approved quotes + quote timeline */
.approved-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.approved-item:last-child { border-bottom: none; }
.approved-item .who { font-weight: 600; }
.approved-item .amt { font-weight: 600; color: var(--good); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.tl-item:last-child { border-bottom: none; }
.tl-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.tl-text { font-size: 14px; color: var(--ink); }
.tl-note .tl-text { background: var(--warn-soft); border: 1px solid oklch(0.88 0.09 75); border-radius: 8px; padding: 8px 10px; }
.del-form { margin: 6px 0 0; }

/* ---- Appraiser Network ---- */
.appraiser-row { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.appraiser-row:last-child { border-bottom: none; }
.appraiser-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.appraiser-head strong { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px; line-height: 18px; color: var(--ink); }
.chip-x { margin: 0; display: inline; }
.chip-x button { background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: 14px;
  line-height: 1; padding: 0 2px; }
.chip-x button:hover { color: var(--danger); }
.row-actions { display: flex; align-items: center; gap: 12px; }

/* ---- Appraiser Network (table layout) ---- */
.net-table-card { overflow: visible; }
.net-head, .net-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) minmax(200px, 2fr) 84px 150px 64px auto;
  gap: 12px; align-items: center;
}
.net-head { padding: 10px 20px; background: var(--canvas); border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.net-head .r { text-align: right; }
.net-row { padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.net-row:first-of-type { border-top: 0; }
.net-appr { display: flex; align-items: center; gap: 12px; min-width: 0; }
.net-avatar { display: flex; width: 34px; height: 34px; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.net-avatar.you { background: var(--rail-active); color: #fff; box-shadow: none; }
.net-who { min-width: 0; }
.net-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.net-contact { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-counties { display: flex; flex-wrap: wrap; gap: 4px; }
.net-rate { text-align: right; font-weight: 500; font-size: 14px; }
.net-login .net-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-faint); }
.net-link { background: none; border: 0; padding: 0; margin-top: 3px; display: block; cursor: pointer;
  font-size: 12px; color: var(--accent); font-family: inherit; }
.net-link:hover { text-decoration: underline; }
.net-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.net-actions .linkdel { display: inline-flex; }
.net-actions .linkdel .ico { width: 16px; height: 16px; }
/* Full-width expanding panel under a row (Edit / Text), and the top-level Add panel. */
.net-panel.row-panel { grid-column: 1 / -1; margin-top: 14px; }
.net-panel { background: var(--canvas); border: 1px solid var(--line-soft); border-radius: 10px; padding: 16px; }
.net-panel.card { background: var(--card); }
.net-panel .form-actions { margin-top: 12px; }
.net-panel[data-panel="add"] { margin-bottom: 20px; }
[data-pane].on { background: var(--accent-soft); border-color: oklch(0.88 0.06 258); color: var(--accent); }

.net-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.net-assign { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.net-assign .btn { height: 38px; }

@media (max-width: 1099px) {
  .net-head { display: none; }
  .net-row { grid-template-columns: 1fr 1fr; gap: 8px 12px; row-gap: 10px; }
  .net-appr { grid-column: 1 / -1; }
  .net-counties { grid-column: 1 / -1; order: 5; }
  .net-rate { text-align: left; order: 2; }
  .net-rate::before { content: "Rate: "; color: var(--ink-faint); font-weight: 400; }
  .net-actions { grid-column: 1 / -1; order: 6; justify-content: flex-start; }
  .net-cols { grid-template-columns: 1fr; }
  .net-assign { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .net-row { grid-template-columns: 1fr; }
  .net-assign { grid-template-columns: 1fr; }
}

/* ---- Billing ---- */
.bill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.card-title { margin: 0; font-size: 15px; font-weight: 600; }
.bill-total { text-align: right; }
.bill-amount { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bill-table th { text-align: left; padding: 9px 10px; background: var(--canvas); border-bottom: 1px solid var(--line);
  color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.bill-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.bill-table tfoot td { border-bottom: none; padding-top: 10px; }
.bill-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.bill-send { margin-top: 14px; }
.bill-table tr.st-row-voided { opacity: .55; }
/* A phone: the colleague portal's statements fit without a sideways swipe nobody knew about (Kyle,
   2026-10-10) - the Period column goes (the Sent date says which week) and the cells close up. */
@media (max-width: 560px) {
  .bill-table th:nth-child(2), .bill-table td:nth-child(2) { display: none; }
  .bill-table th, .bill-table td { padding: 9px 6px; }
}
.st-actions { display: flex; gap: 14px; align-items: center; }
.st-actions form { display: inline-block; margin: 0; }
.st-link { background: none; border: none; padding: 0; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--accent); }
.st-link:hover { text-decoration: underline; }
.st-link-void { color: var(--danger); }
.outstanding { font-size: 14px; color: var(--ink-soft); }
.outstanding strong { color: var(--warn); }
/* Autopay (Stripe) at the top of "Your billing" - shown only when the firm takes payments. */
.autopay { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 4px 0 6px; border-radius: 10px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); }
.autopay.on { background: var(--good-soft); box-shadow: inset 0 0 0 1px oklch(0.85 0.07 155); }
.autopay.bad { background: var(--danger-soft); box-shadow: inset 0 0 0 1px oklch(0.85 0.08 25); }
.autopay .ap-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--accent); }
.autopay.on .ap-icon { color: var(--good); }
.autopay.bad .ap-icon { color: var(--danger); }
.autopay .ap-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink); }
.autopay .ap-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.autopay .ap-actions form { margin: 0; }
.ap-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.ap-note.good { color: var(--good); font-weight: 600; }
.ap-note.bad { color: var(--danger); }
@media (max-width: 560px) { .autopay { flex-wrap: wrap; } .autopay .ap-actions { width: 100%; justify-content: flex-start; } }
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-bar label { gap: 4px; font-size: 12px; }
.filter-bar select, .filter-bar input { padding: 6px 9px; min-height: 34px; font-size: 13px; }
.filter-bar select { padding-right: 30px; }
.filter-actions { display: flex; gap: 12px; align-items: center; }
.period-link { color: var(--ink-soft); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.period-link:hover { color: var(--ink); text-decoration-style: solid; }

/* Colleague portal */
.portal-lead { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.portal-lead:last-child { border-bottom: none; }
.portal-leads-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; }
.portal-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0; }
.portal-filter label { gap: 4px; font-size: 12px; }
.portal-filter select, .portal-filter input { min-height: 34px; font-size: 13px; padding: 6px 9px; }
.portal-filter select { padding-right: 30px; }
.pf-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.portal-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0 4px; border-top: 1px solid var(--line-soft); margin-bottom: 4px; }
.portal-dl { display: flex; gap: 8px; }
.portal-dl .btn .ico { width: 15px; height: 15px; }

/* ---- Sign-in pages (login / setup / forgot / reset) ----
   Shared by every firm, so they carry SignalRE's brand (not any one firm's): the wordmark on a
   deep-navy backdrop with the white card floating below it. */
.auth-wrap { position: relative; min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px; overflow: hidden; }
/* SignalRE backdrop: deep navy with a soft glow in the logo's cyan-to-blue, and a faint dot grid. */
.auth-wrap::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(55% 45% at 18% 12%, oklch(0.62 0.17 230 / 0.32), transparent 70%),
    radial-gradient(45% 40% at 88% 92%, oklch(0.58 0.2 258 / 0.30), transparent 70%),
    var(--rail); }
.auth-wrap::after { content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0.5;
  background-image: radial-gradient(oklch(1 0 0 / 0.07) 1px, transparent 1px);
  background-size: 22px 22px; }
.auth-stack { position: relative; z-index: 1; width: 100%; max-width: 380px; display: flex; flex-direction: column;
  align-items: center; }
.auth-brand { width: 210px; height: auto; margin: 0 0 22px; }
.auth-foot { margin: 18px 0 0; font-size: 12px; color: var(--rail-text); text-align: center; }
.auth-card { position: relative; z-index: 1; background: var(--card); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(10,15,30,.45);
  padding: 28px 30px 32px; width: 100%; max-width: 380px; text-align: center; }
.auth-logo { max-width: 210px; margin: 0 auto 4px; display: block; }
.auth-sub { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 18px; }
.auth-title { font-size: 20px; font-weight: 600; margin: 0 0 16px; color: var(--ink); }
.auth-hint { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 18px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; text-align: left; }
.auth-form label { gap: 6px; }
.auth-btn { margin-top: 8px; width: 100%; height: 40px; }
.auth-error { background: var(--danger-soft); color: oklch(0.45 0.17 25); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-alt { margin: 16px 0 0; font-size: 13px; text-align: center; }
.auth-alt a { color: var(--accent); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* ---- Shared bits ---- */
.content-wide { max-width: 1440px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.faint { color: var(--ink-faint); }
.danger-text { color: var(--danger); }
.empty-ico { display: flex; justify-content: center; color: var(--ink-faint); margin-bottom: 6px; }
.empty-ico .ico { width: 36px; height: 36px; stroke-width: 1.5; }

/* Status pills with a tone. The dot carries the colour; the word stays readable. */
.pill { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 500; line-height: 18px;
  background: var(--bg-t); color: var(--fg-t); box-shadow: inset 0 0 0 1px var(--ring-t); }
.pill.dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 999px;
  background: var(--dot-t); vertical-align: middle; position: relative; top: -1px; }
.t-green  { --bg-t: #ecfdf5; --fg-t: #065f46; --ring-t: #a7f3d0; --dot-t: #10b981; }
.t-blue   { --bg-t: #eff6ff; --fg-t: #1e40af; --ring-t: #bfdbfe; --dot-t: #2563eb; }
.t-amber  { --bg-t: #fffbeb; --fg-t: #78350f; --ring-t: #fde68a; --dot-t: #f59e0b; }
.t-rose   { --bg-t: #fff1f2; --fg-t: #9f1239; --ring-t: #fecdd3; --dot-t: #f43f5e; }
.t-orange { --bg-t: #fff7ed; --fg-t: #9a3412; --ring-t: #fed7aa; --dot-t: #f97316; }
.t-slate  { --bg-t: #f8fafc; --fg-t: #334155; --ring-t: #e2e8f0; --dot-t: #94a3b8; }
.newbadge { flex-shrink: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  line-height: 18px; padding: 0 7px; white-space: nowrap; }

/* ---- Leads: list on the left, the open lead on the right ---- */
.leads-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.leads-toolbar .tabs { margin: 0; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 0 11px; font-size: 12px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.fchip:hover { background: var(--canvas); color: var(--ink); }
.fchip.on { border-color: oklch(0.8 0.1 258); color: var(--accent); background: var(--accent-soft); }
.fdot { width: 6px; height: 6px; border-radius: 999px; background: var(--dot-t); }

/* The open lead is where the work happens, so it gets the larger share (~60%). */
.leads-split { display: grid; grid-template-columns: minmax(380px, 2fr) minmax(460px, 3fr); gap: 20px; align-items: start; }
/* --avail is set by the page script: the window height left below the toolbar. */
.lead-list-card, .lead-panel { padding: 0; margin: 0; position: sticky; top: 125px;
  max-height: var(--avail, calc(100vh - 145px)); overflow: auto; overscroll-behavior: contain; }
.ll-head, .lr { display: grid; grid-template-columns: 148px minmax(0, 1fr) 76px; gap: 12px; align-items: center; }
.ll-head { position: sticky; top: 0; z-index: 1; padding: 9px 16px; background: var(--canvas); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.ll-head .r, .lr-when { text-align: right; }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-list li + li { border-top: 1px solid var(--line-soft); }
.lr { padding: 12px 16px; color: var(--ink); text-decoration: none; }
.lr:hover { background: oklch(0.96 0.02 258 / 0.5); color: var(--ink); }
.lr.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lr-bar { display: none; }
.lr-status { min-width: 0; }
.lr-main { min-width: 0; }
.lr-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 600; }
.lr-name-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-when { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.lr.closed .lr-name { font-weight: 500; color: var(--ink-soft); }
.ll-empty { padding: 28px 16px; text-align: center; font-size: 14px; color: var(--ink-soft); }

.lead-panel { box-shadow: 0 8px 24px oklch(0.22 0.02 259 / 0.07); }
.lp-head { padding: 18px 20px 18px; border-bottom: 1px solid var(--line-soft); }
.lp-back { display: none; }
.lp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-name { margin: 12px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.lp-meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-faint); }
.lp-contact { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 14px; }
.lp-contact > * { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.lp-contact > a { color: var(--accent); }
.lp-contact > a:hover span { text-decoration: underline; }
.lp-contact .ico { color: var(--ink-faint); }
.lp-contact span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lp-notes { margin-top: 14px; border-radius: 8px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line-soft);
  padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); white-space: pre-wrap; }
.lp-alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; border-radius: 8px; padding: 10px 12px;
  font-size: 13px; line-height: 1.45; background: var(--warn-soft); color: oklch(0.42 0.1 55);
  box-shadow: inset 0 0 0 1px oklch(0.88 0.09 75); }
.lp-alert .ico { margin-top: 1px; }
.lp-alert.rose { background: #fff1f2; color: #9f1239; box-shadow: inset 0 0 0 1px #fecdd3; }
.lp-alert a { color: inherit; font-weight: 600; }
.lp-primary { width: 100%; height: 40px; margin-top: 16px; font-size: 14px; }
.lp-secondary { width: 100%; margin-top: 8px; }
.lp-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.lp-actions > * { min-width: 0; margin: 0; }
.ibtn { display: flex; width: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 56px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; font-weight: 500;
  color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.ibtn:hover { background: var(--canvas); color: var(--ink); }
.ibtn.on { background: var(--accent-soft); border-color: oklch(0.8 0.1 258); color: var(--accent); }
.ibtn.danger:hover { color: var(--danger); border-color: oklch(0.85 0.08 25); background: var(--danger-soft); }
.lp-pane { margin-top: 12px; background: var(--canvas); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; }
.lp-pane form > label { margin-bottom: 12px; }
.lp-pane .form-actions { margin-top: 12px; }
.lp-pane .hint { margin-top: 0; }
.lp-pane-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ink); }

.lp-tabs { display: flex; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.lp-tabs button { border: 0; background: none; padding: 12px 0 10px; font-size: 13px; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.lp-tabs button:hover { color: var(--ink); }
.lp-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.lp-tabs .n { color: var(--ink-faint); font-weight: 500; }
.lp-tabpanel { padding: 16px 20px 20px; }
.lp-tabpanel .log { list-style: none; margin: 0; padding: 0; }
.lp-empty { margin: 0 0 12px; }
.new-word { color: var(--accent); font-weight: 600; }

/* Message composer: one box — subject line, message, send. */
.composer { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.composer input.composer-subject, .composer textarea { display: block; width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.composer input.composer-subject { border-bottom: 1px solid var(--line-soft); font-size: 13px; font-weight: 500; }
.composer textarea { font-size: 14px; resize: vertical; }
.composer input:focus, .composer textarea:focus { box-shadow: none; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 8px 12px;
  font-size: 11px; color: var(--ink-faint); }
.composer-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.deleted-card { margin-top: 20px; }
.deleted-card summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.deleted-card summary:hover { color: var(--ink); }

/* ---- Dashboard ---- */
.card.pad0 { padding: 0; overflow: hidden; }
.card-head.padded { padding: 16px 20px 12px; margin: 0; }
.padded { padding-left: 20px; padding-right: 20px; }
.pt0 { padding-top: 0; padding-bottom: 20px; }
.t-accent { --bg-t: var(--accent-soft); --fg-t: var(--accent); --dot-t: var(--accent); }

/* Stat strip: one card divided into cells, each a link. */
.statband { display: grid; grid-template-columns: repeat(var(--cells, 6), minmax(0, 1fr)); padding: 0; overflow: hidden; }
.statcell { display: block; padding: 14px 18px; text-decoration: none; color: var(--ink); }
.statcell + .statcell { border-left: 1px solid var(--line-soft); }
.statcell:hover { background: var(--canvas); }
.statcell-v { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; }
.statcell-v.off { color: var(--ink-faint); }
.statcell-v.on-plain { color: var(--ink); }
.statcell-v.on-accent { color: var(--accent); }
.statcell-v.on-good { color: var(--good); }
.statcell-v.on-warn { color: var(--warn); }
.statcell-l { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-soft); }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; }

/* Attention list */
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { border-top: 1px solid var(--line-soft); }
.attn a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; text-decoration: none; color: var(--ink); }
.attn a:hover { background: var(--canvas); }
.attn-ico { display: flex; width: 32px; height: 32px; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--bg-t); color: var(--fg-t); }
.attn-ico .ico { width: 17px; height: 17px; }
.attn-body { flex: 1; min-width: 0; }
.attn-title { display: block; font-size: 14px; font-weight: 500; }
.attn-detail { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-go { color: var(--ink-faint); flex-shrink: 0; }
.attn a:hover .attn-go { color: var(--accent); }

/* Dashboard tables + side rows */
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-soft);
  background: var(--canvas); padding: 9px 12px; border-top: 1px solid var(--line-soft); }
.dash-table td { padding: 11px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.dash-table tbody tr { cursor: pointer; }
.dash-table tbody tr:hover { background: var(--canvas); }
.dash-table .pl { padding-left: 20px; }
.dash-table .pr { padding-right: 20px; }
.dash-table .r { text-align: right; }
.dash-table .strong { font-weight: 600; }
.dash-table .soft { color: var(--ink-soft); }

.side-row { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.side-avatar { display: flex; width: 28px; height: 28px; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.side-main { flex: 1; min-width: 0; }
.side-name { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sub { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.side-amt { font-size: 14px; font-weight: 600; white-space: nowrap; }
.side-foot { padding: 14px 20px 16px; border-top: 1px solid var(--line-soft); }

@media (max-width: 1099px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .statband { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .statcell:nth-child(3n) + .statcell { border-left: 0; }
  .statcell:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 620px) {
  .statband { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statcell { border-left: 0 !important; }
  .statcell:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .statcell:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

/* ---- Quote Builder: the form on the left, a live price summary on the right ---- */
.crumbs { margin: 0 0 4px; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-faint); }
.crumbs a { text-decoration: none; }
.crumbs .ico { width: 14px; height: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-aside { font-size: 12px; color: var(--ink-faint); text-decoration: none; }
a.card-aside:hover { color: var(--accent); }
.grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field-note { font-size: 12px; font-weight: 400; color: var(--ink-faint); }
.lbl-hint { font-weight: 400; color: var(--ink-faint); }
.field-note.good { color: var(--good); }
.field-note.warn { color: var(--warn); }
/* Inputs with a unit or $ inside the box. */
.affix { position: relative; display: block; }
.affix input { width: 100%; }
.affix .sfx, .affix .pfx { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 400;
  color: var(--ink-faint); pointer-events: none; }
.affix .sfx { right: 12px; }
.affix .pfx { left: 12px; }
.affix input.has-sfx { padding-right: 48px; }
.affix input.has-pfx { padding-left: 24px; }
.ac-wrap.has-ico .field-ico { position: absolute; left: 11px; top: 11px; color: var(--ink-faint); z-index: 1; }
.ac-wrap.has-ico input { padding-left: 34px; }
/* Yes/No as a two-way switch (real radio buttons underneath). */
.seg-radio { display: flex; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg-radio label { flex: 1; display: block; margin: 0; }
.seg-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-radio span { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.seg-radio span:hover { background: var(--canvas); color: var(--ink); }
.seg-radio input:checked + span { background: var(--accent-soft); color: var(--accent); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.qb .route-map { height: 260px; }

.qb { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.qb > .card { margin: 0; }
.qb-cust { grid-column: 1; grid-row: 1; }
.qb-price { grid-column: 1; grid-row: 2; }
.qb-email { grid-column: 1; grid-row: 3; }
.qb-sum { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 125px; padding: 0; }
.qb-email textarea { min-height: 170px; }
.qb-email .card-head .linktext { margin-left: auto; }

.sum-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.sum-head h2 { margin: 0; }
.sum-lines { padding: 0 12px 0 20px; }
.sum-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; font-size: 14px; }
.sum-label { min-width: 0; }
.sum-label .note { color: var(--ink-faint); }
.sum-amt { display: flex; align-items: center; gap: 2px; flex-shrink: 0; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.sum-amt input.amt { width: 76px; height: 28px; min-height: 0; padding: 0 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; text-align: right; font-size: 14px; color: var(--ink); box-shadow: none; font-variant-numeric: tabular-nums; }
.sum-amt input.amt:hover { border-color: var(--line); background: #fff; }
.sum-amt input.amt:focus { border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.sum-line.edited input.amt { color: var(--accent); font-weight: 600; }
.sum-reset { display: none; align-items: center; border: 0; background: none; padding: 2px; margin-right: 2px; color: var(--ink-faint); cursor: pointer; }
.sum-reset .ico { width: 14px; height: 14px; }
.sum-reset:hover { color: var(--accent); }
.sum-line.edited .sum-reset { display: inline-flex; }
.sum-fixed { display: inline-block; width: 76px; padding: 0 9px; text-align: right; color: var(--ink); }
.sum-total { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 20px 0; padding: 14px 0 4px;
  border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.sum-total strong { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.sum-meta { display: flex; align-items: center; gap: 6px; margin: 0 20px; font-size: 13px; color: var(--ink-soft); }
.sum-meta .ico { width: 14px; height: 14px; }
.sum-actions { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 16px; }
.sum-actions .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sum-send { height: 42px; font-size: 14px; }
.sum-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--warn); }
.sum-foot { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: not-allowed; background: var(--accent); border-color: var(--accent); }
.btn.ghost:disabled, .btn.ghost:disabled:hover { background: #fff; border-color: var(--line); }

@media (max-width: 1099px) {
  .qb { grid-template-columns: minmax(0, 1fr); }
  .qb > .card { grid-column: 1; grid-row: auto; }
  .qb-sum { position: static; }
}
@media (max-width: 720px) {
  .grid.grid-3, .pair { grid-template-columns: 1fr; }
  .card-head { flex-wrap: wrap; }
}

/* One column below 1100px: the list, or (once a lead is tapped) that lead. */
@media (max-width: 1099px) {
  .leads-split { grid-template-columns: minmax(0, 1fr); }
  .lead-list-card, .lead-panel { position: static; max-height: none; overflow: visible; }
  .leads-page:not(.has-open) .lead-panel { display: none; }
  .leads-page.has-open .lead-list-card,
  .leads-page.has-open .page-head,
  .leads-page.has-open .leads-toolbar,
  .leads-page.has-open .deleted-card { display: none; }
  .lp-back { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 12px -4px; padding: 4px;
    font-size: 14px; font-weight: 500; color: var(--accent); text-decoration: none; }
  /* Nothing is "open" on the list until a lead is tapped. */
  .leads-page:not(.has-open) .lr.on { background: none; box-shadow: none; }
}

/* ---- Tablets and phones: the white nav bar gives way to a bottom tab bar ---- */
@media (max-width: 1023px) {
  .topnav { display: none; }
  .tb-firm { display: none; }
  .topbar-dark { padding: 10px 14px; }
  body.has-phone-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  [id] { scroll-margin-top: 72px; }

  .phonenav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--rail);
    padding-bottom: env(safe-area-inset-bottom); }
  .phonenav > a, .pn-more > summary { position: relative; display: flex; flex: 1; flex-direction: column;
    align-items: center; gap: 4px; padding: 10px 0; font-size: 11px; color: var(--rail-text);
    text-decoration: none; list-style: none; cursor: pointer; }
  .pn-more { display: flex; flex: 1; }
  .pn-more > summary::-webkit-details-marker { display: none; }
  .phonenav .ico { width: 20px; height: 20px; }
  .phonenav > a.on, .pn-more > summary.on, .pn-more[open] > summary { color: #fff; }
  .pn-count { position: absolute; top: 5px; left: calc(50% + 7px); min-width: 16px; border-radius: 999px;
    background: var(--rail-active); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px;
    padding: 0 4px; text-align: center; font-variant-numeric: tabular-nums; }
  /* The More sheet slides over the page; tapping the dimmed page closes it. */
  .pn-more[open] > summary::before { content: ""; position: fixed; inset: 0; background: oklch(0.22 0.02 259 / 0.4); }
  .pn-sheet { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 1;
    background: var(--card); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-pop); padding: 8px 12px 12px; }
  .pn-sheet-title { margin: 8px 8px 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
  .pn-sheet a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: 10px;
    font-size: 15px; color: var(--ink); text-decoration: none; }
  .pn-sheet a .ico { color: var(--ink-soft); }
  .pn-sheet a.on { background: var(--accent-soft); color: var(--accent); }
  .pn-sheet a.on .ico { color: var(--accent); }
}

@media (max-width: 820px) {
  .grid, .cards { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .tb-logo { height: 24px; }
  .um-who { display: none; }
  .content { padding: 18px 14px 32px; }
  .page-head h1 { font-size: 20px; }
  .page-head .sub { font-size: 13px; }
  .head-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .card { padding: 18px 16px; }
  .card.lead-list-card, .card.lead-panel { padding: 0; }
  .attention-list { margin: 0 -16px -18px; }
  .attention-list a { padding: 12px 16px; }
  .bill-head { flex-direction: column; gap: 8px; align-items: flex-start; }
  .tabs { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs .tab { flex: 1; justify-content: center; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  /* Lead list as phone rows: a colour bar down the edge, status and time on top, then who and where. */
  .ll-head { display: none; }
  .lr { grid-template-columns: 4px minmax(0, 1fr) auto; grid-template-areas: "bar status when" "bar main main";
    gap: 6px 12px; padding: 12px 14px; }
  .lr-bar { display: block; grid-area: bar; align-self: stretch; border-radius: 999px; background: var(--dot-t); }
  .lr-status { grid-area: status; }
  .lr-when { grid-area: when; font-size: 12px; }
  .lr-main { grid-area: main; }
  .lr-name { font-size: 15px; }
  .lr-sub { font-size: 13px; }
  .lr.on { box-shadow: none; }
  .fchips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .fchip { flex-shrink: 0; }
  .lp-head { padding: 16px; }
  .lp-tabs { padding: 0 16px; }
  .lp-tabpanel { padding: 16px; }
  .lead-panel .grid { grid-template-columns: 1fr; }
  .ibtn { font-size: 11px; padding: 0 2px; }
  /* 16px inputs stop iPhone Safari from zooming in when a field is tapped. */
  input[type=text], input[type=number], input[type=email], input[type=password], input[type=search],
  input[type=date], input[type=tel], textarea, select { font-size: 16px; }
}

/* ---- Firms (onboarding): Welcome setup, Settings → Firm, the platform Firms page ---- */
.content-narrow { max-width: 760px; }
.mt0 { margin-top: 0; }
.mt4 { margin-top: 4px; }
.mt14 { margin-top: 14px; }
.grid .span2 { grid-column: 1 / -1; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-head h2 { margin: 0; }
.step-n { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.welcome .form-actions { justify-content: flex-end; }

/* County picker: state + county + Add on one row, chosen counties as chips below. */
.cpick { margin-top: 14px; }
.cpick-add { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cpick-add .btn { height: 38px; }
.cpick .cp-msg { margin-top: 8px; }
.cpick .cp-empty { margin-top: 10px; }
.cpick .chips { margin-top: 12px; }
.cpick .chips:empty { display: none; }

/* On/off rows for optional features: text on the left, a switch on the right. */
.optrows { margin-top: 16px; border-top: 1px solid var(--line-soft); }
.optrow { display: flex; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.optrow:last-child { border-bottom: 0; padding-bottom: 0; }
.optrow-text { display: flex; flex-direction: column; gap: 3px; }
.optrow-title { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--ink); }
.optrow-title .tag { margin-left: 4px; }
.optrow-desc { font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--ink-soft); }
.switch { position: relative; flex-shrink: 0; width: 36px; height: 20px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px oklch(0.22 0.02 259 / 0.25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }

/* Platform Firms page */
.tbl-scroll { overflow-x: auto; }
.firms-table tbody tr { cursor: default; }
.firms-table td { vertical-align: top; }
.firms-table td:first-child { min-width: 190px; }
.firms-table td:nth-child(2) { min-width: 200px; }
.firms-table .tag:first-child { margin-left: 0; }
.firm-admin + .firm-admin { margin-top: 8px; }
.linktext { display: inline-flex; align-items: center; gap: 4px; }
.linktext .ico { width: 14px; height: 14px; }
.linktext:disabled { color: var(--ink-faint); cursor: not-allowed; text-decoration: none; }
.linktext.danger { color: var(--danger); }
a.um-item { text-decoration: none; }

@media (max-width: 620px) {
  .cpick-add { grid-template-columns: 1fr auto; }
  .cpick-add label:first-child { grid-column: 1 / -1; }
}

/* Settings → Lead intake */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 13px; }
.copy-row .btn { height: 38px; flex-shrink: 0; }
.intake-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.intake-status .tag { margin-left: 0; }
.snippet { position: relative; margin-top: 14px; }
.snippet pre { margin: 0; padding: 14px 16px; padding-right: 120px; border-radius: 10px; background: var(--rail); color: var(--rail-text-bright);
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.snippet .btn { position: absolute; top: 10px; right: 10px; }
.howto { margin: 16px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.howto li + li { margin-top: 4px; }
.howto strong { color: var(--ink); font-weight: 500; }
@media (max-width: 620px) {
  .snippet pre { padding-right: 16px; padding-top: 52px; }
}

/* Settings → Firm → Branding */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; margin-top: 14px; }
.brand-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.logo-box { display: flex; align-items: center; justify-content: center; height: 120px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--line); background: repeating-conic-gradient(var(--canvas) 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .15s; }
.logo-box.empty { border-style: dashed; background: var(--canvas); }
.logo-box.removing img { opacity: .25; }
.logo-empty { font-size: 13px; color: var(--ink-faint); text-align: center; }
.logo-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; flex-direction: row; gap: 6px; margin: 0; color: var(--ink); }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.color-row { display: flex; gap: 8px; align-items: stretch; }
.color-row input[type=color] { width: 44px; height: auto; min-height: 0; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.color-row input[type=text] { width: 120px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px oklch(0 0 0 / .12); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.brand-preview { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600; }
.brand-label.mt14 { margin-top: 14px; }
@media (max-width: 720px) { .brand-grid { grid-template-columns: 1fr; } }

/* Settings → Lead intake → webhook */
.linktext.inline-link { display: inline; font-size: inherit; vertical-align: baseline; }
.wh-seen { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--canvas); border: 1px solid var(--line-soft); }
.wh-seen dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.wh-seen dt { color: var(--ink-faint); }
.wh-seen dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.wh-help { margin-top: 14px; }
.wh-help summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--accent); }
.wh-help .howto { margin-top: 10px; }
.mail-snippet { max-height: 220px; overflow: auto; font-size: 13px; line-height: 1.55; color: var(--ink); white-space: pre-wrap;
  overflow-wrap: anywhere; }

/* Billing: waived lead fees */
.amt-struck { color: var(--ink-faint); text-decoration: line-through; }
.waived-note { color: var(--good); font-weight: 500; }
.waive-all { margin: 10px 0 0; }
.bill-actions form { display: inline-block; vertical-align: middle; }
.bill-actions form + form { margin-left: 10px; }
