/* The Demographics Report. PushPrint brand tokens, light mode only. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..700&family=Inter:wght@400..700&display=swap');

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --pp-green: #1a4a42;
  --pp-green-deep: #1c2420;
  --pp-green-hover: #163d36;
  --pp-green-soft: #eef4f0;
  --pp-gold: #d4a537;
  --pp-gold-deep: #b4882a;
  --pp-gold-soft: #fbf1d4;
  --pp-cream: #fef7e0;
  --pp-cream-3: #f6ecd1;
  --pp-white: #ffffff;
  --pp-ink: #2a2820;
  --pp-stone: #5f5b50;
  --pp-sage: #9bb0a8;
  --pp-border: #e3dfd4;
  --pp-danger: #b3402f;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow: 0 4px 12px 0 rgba(28, 36, 32, 0.06), 0 1px 2px 0 rgba(28, 36, 32, 0.05);
  --shadow-md: 0 8px 20px 0 rgba(28, 36, 32, 0.07), 0 2px 4px 0 rgba(28, 36, 32, 0.05);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--pp-cream);
  color: var(--pp-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; overflow: hidden; }
.hidden { display: none !important; }
.card {
  background: var(--pp-white);
  border: 1px solid var(--pp-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.6rem 1.25rem;
  background: var(--pp-white);
  border-bottom: 1px solid var(--pp-border);
  flex-wrap: wrap; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand img { height: 38px; width: auto; }
.brand-text h1 {
  margin: 0; font-family: var(--font-display); font-optical-sizing: auto;
  font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--pp-green-deep); line-height: 1.15;
}
.brand-text span { font-size: 0.78rem; color: var(--pp-stone); }
.controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.search-wrap { position: relative; }
#search {
  width: 300px; padding: 0.5rem 0.85rem;
  border: 1px solid var(--pp-border); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--pp-ink);
  background: var(--pp-white); outline: none;
}
#search:focus { border-color: var(--pp-gold); box-shadow: 0 0 0 3px rgba(212,165,55,0.25); }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  z-index: 50; overflow: hidden;
}
.search-results div {
  padding: 0.5rem 0.85rem; font-size: 0.85rem; cursor: pointer;
}
.search-results div:hover { background: var(--pp-green-soft); }
/* A status line is not a suggestion: it must not invite a tap it cannot honour. */
.search-results div.search-msg {
  cursor: default; color: var(--pp-stone); font-style: italic;
}
.search-results div.search-msg:hover { background: var(--pp-white); }
.radius-toggle, .scope-toggle {
  display: inline-flex; border: 1px solid var(--pp-border);
  border-radius: 999px; overflow: hidden; background: var(--pp-white);
}
.radius-toggle button, .scope-toggle button {
  border: 0; background: transparent; padding: 0.42rem 0.8rem;
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600;
  color: var(--pp-stone); cursor: pointer;
}
.radius-toggle button.active, .scope-toggle button.active {
  background: var(--pp-green); color: #fff;
}
.ghost-btn {
  border: 1px solid var(--pp-border); background: var(--pp-white);
  border-radius: var(--radius-sm); padding: 0.42rem 0.8rem;
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600;
  color: var(--pp-green); cursor: pointer;
}
.ghost-btn:hover { background: var(--pp-green-soft); }

