:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e6e6e3;
  --accent: #0f6e56;
  --accent-soft: #e7f3ef;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --radius: 16px;
  --max: 1040px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
header.top {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(246,246,244,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.brand { padding: 16px 0 8px; }
.brand .eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand h1 { margin: 2.0px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
nav.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  border: 0;
  background: transparent;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
nav.tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow);
  outline: 1px solid var(--line);
}
main { padding: 32px 0 64px; }
.view { display: none; }
.view.active { display: block; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px;
}
.stat .k { margin: 0; color: var(--muted); font-size: 13px; }
.stat .v { margin: 8px 0 0; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.stat .s { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
h2 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; letter-spacing: -0.02em; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.feed article time { color: var(--muted); font-size: 13px; }
.feed p { margin: 8px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts { display: grid; gap: 8px; }
.facts div { display: grid; grid-template-columns: 148px 1fr; gap: 8px; }
.facts dt { color: var(--muted); margin: 0; }
.facts dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-size: 13px; }
.warn {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.warn .tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
  margin-bottom: 8px;
}
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.thumbs figure { margin: 0; }
.thumbs button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.thumbs img { display: block; width: 100%; height: 190px; object-fit: contain; object-position: center; background: #fafafa; }
.thumbs figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px;
}
.filters input { flex: 1 1 180px; min-width: 0; }
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2.0px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.muted { background: #f0f0ee; color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { white-space: nowrap; }
.cards-only { display: none; }
.reason { color: var(--muted); font-size: 13px; margin-top: 4px; }
.council-grid, .rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { margin: 0; padding-left: 16px; }
.check li { margin: 8px 0; }
.price { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0; }
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(960px, calc(100vw - 24px));
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog img { width: 100%; height: auto; border-radius: 12px; background: #fff; }
dialog form { margin-top: 8px; text-align: right; }
dialog button { border: 0; background: #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.tick { list-style: none; margin: 8px 0 0; padding: 0; }
.tick li { padding: 4px 0 4px 24px; position: relative; }
.tick li::before { position: absolute; left: 0; color: var(--accent); }
.tick li.on::before { content: "✓"; content: "✓" / ""; }
.tick li.off { color: var(--muted); }
.tick li.off::before { content: "·"; content: "·" / ""; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chips button, .icon-btn, .io button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 16px;
  cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.io { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.io button { color: var(--accent); }
.media-card { padding: 0 0 16px; overflow: hidden; }
.media-card .pad { padding: 16px 16px 0; }
.hero, .hero-ph {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #efeae2;
}
.hero-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.icon-btn { min-width: 44px; }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.icon-btn .badge { margin-left: 8px; }
.note-panel { display: none; margin-top: 8px; }
.note-panel.open { display: block; }
.note-panel textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  resize: none;
  background: #fafaf8;
}
.save-line { margin: 8px 0 0; color: var(--muted); font-size: 13px; min-height: 1.2em; }
.save-line .ok { color: var(--accent); }
.project-hero { margin: -16px -18px 16px; width: calc(100% + 36px); height: 220px; object-fit: cover; border-radius: 16px 16px 0 0; display: block; }
.status-pill { display: inline-block; font-size: 12px; padding: 2.0px 8px; border-radius: 999px; background: #f0f0ee; color: var(--muted); }
.status-pill.live { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 800px) {
  .stats, .grid-2, .thumbs, .council-grid, .rule-grid { grid-template-columns: 1fr; }
  .facts div, .timeline li { grid-template-columns: 1fr; gap: 2.0px; }
  .table-wrap { display: none; }
  .cards-only { display: flex; flex-direction: column; gap: 8px; }
  .thumbs img { height: 180px; }
  .hero, .project-hero { height: 180px; }
  .project-hero { width: calc(100% + 36px); }
  th:last-child, td:last-child { white-space: nowrap; }
  .brand h1 { font-size: 20px; }
}

#bf-map { height: 520px; border-radius: 16px; margin: 0 0 12px; border: 1px solid var(--line); background: #e7e4dc; }
.bf-toggles { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
.bf-toggles label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.stage-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.stage-label select { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 8px; }
.pipe-counts { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; }
.pipe-counts button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 16px; white-space: nowrap; cursor: pointer; }
.board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.board section { flex: 0 0 260px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.board h3 { margin: 0 0 8px; font-size: 15px; }
.mini { padding: 8px 0; border-top: 1px solid var(--line); }
.mini p { margin: 2.0px 0; }
.pilot-mark { box-shadow: inset 3px 0 0 #b45309; }
@media (max-width: 800px) {
  #bf-map { height: 70vw; min-height: 280px; max-height: 460px; }
  .board section { flex-basis: 80vw; }
}

.basemap { display: flex; gap: 4px; margin: 0 0 8px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.basemap button { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.basemap button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.map-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0; }
a.gmaps { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; }
a.gmaps:hover { text-decoration: none; }
a.sat-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }

.letter-badge { display: inline-block; font-size: 12px; padding: 2.0px 8px; border-radius: 999px; background: #f0f0ee; color: var(--muted); }
.letter-badge.drafted { background: #eeeae4; color: #444; }
.letter-badge.sent { background: #e7eef8; color: #1d4e89; }
.letter-badge.followup { background: #fff4e5; color: #8a4b08; }
.letter-badge.replied { background: var(--accent-soft); color: var(--accent); }
.letter-badge.interested { background: var(--accent); color: #fff; }
.letter-badge.not_interested { background: #f0f0ee; color: #666; }
.letter-badge.returned { background: #fde8e8; color: #8b1e3f; }
#letter-sheet { position: fixed; inset: 0; z-index: 2000; background: #f6f6f4; overflow: auto; padding: 12px 12px 40px; }
#letter-sheet[hidden] { display: none !important; }
.letter-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 auto 12px; max-width: 720px; }
.letter-tools button, .letter-variants button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 16px; cursor: pointer; }
.letter-variants { display: flex; gap: 8px; overflow-x: auto; margin: 0 auto 12px; max-width: 720px; }
.letter-variants button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.letter { max-width: 720px; margin: 0 auto; background: #fff; padding: 32px 24px 32px; border-radius: 16px; color: #1c1c1c; }
.letter h2 { font-size: 20px; margin: 0; }
.letter .lh-meta { color: #444; font-size: 14px; margin: 4px 0; }
.letter [contenteditable="true"] { outline: 1px dashed transparent; border-radius: 6px; }
.letter [contenteditable="true"]:focus { outline-color: #0f6e56; background: #f7fbf9; }
@media print {
  body.printing-letter header, body.printing-letter main, body.printing-letter .no-print { display: none !important; }
  body.printing-letter #letter-sheet { display: block !important; position: static; background: #fff; padding: 0; overflow: visible; }
  body.printing-letter .letter { box-shadow: none; border-radius: 0; max-width: none; }
}

/* Find the owner + pipeline panels */
.owner-block { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fafaf8; }
.owner-block h4 { margin: 0 0 8px; font-size: 15px; }
.owner-actions { margin-top: 8px; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: #fff !important; font-weight: 600; text-decoration: none; }
.owner-block details, .pipe-panels details { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.owner-block summary, .pipe-panels summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; flex-wrap: wrap; }
.pipe-panels { margin: 12px 0; }
.pipe-panels > details { border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px 8px; background: #fff; }
.sum-note { font-weight: 400; color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.field input, .field select, .field textarea { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 8px 8px; font: inherit; color: #1a1a1a; box-sizing: border-box; width: 100%; }
.field textarea { resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }
.ways { margin: 8px 0 0; padding-left: 16px; font-size: 14px; }
.ways li { margin: 4px 0; }
.next-action { margin: 8px 0 0; padding: 8px 8px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.rag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2.0px 8px; border-radius: 999px; color: #fff; }
.rag.green { background: #15803d; }
.rag.amber { background: #b45309; }
.rag.red { background: #b91c1c; }
.rag-box { margin-top: 12px; padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.rag-box.green { background: #ecfdf3; }
.rag-box.amber { background: #fff7e6; }
.rag-box.red { background: #fdecec; }
.rag-box ul { margin: 8px 0 0; padding-left: 16px; }
.auto-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.auto-list li { margin: 8px 0; padding-left: 24px; position: relative; }
.auto-list li span { position: absolute; left: 4px; top: 0; }
.auto-list li.green span { color: #15803d; }
.auto-list li.amber span { color: #b45309; }
.auto-list li.red span { color: #b91c1c; }
.auto-list li.info span { color: var(--muted); font-style: italic; font-weight: 600; }
.appr-out { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0 0; font-size: 14px; }
.appr-out dt { color: var(--muted); }
.appr-out dd { margin: 0; text-align: right; }
.appr-result { margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: #f6f6f4; }
.warn { margin: 0 0 8px; padding-left: 16px; color: #9a3412; font-size: 13px; }
.docs { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.docs li { margin: 8px 0; display: flex; flex-direction: column; }
.docs label { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; }
.docs input { width: 22px; height: 22px; margin-top: 1.0px; flex: none; }
.need { font-size: 11px; font-weight: 600; color: #9a3412; background: #fff1e6; padding: 1.0px 8px; border-radius: 999px; }
.clock { margin: 8px 0 0; padding: 8px 8px; border-radius: 12px; background: #eef4fb; font-size: 14px; }
.overdue { border-color: #f3c08a; background: #fffaf3; }
.overdue ul { margin: 8px 0 0; padding-left: 16px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-align: left; cursor: pointer; min-height: 32px; }
.mini .next-action { font-size: 13px; }

/* ---- Mobile responsiveness (9 Oct 2026) ----
   Cause of the sideways scroll: long unbroken URLs and file paths (Work log
   sources, Expertise sources) forced their cards wider than the screen, and
   mobile Chrome widened the whole page to fit them. */
html { overflow-x: hidden; max-width: 100%; }
/* clip, not hidden: hidden on body made it a scroll container, which silently broke every position: sticky. */
body { overflow-x: clip; max-width: 100%; }
/* The header has never actually stuck (see above); keep it scrolling away so the phone screen stays free. */
header.top { position: relative; }
*, *::before, *::after { box-sizing: border-box; }
body { overflow-wrap: anywhere; word-break: normal; }
p, li, dd, dt, td, th, h1, h2, h3, h4, summary, label, a, .reason, .hint, figcaption { overflow-wrap: anywhere; }
img, video, canvas, iframe, table, pre, input, select, textarea, #bf-map { max-width: 100%; }
.leaflet-container canvas { max-width: none !important; max-height: none !important; }   /* map canvas renderer must not be squeezed by the rule above */
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
.wrap, main, .view, .card, .stack, .owner-block, .pipe-panels, .pipe-panels > details, .field { min-width: 0; max-width: 100%; }
.stack > *, .grid-2 > *, .stats > *, .council-grid > *, .rule-grid > *, .thumbs > *, .facts div > *, .timeline li > *,
.card-actions > *, .map-links > *, .chips > *, .filters > *, .bf-toggles > *, .appr-out > *, .docs label > * { min-width: 0; }
.stats, .grid-2, .council-grid, .rule-grid, .thumbs { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.stats { --cols: 4; }
.thumbs { --cols: 3; }
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
td:last-child, th:last-child { white-space: normal; }
/* Tab bar scrolls inside itself; it never widens the page. */
header.top, header.top .wrap { max-width: 100vw; }
nav.tabs { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
nav.tabs button { flex: none; }
.pipe-counts { max-width: 100%; overscroll-behavior-x: contain; }
.pipe-counts button { flex: none; }
.letter-variants { max-width: 100%; }
.letter-variants button { flex: none; white-space: nowrap; }
/* Leaflet controls and attribution stay inside the map. */
#bf-map, .leaflet-container { width: 100%; overflow: hidden; }
.leaflet-control-attribution { max-width: calc(100% - 8px); white-space: normal; overflow-wrap: anywhere; }
/* Pipeline board: stage columns are collapsible. Desktop keeps a contained
   horizontal board; mobile stacks them as a vertical list. */
.board { max-width: 100%; }
.board .stage-col { flex: 0 0 260px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.board .stage-col > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.board .stage-col > summary::-webkit-details-marker { display: none; }
.board .stage-col > summary h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.board .stage-col > summary h3::before { content: "▸"; content: "▸" / ""; color: var(--muted); font-size: 12px; }
.board .stage-col[open] > summary h3::before { content: "▾"; content: "▾" / ""; }
@media (max-width: 800px) {
  .stats, .grid-2, .council-grid, .rule-grid, .thumbs { --cols: 1; }
  .board { flex-direction: column; overflow-x: visible; gap: 8px; }
  .board .stage-col { flex: none; width: 100%; }
  .wrap { padding: 0 16px; }
  .card { padding: 16px 16px; }
  .project-hero { margin: -14px -14px 12px; width: calc(100% + 28px); }
  .letter { padding: 24px 16px 32px; }
  #letter-sheet { padding: 8px 8px 40px; }
}
@media (max-width: 480px) {
  .appr-grid, .field-grid, .grid-2, .facts div { grid-template-columns: minmax(0, 1fr); }
  .appr-out { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .appr-out dt { margin-top: 8px; }
  .appr-out dd { text-align: left; font-size: 15px; }
  .owner-block .card-actions > *, .owner-actions > * { max-width: 100%; }
  .btn-primary, a.gmaps { white-space: normal; text-align: center; }
}
.appr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; align-items: start; }
@media (max-width: 480px) { .appr-grid { grid-template-columns: minmax(0, 1fr); } }

/* Letters: email and small print */
.letter-tools .send-email { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.letter-email-note { max-width: 720px; margin: 0 auto 12px; font-size: 14px; }
.letter-email-note p { margin: 4px 0; }
.sent-ask { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: #eef4fb; }
.sent-ask[hidden] { display: none; }
.sent-ask button:not(.btn-primary) { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 16px; cursor: pointer; }
.sent-ask .btn-primary { border: 0; cursor: pointer; }
.letter-small { font-size: 11.5px; color: #555; line-height: 1.45; margin: 8px 0 0; }
.letter #letter-dear { display: inline; }
.letter #letter-to, .letter #letter-addr, .letter #letter-body { white-space: pre-line; }
.warn-box { background:#fff4e5; border:1px solid #f3c08a; border-radius:12px; padding:8px 12px; }

/* Barn finder: identity strip, action row, legend, toast, status badges */
.bf-current { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px; margin: 0 0 8px; }
.bf-current p { margin: 0; }
.bf-cur-name { font-weight: 600; font-size: 1.1rem; }
.bf-cur-meta { color: var(--muted); font-size: .92rem; }
.bf-map-wrap { position: relative; }
.bf-map-wrap #bf-map { margin-bottom: 8px; }
.bf-legend { position: absolute; right: 6px; top: 6px; z-index: 500; background: rgba(255,255,255,.93); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 10.5px; line-height: 1.45; max-width: 58%; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.bf-legend summary { cursor: pointer; font-weight: 600; list-style: none; }
.bf-legend summary::-webkit-details-marker { display: none; }
.bf-legend .lg { display: grid; grid-template-columns: auto auto; column-gap: 8px; }
.bf-legend span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.bf-legend span.wide { grid-column: 1 / -1; white-space: normal; }
.bf-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.bf-legend i.lg-pilot { border-radius: 2px; background: #fff; border: 2px solid #b45309; box-shadow: none; width: 10px; height: 8px; }
.bf-legend .lg-star { color: #16a34a; font-size: 12px; line-height: 1; width: 11px; text-align: center; }
.bf-legend .lg-star.ring { border-radius: 50%; box-shadow: 0 0 0 1.5px #9333ea; width: 12px; height: 12px; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.bf-star { color: #16a34a; font-size: 22px; line-height: 22px; text-align: center; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.bf-star.on { color: #14532d; font-size: 26px; }
#bf-actions { margin: 0 0 12px; }
.bf-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bf-act { min-height: 52px; font-size: 1.05rem; font-weight: 600; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: inherit; cursor: pointer; padding: 8px 8px; }
.bf-act.save.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.bf-act.no { border-color: #fca5a5; color: #b91c1c; }
.bf-act.restore { grid-column: span 2; }
.sbadges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.sbadge { font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 1.0px 8px; color: #fff; white-space: nowrap; }
.sbadge.saved { background: #16a34a; }
.sbadge.note { background: #9333ea; }
.sbadge.approach { background: #f97316; }
.sbadge.talks { background: #dc2626; }
.sbadge.planning { background: #0f766e; }
.sbadge.arch, .sbadge.nope { background: #6b7280; }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2000; background: #1f2937; color: #fff; border-radius: 12px; padding: 8px 12px 8px 16px; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 24px); box-shadow: 0 4px 16px rgba(0,0,0,.3); font-size: .95rem; }
.toast span { overflow-wrap: anywhere; }
.toast button { background: #fff; color: #1f2937; border: 0; border-radius: 8px; font-weight: 600; min-height: 40px; padding: 0 16px; cursor: pointer; flex: none; }

/* Focus-area toggle */
#bf-area .area-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 8px; }
#bf-area .area-chips button { min-height: 52px; font-weight: 600; padding: 4px 2.0px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.0px; min-width: 0; }
#bf-area .area-chips button .ac-name { white-space: nowrap; font-size: .95rem; }
#bf-area .area-chips button .badge { margin: 0; }
#bf-area .area-chips button[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }
#bf-area .area-chips button[aria-pressed="true"] .badge { background: #fff; color: #111827; }
.bf-more { width: 100%; min-height: 48px; margin: 4px 0 12px; font-weight: 600; }

/* Declutter: collapsed More / panels, and inline More toggles */
details.more, details.panel { margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0 16px; }
details.more > summary, details.panel > summary { min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; list-style: none; }
details.more > summary::-webkit-details-marker, details.panel > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.panel > summary::before { content: "▸"; content: "▸" / ""; color: var(--muted); font-size: 12px; }
details.more[open] > summary::before, details.panel[open] > summary::before { content: "▾"; content: "▾" / ""; }
details.more[open], details.panel[open] { padding-bottom: 12px; }
details.more .card, details.panel .card { box-shadow: none; }
details.more.layers { margin: 8px 0; }
.more-btn { min-height: 0; padding: 0 2.0px; font-weight: 600; }
.mini-more { margin-top: 4px; }
.mini-more > summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 32px; }
.pipe-panels > details > .field:first-of-type { margin-top: 4px; }

/* Class Q opportunity score */
.score-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 13px; font-weight: 600; font-size: 14px; color: #fff; background: #8a8f98; flex: none; }
.score-badge.hi { background: #1f7a4d; }
.score-badge.mid { background: #b7791f; }
.score-badge.lo { background: #8a8f98; }
.score-badge.ex { background: #b42318; }
.score-row { margin: 8px 0; }
.score-box > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; flex-wrap: wrap; }
.score-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; table-layout: fixed; }
.score-table td { padding: 4px 4px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.score-table td:first-child { width: 34%; }
.score-table td.pts { width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.score-table td.plus { color: #1f7a4d; } .score-table td.minus { color: #b42318; }
.imgv { align-items: center; gap: 8px; margin-top: 8px; }
.top-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.top-row .rank { color: var(--muted); font-size: 13px; min-width: 22px; text-align: right; }
.top-row .top-main { flex: 1; min-width: 0; }
.top-row p { margin: 0; }
.top-row .top-title { overflow-wrap: anywhere; }

/* Beta fixes */
.rag.unknown { background: #6b7280; }
.start-card { border-left: 4px solid var(--accent); }
.start-card h2 { margin-top: 0; font-size: 18px; }
.start-card p { margin: 4px 0; }
.start-steps { margin: 8px 0 8px 16px; padding: 0; }
.start-steps li { margin: 2.0px 0; }
.score-badge small { font-size: 10px; font-weight: 600; opacity: .85; margin-left: 1.0px; }
.score-note { margin: 4px 0 8px; }
.bf-legend:not([open]) { padding: 2.0px 8px; }
.bf-legend summary { font-size: 12px; }
.bf-pulse { animation: bfpulse 1.6s ease-in-out infinite; }
@keyframes bfpulse { 0%, 100% { stroke-opacity: 1; stroke-width: 3px; } 50% { stroke-opacity: .35; stroke-width: 6px; } }
.leaflet-control-attribution { font-size: 9px; line-height: 1.3; }
.pipe-counts .linkish { min-height: 36px; padding: 0 8px; }
.near-box > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; flex-wrap: wrap; }
.near-list { list-style: none; padding: 0; margin: 8px 0; }
.near-list li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.bf-legend:not([open]) .lg { display: none; }
/* Google view sheet */
.map-links .basemap { margin: 0; }
a.ext-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
#gview-sheet { position: fixed; inset: 0; z-index: 2100; background: #f6f6f4; display: flex; flex-direction: column; padding: 8px 8px 8px; }
#gview-sheet[hidden] { display: none !important; }
.gv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gv-bar .basemap { margin: 0; }
.gv-frame { position: relative; flex: 1; min-height: 0; border-radius: 12px; overflow: hidden; background: #e8e8e4; }
.gv-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.gv-frame iframe[hidden] { display: none; }
.gv-fallback { padding: 16px; }
.gv-foot { margin: 8px 2.0px 0; font-size: 13px; }
body.gv-open { overflow: hidden; }
/* Pipeline tab */
.flow-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; margin: 8px 0 16px; }
.flow-strip span { background: #e7efeb; color: var(--accent); border-radius: 999px; padding: 4px 8px; font-weight: 600; }
.flow-strip b { color: #9a9a92; font-weight: 400; }
.stage-card h3 { display: flex; align-items: center; gap: 8px; }
.stage-card h3 .badge { margin-left: auto; }
.stage-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; flex: none; }
.stage-dl { margin: 8px 0 0; display: grid; grid-template-columns: 1fr; gap: 2.0px; }
.stage-dl dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b6b64; margin-top: 8px; }
.stage-dl dd { margin: 0; font-size: 14px; }
.stage-dl .linkish { text-align: left; min-height: 36px; }
.next-list { margin: 8px 0 0 16px; padding: 0; font-size: 14px; }
.gv-bar .basemap button { white-space: nowrap; }
/* Concept review */
.cr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 8px; font-size: 14px; }
.cr-wrap { position: relative; border: 1px solid var(--line, #ddd); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; touch-action: manipulation; }
.cr-wrap.pinning { cursor: crosshair; outline: 2px dashed #d9822b; outline-offset: -2px; }
.cr-sheet { display: block; width: 100%; height: auto; }
.cr-pin { position: absolute; transform: translate(-50%, -100%); min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px 11px 11px 2px; background: #d9822b; color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.cr-actions { margin-top: 8px; }
.cr-approve { display: grid; gap: 8px; margin: 8px 0; padding: 8px; border-radius: 10px; background: #eef5f1; }
.cr-approve[hidden] { display: none; }
.cr-approve input, .cr-form input, .cr-form textarea { width: 100%; box-sizing: border-box; }
.cr-pins { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 8px; }
.cr-pins li { display: grid; grid-template-columns: auto 1fr auto; gap: 2.0px 8px; align-items: center; }
.cr-pins li input { grid-column: 1 / -1; }
.cr-pin-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #d9822b; color: #fff; font-size: 12px; font-weight: 600; }
.cr-pin-where { font-size: 13px; color: #6b6b64; min-width: 0; overflow-wrap: anywhere; }
.cr-checks { display: grid; gap: 4px; margin-top: 8px; }
.cr-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; min-height: 32px; }
.cr-form { margin-top: 8px; padding: 8px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: #fbfbf9; display: grid; gap: 8px; }
.cr-form h4 { margin: 4px 0 0; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #c9c9c2; background: #fff; font: inherit; font-size: 14px; }
.cr-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.cr-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.cr-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: #f3f3ef; padding: 8px; border-radius: 8px; max-height: 320px; overflow: auto; }
.cr-hist { margin: 4px 0 0 16px; padding: 0; }
.ok-box { background: #e7f3ec; border-radius: 8px; padding: 8px 8px; font-size: 14px; }
.cr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-row { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; text-align: left; padding: 8px 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: #fff; font: inherit; min-height: 44px; }
.cr-row-t, .cr-row-s { min-width: 0; }
#cr-zoom { position: fixed; inset: 0; z-index: 2100; background: #f6f6f4; display: flex; flex-direction: column; padding: 8px; }
#cr-zoom[hidden] { display: none !important; }
.crz-scroll { flex: 1; min-height: 0; overflow: auto; border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.crz-inner { position: relative; width: 100%; }
.crz-inner.big { width: 260%; }
.crz-inner img { display: block; width: 100%; height: auto; }
.cr-form textarea, .cr-form input { font: inherit; } .cr-actions .icon-btn, .cr-form .icon-btn { min-height: 40px; }
.energy-line summary { font-size: 14px; } .energy-line .rag { margin: 0 2.0px; }

/* ===================== Design system (9 Oct): one button system, one radius, 8px spacing ===================== */
:root { --r: 12px; --line-strong: #d6d6d0; --track: #efefeb; --s1: 8px; --s2: 16px; --s3: 24px; }
button { cursor: pointer; }
/* Buttons: primary (filled), secondary (outline), text */
.btn, .letter-tools button, .sent-ask button, .chips button, .io button, .pipe-counts button, dialog button, .toast button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 var(--s2);
  border-radius: var(--r); border: 1px solid var(--line-strong); background: #fff; color: #1a1a1a;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; white-space: nowrap; box-sizing: border-box;
}
.btn:hover { text-decoration: none; }
.btn.btn-primary, .letter-tools .btn-primary, .sent-ask .btn-primary, .card-actions .btn-primary, a.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.btn.icon-btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.btn-icon { width: 44px; padding: 0; font-size: 18px; flex: none; }
.btn .ico { font-size: 15px; line-height: 1; color: var(--accent); }
.btn-text, .linkish { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font-weight: 600; text-align: left; }
.linkish.more-btn { display: inline; min-height: 0; padding: 0 2.0px; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Chips (filters): same radius as buttons */
button.chip, .chips button, .pipe-counts button { min-height: 44px; padding: 0 16px; border-radius: var(--r); font-weight: 500; font-size: 14px; }
button.chip[aria-pressed="true"], .chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Segmented control: equal widths, no wrapping */
.seg, .seg.basemap { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2.0px; padding: 2.0px; margin: 0; background: var(--track); border: 0; border-radius: var(--r); }
.seg.basemap { margin: 0 0 var(--s1); }
.seg .seg-btn { min-height: 44px; min-width: 0; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: #55554f; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg .seg-btn[aria-pressed="true"] { background: #fff; color: #1a1a1a; box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.04); }
/* Form controls */
select.select, .stage-label select, .field input, .field select, .field textarea, .cr-form input, .cr-form textarea, .cr-approve input { border-radius: var(--r); border: 1px solid var(--line-strong); min-height: 44px; background: #fff; }
/* One chevron for every disclosure */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.chev, details.fact > summary::after, details.sect > summary::after, .mini-more > summary::after, details.more > summary::after, details.panel > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid #9a9a92; border-bottom: 2px solid #9a9a92; transform: rotate(45deg); margin: 0 4px 4px; transition: transform .15s;
}
details[open].fact > summary::after, details[open].sect > summary::after, .mini-more[open] > summary::after, details.more[open] > summary::after, details.panel[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
details.more > summary::before, details.panel > summary::before { content: none; }
details.more > summary::after, details.panel > summary::after { margin-left: auto; }
.mini-more > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }

/* ===================== Barn detail ===================== */
.bf-current { padding: var(--s2); margin: 0 0 var(--s1); }
.bf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bf-head-t { min-width: 0; }
.bf-cur-name { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.bf-cur-meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.bf-head .score-badge { flex: none; font-size: 18px; padding: 8px 8px; }
.view-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: var(--s1); margin: 0 0 var(--s1); }
.view-row[hidden] { display: none; }
#bf-map { margin-bottom: var(--s1); }
.bf-actions { gap: var(--s1); margin: 0 0 var(--s1); }
.bf-act { border-radius: var(--r); border-width: 1px; border-color: var(--line-strong); min-height: 48px; font-size: 16px; }
#bf-detail { padding: var(--s2); }
.facts-h { margin: 0 0 var(--s1); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts { border-top: 1px solid var(--line); }
.fact { border-bottom: 1px solid var(--line); margin: 0; }
div.fact, details.fact > summary { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s1); align-items: center; min-height: 52px; padding: 4px 0; }
details.fact > summary { grid-template-columns: 96px minmax(0, 1fr) 16px; cursor: pointer; font-weight: 400; flex-wrap: nowrap; }
.fact-k { font-size: 14px; color: var(--muted); }
.fact-v { font-size: 15px; min-width: 0; line-height: 1.35; }
.fact-v .sum-note { display: block; font-size: 13px; }
.fact-more { padding: 0 0 var(--s2); }
.fact-more p { margin: 0 0 var(--s1); }
.fact .stage-label { margin: 0; display: block; }
.fact .stage-label-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fact .stage-label select { width: 100%; }
.fact .seg { margin: 0; }
.fact .score-table { margin-top: 0; }
#bf-detail .next-action { margin: var(--s2) 0 0; padding: 12px var(--s2); border-radius: var(--r); }
.sects { margin-top: var(--s2); border-top: 1px solid var(--line); }
.sects .owner-block { margin: 0; padding: 0; border: 0; background: none; }
.sects details.sect, .sects .pipe-panels > details.sect { margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.sects details.sect > summary { display: flex; align-items: center; gap: var(--s1); min-height: 56px; padding: 0; cursor: pointer; font-weight: 600; font-size: 16px; flex-wrap: nowrap; }
.sects details.sect[open] { padding-bottom: var(--s2); }
.sect-t { flex: none; }
.sect-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 400; font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sect-meta .sum-note { white-space: nowrap; }
.sects .pipe-panels { margin: 0; }
.sects .card-actions { margin-top: var(--s1); }
#bf-detail > .card-actions { margin-top: var(--s2); }
#view-barnfinder.has-barn .seg.basemap[aria-label="Basemap"] { display: none; }
#view-pipeline .card { margin-bottom: 8px; }

/* AI appraiser */
.ai-bar { margin: var(--s1) 0 var(--s2); padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #f6f8f7; }
.ai-bar-t { margin: 0 0 var(--s1); font-size: 14px; color: #333; }
.ai-bar-acts { display: flex; flex-wrap: wrap; gap: var(--s1); }
.ai-bar .ai-how { margin-top: var(--s1); }
.ai-how ul { margin: 4px 0 8px; padding-left: 16px; font-size: 13px; }
.ai-how li { margin: 8px 0; }
.ai-srcs { color: var(--muted); }
.ai-srcs a { color: var(--accent); }
.field.has-ghost input::placeholder { color: #8a8f8c; font-style: italic; }
.field.has-ghost input { border-style: dashed; border-color: #9cbfb1; }
.ai-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; font-size: 13px; color: #333; }
.ai-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 0; }
.ai-tag { display: inline-flex; align-items: center; padding: 2.0px 8px; border-radius: 999px; background: #e6f0ec; color: #0f5e49; font-size: 12px; font-weight: 600; }
.ai-v { font-weight: 600; }
.ai-r { color: var(--muted); }
.conf { font-size: 11px; font-weight: 600; padding: 1.0px 8px; border-radius: 6px; border: 1px solid currentColor; }
.conf-high { color: #0f6e56; }
.conf-med { color: #8a5a00; }
.conf-low { color: #9a3412; }
.ai-row .btn.ai-use { min-height: 44px; min-width: 44px; padding: 0 8px; }
.ai-r { font-size: 12px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: var(--s2) 0 0; font-size: 14px; min-height: 44px; }
.check-row input { width: 22px; height: 22px; margin-top: 2.0px; accent-color: var(--accent); flex: none; }
.check-row .hint { display: block; margin-top: 2.0px; }
#appr-print { display: none; }
.ps { max-width: 760px; margin: 0 auto; padding: 24px; background: #fff; color: #1c1c1c; font-size: 13px; }
.ps h2 { margin: 4px 0; font-size: 20px; }
.ps h3 { margin: 16px 0 8px; font-size: 15px; }
.ps-k { margin: 0; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ps-res { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 12px 0; }
.ps-res dt { color: #555; } .ps-res dd { margin: 0; font-weight: 600; }
.ps-t { width: 100%; border-collapse: collapse; }
.ps-t th, .ps-t td { text-align: left; padding: 4px 8px; border-bottom: 1px solid #ddd; vertical-align: top; }
.ps-how { padding-left: 16px; } .ps-how li { margin: 4px 0; }
.ps-how a { color: #1c1c1c; }
.ps-note { color: #555; }
@media print {
  body.printing-appr header, body.printing-appr main, body.printing-appr .no-print, body.printing-appr #letter-sheet, body.printing-appr .toast { display: none !important; }
  body.printing-appr #appr-print { display: block !important; }
  body.printing-appr .ps { padding: 0; max-width: none; }
}

/* ---------- Back to map bar ---------- */
.bf-backbar { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 4px 0; background: rgba(246, 246, 244, 0.96); border-bottom: 1px solid var(--line, #e5e7eb); backdrop-filter: blur(6px); }
.bf-backbar[hidden] { display: none !important; }
.bf-backbar .back-btn { min-height: 44px; padding: 0 8px 0 0; font-weight: 600; white-space: nowrap; }
.bf-backbar-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #6b7280); font-size: 0.9rem; text-align: right; }

/* ---------- Concept drawings ---------- */
.fact .cd-open { margin-top: 8px; width: 100%; min-height: 44px; }
#cd-sheet { position: fixed; inset: 0; z-index: 2100; background: #f6f6f4; display: flex; flex-direction: column; padding: 8px; overflow-y: auto; }
#cd-sheet[hidden] { display: none !important; }
#cd-sheet .gv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -8px; background: #f6f6f4; padding: 4px 0 8px; z-index: 1; }
.cd-title { font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-body { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.cd-body p { margin: 0; }
.cd-img { display: block; width: 100%; padding: 0; border: 1px solid var(--line, #e5e7eb); border-radius: var(--r, 12px); background: #fff; overflow: hidden; cursor: zoom-in; }
.cd-img img { display: block; width: 100%; height: auto; }
.cd-pre { white-space: pre-wrap; font-size: 0.85rem; background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 8px; margin: 8px 0 0; }
.field-l { font-weight: 600; font-size: 0.9rem; margin-top: 8px !important; }
.seg.seg-3 .seg-btn { flex: 1; }
#cd-sheet .field textarea { width: 100%; box-sizing: border-box; }

/* ---------- QS estimate ---------- */
.qs-ballpark { margin: 0 0 8px; padding: 8px 12px; border: 2px solid #b45309; border-radius: var(--r, 12px); background: #fffbeb; color: #92400e; font-weight: 600; text-align: center; }
.qs-ballpark-sm { margin-top: 12px; font-size: 0.85rem; border-width: 1px; }
.qs-opt { margin-bottom: 8px; }
.qs-total { padding: 12px; border: 1px solid var(--line, #e5e7eb); border-radius: var(--r, 12px); background: #fff; margin-bottom: 8px; }
.qs-total p { margin: 0; }
.qs-total-k { font-size: 0.85rem; color: var(--muted, #6b7280); }
.qs-total-v { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.qs-total-r { font-size: 0.9rem; }
.qs-recon { padding: 12px; border-radius: var(--r, 12px); background: #f3f4f6; margin-bottom: 8px; }
.qs-recon p { margin: 0 0 8px; }
.qs-sec { margin-top: 8px; }
.qs-t { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.qs-t th, .qs-t td { padding: 8px 4px; border-bottom: 1px solid var(--line, #e5e7eb); text-align: right; vertical-align: top; white-space: nowrap; }
.qs-t th:first-child, .qs-t td:first-child { text-align: left; white-space: normal; width: 52%; }
.qs-t.qs-st td:first-child { width: 60%; }
.qs-item { display: block; }
.qs-q { display: block; color: var(--muted, #6b7280); font-size: 0.78rem; }
.qs-grp th { background: #f3f4f6; text-align: left !important; font-weight: 600; }
.qs-sub td { color: var(--muted, #6b7280); }
.qs-tot td { font-weight: 600; border-top: 2px solid var(--line-strong, #9ca3af); }
.qs-bar { display: block; height: 6px; background: #eef0f2; border-radius: 3px; margin: 4px 0 2.0px; }
.qs-bar i { display: block; height: 100%; background: #374151; border-radius: 3px; }
.qs-ladder { display: flex; flex-direction: column; gap: 12px; margin: 8px 0; }
.ql-t { margin: 0 0 4px; }
.ql-up { font-size: 0.85rem; font-weight: 600; }
.ql-up.pos { color: #15803d; } .ql-up.neg { color: #b91c1c; }
.ql-bar { position: relative; height: 22px; background: #f3f4f6; border-radius: 6px; margin-bottom: 4px; overflow: hidden; }
.ql-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.ql-bar.val i { background: #bbf7d0; } .ql-bar.spent i { background: #fecaca; }
.ql-bar span { position: relative; padding-left: 8px; font-size: 0.82rem; line-height: 22px; }
.qs-ladder .hint { margin: 0; }
.qs-risks { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.qs-risks li { padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.qs-risks p { margin: 0 0 2.0px; }
.qs-reward { margin: 8px 0; }
#qs-print { display: none; }
@media print {
  body.printing-qs > *:not(#qs-print) { display: none !important; }
  body.printing-qs #qs-print { display: block !important; }
  body.printing-qs .toast { display: none !important; }
  #qs-print .card-actions, #qs-print .qs-opt { display: none !important; }
  #qs-print details > summary { font-weight: 600; list-style: none; }
  #qs-print .qs-t { font-size: 9pt; }
  #qs-print .table-wrap { overflow: visible !important; }
}
.qs-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
@media print { #qs-print .qs-wrap { overflow: visible !important; } }
.facts div.fact-v { display: block; }
.cd-packs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-packs li { padding: 8px 12px; background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.cd-packs .reason { display: block; }
.cd-file { display: block; word-break: break-all; }
/* Plot seeker */
.bf-kind { margin: 0 0 8px; max-width: 320px; }
.bf-kind .seg-btn { font-weight: 600; }
#bf-legend-host { display: contents; }
.bf-pfilters { margin: 0 0 8px; }
.bf-pfilters .plot-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.bf-pfilters .plot-labels { max-width: 520px; }
.plot-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 13px; font-weight: 600; font-size: 13px; color: #fff; background: #6b7280; flex: none; white-space: nowrap; }
.plot-chip small { font-weight: 600; opacity: .85; font-size: 11px; }
.plot-chip.pass { background: #15803d; }
.plot-chip.weak { background: #b45309; }
.plot-chip.drop { background: #6b7280; }
.plot-row .top-title strong { overflow-wrap: anywhere; }
.prec-fact .auto-list li { overflow-wrap: anywhere; }
.auto-list li.red span[aria-hidden] { color: #b91c1c; }
.auto-list li span.reason, .auto-list li span.hint { color: #4b5563; }

/* Barn finder sub-views and the focused property page (9 Oct 2026) */
.seg.bf-sub { margin: 0 0 var(--s1, 8px); }
#view-barnfinder.bf-sub-map:not(.has-barn) .bf-listonly,
#view-barnfinder.bf-sub-map:not(.has-barn) details.bf-how { display: none !important; }
#view-barnfinder.bf-sub-list:not(.has-barn) .bf-maponly,
#view-barnfinder.bf-sub-list:not(.has-barn) #bf-open { display: none !important; }
#view-barnfinder.bf-sub-list:not(.has-barn) #bf-list-title { display: none; }
/* Focused page: only the open property */
#view-barnfinder.has-barn > *:not(#bf-open) { display: none !important; }
#view-barnfinder.has-barn #bf-open .bf-map-wrap { display: block !important; }
body.bf-focus header.top { display: none; }
body.bf-focus .bf-backbar { margin: 0 0 8px; padding: 8px 0; }
body.bf-focus .bf-backbar-t { color: var(--ink, #111827); font-weight: 600; font-size: 1rem; text-align: left; }
body.bf-focus .bf-cur-name { display: none; }
body.bf-focus main.wrap { padding-top: 4px; }
.prec-fact .auto-list li span:not([aria-hidden]) { position: static; display: block; margin-top: 2.0px; }
.bf-pfilters .plot-labels .seg-btn { padding-left: 8px; padding-right: 8px; white-space: nowrap; min-width: 0; }
.bf-pfilters .plot-labels .seg-btn:first-child { flex: 1.5 1 0; }

/* Concept PDF call to action under Save / Archive / No (9 Oct 2026) */
.bf-cta { margin: 8px 0 12px; }
.bf-cta[hidden] { display: none !important; }
.cd-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 2.0px; width: 100%; min-height: 64px; padding: 12px 16px; border: 0; border-radius: var(--r, 12px); background: var(--accent, #0f6e56); color: #fff; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cd-cta:hover, .cd-cta:focus-visible { filter: brightness(1.08); }
.cd-cta-t { font-weight: 600; font-size: 17px; line-height: 1.3; margin: 0; }
.cd-cta-s { font-size: 13px; line-height: 1.35; opacity: .92; margin: 0; }
.cd-cta-card { border-radius: var(--r, 12px); }
.cd-cta-card.req { padding: 12px 16px; border: 1px solid #f0c27a; background: #fff8eb; }
.cd-cta-card.req .cd-cta-t { color: #7c4a03; }
.cd-cta-card.req .cd-cta-s { color: #5b4520; opacity: 1; }
.cd-cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cd-cta-row .btn { flex: 1 1 140px; }
.cd-step { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--accent, #0f6e56); text-transform: uppercase; letter-spacing: .04em; }
.cd-h { margin: 4px 0 8px; font-size: 18px; }
.cd-honest { margin-top: 8px; }
.cd-next { width: 100%; min-height: 48px; }

/* Barn finder header tidy (9 Oct 2026): primary Barns|Plots, one row Map|Top list + Filters, one-line summary, filter sheet, basemap overlay */
.seg.bf-kind-primary { background: #e6efec; padding: 4px; }
.seg.bf-kind-primary .seg-btn { min-height: 46px; font-weight: 600; font-size: 16px; color: var(--accent, #0f6e56); }
.seg.bf-kind-primary .seg-btn[aria-pressed="true"] { background: var(--accent, #0f6e56); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.bf-row { display: flex; gap: 8px; align-items: stretch; margin: 8px 0 4px; }
.bf-row .seg.bf-sub { flex: 1 1 auto; margin: 0; min-width: 0; }
.bf-row .seg.bf-sub .seg-btn { min-height: 40px; font-size: 14px; }
.bf-filt-btn { flex: none; min-height: 40px; padding: 0 16px; white-space: nowrap; }
.bf-filt-n { font-weight: 600; color: var(--accent, #0f6e56); }
.bf-sum { margin: 2.0px 0 8px; font-size: 13px; color: var(--muted, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-fsheet { position: fixed; inset: 0; z-index: 1600; }
.bf-fsheet[hidden] { display: none !important; }
.bf-fsheet-bg { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); }
.bf-fsheet-in { position: absolute; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0; padding: 12px 16px 24px; box-shadow: 0 -4px 18px rgba(0,0,0,.2); overscroll-behavior: contain; }
.bf-fsheet-h { position: sticky; top: -12px; display: flex; justify-content: space-between; align-items: center; padding: 8px 0; background: #fff; z-index: 1; font-size: 17px; }
.bf-fsheet .field-l { margin: 12px 0 8px; }
.bf-fsheet .bf-lead-full { font-size: 13px; color: var(--muted, #6b7280); margin-top: 12px; }
.bf-fsheet .bf-pfilters { margin-top: 12px; }
body.fs-open { overflow: hidden; }
.seg.bf-basemap-ov { position: absolute; top: 6px; right: 56px; z-index: 500; margin: 0; padding: 2.0px; background: rgba(255,255,255,.93); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.15); width: auto; display: inline-flex; }
.seg.bf-basemap-ov .seg-btn { min-height: 28px; padding: 0 8px; font-size: 12px; flex: none; }
#view-barnfinder.has-barn .seg.bf-basemap-ov { display: none; }
/* concept request form */
.cd-prog { display: flex; gap: 8px; list-style: none; padding: 0; margin: 8px 0; }
.cd-prog li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted, #6b7280); text-align: center; border-top: 3px solid #d1d5db; padding-top: 8px; }
.cd-prog li span { font-weight: 600; }
.cd-prog li.done { border-color: #86c5b2; color: #0f6e56; }
.cd-prog li.cur { border-color: var(--accent, #0f6e56); color: #111827; font-weight: 600; }
.cd-status { margin: 4px 0 8px; }
.seg.seg-4 .seg-btn { flex: 1 1 0; padding: 0 4px; font-size: 14px; }
.cd-nav { display: flex; gap: 8px; margin-top: 16px; }
.cd-nav .btn { flex: 1; min-height: 48px; }
.cd-nav .btn-secondary { flex: 0 0 96px; }
.cd-known { margin: 0 0 8px; padding: 8px 12px; background: #f6f8f7; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; font-size: 14px; }
.cd-known div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 4px 0; }
.cd-known dt { color: var(--muted, #6b7280); }
.cd-known dd { margin: 0; overflow-wrap: anywhere; }
.cd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cd-photo { display: block; max-width: 100%; max-height: 180px; border-radius: 8px; margin: 8px 0; }
.cd-send { margin-top: 8px; }
.cd-track { list-style: none; margin: 8px 0 4px; padding: 0; }
.cd-track li { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; color: #6b7280; }
.cd-track .cd-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #c7cdd4; background: #fff; }
.cd-track li.done { color: #111827; }
.cd-track li.done .cd-dot { background: var(--accent, #0f6e56); border-color: var(--accent, #0f6e56); }
.cd-track li.cur .cd-tl { font-weight: 600; }
.cd-track .cd-tt { font-size: 12px; color: #6b7280; }
.cd-confirm { margin-bottom: 8px; }
.bf-pfilters .plot-labels .seg-btn { font-size: 13px; padding-left: 4px; padding-right: 4px; }
.bf-pfilters .plot-labels .seg-btn:first-child { flex: 1.9 1 0; }

/* ---------- Solar mode ---------- */
.bf-kind-primary .seg-btn { min-width: 0; }
.sol-lay { margin: 4px 0; }
.sol-svg { width: 100%; height: auto; max-height: 340px; background: #f8fafc; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; display: block; }
.sol-svg .sol-roof { fill: #e5e7eb; stroke: #6b7280; stroke-width: var(--sw); }
.sol-svg .sol-use { fill: #fef3c7; stroke: #d97706; stroke-width: var(--sw); stroke-dasharray: calc(var(--sw) * 4) calc(var(--sw) * 2); }
.sol-svg .sol-mods rect { fill: #1e3a8a; stroke: #93c5fd; stroke-width: calc(var(--sw) * 0.5); }
.sol-svg .sol-ridge { stroke: #b91c1c; stroke-width: var(--sw); stroke-dasharray: calc(var(--sw) * 6) calc(var(--sw) * 3); }
.sol-svg .sol-north line, .sol-svg .sol-scale line { stroke: #111827; stroke-width: calc(var(--sw) * 1.5); }
.sol-svg .sol-north path, .sol-svg text { fill: #111827; }
.sol-cap { margin: 8px 0 2.0px; font-size: .9rem; }
.sol-deals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
@media (max-width: 560px) { .sol-deals { grid-template-columns: 1fr; } }
.sol-deal { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px; background: #fff; }
.sol-deal h4 { margin: 0 0 8px; font-size: .95rem; }
.sol-deal p { margin: 2.0px 0; }
.sol-deal .sol-big { font-size: 1.15rem; font-weight: 600; }
.sol-deal .sol-pay { font-weight: 600; margin-top: 8px; }
.sol-deal.dim { opacity: .7; background: #f9fafb; }

/* ---------- Documents (Pipeline tab) ---------- */
.doc-modes { margin: 4px 0 8px; display: flex; }
.doc-modes .seg-btn small { opacity: .7; }
.doc-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.doc-tools select { flex: 0 0 auto; max-width: 45%; }
.doc-tools input { flex: 1 1 auto; min-width: 0; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row { border-top: 1px solid var(--line, #e5e7eb); padding: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.doc-row.latest { background: #f0fdf4; border-left: 3px solid #15803d; padding-left: 8px; }
.doc-row.old { opacity: .75; }
.doc-name { text-align: left; font-weight: 600; padding: 0; }
.doc-meta { font-size: .85rem; color: var(--muted, #4b5563); }
.doc-mode { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1.0px 8px; border-radius: 999px; background: #e5e7eb; color: #111827; }
.doc-mode.barns { background: #fde68a; } .doc-mode.plots { background: #bbf7d0; } .doc-mode.solar { background: #bfdbfe; }
.doc-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-part { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.doc-pl { font-size: .8rem; color: var(--muted, #4b5563); }
.doc-b { min-height: 36px; padding: 4px 8px; font-size: .85rem; }
.doc-req { font-size: .8rem; color: var(--muted, #4b5563); font-style: italic; }
div.fact.sol-fact { grid-template-columns: 1fr; padding: 8px 0; }
div.fact.sol-fact .fact-k { font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
table.comps { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.comps th, table.comps td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line, #e3e3e3); vertical-align: top; }
table.comps td:nth-child(n+2), table.comps th:nth-child(n+2) { text-align: right; white-space: nowrap; }
details.comps-t { margin: 8px 0; }
/* Asbestos mode + labelling */
.bf-asb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; margin: 4px 0 8px; }
.bf-asb-bar[hidden] { display: none !important; }
.bf-kind .seg-btn { min-width: 0; padding-left: 8px; padding-right: 8px; }
.asb-chip { position: relative; width: 100%; max-width: 420px; background: #222; border-radius: 10px; overflow: hidden; }
.asb-chip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; image-rendering: auto; }
.asb-chip .asb-ov { position: absolute; inset: 0; width: 100%; height: 100%; }
.asb-chip .asb-ov polygon { fill: none; stroke: #facc15; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; }
.asb-chip.big { max-width: 560px; margin: 8px auto; max-height: 52vh; }
.asb-chip.print { max-width: 300px; }
#asb-sheet { position: fixed; inset: 0; z-index: 2050; background: #f6f6f4; overflow-y: auto; padding: 8px 12px 40px; }
#asb-sheet[hidden] { display: none !important; }
#asb-sheet .asb-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -8px; background: #f6f6f4; padding: 4px 0 8px; z-index: 1; }
.asb-prog { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.asb-prog i { display: block; height: 100%; background: #15803d; }
.asb-meta { margin: 8px 0; font-size: .92rem; overflow-wrap: anywhere; }
.asb-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.asb-b { border: 1px solid var(--line, #d1d5db); background: #fff; min-height: 46px; font-size: .95rem; }
.asb-b b { display: inline-block; min-width: 1.4em; padding: 0 4px; margin-right: 4px; border-radius: 4px; background: #eef2f7; }
.asb-b[aria-pressed="true"] { background: #1f2937; color: #fff; border-color: #1f2937; }
.asb-b[aria-pressed="true"] b { background: #374151; }
.asb-b.a[aria-pressed="true"] { background: #b45309; border-color: #b45309; }
.asb-b.m[aria-pressed="true"] { background: #1d4ed8; border-color: #1d4ed8; }
.asb-b.d[aria-pressed="true"] { background: #b91c1c; border-color: #b91c1c; }
.asb-nav { display: flex; gap: 8px; justify-content: space-between; }
.asb-nav .btn { flex: 1; }
.asb-txt { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; font-size: .8rem; }
.doc-mode.asbestos { background: #fecaca; color: #7f1d1d; }
.seg.bf-kind-primary { max-width: 420px; }
.seg.bf-kind-primary .seg-btn { font-size: 15px; padding-left: 4px; padding-right: 4px; flex: 1 1 auto; }
.asb-btns { grid-template-columns: repeat(3, 1fr); }
.asb-btns .asb-b:last-child { grid-column: span 2; }
.doc-line { display: block; font-size: .8rem; color: #6b7280; margin-top: 2.0px; overflow-wrap: anywhere; }

.rep-q { width: 100%; box-sizing: border-box; margin: 8px 0 4px; min-height: 44px; font-size: 16px; padding: 8px 8px; border: 1px solid #d1d5db; border-radius: 8px; }
.rep-h { margin: 16px 0 8px; font-size: 1rem; } .rep-h small { color: #6b7280; font-weight: 400; }
.rep-gen { border-left: 3px solid #D9822B; padding-left: 8px; }
.rep-ok { text-align: left; } .rep-tick { font-size: 2rem; color: #3E7C4F; margin: 0; }
.rep-step { background: #FFF6EA; border-left: 3px solid #D9822B; padding: 8px 12px; border-radius: 6px; margin: 8px 0; overflow-wrap: anywhere; }
.rep-modes { flex-wrap: wrap; }

.th-row { display: flex; gap: 8px; align-items: center; }
.th-row .top-main { flex: 1 1 auto; min-width: 0; }
.th-row .top-title { overflow-wrap: anywhere; margin: 0 0 2.0px; }
.th-row .rank { position: static; margin-right: 8px; }
.top-th { flex: none; width: 72px; height: 54px; border-radius: 6px; object-fit: cover; background: #dfe3e6; }
.top-th-ph { display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #9aa3aa; }
.th-row .icon-btn { flex: none; }

/* toasts: small, quick, top so they never cover buttons */
.toast { top: calc(var(--hdr, 56px) + 6px); bottom: auto; font-size: .82rem; padding: 8px 8px; border-radius: 8px; max-width: min(92vw, 360px); opacity: .95; }
.toast button { min-height: 32px; padding: 0 8px; }
/* asbestos slim page */
.asb-stat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.kpi3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 8px; }
.kpi3 div { background: #f6f3ee; border-radius: 8px; padding: 8px; min-width: 0; }
.kpi3 b { display: block; font-size: 1rem; color: #B8691F; overflow-wrap: anywhere; } .kpi3 span { display: block; font-size: .75rem; color: #6b7280; overflow-wrap: anywhere; }
.asb-pl, .rep-scope { display: flex; flex-wrap: wrap; gap: 8px; } .asb-pl .seg-btn, .rep-scope .seg-btn { flex: 1 1 auto; min-height: 40px; }
.rep-scope { margin: 0 0 8px; } .rep-ed { margin-top: 8px; width: 100%; }
/* edit area */
.ed-pt { background: #fff; border: 3px solid #D9822B; border-radius: 50%; box-sizing: border-box; }
.ed-pt.sel { background: #B03A2E; border-color: #fff; }
.ed-pt.mid { background: rgba(255,255,255,.85); border: 2px dashed #D9822B; color: #B8691F; font-weight: 600; text-align: center; line-height: 20px; font-size: 16px; }
.ed-bar { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 1900; background: #fff; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.25); padding: 8px 12px; max-width: 560px; margin: 0 auto; box-sizing: border-box; }
.ed-t { margin: 0; overflow-wrap: anywhere; } .ed-h { margin: 2.0px 0 8px; font-size: .8rem; color: #6b7280; }
.ed-acts { display: flex; flex-wrap: wrap; gap: 8px; } .ed-acts .btn { flex: 1 1 auto; min-height: 40px; }
/* standard header */
.hdr-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hdr-b { flex: none; width: 40px; height: 40px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: inherit; font-size: 1.3rem; cursor: pointer; }
.hdr-tt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hdr-brand { font-size: .7rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav-sheet { position: fixed; inset: 0; z-index: 2100; background: rgba(0,0,0,.35); }
#nav-sheet .nav-in { position: absolute; top: 0; right: 0; width: min(84vw, 320px); height: 100%; background: #fff; padding: 12px; box-sizing: border-box; overflow-y: auto; }
.nav-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#nav-sheet ul { list-style: none; margin: 0; padding: 0; } .nav-it { width: 100%; text-align: left; min-height: 48px; border: 0; border-bottom: 1px solid #eee; background: none; font-size: 1rem; cursor: pointer; }
@media (max-width: 720px) { header .brand { display: none; } nav.tabs { display: none; } }
@media (min-width: 721px) { .hdr-bar [data-act=navmenu] { display: none; } }
body.bf-focus header.top { display: block !important; }
body.bf-focus .bf-backbar { display: none !important; }
.hdr-bar { padding: 8px 0; }
.hdr-b { background: #ecebe7; color: #1f2937; }
.toast[hidden] { display: none !important; }
.pnl-note { border-left: 3px solid #9aa3aa; background: #f6f6f4; padding: 8px 8px; border-radius: 6px; margin: 0 0 8px; overflow-wrap: anywhere; } .pnl-note.flag { border-color: #B03A2E; background: #fdf1ef; } .pnl-note p { margin: 0 0 4px; }
.pnl-b { background: #fdf1ef; color: #B03A2E; }

.lab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0; }
.lab-grid .seg-btn { min-height: 40px; padding: 4px 8px; font-size: .85rem; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.lab-c[aria-pressed="true"] { background: #1f2937; color: #fff; } .lab-c.a[aria-pressed="true"] { background: #B03A2E; } .lab-c.n[aria-pressed="true"] { background: #3E7C4F; }
.lab-more summary { font-size: .85rem; color: #6b7280; cursor: pointer; padding: 4px 0; min-height: 32px; }
.lab-na { background: #e7f3ea; color: #2f6b40; }

.also-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 0; font-size: .78rem; min-width: 0; }
.also-l { color: #6b7280; margin-right: 2.0px; }
.also-b { border: 1px solid #d1d5db; background: #f9fafb; color: #374151; border-radius: 999px; padding: 2.0px 8px; min-height: 28px; font-size: .78rem; cursor: pointer; max-width: 100%; }
.also-b.ok { border-color: #3E7C4F; color: #2f6b40; background: #eef7f0; }
.also-multi { background: #6d28d9; color: #fff; border-radius: 999px; padding: 2.0px 8px; font-size: .74rem; }
.also-no { color: #9ca3af; font-size: .74rem; }

/* Always-visible area switch (barn finder) */
#bf-areabar { margin: 8px 0 4px; }
.area-bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; }
.area-bar::-webkit-scrollbar { display: none; }
.area-bar .ab-l { font-size: .8rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; flex: none; }
.area-bar .ab-chip { flex: none; min-height: 36px; padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 999px; background: #fff; font-weight: 600; font-size: .9rem; color: #111827; cursor: pointer; white-space: nowrap; }
.area-bar .ab-chip small { font-weight: 500; color: #6b7280; margin-left: 2.0px; }
.area-bar .ab-chip[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }
.area-bar .ab-chip[aria-pressed="true"] small { color: #d1d5db; }
.area-bar.area-fixed { flex-wrap: wrap; overflow: visible; }
.area-bar .ab-fixed { font-weight: 600; font-size: .9rem; padding: 4px 8px; border-radius: 999px; background: #111827; color: #fff; }
.area-bar .ab-note { font-size: .8rem; color: #6b7280; min-width: 0; }
@media (max-width: 560px) { .area-bar:not(.area-fixed) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: visible; } .area-bar:not(.area-fixed) .ab-l { display: none; } .area-bar .ab-chip { padding: 4px 2.0px; font-size: .88rem; min-width: 0; min-height: 44px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; } .area-bar .ab-chip small { font-size: .72rem; margin: 0; } }
#nav-sheet .nav-h { font-weight: 600; margin: 16px 0 8px; font-size: .9rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
#nav-sheet .nav-areas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
#nav-sheet .nav-area { min-height: 44px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-weight: 600; padding: 4px 2.0px; min-width: 0; }
#nav-sheet .nav-area[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }
#nav-sheet .nav-fixed { font-size: .9rem; margin: 0; }
/* Saved star, Saved chip, Start here block */
.fav-star { color: #d4a017; font-size: .95em; }
.saved-row { margin: 8px 0 2.0px; }
.saved-chip[aria-pressed="true"] { border-color: #d4a017; }
.start-here { margin-top: 8px; }
.sh-h { font-weight: 600; margin: 0 0 8px; }
.sh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sh-btn { justify-content: space-between; text-align: left; min-height: 44px; white-space: normal; }
@media (min-width: 900px) { .sh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* What we make */
.smp-lead { margin: 0 0 16px; }
.smp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.smp-card { padding: 0; overflow: hidden; display: flex; }
.smp-hit { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; width: 100%; }
.smp-hit:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.smp-cover { display: flex; align-items: center; justify-content: center; background: #eef0f2; aspect-ratio: 4 / 3; padding: 16px; border-bottom: 1px solid #e3e5e8; }
.smp-cover img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 2px 10px rgba(0,0,0,.18); background: #fff; }
.smp-cover.smp-ph::after { content: "📄"; font-size: 2.5rem; }
.smp-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 16px; flex: 1; }
.smp-t { font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.smp-d { font-size: .95rem; line-height: 1.4; color: #444; }
.smp-meta { font-size: .85rem; color: #666; }
.smp-btn { margin-top: auto; align-self: flex-start; }
.smp-hit-v { cursor: default; }
.smp-cover-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: center; background: #eef0f2; aspect-ratio: 4 / 3; padding: 16px; border-bottom: 1px solid #e3e5e8; }
.smp-cover-btn:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.smp-vars { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.smp-vbtn { min-height: 44px; }
.smp-ov { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.6); display: flex; flex-direction: column; padding: 24px; gap: 0; }
.smp-ov-bar { display: flex; align-items: center; gap: 8px; background: #fff; padding: 8px 12px; border-radius: 8px 8px 0 0; }
.smp-ov-sp { flex: 1; } .smp-ov iframe { flex: 1; border: 0; background: #fff; border-radius: 0 0 8px 8px; width: 100%; }
@media (max-width: 480px) { .smp-grid { grid-template-columns: 1fr; } .smp-cover { aspect-ratio: 16 / 11; } }

/* Add a building, location search, Add from listing */
.loc-bar { position: relative; margin: 0 0 8px; }
.loc-in { display: flex; gap: 8px; }
.loc-in input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line, #d0d5dd); border-radius: 10px; font: inherit; font-size: 16px; }
.loc-add { white-space: nowrap; }
.loc-res { position: absolute; z-index: 1200; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line, #d0d5dd); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 50vh; overflow: auto; }
.loc-it { display: block; width: 100%; text-align: left; padding: 8px 8px; border: 0; background: none; font: inherit; border-radius: 8px; cursor: pointer; }
.loc-it:hover, .loc-it:focus { background: #f2f4f7; }
.loc-it small { color: #667085; }
body.ui-adding #bf-map { outline: 3px solid #d97706; outline-offset: -3px; cursor: crosshair; }
.ui-sheet { position: fixed; z-index: 3000; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow: auto; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.ui-in { max-width: 620px; margin: 0 auto; }
.ui-inp { width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--line, #d0d5dd); border-radius: 10px; font: inherit; font-size: 16px; }
.ui-modes { margin: 4px 0 8px; display: flex; flex-wrap: wrap; }
.ui-hr { border: 0; border-top: 1px solid #eaecf0; margin: 16px 0 8px; }
.lst-row { display: flex; gap: 8px; }
.lst-row .lst-inp { flex: 1; min-width: 0; }
.lst-st { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.lst-st li { margin: 4px 0; overflow-wrap: anywhere; }
.nav-in .lst-box { margin-top: 16px; }
.added-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1.0px 8px; border-radius: 999px; background: #fff4e5; color: #9a4b00; border: 1px solid #f5c58a; vertical-align: middle; }
.ui-block { border: 1px solid #f5c58a; background: #fffaf2; border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; }
.ui-meta { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.badge.warn { background: #fef3f2; color: #b42318; border-color: #fda29b; }
.ui-approx { background: #fff; border: 1px dashed #d97706; border-radius: 10px; padding: 8px 8px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ui-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.ui-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; background: #eee; }
.rtm { border: 1px solid #eaecf0; border-radius: 10px; padding: 8px 8px; margin: 8px 0 0; background: #fff; }
.rtm legend { font-weight: 600; padding: 0 4px; }
.rtm-it { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f2f4f7; }
.rtm-it span { flex: 1; min-width: 160px; }
.rtm-it small { display: block; color: #667085; }
.rtm-it.off { opacity: .55; }
.rtm-it input { width: 20px; height: 20px; }
.rtm-scope { padding: 8px; border-radius: 8px; font: inherit; }
.ui-nofp { background: #fff7ed; border: 1px solid #fdba74; border-radius: 10px; padding: 8px 8px; margin: 8px 0 8px; }
.ui-nofp p { margin: 0 0 8px; }
.ui-drawbar { position: fixed; z-index: 3000; left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 8px; max-width: 620px; margin: 0 auto; }
.ui-db-t { flex: 1 1 100%; font-weight: 600; font-size: 14px; }
.os-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1.0px 8px; border-radius: 999px; background: #eef4ff; color: #3538cd; border: 1px solid #c7d7fe; vertical-align: middle; }
.rp-block { margin: 8px 0 4px; }
.rp-h { font-size: 15px; margin: 0 0 8px; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.rp-b { position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 4px; min-height: 92px; height: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 12px; border: 1px solid #cfe3da; background: #f4faf7; color: #0b4d39; font: inherit; cursor: pointer; min-width: 0; transition: background .12s, border-color .12s, box-shadow .12s; }
.rp-b:hover { background: #e7f4ee; border-color: #0f6b4f; box-shadow: 0 1px 4px rgba(15,107,79,.12); }
.rp-b:focus-visible { outline: 2px solid #0f6b4f; outline-offset: 2px; }
.rp-hd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rp-ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; background: rgba(255,255,255,.75); }
.rp-t { font-weight: 600; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.rp-d { font-size: 12px; line-height: 1.3; color: #52616b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-s { margin-top: auto; font-size: 12px; font-weight: 600; color: #0f6b4f; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-b.off { background: #f7f7f8; border-color: #e4e4e7; color: #55555e; }
.rp-b.off:hover { background: #f0f0f2; border-color: #b9b9c2; box-shadow: none; }
.rp-b.off .rp-ic { filter: grayscale(1); opacity: .7; }
.rp-b.off .rp-s { color: #8a8a93; font-weight: 500; }
.rp-b.ask { cursor: default; border-color: #f0b44c; background: #fffaf0; }
.rp-q { font-size: 12px; line-height: 1.3; color: #7a4b00; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-qa { font-size: 12px; color: #7a4b00; }
.rp-ask { margin-top: auto; display: flex; gap: 8px; }
.rp-ask .btn { flex: 0 1 auto; padding: 4px 8px; font-size: 12px; min-height: 30px; white-space: nowrap; }
.rp-b.gen { background: #fff8eb; border-color: #f0c674; color: #7a4b00; }
.rp-b.gen .rp-s { color: #7a4b00; }
.rp-b.ready { background: #0f6b4f; border-color: #0f6b4f; color: #fff; }
.rp-b.ready .rp-d { color: #cdeee2; } .rp-b.ready .rp-s { color: #fff; } .rp-b.ready .rp-ic { background: rgba(255,255,255,.18); }
.rp-scope { margin-top: 8px; display: flex; flex-wrap: wrap; }
.rp-scope .seg-btn { flex: 1 1 30%; font-size: 13px; }
@media (max-width: 340px) { .rp-grid { grid-template-columns: 1fr; grid-auto-rows: auto; } }
.rp-scope .seg-btn { white-space: normal; line-height: 1.15; padding: 8px 4px; }
/* desktop: one-line explainer, full text as a hover tooltip; phone keeps two lines visible */
@media (hover: hover) and (min-width: 900px) {
  .rp-d { -webkit-line-clamp: 1; }
  .rp-b[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 20; background: #1f2933; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.35; padding: 8px 8px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.2); pointer-events: none; }
}
.ck-card.ck-done { padding: 8px 12px; }
.ck-card.ck-done .ck-t { margin: 0 auto 0 0; }
.rp-lab { margin: 0 0 8px; border: 1px solid #eaecf0; border-radius: 10px; padding: 8px 8px; background: #fff; }
.rp-lab summary { cursor: pointer; font-size: 14px; }
.rp-lab .lab-grid { margin-top: 8px; }
.pj-of { margin: 0 0 8px; font-size: 13px; background: #eef4ff; border-radius: 8px; padding: 4px 8px; }
.loc-in .loc-add + .loc-add { margin-left: 0; }
.sel-bar .ui-db-t { color: #1d4ed8; }
.pj-map { height: 260px; border-radius: 12px; margin: 8px 0; }
.pj-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.pj-facts div { background: #f6f8fb; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.pj-facts b { font-size: 17px; }
.pj-facts span { font-size: 12px; color: #667085; }
.pj-tw { overflow-x: auto; margin: 8px 0 8px; }
.pj-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.pj-t th, .pj-t td { text-align: left; padding: 4px 4px; border-bottom: 1px solid #eaecf0; }
.pj-t td:nth-child(n+3), .pj-t th:nth-child(n+3) { text-align: right; white-space: nowrap; }
.pj-lh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pj-lh h2 { margin: 0; }
.pj-ren { font-size: 13px; font-weight: 400; }
.pj-cs { margin: 16px 0 8px; }
.sel-bar[hidden] { display: none !important; }
.pj-t td:nth-child(2) { white-space: nowrap; }

/* Building check (pre-concept) */
.ck-card { border: 1px solid var(--line, #d9d6cf); border-left: 4px solid #E07B39; border-radius: 10px; padding: 8px 12px; margin: 8px 0 8px; background: #fff; }
.ck-card.confirmed { border-left-color: #2E8B57; } .ck-card.wrong { border-left-color: #C0392B; }
.ck-t { font-weight: 600; margin: 0 0 4px; } .ck-s { margin: 0 0 8px; font-size: 0.9em; color: var(--muted, #666); }
.ck-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ck-st { font-size: 0.9em; } .ck-st.ok { color: #2E8B57; } .ck-st.bad { color: #C0392B; }

/* In-page ask sheet (replaces prompt/confirm) */
#ask-sheet { position: fixed; inset: 0; z-index: 2300; display: flex; align-items: flex-end; justify-content: center; }
#ask-sheet[hidden] { display: none !important; }
.ask-bg { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.ask-card { position: relative; width: 100%; max-width: 480px; box-sizing: border-box; background: #fff; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.ask-t { font-weight: 600; font-size: 1.05rem; margin: 0 0 8px; }
.ask-s { margin: 0 0 8px; color: #555; }
.ask-in { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px 12px; border: 1px solid #ccc; border-radius: 10px; margin: 0 0 8px; }
.ask-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.btn-danger { background: #b42318; color: #fff; border-color: #b42318; }

/* Fix the building (full screen, mobile first) */
#fix-sheet { position: fixed; inset: 0; z-index: 2200; background: #f6f6f4; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); box-sizing: border-box; overflow: hidden; max-width: 100vw; }
#fix-sheet[hidden] { display: none !important; }
.fx-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fx-title { margin: 0; font-weight: 600; font-size: 1.1rem; }
.fx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-chip { border: 1px solid #c9cdc9; background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 14px; min-height: 38px; color: #222; }
.fx-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.fx-chip.warn[aria-pressed="true"] { background: #b42318; border-color: #b42318; }
.fx-mapwrap { position: relative; flex: 1; min-height: 180px; border-radius: 12px; overflow: hidden; }
#fx-map { position: absolute; inset: 0; }
.fx-hint { position: absolute; left: 56px; right: 8px; top: 8px; z-index: 500; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; padding: 8px 8px; border-radius: 8px; pointer-events: none; text-align: center; }
.fx-panel { display: none; background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.fx-panel.on { display: block; }
.fx-sec .fx-chips { margin-bottom: 8px; }
.fx-st { margin: 0 0 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fx-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.fx-foot { display: flex; flex-direction: column; gap: 8px; }
.fx-foot .ask-in { margin: 0; }
.fx-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-tools .btn { flex: 1 1 auto; }
.fx-send { width: 100%; min-height: 52px; font-size: 1.1rem; }
.fx-num span { display: flex; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 600; align-items: center; justify-content: center; border: 2px solid #fff; box-sizing: border-box; font-size: 13px; }
.fx-vert { background: #fff; border: 3px solid #222; border-radius: 50%; box-sizing: border-box; }
#fix-sheet.panel-on .fx-foot { display: none; }
#fix-sheet.panel-on .fx-mapwrap { min-height: 240px; }
.fx-chip.fx-done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fx-sec .fx-chips:last-child { margin-bottom: 0; }

/* add-building flow, saved page, polytunnels */
.ui-sheet[hidden], .ui-drawbar[hidden] { display: none !important; }
body.ui-drawing .ui-sheet, body.ui-drawing #sel-bar { display: none !important; }

.ui-drawbar { flex-wrap: wrap; }
.ui-drawbar .ui-db-t { flex: 1 1 auto; min-width: 120px; font-weight: 600; font-size: 14px; line-height: 1.2; }
.ui-drawbar .btn { flex: 0 0 auto; padding-left: 8px; padding-right: 8px; }
.ui-x { min-width: 36px; font-size: 18px; }
.ui-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.ui-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ui-row .btn-primary { flex: 1; }
.ui-nm { margin-top: 8px; } .ui-nm summary { color: #6b7280; font-size: 14px; cursor: pointer; } .ui-nm .ui-inp { margin-top: 8px; width: 100%; box-sizing: border-box; }
.ui-modes { display: grid; grid-template-columns: repeat(4, 1fr); }
.sv-hd, .sv-gh { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sv-gh h3 { margin: 16px 0 8px; }
.sv-list { list-style: none; margin: 0; padding: 0; }
.sv-row { display: flex; align-items: center; gap: 4px; border-top: 1px solid #e5e7eb; min-width: 0; }
.sv-open { flex: 1 1 auto; min-width: 0; text-align: left; background: none; border: 0; padding: 8px 2.0px; display: flex; flex-direction: column; cursor: pointer; }
.sv-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-s { font-size: 13px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-sc { font-weight: 600; min-width: 26px; text-align: right; }
.sv-ic { background: none; border: 0; font-size: 18px; width: 40px; height: 40px; cursor: pointer; } .sv-ic.on { color: #16a34a; }
.gh-badge { background: #cffafe; color: #155e75; border-radius: 8px; padding: 0 8px; font-size: 12px; }
.gh-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #06b6d4; vertical-align: middle; }
#fix-sheet .fx-size{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap;margin-top:8px}
#fix-sheet .fx-size label{display:flex;flex-direction:column;font-size:12px;gap:2.0px;flex:1 1 90px}
#fix-sheet .fx-size input{font-size:16px;padding:8px;border:1px solid #c9ccd1;border-radius:8px;width:100%;box-sizing:border-box}
#fix-sheet .fx-move{display:flex;align-items:center;justify-content:center;font-size:18px;background:#fff;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.4)}

.fx-body { flex: 1; min-height: 0; display: flex; }
.fx-inspector { width: 220px; }


.plot-row { border-radius: 16px !important; border: 1px solid #e0e0e0 !important; background: #fff !important; box-shadow: 0 2px 8px rgba(0,0,0,.06) !important; padding: 16px !important; margin: 12px 0 !important; }
.plot-row:hover { box-shadow: 0 6px 16px rgba(0,0,0,.1) !important; }
.plot-row .thumb, .plot-row img, .plot-row .bf-thumb { width: 110px !important; height: 80px !important; border-radius: 10px !important; object-fit: cover !important; }
.plot-row .top-title { font-size: 16px !important; font-weight: 600 !important; }
.plot-row .reason { color: #555 !important; font-size: 14px !important; }
.plot-row .reason { color: #666; font-size: 13px; }

.ck-banner { background:#FFF4D6; border:2px solid #E0A800; border-radius:12px; padding:12px 16px; margin:12px 0; font-size:1rem; }
.ck-banner ul { list-style:none; margin:8px 0 0; padding:0; }
.ck-banner li { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-top:1px solid #f0d98a; }
.ck-banner li span { min-width:0; overflow-wrap:anywhere; }
.tab-badge { display:inline-block; margin-left:4px; min-width:18px; padding:0 4px; border-radius:9px; background:#C0392B; color:#fff; font-size:.75rem; line-height:18px; text-align:center; }

.lg-no { display:inline-block; width:11px; height:11px; border-radius:50%; background:#9ca3af; opacity:.75; border:1.5px solid #9ca3af; margin-right:4px; vertical-align:-1px; }
.lg-no.arc { background:transparent; border-style:dashed; }

/* Fix the building v2: mobile-first */
#fix-sheet { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 4px; }
#fix-sheet .fx-bar { padding: 0 2.0px; }
#fix-sheet .fx-close { min-height: 36px; padding: 4px 12px; }
#fix-sheet .fx-toolbar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0; background: none; border: 0; }
#fix-sheet .fx-tb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.0px; min-height: 48px; padding: 4px 0; border: 1px solid #d6d9d6; background: #fff; border-radius: 10px; color: #1f2937; font-size: 11px; line-height: 1.1; min-width: 0; }
#fix-sheet .fx-tb .fx-ic { font-size: 18px; line-height: 1; }
#fix-sheet .fx-tb[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
#fix-sheet .fx-tb:disabled { opacity: .4; }
#fix-sheet .fx-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; gap: 0; }
#fix-sheet .fx-mapwrap { flex: 1 1 auto; min-height: 65vh; border-radius: 12px; }
#fix-sheet.panel-on .fx-mapwrap { min-height: 52vh; }
#fix-sheet .fx-hint { left: 50%; right: auto; transform: translateX(-50%); top: 8px; max-width: calc(100% - 70px); border-radius: 18px; padding: 4px 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fix-sheet .fx-hint[hidden] { display: none; }
#fix-sheet .fx-sheet { width: 100%; box-sizing: border-box; background: #fff; border-radius: 14px 14px 10px 10px; box-shadow: 0 -2px 12px rgba(0,0,0,.15); padding: 8px 8px 8px; margin-top: -10px; position: relative; z-index: 600; max-height: 34vh; overflow-y: auto; }
#fix-sheet .fx-sheet[hidden] { display: none; }
.fx-sh-hd { display: flex; align-items: center; gap: 8px; }
.fx-sh-t { flex: 1; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 0; font-weight: 600; font-size: 15px; text-align: left; color: #111; min-width: 0; }
.fx-sh-t small { font-weight: 500; color: #4b5563; }
.fx-car { margin-left: auto; color: #6b7280; }
.fx-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #d6d9d6; background: var(--accent); color: #fff; font-size: 18px; flex: 0 0 auto; }
.fx-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.fx-row.fx-scroll { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .fx-row.fx-scroll::-webkit-scrollbar { display: none; }
.fx-row.fx-wrap { flex-wrap: wrap; }
.fx-row .fx-chip { flex: 0 0 auto; min-height: 40px; padding: 8px 12px; }
.fx-num-in { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; flex: 1 1 0; min-width: 0; }
.fx-num-in input { width: 100%; min-width: 0; font-size: 16px; padding: 8px 8px; border: 1px solid #c9ccd1; border-radius: 8px; box-sizing: border-box; }
.fx-tip { margin: 4px 0 0; font-size: 14px; color: #374151; }
.fx-nudge .fx-chip { flex: 1 1 0; padding: 8px 4px; }
#fix-sheet .fx-foot { flex-direction: row; align-items: center; gap: 8px; padding: 0; border: 0; flex-wrap: nowrap; }
#fix-sheet .fx-foot .ask-in { flex: 1 1 auto; min-width: 0; min-height: 44px; }
#fix-sheet .fx-send { width: auto; flex: 0 0 auto; min-height: 44px; padding: 0 16px; font-size: 1rem; }
#fix-sheet .fx-uns { display: none; }
#fix-sheet.panel-on .fx-foot { display: flex; }
.fx-h { background: none; border: 0; display: flex !important; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.fx-h::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -11px 0 0 -11px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #111827; box-shadow: 0 1px 4px rgba(0,0,0,.5); box-sizing: border-box; }
.fx-h.fx-mv::after, .fx-h.fx-rot::after { display: none; }
.fx-h.fx-mv, .fx-h.fx-rot { font-size: 20px; color: #111827; }
.fx-h.fx-mv { background: rgba(255,255,255,.95); border-radius: 50%; width: 36px !important; height: 36px !important; margin: -18px 0 0 -18px !important; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.fx-h.fx-rot { background: #facc15; border-radius: 50%; width: 34px !important; height: 34px !important; margin: -17px 0 0 -17px !important; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.fx-h.fx-all { background: #22d3ee; width: 48px !important; height: 48px !important; margin: -24px 0 0 -24px !important; font-size: 24px; }
.fx-num.sm span { width: 10px; height: 10px; border-width: 1.5px; }
.fx-num span { width: 22px; height: 22px; font-size: 12px; }
#fix-sheet.fx-dragging .fx-hint { background: rgba(15,110,86,.9); }
@media (min-width: 900px) {
  #fix-sheet .fx-body { flex-direction: row; }
  #fix-sheet .fx-mapwrap, #fix-sheet.panel-on .fx-mapwrap { min-height: 0; }
  #fix-sheet .fx-sheet { width: 320px; max-height: none; margin: 0 0 0 8px; border-radius: 12px; }
  #fix-sheet .fx-toolbar { grid-template-columns: repeat(7, 72px); }
}
/* ===== Standard header (12 Oct 2026): one bar on every page and width. Logo + brand + page title + Menu.
   No back button. Desktop adds the tab row underneath; phones use Menu. ===== */
header.top { position: sticky; top: 0; z-index: 1200; background: #fbfbf9; border-bottom: 1px solid var(--line); }
header.top .brand { display: none !important; }
.hdr-bar { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0; min-width: 0; }
.hdr-logo { flex: none; display: flex; text-decoration: none !important; }
.hdr-mark { width: 40px; height: 40px; border-radius: 10px; background: #0f6b4f; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 1.3rem; letter-spacing: -.02em; }
.hdr-tt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.hdr-brand { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); opacity: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-title { font-size: 1.2rem; font-weight: 600; color: var(--ink, #111827); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-b { flex: none; width: auto; height: 44px; min-width: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #1f2937; font-size: 1rem; font-weight: 600; cursor: pointer; }
.hdr-b > span[aria-hidden] { font-size: 1.2rem; line-height: 1; }
nav.tabs { padding: 0 0 8px; }
@media (max-width: 720px) { nav.tabs { display: none; } .hdr-bar { height: 60px; gap: 8px; } }
@media (max-width: 360px) { .hdr-b-l { display: none; } .hdr-b { padding: 0 8px; } }
@media (min-width: 721px) { .hdr-bar [data-act=navmenu] { display: none; } }
#nav-sheet .nav-it[aria-current="page"] { font-weight: 600; color: #0f6b4f; background: #eef5f1; }
#nav-sheet .nav-it { font-size: 1.05rem; padding: 0 8px; }
/* Focused item: header stays; the in-page Close bar is a normal row, never a second header. */
body.bf-focus header.top { display: block !important; }
.bf-backbar, body.bf-focus .bf-backbar { position: static; display: flex !important; background: none; border: 0; backdrop-filter: none; padding: 0; margin: 0 0 8px; }
.bf-backbar[hidden], body.bf-focus .bf-backbar[hidden] { display: none !important; }
.bf-backbar .back-btn { padding: 0 16px; }
/* ===== Fix the building: section panel (12 Oct 2026). Labelled groups, wrap (never clip), real heights in metres. ===== */
#fix-sheet .fx-sh-b { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.fx-grp { border-top: 1px solid #e5e7eb; padding-top: 8px; min-width: 0; }
.fx-gl { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #374151; margin-bottom: 8px; }
.fx-gl span { font-weight: 500; text-transform: none; letter-spacing: 0; color: #6b7280; margin-left: 4px; }
.fx-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.fx-seg .fx-chip, .fx-acts .fx-chip { min-height: 44px; padding: 8px 4px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #111827; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-seg .fx-chip[aria-pressed="true"] { color: #fff; }
.fx-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fx-acts .fx-chip.warn { color: #b42318; border-color: #f1b5ae; }
.fx-acts .fx-chip.warn[aria-pressed="true"] { color: #fff; }
.fx-row.fx-size2 { margin-top: 0; flex-wrap: nowrap; }
.fx-size2 .fx-num-in span { color: #374151; }
.fx-size2 .fx-num-in input { min-height: 44px; color: #111827; }
.fx-size2 .fx-set { min-height: 44px; border-radius: 10px; font-weight: 600; flex: 0 0 auto; padding: 8px 16px; }
.fx-hts { display: flex; flex-direction: column; gap: 8px; }
.fx-hcol { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fx-hrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fx-hl { flex: 1 1 auto; min-width: 0; white-space: nowrap; font-weight: 600; font-size: 15px; color: #111827; display: flex; flex-direction: column; line-height: 1.15; }
.fx-hl small { font-weight: 500; font-size: 12px; color: #6b7280; }
.fx-hrow.eav .fx-hl { border-left: 4px solid #2563eb; padding-left: 8px; }
.fx-hrow.rid .fx-hl { border-left: 4px solid #b45309; padding-left: 8px; }
.fx-step { display: flex; align-items: center; border: 1px solid #c9ccd1; border-radius: 10px; overflow: hidden; flex: 0 0 auto; background: #fff; }
.fx-sb { width: 44px; height: 44px; border: 0; background: #f3f4f6; font-size: 22px; font-weight: 600; color: #111827; cursor: pointer; }
.fx-sb:active { background: #e5e7eb; }
.fx-step output { min-width: 64px; text-align: center; font-size: 17px; font-weight: 600; color: #111827; font-variant-numeric: tabular-nums; }
.fx-step output span { font-size: 13px; font-weight: 500; color: #4b5563; }
.fx-prof { display: block; max-width: 300px; align-self: center; background: #f9fafb; border-radius: 8px; }
.fx-hreset { align-self: flex-start; font-size: 13px; }
@media (min-width: 900px) { #fix-sheet .fx-sheet { width: 360px; overflow-x: hidden; } }

/* Rightmove-style list cards (barn finder Top list / A–Z, all four modes) */
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; min-width: 0; }
.rm-grid > .bf-more, .rm-grid > .card:not(.rm-card) { grid-column: 1 / -1; }
.rm-card { padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; border-radius: 12px; border: 1px solid #dcdfe3; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: box-shadow .15s, transform .15s; min-width: 0; margin: 0; }
.rm-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.rm-card:active { transform: scale(.995); }
.rm-photo { position: relative; aspect-ratio: 16 / 10; background: #cfd5da; overflow: hidden; }
.rm-img, .rm-outline { position: absolute; inset: 0; width: 100%; height: 100%; }
.rm-img { overflow: hidden; }
.rm-img img { position: absolute; display: block; max-width: none; }
.rm-outline polygon { fill: rgba(255, 214, 0, .12); stroke: #ffd600; stroke-width: 4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rm-pin { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #ffd600; border: 3px solid #fff; }
.rm-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; }
.rm-rank { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.72); color: #fff; font-weight: 600; font-size: 14px; border-radius: 6px; padding: 4px 8px; }
.rm-score { position: absolute; left: 10px; bottom: 10px; }
.rm-score .score-badge, .rm-score .badge { font-size: 15px; font-weight: 600; padding: 4px 8px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.rm-fav { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #222; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.rm-fav.on { color: #e0a100; }
.rm-body { padding: 12px 16px 16px; color: #1a1a1a; min-width: 0; }
.rm-title { font-size: 19px; font-weight: 600; line-height: 1.25; margin: 0 0 4px; color: #111; overflow-wrap: anywhere; }
.rm-facts { margin: 0; font-size: 15px; color: #333; overflow-wrap: anywhere; }
.rm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.rm-chip { font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: #eef1f4; color: #222; }
.rm-chip.asb { background: #fdecea; color: #8a1c12; }
.rm-chip.sol { background: #fff4d1; color: #6b4e00; }
.rm-chip.warn { background: #ffe6cc; color: #7a3a00; }
.rm-body .also-row { margin: 8px 0 0; }
.rm-acts { display: flex; gap: 8px; margin-top: 8px; }
.rm-count { margin: 4px 0; font-size: 15px; font-weight: 600; color: #222; }
.rm-more summary { cursor: pointer; color: #555; font-size: 14px; }
@media (max-width: 640px) { .rm-grid { grid-template-columns: 1fr; gap: 16px; } }
@media (max-width: 899px) { #fix-sheet .fx-sheet { max-height: 46vh; } #fix-sheet.panel-on .fx-mapwrap { min-height: 40vh; } }

.os-tag.lidar-tag{background:#ede9fe;color:#4c1d95;border-color:#c4b5fd}
/* One Add sheet */
.add-in { display: flex; flex-direction: column; gap: 8px; }
.add-t { font-size: 18px; line-height: 1.25; }
.add-row { display: flex; gap: 8px; }
.add-row .add-inp { flex: 1; min-width: 0; min-height: 52px; font-size: 16px; padding: 12px 16px; border-radius: 12px; }
.add-go { min-height: 52px; padding: 0 16px; font-size: 16px; font-weight: 600; border-radius: 12px; flex: 0 0 auto; }
.add-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-big { min-height: 56px; font-size: 16px; font-weight: 600; border-radius: 12px; white-space: normal; line-height: 1.2; }
.add-msg { margin: 0; font-size: 15px; color: #475467; overflow-wrap: anywhere; }
.add-back { align-self: center; min-height: 44px; }
@media (max-width: 380px) { .add-btns { grid-template-columns: 1fr; } }
/* Reports: Rightmove-style cards (repCard) */
.rp-cards { margin: 8px 0 16px; }
.rp-card { cursor: default; }
.rp-card .rm-photo { cursor: pointer; }
.rp-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center top; background: #eef0f2; padding: 8px; box-sizing: border-box; }
.rp-card .rm-score .doc-mode { font-size: 14px; font-weight: 600; padding: 4px 8px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.rp-date { margin: 4px 0 0; font-size: 14px; color: #555; }
.rp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rp-acts .btn { min-height: 44px; }
.rp-acts .ck-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Standalone public/static pages (samples, grants): same header pattern */
.pub-hd { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
.pub-hd img { width: 40px; height: 40px; }
.pub-hd h1 { margin: 0; font-size: 1.25rem; } .pub-hd .eyebrow { margin: 0; }
.pub-hd .sp { flex: 1; }
.pub-foot { color: var(--muted); font-size: .9rem; margin: 32px 0 40px; }
/* Grants filters: full labels, wrap on phones */
.gr-f { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.gr-f .seg-btn { flex: 0 1 auto; white-space: normal; min-height: 44px; padding: 8px 16px; border: 1px solid #d0d5dd; border-radius: 999px; background: #fff; }
.gr-f .seg-btn[aria-pressed="true"] { background: #0f6e56; color: #fff; border-color: #0f6e56; }
/* report progress + cancel (Generating cards) */
.rp-prog{flex:1 0 100%;width:100%;height:8px;border-radius:4px;background:#e6e2d8;overflow:hidden;margin:8px 0 4px}
.rp-prog span{display:block;height:100%;background:#2f6b3a;transition:width .4s}
.rp-step{flex:1 0 100%;font-size:15px;margin:0 0 8px;color:#333}
.rp-cancel{display:flex;flex-direction:column;align-items:flex-start;gap:2.0px;min-height:48px;text-align:left}
.rp-cancel small{font-size:13px;opacity:.8}
/* Select mode: tick cards, one-tap request for the group */
.rm-selmode { outline: 3px solid transparent; }
.rm-selmode.rm-picked { outline-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.rm-check { position: absolute; left: 8px; top: 8px; width: 40px; height: 40px; border-radius: 10px; border: 3px solid #fff; background: rgba(17,24,39,.45); color: #fff; font-size: 24px; font-weight: 600; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.rm-check.on { background: #2563eb; }
.sel-bar { flex-wrap: wrap; gap: 8px; }
.sel-bar .sel-req { flex: 1 1 100%; min-height: 48px; font-size: 17px; }
.sel-bar .sel-hint { flex: 1 1 100%; font-size: 13px; color: #374151; }
#pick-sheet[hidden] { display: none; }
#pick-sheet { position: fixed; inset: 0; z-index: 3000; }
.pick-card { max-height: 86vh; overflow: auto; }
.pick-list { display: grid; gap: 8px; margin: 8px 0; }
.pick-b { display: flex; gap: 12px; align-items: center; text-align: left; min-height: 56px; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; font-size: 16px; cursor: pointer; }
.pick-b.off { background: #f9fafb; color: #4b5563; }
.pick-ic { font-size: 24px; }
.pick-tx { display: flex; flex-direction: column; }
.pick-tx small { font-size: 13px; color: #4b5563; }
.bs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; margin: 8px 0; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #f8fafc; }
.bs-t { margin: 0; font-weight: 600; flex: 1 1 100%; }
.bs-b { min-height: 44px; }
.bs-why { flex: 1 1 100%; color: #4b5563; font-size: 13px; }
/* Area picker (dropdown, multi-select; scales to ~20 areas) + greenhouse chip — 15 Oct 2026 */
.bf-row { flex-wrap: wrap; }
.bf-areabar { flex: none; position: relative; }
.area-dd { position: relative; }
.area-dd-btn { min-height: 40px; padding: 0 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; max-width: 220px; }
.area-dd-btn .ad-l { font-size: .75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.area-dd-btn .ad-v { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.area-dd-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; width: 280px; max-height: 60vh; overflow: auto; background: #fff; border: 1px solid #d1d5db; border-radius: 12px; box-shadow: 0 12px 32px rgba(17,24,39,.18); padding: 8px; }
.area-dd-list { display: flex; flex-direction: column; gap: 2.0px; }
.area-dd-list .ad-q { width: 100%; min-height: 38px; margin: 0 0 8px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 16px; }
.ad-row { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 8px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.ad-row:hover { background: #f3f4f6; }
.ad-row input { width: 18px; height: 18px; accent-color: #111827; flex: none; }
.ad-row .ad-name { flex: 1 1 auto; min-width: 0; }
.ad-row .ad-n { font-size: .8rem; color: #6b7280; font-weight: 500; }
.ad-row.ad-all { border-bottom: 1px solid #e5e7eb; border-radius: 8px 8px 0 0; margin-bottom: 2.0px; }
.ad-row[hidden] { display: none; }
.ad-foot { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid #e5e7eb; margin-top: 4px; }
#bf-area .area-dd-list { border: 1px solid #e5e7eb; border-radius: 10px; padding: 4px; margin: 0 0 8px; }
.gh-chip { min-height: 40px; flex: none; }
.gh-chip[aria-pressed="true"] { background: #0e7490; color: #fff; border-color: #0e7490; }
.gh-chip[aria-pressed="true"] .badge { background: #fff; color: #0e7490; }
.gh-pin { font-size: 18px; line-height: 22px; text-align: center; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff); }
@media (max-width: 560px) {
  .bf-row .seg.bf-sub { flex: 1 1 100%; }
  .bf-areabar { flex: 1 1 0; min-width: 0; }
  .area-dd-btn .ad-l { display: none; }
  .area-dd-btn { width: 100%; max-width: none; justify-content: center; }
  .area-dd-pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 70vh; }
  .gh-chip { flex: 1 1 100%; justify-content: center; min-height: 36px; }
}
/* Map view: listing cards under the map */
.bf-maplist { margin: 12px 0 8px; }
.bf-maplist .ml-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 8px; }
.bf-maplist .ml-h h2 { margin: 0; font-size: 1.1rem; }
.ml-btns { display: flex; gap: 8px; padding: 0 12px 12px; flex-wrap: wrap; }
.ml-btns .btn { flex: 1 1 0; min-height: 38px; }
.ml-btns .btn.on { background: #fef3c7; border-color: #f59e0b; }
.rm-card.ml-arch { opacity: .55; filter: grayscale(.7); }
#bf-near label { display: flex; gap: 8px; align-items: center; font-weight: 600; min-height: 40px; }
#bf-near .near-sl { display: flex; gap: 8px; align-items: center; }
#bf-near .near-sl input { flex: 1 1 auto; accent-color: #111827; }
#bf-near .near-sl span { flex: none; font-weight: 600; min-width: 92px; }
@media (min-width: 561px) {
  .bf-row { flex-wrap: nowrap; align-items: center; }
  .bf-row .seg.bf-sub { flex: 0 1 360px; }
  .bf-row .bf-areabar { order: 2; }
  .bf-row .gh-chip { order: 3; }
  .bf-row .bf-filt-btn { order: 4; margin-left: auto; }
  .area-dd-btn { max-width: 260px; }
}
@media (max-width: 560px) { .bf-row .bf-filt-btn { order: 3; } .bf-row .bf-areabar { order: 2; } .bf-row .gh-chip { order: 4; } }
.bt-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: middle; flex: none; }
.bt-btn.on { background: #0e7490 !important; color: #fff !important; }
.bt-note { margin: 2.0px 8px 8px; font-size: 12px; }
.bt-card .rm-body { padding: 12px; }
@media (max-width: 560px) { .bf-row .bt-bar { order: 4; flex: 1 1 100%; } }
@media (min-width: 561px) { .bf-row .bt-bar { order: 3; } }

/* Nav sheet: readable in both themes */
#nav-sheet .nav-in { background: #fff !important; color: #1a1a1a !important; }
#nav-sheet .nav-it, #nav-sheet .nav-it span { color: #1a1a1a !important; }
#nav-sheet .nav-h { color: #374151 !important; }
#nav-sheet .nav-brand, #nav-sheet .nav-brand strong, #nav-sheet .nav-brand small { color: #1a1a1a !important; }
#nav-sheet .nav-it[aria-current="page"] { color: #0f6b4f !important; background: #eef5f1 !important; }
html[data-theme="dark"] #nav-sheet .nav-in,
body.theme-dark #nav-sheet .nav-in { background: var(--card) !important; color: var(--ink) !important; }
html[data-theme="dark"] #nav-sheet .nav-it,
html[data-theme="dark"] #nav-sheet .nav-it span,
body.theme-dark #nav-sheet .nav-it,
body.theme-dark #nav-sheet .nav-it span { color: var(--ink) !important; }
html[data-theme="dark"] #nav-sheet .nav-h,
body.theme-dark #nav-sheet .nav-h { color: #94a3b8 !important; }
html[data-theme="dark"] #nav-sheet .nav-it[aria-current="page"],
body.theme-dark #nav-sheet .nav-it[aria-current="page"] { color: #86efac !important; background: var(--line-strong) !important; }

.sv-row .top-th, .sv-row img { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; }

/* Keep match result thumbs contained */
#match-body .rm-img, #match-body .rm-outline { position: absolute; inset: 0; width: 100%; height: 100%; }
#match-body article > div:first-child { position: relative; overflow: hidden; }

.match-card { display: flex; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border, #e5e5e5); margin: 8px 0; align-items: center; background: var(--card, #fff); }
.match-img { width: 100px; height: 75px; border-radius: 8px; overflow: hidden; flex: none; position: relative; background: #cfd5da; }
.match-img .rm-img, .match-img .rm-outline { position: absolute; inset: 0; width: 100%; height: 100%; }
.match-info { flex: 1; min-width: 0; }
.match-title { font-weight: 600; margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-meta { margin: 2.0px 0; font-size: 12px; color: #666; }
.match-score { margin: 0; font-size: 11px; color: #888; }
.match-acts { display: flex; flex-direction: column; gap: 8px; flex: none; }
.match-acts .btn { font-size: 12px; padding: 8px 8px; }
.rp-b .rp-test{font-size:11px;color:var(--muted,#777);margin-top:2.0px}
/* companies-1026: Company owner panel */
.ch-search{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}.ch-search .field{flex:1 1 220px;margin:0}
.ch-card h4{margin:10px 0 6px}.ch-facts{display:grid;grid-template-columns:max-content 1fr;gap:4px 12px;margin:0}
.ch-facts dt{font-weight:600}.ch-facts dd{margin:0;overflow-wrap:anywhere}.ch-off,.ch-results{margin:0;padding-left:18px}
@media(max-width:520px){.ch-facts{grid-template-columns:1fr}.ch-facts dd{margin-bottom:6px}}
/* post-1026: Stannp printing & posting sheet */
#post-sheet{position:fixed;inset:0;z-index:4000;display:flex;align-items:center;justify-content:center}
#post-sheet[hidden]{display:none}
#post-sheet .post-card{position:relative;max-width:560px;width:calc(100% - 24px);max-height:calc(100vh - 32px);overflow:auto}
#post-sheet .post-letter{width:100%;font:inherit;min-height:14em}
#post-sheet fieldset{border:0;padding:0;margin:0}
#post-sheet .ok-box{padding:8px 10px;border-radius:6px;background:rgba(40,140,80,.12)}
/* v221: INSPIRE parcel sheet (no building under the tap): one clean card, no boxed buttons except the primary */
.pc-in { gap: 6px; }
.ui-sheet .pc-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 0 !important; padding-bottom: 0 !important; position: static !important; }
.pc-k { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #667085); }
.pc-a { display: block; font-size: 20px; line-height: 1.25; font-weight: 650; margin-top: 2px; }
.pc-id { margin: 0; font-size: 13px; color: var(--muted, #667085); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pc-note { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink2, #475467); }
.pc-go { width: 100%; min-height: 50px; font-size: 16px; font-weight: 600; border-radius: 12px; margin-top: 8px; }
.pc-alt { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; color: var(--muted, #98a2b3); }
.pc-alt .btn-text { min-height: 40px; padding: 6px 8px; font-size: 14px; font-weight: 600; border: 0 !important; background: none !important; }
.pc-src { margin: 0; text-align: center; font-size: 11.5px; color: var(--muted, #98a2b3); }
@media (max-width: 480px) { .ui-sheet:has(.pc-in) { padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); } }
/* v224: stacked secondary actions, no separator */
.pc-alt { flex-direction: column; gap: 0; }
.pc-alt .btn-text { width: auto; min-height: 36px; padding: 4px 8px; }
