/* ─────────────────────────────────────────────
   Design tokens
   ───────────────────────────────────────────── */
:root {
  --bg:           #F8F7F5;
  --surface:      #FFFFFF;
  --border:       #E4E2DE;
  --border-light: #EDECEA;

  --text:         #111110;
  --text-muted:   #78716C;
  --text-xmuted:  #A8A29E;

  --pursue:        #0F4C2A;
  --pursue-bg:     #F0FDF4;
  --pursue-border: #BBF7D0;

  --verify:        #7C3300;
  --verify-bg:     #FFFBEB;
  --verify-border: #FDE68A;

  --pass:          #3D3D3A;
  --pass-bg:       #F5F5F3;
  --pass-border:   #D6D5D1;

  --solid-text:   #0C4A6E;
  --solid-bg:     #F0F9FF;
  --accent:       #B08A4A;
  --map-ink:      #1D211F;
  --map-wash:     #F7F3EA;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', 'SF Mono', ui-monospace, 'Cascadia Code', monospace;

  --radius:    3px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

/* ─────────────────────────────────────────────
   Reset
   ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─────────────────────────────────────────────
   Parallax background, land gradient field
   Each layer fills the viewport; overlapping soft radial gradients
   read as one ambient wash rather than distinct shapes.
   ───────────────────────────────────────────── */
.scene-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  will-change: transform;
}
/* Oregon forest green, upper-left quadrant */
.blob-a {
  width: 110vw; height: 95vh;
  top: -12vh; left: -12vw;
  background: radial-gradient(ellipse 52% 58% at 30% 36%, rgba(15,76,42,.20) 0%, transparent 80%);
}
/* Warm clay / earth, right side */
.blob-b {
  width: 95vw; height: 110vh;
  top: -8vh; right: -12vw;
  background: radial-gradient(ellipse 48% 52% at 70% 46%, rgba(139,90,43,.17) 0%, transparent 78%);
}
/* Dry grass / ochre, lower center */
.blob-c {
  width: 90vw; height: 78vh;
  bottom: -10vh; left: 8vw;
  background: radial-gradient(ellipse 56% 54% at 48% 64%, rgba(180,155,75,.14) 0%, transparent 82%);
}
header, .main, .footer {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}
a:hover {
  text-decoration-color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   Navigation
   ───────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 3.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo-wordmark {
  display: block;
  height: 30px;
  width: 142px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-link:hover { color: var(--text); }

/* ─────────────────────────────────────────────
   Main content area
   ───────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
  width: 100%;
}

/* ─────────────────────────────────────────────
   Home hero
   ───────────────────────────────────────────── */
.hero {
  margin-bottom: 2.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 30rem;
  line-height: 1.55;
  text-wrap: balance;
}

/* ─────────────────────────────────────────────
   Page-load reveal — one calm, staggered entrance.
   Restraint over flourish: a short rise + fade, disabled for
   reduced-motion users and when the browser cannot animate.
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero,
  .search-section,
  .map-workspace,
  .page-header,
  .candidates-list {
    animation: plumb-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero,
  .page-header { animation-delay: 0.04s; }
  .search-section,
  .candidates-list { animation-delay: 0.14s; }
  .map-workspace { animation-delay: 0.24s; }
}

@keyframes plumb-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────
   Search form
   ───────────────────────────────────────────── */
.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.form-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
}
.form-or::before,
.form-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.form-or span {
  font-size: 0.75rem;
  color: var(--text-xmuted);
  letter-spacing: 0.04em;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input {
  height: 2.625rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.12s;
  width: 100%;
}
.form-input:focus {
  border-color: #9CA3AF;
  background: var(--surface);
}
.form-input::placeholder { color: var(--text-xmuted); }
.form-input--mono { font-family: var(--font-mono); font-size: 0.875rem; letter-spacing: 0.02em; }


.form-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.15rem;
}

/* County selector */
.county-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
}