/* ---------- layout ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
#map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.legend {
  position: absolute; left: 1rem; bottom: 1.6rem; z-index: 10;
  padding: 0.7rem 0.9rem; width: 210px;
}
.legend-title {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--pp-stone); margin-bottom: 0.4rem;
}
.legend-bar {
  height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, #f2efe2, #dfe7d2, #a8c3a0, #5d8a6f, #1a4a42);
  border: 1px solid var(--pp-border);
}
.legend-ends {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--pp-stone); margin-top: 0.2rem;
}
.legend-note { font-size: 0.72rem; color: var(--pp-stone); margin-top: 0.3rem; line-height: 1.4; }
.famrow {
  display: flex; align-items: center; gap: 0.45rem; width: 100%;
  border: 0; background: none; padding: 0.22rem 0.1rem; margin: 0;
  font-family: var(--font-sans); font-size: 0.76rem; color: var(--pp-ink);
  cursor: pointer; text-align: left; border-radius: 5px;
}
.famrow:hover { background: var(--pp-green-soft); }
.famrow.on { background: var(--pp-gold-soft); font-weight: 700; }
.famrow i {
  width: 12px; height: 12px; border-radius: 3px; flex: none;
  border: 1px solid rgba(28,36,32,0.15);
}
.famrow.famclear { color: var(--pp-green); font-weight: 600; text-decoration: underline; }
.legend-link {
  display: block; border: 0; background: none; padding: 0; margin-top: 0.45rem;
  font-family: var(--font-sans); font-size: 0.72rem; color: var(--pp-sage);
  text-decoration: underline; cursor: pointer;
}
.legend-link:hover { color: var(--pp-green); }

/* one visible layer at a time, switched here */
.layer-switch {
  position: absolute; top: 0.9rem; left: 1rem; z-index: 10;
  display: inline-flex; padding: 0.25rem; gap: 0.15rem; border-radius: 999px;
}
.layer-switch button {
  border: 0; background: transparent; border-radius: 999px;
  padding: 0.38rem 0.85rem; font-family: var(--font-sans);
  font-size: 0.8rem; font-weight: 600; color: var(--pp-stone); cursor: pointer;
}
.layer-switch button.active { background: var(--pp-green); color: #fff; }

/* collapsed evidence sections */
.fold {
  margin-top: 0.8rem; background: var(--pp-white);
  border: 1px solid var(--pp-border); border-radius: var(--radius);
  padding: 0 0.85rem;
}
.fold summary {
  cursor: pointer; list-style: none; padding: 0.65rem 0;
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  color: var(--pp-green-deep);
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "+"; float: right; color: var(--pp-sage); font-weight: 600;
}
.fold[open] summary::after { content: "\2212"; }
.fold[open] { padding-bottom: 0.8rem; }

.sidebar-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; margin-bottom: 0.6rem;
}
.map-loading {
  position: absolute; top: 0.9rem; left: 50%; transform: translateX(-50%);
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: 999px; padding: 0.3rem 0.9rem; font-size: 0.8rem;
  color: var(--pp-stone); box-shadow: var(--shadow); z-index: 10;
}

/* office pins */
.office-pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--pp-gold); border: 2.5px solid var(--pp-white);
  box-shadow: 0 2px 6px rgba(28,36,32,0.35); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.office-pin span {
  transform: rotate(45deg); font-weight: 700; font-size: 0.72rem;
  color: var(--pp-green-deep); font-family: var(--font-sans);
}
.mapboxgl-popup-content {
  font-family: var(--font-sans); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); padding: 0.7rem 0.9rem;
}
.pop-name { font-weight: 700; color: var(--pp-green-deep); font-size: 0.88rem; }
.pop-line { font-size: 0.8rem; color: var(--pp-stone); }
.pop-score { color: var(--pp-green); font-weight: 700; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 430px; max-width: 45vw; background: var(--pp-cream);
  border-left: 1px solid var(--pp-border); overflow-y: auto;
  padding: 1rem 1.1rem 2rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.panel h2 {
  margin: 0.2rem 0; font-family: var(--font-display); font-optical-sizing: auto;
  font-size: 1.45rem; font-weight: 600; color: var(--pp-green-deep);
}
.panel h3 {
  margin: 0 0 0.3rem; font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 600; color: var(--pp-green-deep);
}
.panel-sub { font-size: 0.82rem; color: var(--pp-stone); margin: 0.3rem 0 0.8rem; }

.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-list li {
  counter-increment: rank; display: flex; gap: 0.7rem; align-items: center;
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem;
  margin-bottom: 0.45rem; cursor: pointer;
}
.rank-list li:hover { background: var(--pp-green-soft); }
.rank-list li::before {
  content: counter(rank); font-family: var(--font-display);
  font-weight: 600; font-size: 1rem; color: var(--pp-sage); width: 1.2rem;
  flex: none; text-align: center;
}
.rank-place { font-weight: 600; font-size: 0.88rem; color: var(--pp-green-deep); }
.rank-stats { font-size: 0.76rem; color: var(--pp-stone); }
.rank-main { flex: 1; min-width: 0; }
.score-chip {
  flex: none; min-width: 3.1rem; text-align: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  border-radius: var(--radius-sm); padding: 0.28rem 0.45rem;
}

.ref-block { margin-top: 1.2rem; }
.ref-card {
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius-sm); padding: 0.65rem 0.8rem;
  margin-bottom: 0.5rem; cursor: pointer;
}
.ref-card:hover { background: var(--pp-green-soft); }
.ref-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.ref-name { font-weight: 700; font-size: 0.88rem; color: var(--pp-green-deep); }
.ref-stats { font-size: 0.78rem; color: var(--pp-stone); margin-top: 0.15rem; }
.ref-prod { font-size: 0.76rem; color: var(--pp-gold-deep); margin-top: 0.15rem; font-weight: 600; }

