/* Dallas leads. Two themes share one set of tokens; the theme is set on <html data-theme>. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f0f3f2;
  --ink: #14201c;
  --muted: #5f6e69;
  --line: #e1e7e4;
  --track: #e6ebe9;
  --accent: #0f6b58;
  --accent-soft: #e0f1ec;
  --on-accent: #ffffff;
  --hover: #f3f7f5;
  --shadow: 0 1px 2px rgba(20, 32, 28, 0.05), 0 6px 20px rgba(20, 32, 28, 0.05);
  --shadow-lg: -12px 0 40px rgba(20, 32, 28, 0.16);
  --scrim: rgba(20, 32, 28, 0.4);
  /* what earned the score */
  --c-condition: #c2412f;
  --c-tax: #d0910a;
  --c-absentee: #2f7cc0;
  --c-ownership: #7a55b3;
  --c-other: #8d9a95;
  --bad-bg: #fbe5e1; --bad-ink: #8a2416;
  --warn-bg: #fbefd2; --warn-ink: #734c00;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: light;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
}
:root[data-theme="dark"] {
  --bg: #0e1513;
  --surface: #151e1b;
  --surface-2: #1b2623;
  --ink: #e7eeeb;
  --muted: #93a39d;
  --line: #26332f;
  --track: #2a3733;
  --accent: #3fbf9f;
  --accent-soft: #17332c;
  --on-accent: #06211a;
  --hover: #1a2522;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: -12px 0 40px rgba(0, 0, 0, 0.5);
  --scrim: rgba(0, 0, 0, 0.55);
  --c-condition: #ef6f5c;
  --c-tax: #e9b23a;
  --c-absentee: #5aa7e8;
  --c-ownership: #a98be0;
  --c-other: #7f8d88;
  --bad-bg: #3a1c17; --bad-ink: #ffb4a6;
  --warn-bg: #362a0c; --warn-ink: #f4cf7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
body { display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.search {
  flex: 1; max-width: 440px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 99px; color: var(--muted);
}
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search input { flex: 1; border: 0; background: none; padding: 9px 0; outline: none; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.icon-btn:hover { background: var(--hover); }
:root[data-theme="dark"] .sun, :root:not([data-theme="dark"]) .moon { display: none; }

.layout { flex: 1; display: grid; grid-template-columns: 296px 1fr; min-height: 0; }

/* filters */
.filters { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding-bottom: 32px; }
.filters-head {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 20px;
  position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--line); font-size: 15px;
}
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.link:hover { text-decoration: underline; }
details.group { border-bottom: 1px solid var(--line); }
details.group > summary {
  list-style: none; cursor: pointer; padding: 13px 20px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); margin-right: 3px;
}
details.group[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.group-body { padding: 0 20px 16px; display: grid; gap: 14px; }
.field > label, .field > .label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.range span { color: var(--muted); font-size: 12.5px; }
.field input[type="number"], .field input[type="text"] {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.field input:focus { border-color: var(--accent); outline: none; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 0; cursor: pointer; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.checks { display: grid; gap: 5px; max-height: 196px; overflow-y: auto; padding-right: 4px; }
.checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.checks input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.checks .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.note { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.45; }

/* results */
.results { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 16px 20px 0; gap: 12px; }
.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.stat-main { flex-direction: column; align-items: flex-start; gap: 0; justify-content: center; }
.stat-num { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-main .stat-num { font-size: 26px; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent);
}

.results-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend-title { font-weight: 700; color: var(--ink); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin-right: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; font-weight: 700; font-size: 13px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn:disabled { opacity: 0.4; cursor: default; }
.results-head .btn { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip { background: var(--accent-soft); color: var(--ink); border: 0; border-radius: 99px; padding: 4px 11px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.chip::after { content: " ×"; color: var(--muted); }

.table-wrap { flex: 1; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 960px; }
thead th {
  position: sticky; top: 0; background: var(--surface); z-index: 1; text-align: left; font-weight: 600; font-size: 12.5px;
  padding: 11px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--muted);
}
thead th.num { text-align: right; }
thead th button { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; color: inherit; }
thead th button:hover, thead th[aria-sort] button { color: var(--ink); }
thead th[aria-sort="descending"] button::after { content: " ↓"; color: var(--accent); }
thead th[aria-sort="ascending"] button::after { content: " ↑"; color: var(--accent); }
tbody td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr:focus-visible { background: var(--hover); }
tbody tr.selected { background: var(--accent-soft); }
.addr { font-weight: 700; }
.sub { color: var(--muted); font-size: 12.5px; }
.sites { margin-top: 3px; font-size: 12.5px; }
.site { color: var(--accent); font-weight: 600; text-decoration: none; }
.site:hover { text-decoration: underline; }
.owner { max-width: 165px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

/* score ring */
.ring { display: block; }
.ring-num { fill: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); margin-right: 4px;
}
.tag.cond-bad { background: var(--bad-bg); color: var(--bad-ink); }
.tag.cond-fair { background: var(--warn-bg); color: var(--warn-ink); }
.tag.cond-bad::before, .tag.cond-fair::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.empty { padding: 56px 16px; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 2px 0 14px; }

/* detail drawer */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 9; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); background: var(--surface); z-index: 10;
  overflow-y: auto; padding: 26px 28px 40px; box-shadow: var(--shadow-lg); border-left: 1px solid var(--line);
}
.drawer-close { position: absolute; top: 18px; right: 20px; }
.drawer h2 { margin: 0 48px 4px 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.drawer h3 { margin: 28px 0 10px; font-size: 14px; font-weight: 800; }
.lead-score {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 18px;
  background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px;
}
.why { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.why li { display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: baseline; }
.why i { width: 9px; height: 9px; border-radius: 99px; display: inline-block; }
.why .pts { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.lead-score + .note, .note + .note { margin-top: 12px; }
dl.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0; }
dl.facts div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 7px 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.owner-block { line-height: 1.55; }
.taxes { width: 100%; min-width: 0; }
.taxes th, .taxes td { padding: 7px 0; border-bottom: 1px solid var(--line); position: static; background: none; white-space: nowrap; }
.taxes th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: left; }
.taxes th.num { text-align: right; }
.taxes td:last-child, .taxes th:last-child { padding-left: 18px; }
.drawer-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.only-narrow { display: none; }
@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0 auto 0 0; width: min(320px, 90vw); z-index: 8; transform: translateX(-100%); box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25); }
  .filters.open { transform: none; }
  .only-narrow { display: inline-flex; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  #dataDates, .legend { display: none; }
  .results { padding: 12px 12px 0; }
  .stat { padding: 10px 12px; }
  .stat-main .stat-num { font-size: 22px; }
  .lead-score { grid-template-columns: 1fr; justify-items: start; }
  dl.facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .filters { transition: transform 0.18s ease; }
  .icon-btn, .btn, tbody tr, .seg button { transition: background-color 0.12s ease, color 0.12s ease; }
}
thead th:first-child, tbody td:first-child { padding-left: 14px; }
thead th:last-child, tbody td:last-child { padding-right: 14px; }

/* ===== RT Cloud: navigation and shared page pieces ===== */
.topbar { position: sticky; top: 0; z-index: 7; }
a.brand { color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 2px; margin-left: 12px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; white-space: nowrap;
  color: var(--muted); text-decoration: none; font-weight: 600;
}
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--accent-soft); color: var(--ink); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body[data-page="properties"] { height: 100vh; overflow: hidden; }
body:not([data-page="properties"]) { display: block; height: auto; min-height: 100%; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; display: grid; gap: 28px; }
.page-wide { max-width: 1400px; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page h1 { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.page h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.page-head p { margin: 0; max-width: 62ch; line-height: 1.5; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head p { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.table-wrap.flow { flex: none; overflow-x: auto; }
.seg-wide { grid-template-columns: repeat(2, 1fr); min-width: 220px; }
.seg-wide button { padding: 7px 14px; }

/* star (save to shortlist) */
.star { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--muted); border-radius: 6px; display: inline-grid; }
.star:hover { color: var(--c-tax); }
[data-star][aria-pressed="true"] { color: var(--c-tax); --star-fill: currentColor; }
.star-btn[aria-pressed="true"] { color: var(--ink); }
.star-btn[aria-pressed="true"] svg { color: var(--c-tax); }
.score-cell { display: flex; align-items: center; gap: 6px; }

/* properties toolbar */
.results-head .search { flex: 0 1 300px; }
.results-head .legend { margin-left: 4px; }

/* home */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding: 12px 0 4px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 16px; text-wrap: balance; }
.hero-sub { font-size: 16px; line-height: 1.55; color: var(--muted); max-width: 56ch; margin: 0 0 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { padding: 11px 18px; font-size: 14px; }
.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; box-shadow: var(--shadow); cursor: pointer;
}
.hero-card:hover, .hero-card.selected { border-color: var(--accent); }
.hero-card-body { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; margin-top: 12px; }
.hero-addr { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.hero-card .why { margin-top: 12px; font-size: 13px; }
.views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.view {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.view:hover { border-color: var(--accent); }
.view-count { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.1; }
.view-title { font-weight: 700; margin: 6px 0 4px; }
.view .small { line-height: 1.45; }
.lead-list { display: grid; }
.lead { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.lead + .lead { border-top: 1px solid var(--line); border-radius: 0; }
.lead:hover, .lead.selected { background: var(--hover); }
.lead-main { min-width: 0; }
.lead-main .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-side { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 44px; gap: 12px; align-items: center; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.bar-row:hover { background: var(--hover); }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: block; height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cell-bar { display: inline-grid; grid-template-columns: 110px 44px; gap: 10px; align-items: center; }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pipe { display: block; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--ink); }
.pipe:hover { outline: 1px solid var(--accent); }
#marketBody tr { cursor: pointer; }

/* shortlist board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.board[hidden] { display: none; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.column h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.column-empty { padding: 6px 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; cursor: pointer; }
.card:hover, .card.selected { border-color: var(--accent); }
.card-top { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.card select, .card textarea, .calc-inputs input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit;
}
.card textarea { resize: vertical; min-height: 52px; }
.card-actions { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }

/* calculator */
.calc { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 20px; align-items: start; }
.calc-inputs { display: grid; gap: 14px; }
.calc-inputs h2:not(:first-child) { margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.money:focus-within { border-color: var(--accent); }
.money span { padding: 0 10px; color: var(--muted); }
.money input { border: 0 !important; background: none !important; padding-left: 0; outline: none; }
.money.pct input { padding-left: 10px; }
.field .note { margin-top: 5px; }
.calc-results { display: grid; gap: 16px; position: sticky; top: 76px; }
.calc-results h2 { margin-bottom: 10px; }
.result-main { background: var(--accent-soft); border-color: transparent; }
.result-num { font-size: clamp(40px, 6vw, 60px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
dl.facts.one { grid-template-columns: 1fr; }
.neg { color: var(--c-condition); }
.pos { color: var(--accent); }

/* scoring */
.score-explain { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.score-explain p { margin: 0 0 12px; line-height: 1.55; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rule-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; flex-wrap: wrap; }
.rule-head i { width: 10px; height: 10px; border-radius: 99px; flex: none; }
.rule p { margin: 0 0 8px; }
.plain { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.5; }

@media (max-width: 980px) {
  .hero, .two-col, .calc { grid-template-columns: 1fr; }
  .views { grid-template-columns: 1fr 1fr; }
  .calc-results { position: static; }
  .rules { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav { order: 3; flex-basis: 100%; margin-left: -6px; }
  .page { padding: 20px 14px 40px; gap: 22px; }
  .views, .pipeline { grid-template-columns: 1fr 1fr; }
  .hero-card-body, .score-explain { grid-template-columns: 1fr; }
  .results-head .search { flex: 1 1 100%; order: 0; }
  .bar-row { grid-template-columns: 110px 1fr 40px; }
  body[data-page="properties"] { height: auto; overflow: auto; }
  body[data-page="properties"] .table-wrap { max-height: 70vh; }
}

/* ===== outreach, inbox, owners, changes, spending ===== */
.nav-sep { width: 1px; align-self: stretch; margin: 6px 6px; background: var(--line); flex: none; }
.nav a { padding: 7px 10px; }
.split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; align-items: start; }
section[data-panel] { display: grid; gap: 20px; }
section[data-panel][hidden] { display: none; }
.seg-tabs { grid-template-columns: repeat(4, auto); }
.seg-tabs button, .seg-two button { padding: 7px 14px; white-space: nowrap; }
.seg-two { grid-template-columns: 1fr 1fr; }
.pick.selected { background: var(--accent-soft); }
.lead.pick { grid-template-columns: auto 1fr; }
.lead.pick:first-child:last-child, .lead.pick { padding: 10px 8px; }
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#composer, #thread, #tplForm, #expForm, .narrow-form { display: grid; gap: 14px; }
#composer[hidden], #thread[hidden] { display: none; }
#composer .section-head, #thread .section-head { margin-bottom: 0; }
.narrow-form { max-width: 560px; }
.panel input[type="text"], .panel input[type="number"], .panel input[type="date"], .panel select, .panel textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit;
}
.panel textarea { resize: vertical; line-height: 1.5; }
.panel input:focus, .panel select:focus, .panel textarea:focus { border-color: var(--accent); outline: none; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-sm); padding: 10px 14px; line-height: 1.5; }
.panel.notice { border-color: transparent; box-shadow: none; }
.notice .link { color: inherit; text-decoration: underline; }
.messages { display: grid; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.msg.out { justify-self: end; background: var(--accent-soft); }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; line-height: 1.5; }
.toolbar { display: flex; gap: 18px; align-items: end; flex-wrap: wrap; padding: 14px 18px; }
.toolbar .search { flex: 1 1 240px; max-width: 340px; }
.field.inline { width: 120px; }
.check { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
#ownerBody tr { cursor: pointer; }
.view-btn { text-align: left; font: inherit; cursor: pointer; }
.view-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.bar-row.static:hover { background: none; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity 0.18s ease, transform 0.18s ease; } }
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .stats-4 { grid-template-columns: 1fr 1fr; }
  .seg-tabs { grid-template-columns: 1fr 1fr; width: 100%; }
}
@media (max-width: 560px) { .comp-grid { grid-template-columns: 1fr; } .msg { max-width: 100%; } }
.page > *, .split > *, .two-col > *, section[data-panel] > * { min-width: 0; }
#log, #dncList, #expList, #perProp { overflow-x: auto; }
@media (max-width: 560px) { .toolbar { padding: 12px; gap: 12px; } .field.inline { width: 46%; } }
[hidden] { display: none !important; }

/* signed-in users who are not the admin don't see outreach, reply and spending controls */
[data-role="viewer"] [data-admin] { display: none !important; }

/* ---------- sign-in page ---------- */
body.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.auth-wrap { width: min(400px, 100%); display: grid; gap: 18px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.auth-card { padding: 28px 26px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
.auth-card form > .muted { margin: 0 0 20px; font-size: 14px; line-height: 1.45; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.auth-field input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 16px;
}
.auth-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.auth-field .note { margin-top: 6px; }
.auth-pw { position: relative; }
.auth-pw input { padding-right: 64px; }
.auth-show {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.auth-show:hover { background: var(--hover); }
.auth-submit { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; margin-top: 4px; }
.auth-links { margin: 16px 0 0; text-align: center; font-size: 14px; }
.auth-links a { color: var(--accent); }
.auth-error, .auth-notice { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.45; }
.auth-error { background: color-mix(in srgb, #d64545 12%, var(--surface)); border: 1px solid color-mix(in srgb, #d64545 45%, var(--surface)); }
.auth-notice { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.auth-foot { text-align: center; font-size: 13px; margin: 0; }