.county-tab { cursor: pointer; }

.county-tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.county-tab span {
  display: block;
  padding: 0.4375rem 1.125rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg);
  border-right: 1px solid var(--border);
  transition: background 0.1s, color 0.1s;
  user-select: none;
}
.county-tab:last-child span { border-right: none; }

.county-tab input:checked + span {
  background: var(--text);
  color: #fff;
}

/* Submit button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.625rem;
  padding: 0 1.375rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: opacity 0.12s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.82; }
.btn-primary:active { opacity: 0.72; }

/* Spinner indicator */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

/* ─────────────────────────────────────────────
   Packet zone (HTMX swap target)
   ───────────────────────────────────────────── */
.packet-zone { min-height: 2rem; }

/* ─────────────────────────────────────────────
   Map workspace
   ───────────────────────────────────────────── */
.map-workspace {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.map-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: normal;
  line-height: 1.3;
  color: var(--text);
}

.map-sub {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 0.2rem;
}

.city-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  max-width: 780px;
}

.city-focus-btn {
  background: #FBFAF7;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  height: 1.7rem;
  line-height: 1;
  padding: 0 0.7rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.city-focus-btn:hover {
  border-color: #B08A4A;
  color: var(--text);
}

.city-focus-btn.is-active {
  background: #F0FDF4;
  border-color: #0F4C2A;
  color: #0F4C2A;
}

.map-status {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1;
  padding: 0.45rem 0.55rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-header-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.basemap-toggle {
  background: #FBFAF7;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.18rem;
}

.basemap-btn {
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.75rem;
  height: 1.75rem;
  min-width: 4.35rem;
  padding: 0 0.65rem;
}

.basemap-btn:hover,
.basemap-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  height: min(780px, calc(100vh - 6rem));
  min-height: 640px;
  position: relative;
}

/* Floating parcel hover card — follows the cursor over the fabric */
.parcel-hover-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  width: 220px;
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s ease;
  will-change: transform;
}
.parcel-hover-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parcel-hover-owner {
  font-size: 0.78rem;
  color: var(--text);
  margin-top: 0.18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parcel-hover-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.parcel-hover-apn {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-xmuted);
  margin-top: 0.2rem;
}
.parcel-hover-cta {
  font-size: 0.6875rem;
  color: var(--accent);
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}

.parcel-map {
  background:
    linear-gradient(rgba(29, 33, 31, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 33, 31, 0.025) 1px, transparent 1px),
    var(--map-wash);
  background-size: 32px 32px;
  min-height: 0;
}

.parcel-map .maplibregl-ctrl-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.parcel-map .maplibregl-ctrl button {
  background-color: var(--surface);
}

.parcel-sidepanel {
  background: #FBFAF7;
  border-left: 1px solid var(--border);
  min-height: 0;
  overflow: hidden;
}

/* The whole side panel is one scroll region (no cramped nested box). The
   selected-parcel header stays pinned while the diligence card scrolls under it,
   so scrolling works anywhere over the panel. */
.sidepanel-sticky {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #C8C5BF transparent;
  scrollbar-width: thin;
}
.sidepanel-sticky::-webkit-scrollbar { width: 0.55rem; }
.sidepanel-sticky::-webkit-scrollbar-thumb {
  background: #D6D5D1;
  border-radius: 999px;
}

.inspector-block {
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 1.15rem;
}

.inspector-block--selected {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 3;
}

.inspector-block:last-child {
  border-bottom: none;
}