/* ---------- detail panel ---------- */
.back { margin-bottom: 0.7rem; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.7rem; }
.detail-head h2 { font-size: 1.35rem; margin: 0; }
.detail-sub { font-size: 0.8rem; color: var(--pp-stone); margin: 0.15rem 0 0; }
.score-big {
  flex: none; text-align: center; border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
}
.score-big .n { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; line-height: 1; }
.score-big .l { font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }

.hero-stat {
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius); padding: 0.9rem 1rem; margin-top: 0.9rem;
}
.hero-stat .big {
  font-family: var(--font-display); font-optical-sizing: auto;
  font-size: 2.1rem; font-weight: 600; color: var(--pp-green); line-height: 1.05;
}
.hero-stat .cap { font-size: 0.8rem; color: var(--pp-stone); margin-top: 0.25rem; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-top: 0.6rem; }
.stat {
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
}
.stat .n { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--pp-green-deep); }
.stat .n.good { color: var(--pp-green); }
.stat .n.bad { color: var(--pp-danger); }
.stat .l { font-size: 0.72rem; color: var(--pp-stone); line-height: 1.35; margin-top: 0.1rem; }

.flag {
  display: flex; gap: 0.55rem; align-items: baseline;
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; margin-top: 0.55rem;
  font-size: 0.8rem; border: 1px solid var(--pp-border); background: var(--pp-white);
}
.flag .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; position: relative; top: -1px; }
.flag.ok .dot { background: var(--pp-green); }
.flag.mid .dot { background: var(--pp-gold); }
.flag.warn .dot { background: var(--pp-danger); }
.flag b { color: var(--pp-green-deep); }
.flag span { color: var(--pp-stone); }

.seg-section { margin-top: 1.3rem; }
.segcard {
  display: flex; background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 0.6rem;
}
.seg-photo {
  width: 108px; flex: none; background-size: cover; background-position: center;
  position: relative; min-height: 118px;
}
.seg-share {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(28,36,32,0.72); color: #fff; border-radius: 6px;
  font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.4rem;
}
.segbody { padding: 0.6rem 0.75rem; min-width: 0; flex: 1; }
.seg-top { display: flex; align-items: center; gap: 0.45rem; }
.seg-chipdot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.seg-top h4 {
  margin: 0; font-family: var(--font-sans); font-size: 0.9rem; font-weight: 700;
  color: var(--pp-green-deep);
}
.seg-blurb { font-size: 0.76rem; color: var(--pp-stone); margin: 0.25rem 0 0.4rem; }
.seg-traits { display: grid; gap: 0.12rem; }
.trait { display: flex; gap: 0.4rem; font-size: 0.72rem; }
.trait .tk {
  flex: none; width: 70px; color: var(--pp-sage); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.62rem;
  padding-top: 0.1rem;
}
.trait .tv { color: var(--pp-ink); }
.seg-attrib { font-size: 0.7rem; color: var(--pp-sage); margin-top: 0.5rem; }