.inspector-label {
  color: var(--text-xmuted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.inspector-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
}

.inspector-value {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.inspector-link {
  color: var(--text);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.source-meta {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.source-meta div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 0.75rem;
}

.source-meta dt {
  color: var(--text-xmuted);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-meta dd {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.layer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.layer-chip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.75rem;
  gap: 0.4rem;
  min-height: 1.8rem;
  padding: 0.3rem 0.55rem;
}

.layer-chip:hover {
  border-color: var(--text-xmuted);
  color: var(--text);
}

.layer-dot {
  border-radius: 50%;
  display: inline-block;
  height: 0.45rem;
  width: 0.45rem;
}

.packet-panel-content {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  flex: 0 0 auto;
}

.packet-panel-content::-webkit-scrollbar {
  width: 0.55rem;
}

.packet-panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.packet-panel-content::-webkit-scrollbar-thumb {
  background: #C8C5BF;
  border-radius: 99px;
  border: 2px solid var(--surface);
}

/* Diligence loading + error states (the click->DD path fetches over the network) */
.packet-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  color: var(--accent);
}
.spinner-inline {
  flex: 0 0 auto;
  border: 2px solid rgba(176, 138, 74, .25);
  border-top-color: var(--accent);
}
.packet-loading-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6B6760;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.packet-loading-text::after {
  content: "";
  animation: packet-dots 1.4s steps(4, end) infinite;
}
@keyframes packet-dots {
  0% { content: ""; } 25% { content: "."; }
  50% { content: ".."; } 75% { content: "..."; }
}
.packet-loading-target {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink, #2B2A27);
  font-weight: 600;
}
.packet-error {
  padding: 1.1rem 1.25rem;
  font-size: 0.85rem;
  color: #8A5A3A;
  background: rgba(176, 138, 74, .06);
  border-left: 3px solid var(--accent);
}

.empty-panel {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  padding: 1.125rem 1.25rem 1.5rem;
}

.source-drawer {
  background: #FBFAF7;
  flex-shrink: 0;
}

.source-drawer summary {
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  list-style: none;
  padding: 0.9rem 1.25rem;
  text-transform: uppercase;
}

.source-drawer summary::-webkit-details-marker {
  display: none;
}

.source-drawer summary::after {
  content: '+';
  float: right;
  font-family: var(--font-mono);
}

.source-drawer[open] summary::after {
  content: '-';
}

/* Collapsible reference sections in the diligence memo: lead concise, detail on tap */
.packet-collapse > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.packet-collapse > summary::-webkit-details-marker { display: none; }
.packet-collapse > summary::after {
  content: '+';
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--text-xmuted);
}
.packet-collapse[open] > summary::after { content: '-'; }
.collapse-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-xmuted);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

/* ─────────────────────────────────────────────
   Diligence packet / memo
   ───────────────────────────────────────────── */
.packet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.packet-panel-content .packet {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.packet-panel-content .verdict {
  padding: 1.125rem 1.25rem;
}

.packet-panel-content .verdict-chip {
  margin-bottom: 0.75rem;
}

.packet-panel-content .verdict-headline {
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Hero stat: the number that moves the deal, given a premium focal treatment. */
/* Deal-type verdict: the judgment-first lead, above the money number. */
.deal-verdict {
  border-bottom: 1px solid var(--border-light);
}
.deal-verdict-top {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.deal-verdict-archetype {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
}
.deal-verdict-roi {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--pursue);
  background: var(--pursue-bg);
  border: 1px solid var(--pursue-border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}
.deal-verdict-read {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.hero-stat {
  background: linear-gradient(180deg, var(--pursue-bg) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border-light);
}
.hero-stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pursue);
  margin-bottom: 0.25rem;
}
.hero-stat-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-stat-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.45;
}

.packet-panel-content .verdict-parcel {
  font-size: 1rem;
}

.packet-panel-content .packet-section {
  padding: 0.95rem 1.15rem;
}

.packet-panel-content .section-title {
  margin-bottom: 0.75rem;
}

.packet-panel-content .pencil-line {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.4rem;
}

.packet-panel-content .pencil-text,
.packet-panel-content .finding-value {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.packet-panel-content .source-list-item {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.15rem;
}

/* Verdict header */
.verdict {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
}

.verdict-chip {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.verdict-chip--pursue       { background: var(--pursue); color: #fff; }
.verdict-chip--proceed      { background: var(--solid-text); color: #fff; }
.verdict-chip--verify       { background: var(--verify); color: #fff; }
.verdict-chip--caution      { background: var(--verify); color: #fff; }
.verdict-chip--pass         { background: var(--pass);   color: #fff; }
.verdict-chip--insufficient { background: var(--text-muted); color: #fff; }

/* Neutral, descriptive use-class chip (what the parcel IS, not a judgment). */
.verdict-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.use-chip {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  background: var(--pass-bg);
  color: var(--pass);
  border: 1px solid var(--pass-border);
}
.packet-print {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.32rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.packet-print:hover { border-color: var(--text-xmuted); color: var(--text); }

/* Unique advantages — non-obvious money angles, each with a citeable source. */
.advantage-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  list-style: none;
}
.advantage-item {
  position: relative;
  padding-left: 0.95rem;
  border-left: 2px solid var(--pursue-border);
}
.advantage-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
}
.advantage-source {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--solid-text);
  text-decoration-color: var(--border);
}

/* Drafted outreach letter — readable, editable-looking, prints with the memo. */
.outreach-letter {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
}

/* Subtle info marker with a clean CSS tooltip (the disclaimer lives in it). */
.tip {
  position: relative;
  cursor: help;
  margin-left: 0.28rem;
  color: var(--text-xmuted);
  font-size: 0.8em;
  vertical-align: super;
  outline: none;
}
.tip:hover, .tip:focus { color: var(--accent); }

/* The bubble is a single fixed element on <body> (see tooltips.js) so it is never
   clipped by a scrolling panel, table, or card. JS sets its position; CSS styles it. */
.tip-floating {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 0.5rem 0.65rem;
  background: var(--map-ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.verdict-headline {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--text);
}

.verdict-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.verdict-parcel {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--text);
  line-height: 1.4;
}

.verdict-ts {
  font-size: 0.75rem;
  color: var(--text-xmuted);
  margin-top: 0.125rem;
}

.verdict-verify-note {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--verify);
  background: var(--verify-bg);
  border: 1px solid var(--verify-border);
  border-radius: var(--radius);
  padding: 0.5625rem 0.875rem;
  line-height: 1.5;
}

/* Packet sections */
.packet-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
}
.packet-section--last { border-bottom: none; }

.section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-xmuted);
  margin-bottom: 1.125rem;
}
.section-title--risk { color: var(--verify); }

.section-disclaimer {
  font-size: 0.75rem;
  color: var(--text-xmuted);
  font-style: italic;
  margin: -0.75rem 0 1rem;
}

/* Pencil synthesis lines */
.pencil-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pencil-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.pencil-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
}
.pencil-line--risk {
  padding-left: 0.875rem;
  border-left: 2px solid var(--verify-border);
}
.pencil-line--risk .pencil-text { color: var(--text); }

/* Cleared items: a quiet green check mirrors the risk left-border, so the memo
   reads at a glance — green is resolved, warm is a risk to watch. */
.pencil-line--clear {
  position: relative;
  padding-left: 1.5rem;
}
.pencil-line--clear::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--pursue);
  font-size: 0.82em;
  font-weight: 700;
  line-height: 1.55;
}

/* Sources footer */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}
.source-list-item {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.source-list-item a {
  color: var(--solid-text);
  text-decoration-color: var(--border);
}
.source-list-ts {
  font-size: 0.6875rem;
  color: var(--text-xmuted);
  white-space: normal;
}

/* Findings list */
.findings-list {
  display: flex;
  flex-direction: column;
}

.finding {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-light);
}
.finding:first-child { padding-top: 0; }
.finding:last-child  { border-bottom: none; padding-bottom: 0; }

.finding-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.finding-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.finding-value {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.5;
}

.finding-notes {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0.3125rem;
  font-style: italic;
}

.finding-sources {
  margin-top: 0.4375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.source-ref {
  font-size: 0.75rem;
  color: var(--text-xmuted);
}
.source-ref a {
  color: var(--text-muted);
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
}
.source-ref a:hover {
  color: var(--text);
  text-decoration-color: var(--text-muted);
}

/* Confidence badges */
.conf-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
}
.conf-badge--strong      { background: var(--pursue-bg); color: var(--pursue); }
.conf-badge--solid       { background: var(--solid-bg);  color: var(--solid-text); }
.conf-badge--directional { background: var(--pass-bg);   color: var(--pass); }
.conf-badge--verify      { background: var(--verify-bg); color: var(--verify); }

/* Verification checklist */
.verify-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.verify-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.verify-item strong {
  color: var(--text);
  font-weight: 500;
}

.verify-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--verify);
  flex-shrink: 0;
  margin-top: 0.5rem;
}

/* ─────────────────────────────────────────────
   Deal sourcer tabs + deals page
   ───────────────────────────────────────────── */
.page-header { margin-bottom: 2rem; }

.surface-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-xs);
}

.surface-tabs--explore {
  margin-bottom: 1rem;
}