/* State reads through the same dot vocabulary as .flag, no side stripe. */
.drive-line {
  margin-top: 0.55rem; padding: 0.6rem 0.75rem; font-size: 0.8rem;
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius-sm);
}
.drive-line b::before {
  content: ""; display: inline-block; width: 9px; height: 9px;
  border-radius: 50%; background: var(--pp-green); margin-right: 0.45rem;
}
.drive-line.mid b::before { background: var(--pp-gold); }
.drive-line.warn b::before { background: var(--pp-danger); }
.drive-line b { display: block; color: var(--pp-green-deep); }
.drive-line span { color: var(--pp-stone); }

.will-break { margin-top: 0.45rem; }
.wb-row {
  display: flex; justify-content: space-between; gap: 0.6rem;
  padding: 0.22rem 0; border-top: 1px solid var(--pp-border);
  font-size: 0.74rem;
}
.wb-k { color: var(--pp-ink); font-weight: 600; flex: none; }
.wb-k em {
  font-style: normal; color: var(--pp-sage); font-weight: 600;
  margin-left: 0.3rem;
}
.wb-v { color: var(--pp-stone); text-align: right; }
.wb-note { font-size: 0.7rem; color: var(--pp-sage); padding-top: 0.35rem; }

.offices-note {
  margin-top: 1rem; font-size: 0.8rem; color: var(--pp-stone);
  background: var(--pp-gold-soft); border: 1px solid var(--pp-border);
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem;
}

/* ---------- freshness modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(28,36,32,0.35);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 1rem;
}
.modal-card { max-width: 640px; width: 100%; max-height: 82vh; overflow-y: auto; padding: 1.1rem 1.3rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0; color: var(--pp-green-deep); }
.fresh-row { border-top: 1px solid var(--pp-border); padding: 0.55rem 0; }
.fresh-row .fn { font-weight: 700; font-size: 0.85rem; color: var(--pp-green-deep); }
.fresh-row .fl { font-size: 0.78rem; color: var(--pp-stone); }
.fresh-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  border-radius: 999px; padding: 0.08rem 0.5rem; margin-left: 0.4rem;
  background: var(--pp-green-soft); color: var(--pp-green);
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .layout { flex-direction: column; }
  #map-wrap { height: 58vh; flex: none; }
  .sidebar { width: 100%; max-width: none; border-left: 0; border-top: 1px solid var(--pp-border); }
  #search { width: 180px; }
}

/* search pin, dropped by the address search */
.search-pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--pp-green); border: 2.5px solid var(--pp-white);
  box-shadow: 0 2px 6px rgba(28,36,32,0.35);
}
.search-pin::after {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  background: var(--pp-gold);
}

/* rank line under the detail head */
.rank-line { font-size: 0.82rem; color: var(--pp-stone); margin: 0.5rem 0 0; }
.rank-line b { color: var(--pp-green); }

/* count badge on Compare */
.count-badge {
  display: inline-block; min-width: 1.15rem; text-align: center;
  background: var(--pp-gold); color: var(--pp-green-deep);
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  padding: 0.05rem 0.3rem; margin-left: 0.25rem;
}
.compare-btn { border-color: var(--pp-gold); }

/* save button */
.save-btn {
  width: 100%; margin-top: 0.7rem; border: 0; cursor: pointer;
  background: var(--pp-green); color: #fff; font-family: var(--font-sans);
  font-weight: 600; font-size: 0.86rem; padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
}
.save-btn:hover { background: var(--pp-green-hover); }
.save-btn:disabled { background: var(--pp-sage); cursor: default; }