.surface-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.surface-tab:hover,
.surface-tab--active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: normal;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.page-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.deal-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  max-width: 46rem;
  margin-top: 1rem;
}

.deal-search input {
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.deal-search button {
  padding: 0.7rem 1rem;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.deal-query-read,
.candidate-match {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.deal-query-read { margin-top: 0.65rem; }

.deal-query-read span,
.candidate-match span {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.deal-query-read p {
  color: var(--verify);
  font-size: 0.8125rem;
}

.candidates-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.candidate-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.candidate-card:hover {
  border-color: rgba(176, 138, 74, 0.55);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.candidate-address {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.candidate-apn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 0.375rem;
}

.candidate-archetype-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.candidate-archetype {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}
.candidate-roi {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--pursue);
  background: var(--pursue-bg);
  border: 1px solid var(--pursue-border);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  white-space: nowrap;
}
.candidate-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.candidate-county {
  font-size: 0.8125rem;
  color: var(--text-xmuted);
}
.candidate-acres {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.candidate-proposed {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--pursue-bg);
  border: 1px solid var(--pursue-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.candidate-proposed-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pursue);
  flex: 0 0 auto;
}
.candidate-proposed-value {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

/* Defensible basis + screen spread (DC4): the money read that orders the board. */
.candidate-basis {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.candidate-basis--strong_value,
.candidate-basis--in_range {
  background: var(--pursue-bg);
  border-color: var(--pursue-border);
  color: var(--pursue);
}
.candidate-basis--overpriced,
.candidate-basis--premium_spec {
  background: var(--verify-bg);
  border-color: var(--verify-border);
  color: var(--verify);
}

.candidate-control {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.7rem;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.52);
}

.candidate-control-top {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.candidate-control-label,
.candidate-control-stage {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.candidate-control-label { color: var(--text-xmuted); }
.candidate-control-stage { color: var(--verify); }

.candidate-control-action {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
}

.candidate-control-stop {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.candidate-signals {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  margin-top: 0.75rem;
}

.candidate-match {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.signal-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.signal-tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.075rem;
}
.signal-tag--entitlement_delta { background: var(--pursue-bg); color: var(--pursue); }
.signal-tag--risk              { background: #FEF2F2;          color: #991B1B; }
.signal-tag--verify            { background: var(--verify-bg); color: var(--verify); }

.signal-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Empty state */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}
.empty-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: normal;
  color: var(--text);
  margin-bottom: 0.375rem;
}
.empty-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   Error notice
   ───────────────────────────────────────────── */
.error-notice {
  padding: 0.875rem 1rem;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: #7F1D1D;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Utilities
   ───────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }

/* ─────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.125rem 2.5rem;
  background: var(--surface);
}

.footer-text {
  font-size: 0.75rem;
  color: var(--text-xmuted);
  text-align: center;
  letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────
   Print
   ───────────────────────────────────────────── */
@media print {
  .nav, .search-form, .footer { display: none; }
  body { background: #fff; }
  .packet { border: none; box-shadow: none; }
  .verdict-chip,
  .conf-badge,
  .signal-tag { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ─────────────────────────────────────────────
   Explore Layout (Workbench)
   ───────────────────────────────────────────── */

.explore-body {
  height: 100vh;
  overflow: hidden;
}

.explore-main {
  padding: 0;
  max-width: none;
  height: calc(100vh - 3.25rem); /* viewport minus nav */
  display: flex;
  flex-direction: column;
}

.explore-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 1.5rem 2rem 0;
}

.surface-tabs--bar {
  margin-bottom: 1rem;
}

.explore-search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.explore-search-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.explore-search-input {
  flex: 1;
  height: 2.25rem;
  font-size: 0.875rem;
}

.explore-county-tabs {
  margin: 0;
  flex-shrink: 0;
}
.explore-county-tabs span {
  padding: 0.25rem 0.75rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
}

.explore-main .map-shell {
  flex: 1;
  min-height: 0;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.explore-main .map-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.explore-main .map-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.explore-main .city-focus {
  margin-top: 0;
}

.explore-main .parcel-map {
  flex: 1;
  min-height: 0;
}

.explore-main .parcel-sidepanel {
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .main { padding: 2rem 1.25rem 3rem; }
  .nav { padding: 0 1.25rem; }
  .search-form { padding: 1.25rem 1.25rem; }
  .form-footer { flex-direction: column; align-items: flex-start; }
  .map-header { flex-direction: column; padding: 1.1rem 1.25rem; }
  .map-header-actions { align-items: flex-start; width: 100%; }
  .city-focus {
    flex-wrap: nowrap;
    max-width: calc(100vw - 2.5rem);
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }
  .city-focus-btn { flex: 0 0 auto; }
  .map-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .parcel-map { min-height: 340px; }
  .parcel-sidepanel {
    border-left: none;
    border-top: 1px solid var(--border);
    min-height: 0;
  }
  .sidepanel-sticky {
    height: auto;
    max-height: none;
    position: static;
  }
  .packet-panel-content {
    max-height: none;
    min-height: 18rem;
  }
  .verdict, .packet-section { padding: 1.25rem 1.25rem; }
}

/* ─────────────────────────────────────────────
   Print: produce a clean one-page diligence memo.
   Hides all app chrome; prints only the DD packet.
   ───────────────────────────────────────────── */
@media print {
  html, body { background: #fff !important; }
  .scene-bg, header.nav, .nav, .footer, .hero, .search-section,
  .map-header, .parcel-map, .map-inspector, .source-drawer,
  .basemap-toggle, .city-focus-row, .map-status, .no-print,
  .inspector-block--selected, #map-layer-list, .layer-list { display: none !important; }

  /* Expand collapsed memo sections so the PDF is complete. */
  .packet-collapse > summary::after { display: none; }
  .packet-collapse:not([open]) > *:not(summary) { display: revert !important; }

  .main { max-width: none; margin: 0; padding: 0; }
  .map-workspace, .map-shell { display: block; height: auto; border: none; box-shadow: none; }
  .parcel-sidepanel { border: none; background: #fff; }
  .sidepanel-sticky { overflow: visible; height: auto; display: block; }
  .packet-panel-content { overflow: visible; flex: none; }

  .packet { border: none; box-shadow: none; }
  .packet-section { break-inside: avoid; padding: 0.6rem 0; border-bottom: 1px solid #e4e2de; }
  .hero-stat { background: none !important; }
  .tip { display: none; }
  a[href]::after { content: ""; }  /* don't print raw URLs */

  /* Branded memo header */
  .packet::before {
    content: "plumb  ·  source-verified diligence";
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: #1d211f;
    border-bottom: 2px solid #1d211f;
    padding-bottom: 0.4rem;
    margin-bottom: 0.8rem;
  }
  @page { margin: 0.6in; }
}

/* ─────────────────────────────────────────────
   Data corpus dashboard (/data)
   ───────────────────────────────────────────── */
.corpus-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}
.corpus-stat {
  background: var(--surface);
  padding: 1.1rem 1.25rem;
}
.corpus-stat--hero { grid-column: span 2; }
.corpus-stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.05;
}
.corpus-stat--hero .corpus-stat-value { font-size: 2.6rem; color: var(--accent); }
.corpus-stat-label {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.corpus-section { margin-bottom: 2.25rem; }
.corpus-section-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.corpus-note {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 60ch;
}
.growth-strip { display: flex; flex-direction: column; gap: 0.4rem; }
.growth-bar-row { display: flex; align-items: center; gap: 0.7rem; }
.growth-day {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 5.5rem;
  flex: 0 0 auto;
}
.growth-bar {
  height: 0.7rem;
  background: var(--accent);
  border-radius: 2px;
  min-width: 2px;
  opacity: 0.85;
}
.growth-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
}
.corpus-table-wrap { overflow-x: auto; border: 1px solid var(--border-light); border-radius: var(--radius); }
.corpus-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.corpus-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.corpus-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.corpus-table tr:last-child td { border-bottom: none; }
.corpus-table .num { text-align: right; font-family: var(--font-mono); }
.corpus-table .muted { color: var(--text-muted); }
.tier-chip {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 0.3rem;
}
.status-dot--ok { background: var(--pursue); }
.status-dot--pending { background: var(--text-xmuted); }
.change-feed { display: flex; flex-direction: column; gap: 0.45rem; }
.change-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.82rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-light);
}
.change-source { font-family: var(--font-mono); color: var(--text); }
.change-field { color: var(--accent); font-size: 0.76rem; }
.change-delta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.change-when { margin-left: auto; font-size: 0.74rem; }

/* Signals: the off-market revaluation feed (/signals). */
.signal-feed { display: flex; flex-direction: column; gap: 0.75rem; }
.signal-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
/* Earliest-signal triggers get the strongest accent (most edge). */
.signal-card--comp_plan_amendment,
.signal-card--infrastructure,
.signal-card--ugb_change { border-left-color: var(--pursue); }
.signal-card-top {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.signal-trigger {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.signal-conf {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
}
.signal-conf--solid { color: var(--solid-text); background: var(--solid-bg); }
.signal-conf--directional { color: var(--text-muted); background: var(--bg); }
.signal-conf--verify { color: var(--verify); background: var(--verify-bg); }
.signal-when { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-xmuted); }
.signal-summary { font-size: 0.86rem; color: var(--text); margin-bottom: 0.4rem; }
.signal-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: baseline; }
.signal-parcel { font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); text-decoration: none; }
.signal-parcel:hover { text-decoration: underline; }
.signal-parcel--jurisdiction { color: var(--text-muted); }
.signal-source { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-xmuted); margin-left: auto; }

/* Data tab: health band, value buckets, examples, value/health columns. */
.health-band {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin: 0.25rem 0 1.1rem;
}
.health-pill {
  font-size: 0.78rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: 999px; border: 1px solid var(--border);
}
.health-pill--live  { color: var(--pursue); background: var(--pursue-bg); border-color: var(--pursue-border); }
.health-pill--stale { color: var(--verify); background: var(--verify-bg); border-color: var(--verify-border); }
.health-pill--down  { color: #9F1239; background: #FFF1F2; border-color: #FECDD3; }
.health-band-note { font-size: 0.76rem; color: var(--text-muted); margin-left: 0.25rem; }

.value-buckets { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.6rem; }
.value-bucket {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.55rem 0.85rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 9rem;
}
.value-bucket-count { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); }
.value-bucket-label { font-size: 0.76rem; color: var(--text-muted); }

.example-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem; }
.example-card {
  padding: 0.85rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}
.example-card--signal { border-left-color: var(--verify); }
.example-card--parcel { border-left-color: var(--solid-text); }
.example-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.35rem; }
.example-body { font-size: 0.86rem; color: var(--text); line-height: 1.4; }
.example-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.4rem; font-family: var(--font-mono); }

.value-chip {
  font-size: 0.74rem; padding: 0.12rem 0.5rem; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
  white-space: nowrap; cursor: help;
}
.health-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.3rem; }
.health-dot--live  { background: var(--pursue); }
.health-dot--stale { background: var(--verify); }
.health-dot--down  { background: #E11D48; }
.health-pill--ondemand { color: var(--solid-text); background: var(--solid-bg); border-color: #BAE6FD; }
.health-dot--on-demand { background: var(--solid-text); }

/* DC4-A: operator price inputs in the Explore search form */
.explore-price-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.625rem;
  flex-wrap: wrap;
}
.price-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.price-input {
  width: 9rem;
  height: 2rem;
  font-size: 0.8125rem;
}
.price-hint {
  font-size: 0.75rem;
  color: var(--text-xmuted);
  font-style: italic;
  margin-left: 0.25rem;
}

/* DC4-A: price ladder in the diligence packet */
.price-ladder-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.price-ladder-item {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
  font-family: var(--font-mono);
}
.price-ladder-notes {
  margin-top: 0.5rem;
}

/* DC8-A: lifecycle rail in the diligence packet */
.lifecycle-path-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.lifecycle-projected {
  margin-left: 0.5rem;
  color: var(--verify);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
}
.lifecycle-stage-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.lifecycle-stage {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
}
.lifecycle-stage--completed {
  border-left-color: var(--pursue);
  color: var(--text-muted);
}
.lifecycle-stage--current {
  border-left-color: var(--solid-text);
  background: var(--surface-raised);
}
.lifecycle-stage--upcoming {
  color: var(--text-xmuted);
}
.lifecycle-stage--skipped {
  color: var(--text-xmuted);
  text-decoration: line-through;
}
.lifecycle-stage--blocked {
  border-left-color: var(--verify);
}
.lifecycle-stage-label {
  font-weight: 500;
}
.lifecycle-stage-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.lifecycle-stage-detail--blocked {
  color: var(--verify);
}
.lifecycle-gate { font-style: italic; }
.lifecycle-capital { }
.lifecycle-why { color: var(--text-xmuted); }
.lifecycle-spend { }
.lifecycle-stage-decision {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}
.lifecycle-stage-decision--skip { color: var(--verify); }

/* DC7-A: control strategy packet */
.control-packet { }
.control-verdict {
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--border);
}
.control-verdict--ready_for_control {
  background: var(--pursue-bg);
  border-left-color: var(--pursue);
  color: var(--pursue);
}
.control-verdict--needs_more_proof {
  background: var(--verify-bg);
  border-left-color: var(--verify);
  color: var(--verify);
}
.control-verdict--fatal_issue {
  background: #FEF2F2;
  border-left-color: #DC2626;
  color: #991B1B;
}
.control-verdict--no_basis {
  background: var(--pass-bg);
  border-left-color: var(--pass);
  color: var(--pass);
}
.control-row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
}
.control-label {
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 0.05rem;
}
.control-value {
  color: var(--text);
}
.control-value--positive {
  color: var(--pursue);
}
.control-proof-section,
.control-conditions-section {
  margin-top: 0.75rem;
}
.control-proof-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.control-proof-list {
  margin: 0;
  padding-left: 1.25rem;
}
.control-proof-item {
  font-size: 0.8125rem;
  color: var(--text);
  padding: 0.15rem 0;
}
.control-legal-note {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-xmuted);
  font-style: italic;
  border-top: 1px solid var(--border-light);
  padding-top: 0.5rem;
}