/* saved pins */
.saved-pin { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.saved-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--pp-green);
  border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(28,36,32,0.4); flex: none;
}
.saved-name {
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.72rem;
  font-weight: 700; color: var(--pp-green-deep); box-shadow: var(--shadow);
  white-space: nowrap;
}

/* ---------- compare view ---------- */
.compare-view {
  position: fixed; inset: 0; background: var(--pp-cream); z-index: 90;
  overflow-y: auto;
}
.compare-inner { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1.4rem 3rem; }
.compare-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.compare-actions { display: flex; gap: 0.5rem; }
.cmp-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--pp-white); border: 1px solid var(--pp-border);
  border-radius: var(--radius); overflow: hidden;
}
.cmp-table th, .cmp-table td {
  padding: 0.65rem 0.8rem; text-align: left; font-size: 0.88rem;
  border-top: 1px solid var(--pp-border); vertical-align: top;
}
.cmp-table thead th { border-top: 0; background: var(--pp-green-soft); }
.cmp-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--pp-green-deep); }
.cmp-tools { display: flex; gap: 0.35rem; margin-top: 0.25rem; }
.cmp-tools button {
  border: 1px solid var(--pp-border); background: var(--pp-white);
  border-radius: 999px; font-size: 0.68rem; padding: 0.08rem 0.5rem;
  color: var(--pp-stone); cursor: pointer; font-weight: 600;
}
.cmp-tools button:hover { color: var(--pp-danger); }
.cmp-label { font-weight: 600; color: var(--pp-stone); width: 200px; }
.cmp-table td.best { background: var(--pp-gold-soft); font-weight: 700; color: var(--pp-green-deep); position: relative; }
.cmp-sub { font-size: 0.72rem; color: var(--pp-sage); font-weight: 400; }
.cmp-tie {
  font-size: 0.68rem; font-weight: 700; color: var(--pp-gold-deep);
  background: var(--pp-gold-soft); border-radius: 999px; padding: 0.05rem 0.45rem;
}
.compare-note { font-size: 0.78rem; color: var(--pp-stone); margin-top: 0.8rem; }

@media print {
  body > .topbar, body > .layout, .modal, .no-print { display: none !important; }
  .compare-view { position: static; background: #fff; }
  .cmp-table { box-shadow: none; }
  /* The compare view's own buttons live inside .compare-view, which print
     keeps, so a printed sheet carried a "Print or save PDF" and a "Back to
     map" button on the paper. Nobody can press a button on a page they are
     holding, and an EDDM report that prints its own chrome looks unfinished.
     Seen in pass6/print-view.png. */
  #compare-print, #compare-close { display: none !important; }
}

@media (max-width: 900px) {
  .compare-inner { padding: 0.8rem; }
  .cmp-table th, .cmp-table td { padding: 0.45rem 0.5rem; font-size: 0.78rem; }
  .cmp-label { width: 110px; }
}

.pop-link { display: inline-block; margin-top: 6px; font-size: 0.82rem;
  font-weight: 600; color: var(--pp-green-deep); text-decoration: underline; }
.pop-link:hover { opacity: 0.75; }

.listing-card { margin: 10px 0 4px; padding: 12px 14px; border-radius: 10px;
  background: #f4f7f4; border: 1px solid #dbe5dc; }
.listing-kicker { font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.63rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: #5d7a68; margin-bottom: 5px; }
.listing-tag { background: #d4a537; color: #2a2200; border-radius: 4px;
  padding: 1px 5px; font-size: 0.6rem; letter-spacing: 0.04em; }
.listing-line { font-weight: 700; color: #1c2420; font-size: 0.95rem; }
.listing-rate { color: #1a4a42; font-size: 0.9rem; margin-top: 2px; }
.listing-rate.muted { color: #7b8b80; font-style: italic; }
.listing-broker { color: #5f6b63; font-size: 0.8rem; margin-top: 4px; }
.listing-link { display: inline-block; margin-top: 7px; font-size: 0.82rem;
  font-weight: 600; color: #1a4a42; text-decoration: underline; }
.listing-link:hover { opacity: 0.75; }


/* Office source key. One swatch per agreement class, so the colour on the
   map is readable without a click. */
.legend-key { margin: 8px 0 6px; display: grid; gap: 5px; }
.legend-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px;
  line-height: 1.3; color: #4a4a48; }
.legend-row i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px;
  border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.10); }
.legend-row b { font-weight: 600; color: #23231f; }

/* Which sources back a dot. Quiet, because it is provenance not a claim. */
.pop-line.pop-src { color: #7a7a72; font-size: 11px; margin-top: 3px; }

/* Two ratios sit next to each other and they are not equally trustworthy.
   The tag says which is which so the weaker one cannot be misread as
   settled fact. */
.stat-tag {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.stat-tag.solid { color: var(--pp-green); }
.stat-tag.soft { color: var(--pp-stone); }
.hero-stat.secondary { background: transparent; }
.hero-stat.secondary .big { font-size: 1.6rem; color: var(--pp-stone); }

/* The spend gate. Sits over the map, states the price, and is the only
   control in the product that can cost money. */
.pull-card {
  position: absolute; top: 4.2rem; right: 0.9rem; width: 270px;
  padding: 0.8rem 0.9rem; z-index: 5;
}
.pull-lead { font-size: 0.82rem; color: var(--pp-ink, #23231f); line-height: 1.35; }
.pull-btn {
  width: 100%; margin: 0.6rem 0 0.45rem; padding: 0.55rem 0.7rem;
  background: var(--pp-green); color: #fff; border: 0;
  border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
}
.pull-btn:hover { filter: brightness(1.08); }
.pull-btn:disabled { opacity: 0.6; cursor: default; }
.pull-quiet { font-size: 0.72rem; color: var(--pp-stone); line-height: 1.35; margin-top: 0.3rem; }

/* Specialty chips on the offices legend. */
.spec-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0 4px; }
.spec-row button {
  font-size: 10.5px; padding: 3px 7px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--pp-border); background: var(--pp-white);
  color: var(--pp-stone);
}
.spec-row button.on { background: var(--pp-green); border-color: var(--pp-green); color: #fff; }

/* ---------- first run ---------- */
/* Not a modal: no backdrop, the map stays live behind it, and it removes
   itself for good the moment the user does anything real. */
.first-run {
  position: absolute; z-index: 30; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 2rem));
  padding: 1.4rem 1.5rem 1rem;
}
.fr-kicker {
  margin: 0; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--pp-gold-deep);
}
.first-run h2 {
  margin: 0.25rem 0 0.35rem; font-family: var(--font-display);
  font-optical-sizing: auto; font-size: 1.65rem; font-weight: 600;
  letter-spacing: -0.01em; color: var(--pp-green-deep); line-height: 1.12;
}
.fr-sub { font-size: 0.86rem; color: var(--pp-stone); margin: 0 0 0.9rem; }
.fr-search { display: block; }
#fr-search {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1px solid var(--pp-border); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 1rem; color: var(--pp-ink);
  background: var(--pp-white); outline: none;
}
#fr-search:focus { border-color: var(--pp-gold); box-shadow: 0 0 0 3px rgba(212,165,55,0.25); }
#fr-search::placeholder { color: var(--pp-sage); }
.fr-hints {
  display: flex; gap: 1.1rem; margin-top: 0.9rem;
  font-size: 0.76rem; color: var(--pp-stone); line-height: 1.4;
}
.fr-hints b { color: var(--pp-green-deep); }
.first-run .legend-link { margin-top: 0.75rem; }

/* ---------- copy link ---------- */
.link-btn {
  width: 100%; margin-top: 0.45rem; cursor: pointer;
  background: var(--pp-white); color: var(--pp-green);
  border: 1px solid var(--pp-border); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-weight: 600; font-size: 0.86rem;
  padding: 0.55rem 0.9rem;
}
.link-btn:hover { background: var(--pp-green-soft); }
.link-btn.done { border-color: var(--pp-green); color: var(--pp-green); }

/* ---------- legend collapse toggle, phones only ---------- */
.legend-toggle {
  display: none; width: 100%; border: 0; background: none; padding: 0;
  font-family: var(--font-sans); font-size: 0.76rem; font-weight: 700;
  color: var(--pp-green); cursor: pointer; text-align: left;
}
.legend-toggle::after { content: "\2212"; float: right; color: var(--pp-sage); }
.legend.collapsed .legend-toggle::after { content: "+"; }

/* scrim behind the phone sheet; a cream veil, never a dark wash */
.sheet-scrim { display: none; }

/* ---------- phone layout, structural ---------- */
@media (max-width: 700px) {
  body { overflow: hidden; }
  #map-wrap { height: auto; flex: 1; }

  .topbar { padding: 0.5rem 0.75rem; row-gap: 0.4rem; }
  .brand { gap: 0.55rem; }
  .brand img { height: 28px; }
  .brand-text h1 { font-size: 1.05rem; }
  .brand-text span { display: none; }
  .controls { width: 100%; flex-wrap: nowrap; }
  .search-wrap { flex: 1 1 auto; min-width: 0; }
  #search { width: 100%; }
  .ghost-btn { flex: none; }

  .layer-switch {
    left: 0.6rem; right: 0.6rem; top: 0.6rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .layer-switch::-webkit-scrollbar { display: none; }
  .layer-switch button { white-space: nowrap; flex: none; }

  .legend {
    left: 0.6rem; right: auto; bottom: 0.9rem; width: auto;
    min-width: 190px; max-width: calc(100% - 1.2rem);
    max-height: 44vh; overflow-y: auto;
  }
  .legend-toggle { display: block; }
  .legend.collapsed #legend-content,
  .legend.collapsed #freshness-btn { display: none; }
  .legend:not(.collapsed) .legend-toggle { margin-bottom: 0.45rem; }

  .pull-card { top: 3.8rem; left: auto; right: 0.6rem; bottom: auto;
    width: min(260px, 72vw); max-height: 40vh; overflow-y: auto; z-index: 8; }

  .first-run { top: 4.6rem; transform: translateX(-50%); }
  .fr-hints { flex-direction: column; gap: 0.3rem; }

  /* The sidebar becomes a bottom sheet: explicit Close, scrim tap and
     Escape all close it, and it layers above every map control. */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; max-width: none; max-height: 76vh;
    border-left: 0; border-top: 1px solid var(--pp-border);
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -10px 30px rgba(28, 36, 32, 0.14);
    z-index: 60; padding-top: 0.4rem;
  }
  .sidebar::before {
    content: ""; display: block; width: 42px; height: 4px; border-radius: 2px;
    background: var(--pp-border); margin: 0 auto 0.55rem;
  }
  .sheet-scrim:not(.hidden) {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(254, 247, 224, 0.45);
  }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-head h2 { font-size: 1.2rem; }
}

/* Freshness modal: our copy's age is the number that matters, so it is the
   badge. Vendor cadence is a supporting line, not the headline. */
.fresh-row .fresh-basis { color: var(--pp-stone); font-size: 0.72rem; }
.fresh-lead { font-size: 0.95rem; font-weight: 600; color: var(--pp-green-deep);
  margin: 0.2rem 0 0.35rem; }
.fresh-badge.fresh-old { background: #fdf0e3; color: #9a5b12; }
.fresh-badge.fresh-unknown { background: var(--pp-mist, #eef1ef); color: var(--pp-stone); }
.fresh-warn {
  border: 1px solid #f0d9b8; background: #fdf8f0; border-radius: 8px;
  padding: 0.6rem 0.8rem; margin: 0.6rem 0 0.2rem;
  font-size: 0.78rem; color: #6b4a14;
}
.fresh-warn ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.fresh-warn li { margin-bottom: 0.25rem; }
