:root {
  --bg: #f7f5ef;
  --panel: #ffffff;
  --text: #1f2a1f;
  --muted: #5f6b5f;
  --line: #e2ddd0;
  --accent: #2f6b3a;
  --accent-soft: #e4efe2;
  --warn: #9a3b2c;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141814; --panel: #1c221c; --text: #e8ece6; --muted: #a3ada1;
    --line: #2d362d; --accent: #7cc187; --accent-soft: #223325; --warn: #e08b7a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
.topbar {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { font-weight: 600; }
.brand span { color: var(--accent); margin-left: 6px; }
.ghost { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.layout { display: flex; height: calc(100% - 52px); }
.panel { width: 360px; max-width: 100%; overflow-y: auto; padding: 16px; background: var(--panel); border-right: 1px solid var(--line); }
.map-wrap { flex: 1; position: relative; min-height: 300px; }
.map-wrap .map { position: absolute; inset: 0; }
.map { flex: 1; min-height: 300px; }
h2 { font-size: 1.15rem; margin: 0 0 6px; }
h3 { font-size: 0.95rem; margin: 18px 0 8px; }
.lede, p { line-height: 1.45; font-size: 0.92rem; }
.small { font-size: 0.82rem; }
.muted { color: var(--muted); }
.card { background: var(--accent-soft); border-radius: var(--radius); padding: 12px; margin-top: 12px; }
.card h3 { margin-top: 0; }
.status { font-weight: 600; }
.status.warn { color: var(--warn); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.layers { list-style: none; padding: 0; margin: 0; }
.layers li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.9rem; }
.swatch { width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.15); }
details { border-top: 1px solid var(--line); padding: 8px 0; }
summary { cursor: pointer; font-size: 0.9rem; font-weight: 500; }
details p { color: var(--muted); }
a { color: var(--accent); }
.disclaimer { margin-top: 18px; font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

@media (max-width: 760px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .brand { font-size: .92rem; line-height: 1.15; }
  .topbar .ghost { padding: 5px 8px; font-size: .82rem; white-space: nowrap; }
  .layout { flex-direction: column-reverse; }
  .panel { width: 100%; height: 45%; border-right: none; border-top: 1px solid var(--line); }
  .panel.collapsed { display: none; }
  .map-wrap { height: 55%; flex: none; }
  .map-wrap .map { height: auto; }
}

.score { background: var(--panel); border: 1px solid var(--line); }
#scoreForm { margin-top: 8px; }
#scoreForm .row { display: flex; gap: 6px; margin-top: 6px; }
#scoreForm .small-inputs label { flex: 1; font-size: 0.78rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
#scoreForm .small-inputs input { width: 100%; }
.prefs { border-top: none; padding: 4px 0 0; }
.prefs summary { font-size: 0.82rem; color: var(--accent); }
.total .verdict { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; vertical-align: middle; }
.total .verdict.excellent { background: #d6ecd9; color: #1d5a2c; }
.total .verdict.good { background: #e6f1d4; color: #3f6b1f; }
.total .verdict.fair { background: #f6ecc8; color: #7a5a10; }
.total .verdict.poor, .total .verdict.fails { background: #f5d6d2; color: #8a2b21; }
#scoreForm select { width: 100%; box-sizing: border-box; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
#scoreForm input { flex: 1; min-width: 0; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
#scoreForm button, #scoreSpotBtn { padding: 8px 12px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
#scoreSpotBtn { margin-top: 8px; background: none; color: var(--accent); border: 1px solid var(--line); }
.score-result { margin-top: 12px; }
.score-result h3 { font-size: 0.9rem; margin: 0 0 6px; }
.total { font-size: 2.2rem; font-weight: 700; color: var(--accent); }
.total span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.total.warn { color: var(--warn); }
.flags { background: rgba(176,65,62,.08); border-radius: 8px; padding: 8px 10px; margin: 8px 0; color: var(--warn); font-size: 0.85rem; }
.flags ul, .cat ul { margin: 4px 0 0; padding-left: 18px; }
.cat { border-top: 1px solid var(--line); padding: 8px 0; font-size: 0.85rem; }
.cat-head { display: flex; justify-content: space-between; font-weight: 600; }
.cat li { color: var(--muted); }

.legend { margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.legend-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #be2828, #dc5532 25%, #ee963c 45%, #f2d25a 60%, #aacd64 75%, #469b4b 88%, #0f5f2d); }
.legend-labels { display: flex; justify-content: space-between; margin-top: 2px; }
.legend-gray { display: flex; align-items: center; gap: 6px; margin-top: 6px; }

.maplibregl-popup-content { font-size: 0.85rem; line-height: 1.4; color: #1f2a1f; }
.maplibregl-popup-content .muted { color: #5f6b5f; }
.popup-links { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.popup-links a { color: #2f6b3a; }

/* 2026-10-13: sources on every reason line, "not yet scored", listing link, church pins, storm note */
.cat li .src, .flags li .src { color: var(--muted); font-size: 0.78rem; white-space: normal; }
.flags li .src { opacity: 0.85; }
.nys { color: var(--muted); font-weight: 400; font-style: italic; font-size: 0.85rem; }
.total .nys { font-size: 1rem; }
#scoreForm .link-field { flex: 1; font-size: 0.78rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#scoreForm .link-field input { width: 100%; }
.storm-note { background: rgba(47,107,58,.07); border-radius: 8px; padding: 8px 10px; margin: 8px 0; line-height: 1.45; }
.flags.outside { color: var(--text); }
.flags.outside p { margin: 4px 0 0; }
.church-pin { width: 22px; height: 22px; border-radius: 50%; background: #2b6cb0; color: #fff; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; cursor: pointer; }
.score-result a, .score-result li { overflow-wrap: anywhere; }

/* "Where do you work?" */
#commuteForm select { flex: none; width: auto; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
#commuteForm input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
#commuteForm button { padding: 8px 12px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.best-list { list-style: none; padding-left: 0; font-size: 0.86rem; line-height: 1.5; }
.best-list li { margin: 4px 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.best-pin { width: 24px; height: 24px; border-radius: 50%; background: #2f6b3a; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; }
.work-pin { width: 28px; height: 28px; border-radius: 6px; background: #1f2a1f; color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.find-card { margin-top: 10px; }
#commuteForm .row { display: flex; gap: 6px; margin-top: 6px; }
/* Bottom line and warnings (score upgrades, 2026-10-14) */
.bottom-line { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; font-size: 0.9rem; line-height: 1.45; }
.flags.warnings { background: rgba(214, 158, 46, .12); color: #7a5a10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flags.warnings { color: #f0c96a; } }

/* Personal Fit questionnaire */
.fit-card details summary { cursor: pointer; font-weight: 600; color: var(--accent); margin: 6px 0; }
.fit-q { margin: 10px 0; font-size: 0.88rem; }
.fit-q input[type="text"] { width: 100%; margin: 4px 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.fit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.85rem; }
.fit-num input { width: 58px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.fit-mode, #fitElbow { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.fit-list { padding-left: 20px; margin: 6px 0; } .fit-list li { margin: 6px 0; }
.fit-pin { width: 24px; height: 24px; border-radius: 50%; background: #1f5f8b; color: #fff; font: 700 12px system-ui; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* Confidence labels and "what to ask" lines */
.conf { font-size: 0.68rem; font-weight: 600; border-radius: 10px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.conf-high { background: rgba(47,107,58,.12); color: #2f6b3a; } .conf-moderate { background: rgba(214,158,46,.18); color: #8a6100; } .conf-low { background: rgba(176,65,62,.12); color: #b0413e; }
.ask { font-size: 0.8rem; margin: 4px 0 0; padding: 6px 8px; background: rgba(0,0,0,.03); border-radius: 6px; }

/* "Get the free city guide" prompt over the map: small, at the bottom */
.guide-prompt { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid #b9dcc0; border-left: 4px solid #2f6b3a; border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,.16); font-size: .8rem; }
.guide-prompt[hidden] { display: none; }
.guide-prompt .gp-go { display: block; padding: 5px 2px 5px 10px; color: #1f2a1f; text-decoration: none; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-prompt .gp-go b { color: #2f6b3a; }
.guide-prompt .gp-go span { color: #4a574a; font-size: .76rem; }
.guide-prompt .gp-go:hover b { text-decoration: underline; }
.guide-prompt .gp-x { border: 0; background: none; font-size: 1.05rem; line-height: 1; cursor: pointer; color: #778; padding: 3px 8px; }
/* a quick glow when it switches to another city */
.guide-prompt.flash { animation: gp-glow 1.4s ease-out 1; }
@keyframes gp-glow {
  0% { box-shadow: 0 0 0 0 rgba(47,107,58,.0); border-color: #b9dcc0; }
  20% { box-shadow: 0 0 0 6px rgba(124,194,135,.55), 0 0 18px 6px rgba(124,194,135,.6); border-color: #2f6b3a; }
  100% { box-shadow: 0 3px 12px rgba(0,0,0,.16); border-color: #b9dcc0; }
}
@media (prefers-reduced-motion: reduce) { .guide-prompt.flash { animation: none; } }
.fit-checks { display: grid; gap: 4px; margin-top: 4px; }
.fit-checks label { display: flex; gap: 6px; align-items: center; font-size: .88rem; font-weight: 400; }
@media (max-width: 420px) { .topbar .brand span { display: none; } }

/* Map layers menu (top-left of the map) */
.layers-menu { position: absolute; top: 10px; left: 10px; z-index: 6; max-width: calc(100% - 70px); }
.layers-menu > button { background: var(--panel, #fff); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
#layersPanel { margin-top: 6px; background: var(--panel, #fff); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 290px; max-width: 100%; max-height: 60vh; overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#layersPanel .layers li { font-size: .86rem; padding: 3px 0; }
@media (max-width: 760px) { #layersPanel { max-height: 300px; width: 270px; } }

/* Evaluate a property: optional details folded away */
.more-details { border: 0; padding: 4px 0 0; } .more-details summary { font-size: .85rem; color: var(--accent); }
/* The preferences quiz opens in its own window (full screen on phones) */
.quiz-btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
dialog.quiz { border: 0; border-radius: 14px; padding: 16px 18px 20px; width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; background: var(--panel, #fff); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.quiz::backdrop { background: rgba(20,30,20,.45); }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: -16px; background: var(--panel, #fff); padding: 4px 0; z-index: 1; }
.quiz-head h2 { margin: 0; }
@media (max-width: 760px) { dialog.quiz { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; } }

/* ===== Layout v3 (owner, 2026-10-16): a slim action bar on top, the map full size, results slide in only when needed ===== */
.layout { display: flex; flex-direction: column; height: calc(100% - 52px); }
.action-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar-form { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; flex-wrap: wrap; }
.bar-form > input#scoreAddress { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
.bar-form > button[type=submit], .quiz-btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.more-btn { font-size: .82rem; padding: 6px 8px; white-space: nowrap; }
.more-row { display: flex; gap: 6px; flex-basis: 100%; flex-wrap: wrap; }
.more-row input, .more-row select { flex: 1; min-width: 100px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .88rem; background: var(--bg); color: var(--text); }
.layout .map-wrap { flex: 1; height: auto; position: relative; min-height: 0; }
.layout .panel { position: absolute; z-index: 7; top: 10px; right: 52px; bottom: 10px; width: 390px; max-width: calc(100% - 64px); height: auto; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 34px 14px 14px; background: var(--panel); }
.layout .panel.collapsed { display: none; }
.close-panel { position: sticky; top: -26px; float: right; margin: -26px -4px 0 0; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: .9rem; z-index: 2; }
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .action-bar { padding: 6px 8px; gap: 6px; }
  .bar-form > input#scoreAddress { min-width: 0; font-size: .92rem; }
  .bar-form > button[type=submit], .quiz-btn { padding: 7px 10px; font-size: .9rem; }
  .more-btn { padding: 5px 7px; }
  .quiz-btn { flex: 1; }
  .layout .map-wrap { height: auto; flex: 1; }
  .layout .panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; height: 62%; border-radius: 14px 14px 0 0; border-bottom: 0; }
}
.more-row[hidden] { display: none; }
.bar-form .more-btn { background: none; color: var(--accent); border: 1px solid var(--line); font-weight: 600; }
@media (max-width: 760px) {
  .action-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; padding: 6px 8px; align-items: center; }
  .bar-form { display: contents; }
  .bar-form > input#scoreAddress { grid-column: 1 / 3; grid-row: 1; width: 100%; font-size: .9rem; padding: 7px 9px; }
  .bar-form > button[type=submit] { grid-column: 3; grid-row: 1; font-size: .88rem; padding: 7px 12px; }
  .bar-form .more-btn { grid-column: 1; grid-row: 2; font-size: .8rem; padding: 6px 8px; }
  .action-bar .quiz-btn { grid-column: 2 / 4; grid-row: 2; font-size: .88rem; padding: 7px 10px; }
  .more-row { grid-column: 1 / -1; grid-row: 3; }
}
#scoreForm .more-btn, #scoreForm button.more-btn { background: none; color: var(--accent); border: 1px solid var(--line); }

/* ===== Oct 18, 2026: details button gone, satellite toggle, property lines, score-only card, saved list, preferences nudge ===== */
.layers-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.layers-menu > #layersPanel { flex-basis: 100%; margin-top: 0; }
.layers-menu > .sat-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 760px) { .action-bar .quiz-btn { grid-column: 1 / -1; } }
.parcel-note { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.parcel-swatch { display: inline-block; width: 14px; height: 10px; border: 2px solid #ffd23f; outline: 1px solid #1d1d1d; background: rgba(255,210,63,.15); flex: none; }
.score-actions { margin: 6px 0 10px; }
.save-btn { font-weight: 600; }
.save-btn.saved { color: #9a6b00; border-color: #e0c060; background: #fff8e1; }
.report-gate { border: 1px solid var(--line); background: var(--accent-soft); border-radius: 10px; padding: 12px; margin: 8px 0; }
.report-gate p { margin: 0 0 8px; }
.report-btn { display: block; box-sizing: border-box; width: 100%; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 12px; font: inherit; font-weight: 700; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer; }
a.report-btn:hover, .report-btn:hover { filter: brightness(1.08); color: #fff; }
a.report-btn:visited { color: #fff; }
.report-btn span { display: block; font-weight: 400; font-size: .82rem; opacity: .9; margin-top: 2px; }
.saved-list { list-style: none; padding: 0; margin: 0; }
.saved-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.saved-score { font-weight: 600; margin-left: 4px; }
/* Gentle pulse on "Set your preferences" until they're saved (owner, Oct 18, 2026) */
@keyframes prefPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47,107,58,.55); transform: scale(1); } 50% { box-shadow: 0 0 0 9px rgba(47,107,58,0); transform: scale(1.06); } }
.quiz-btn.nudge { animation: prefPulse 1.6s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { .quiz-btn.nudge { animation: none; outline: 3px solid #f2d25a; } }
/* Preferences: yes/no questions that open more */
.fit-yn { display: flex; gap: 6px; margin: 6px 0; }
.fit-yn label { flex: 1; display: flex; justify-content: center; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.fit-yn label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.fit-more { border-left: 3px solid var(--accent-soft); padding-left: 10px; margin-top: 6px; display: grid; gap: 6px; }
.fit-more[hidden] { display: none; }
.fit-q > input[type=text], .fit-q > select, .fit-more > input[type=text] { width: 100%; box-sizing: border-box; }
.fit-family-row { display: flex; gap: 6px; }
.fit-family-row input { flex: 1; min-width: 0; }
.fit-animals { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: .9rem; }
.fit-animals input[type=number] { width: 64px; }
.fit-need { background: #fff8e1; border: 1px solid #ecd9a0; border-radius: 8px; padding: 8px 10px; font-size: .88rem; color: #3a3220; }
.fit-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 2px; }
.work-pin { background: #1f4fa3; color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 7px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.over-tag { font-size: .74rem; background: #e8eefb; color: #1f4fa3; border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.fit-radio { display: flex; gap: 6px; align-items: center; font-size: .9rem; font-weight: 400; }
.fit-radio[hidden], .fit-row[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  .fit-need { background: #3a3420; border-color: #6b5d2e; color: #f3e9c9; }
  .save-btn.saved { background: #3a3420; color: #f3d77a; border-color: #6b5d2e; }
  .over-tag { background: #1e2b45; color: #a9c1f2; }
}
/* Phone header: Saved shows as a star and a count, so the brand stays on one line (Oct 18, 2026) */
@media (min-width: 641px) { .topbar .cg-short { display: none; } }
@media (max-width: 640px) {
  .topbar .brand { white-space: nowrap; font-size: .84rem; line-height: 1.1; flex: none; }   /* "Plow & Promise" fits on one line (Oct 24, 2026) */
  .topbar .cg-long { display: none; }
  .topbar .ghost { padding: 5px 7px; font-size: .8rem; }
  #savedBtn .sv-word { display: none; }
}
.fit-sub { margin: -2px 0 4px 24px; font-size: .88rem; }
.fit-animals input[type=number] { width: 70px; box-sizing: border-box; justify-self: end; }
.fit-animals input[type=checkbox] { justify-self: end; }
/* Oct 18, 2026: wider budget box; animal size menus; land preference */
#fitBudget { width: 130px; }
#fitAcres, #fitFarmAcres, #fitFoodPlot, #fitTrees { width: 72px; }
.fit-animals { grid-template-columns: auto 1fr; }
.fit-animals select { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .88rem; background: var(--bg); color: var(--text); }
.fit-lab { display: grid; gap: 3px; font-size: .88rem; font-weight: 400; margin-top: 6px; }
.fit-lab select { width: 100%; }
.fit-water { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; font-size: .9rem; margin-top: 4px; }
.fit-water select { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .88rem; background: var(--bg); color: var(--text); }
.area-ok { color: var(--accent); font-weight: 600; margin: 4px 0 0; }
.area-bad { color: var(--warn); margin: 4px 0 0; }
.area-pin { background: #1f6b34; }
#fitAreaMiles { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--bg); color: var(--text); }
.fit-q > select, .fit-lab select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .9rem; background: var(--bg); color: var(--text); }
#fitForm button[type=submit] { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; }
/* Listing pins popup (Oct 18, 2026) */
.lp { font-size: .86rem; display: grid; gap: 3px; }
.lp-score { font-size: .95rem; } .lp-score b { font-size: 1.2rem; color: var(--accent); } .lp-score span { font-size: .78rem; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 1px 6px; margin-left: 4px; }
.lp-btns { display: flex; gap: 6px; margin: 4px 0; }
.lp-btns button { flex: 1; padding: 6px 8px; border-radius: 7px; font: inherit; font-weight: 700; cursor: pointer; border: 1px solid var(--accent); }
.lp-go { background: var(--accent); color: #fff; } .lp-save { background: none; color: var(--accent); }
@media (max-width: 640px) {
  .topbar { gap: 4px; padding: 0 8px; }
  .topbar .acct-btn { padding: 5px 7px; font-size: .78rem; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .topbar .acct-btn img { display: none; }
}
.lr-badge { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 1px 7px; }
.lr-get { display: inline-block; font-size: .8rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 7px; padding: 3px 9px; text-decoration: none; margin: 2px 0; }
@media (max-width: 640px) {
  .topbar .acct-btn { flex: none; max-width: none; overflow: visible; }
  .topbar a.ghost { margin-right: 0 !important; }
  .topbar .ghost { padding: 5px 6px; }
}
/* Properties for the family, Zillow-style (Oct 19, 2026): map on the left, ranked list on the right */
@media (min-width: 761px) { .layout .panel.wide { width: min(560px, 48%); } }
.props-h { font-size: 1rem; margin: 6px 0 4px; }
.prop-list { display: grid; gap: 8px; margin: 8px 0 14px; }
.prop-card { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.prop-card.hot { border-color: #1d1d1d; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.prop-card.open { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.prop-card:hover .pc-addr { text-decoration: underline; }
.prop-card.flash { animation: cardFlash 1.2s ease-out; }
@keyframes cardFlash { 0% { background: #fff3c4; } 100% { background: var(--panel); } }
.pc-rank { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.pc-top { font-size: .95rem; } .pc-addr { font-size: .86rem; margin: 2px 0; }
.pc-scores { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pc-match { font-weight: 800; color: var(--accent); }
.pc-tags { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.pc-btns { margin-top: 6px; }
.pc-open { background: var(--accent); color: #fff; border: 0; border-radius: 7px; padding: 5px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
@media (prefers-color-scheme: dark) { @keyframes cardFlash { 0% { background: #4a3d10; } 100% { background: var(--panel); } } }
/* Sample report button in the header; on phones it moves into the results drawer (the header is full) */
.sample-phone { display: none; }
@media (max-width: 640px) { .topbar .sample-link { display: none; } .sample-phone { display: block; } }
/* Outside your search area (Oct 19, 2026) */
.outside-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 8px; align-items: center; background: #fff8e1; color: #3a3220; border: 1px solid #ecd9a0; border-radius: 10px; padding: 6px 8px 6px 12px; font-size: .88rem; box-shadow: 0 2px 10px rgba(0,0,0,.18); white-space: nowrap; }
.outside-bar[hidden] { display: none; }
.outside-bar button { background: var(--accent); color: #fff; border: 0; border-radius: 7px; padding: 5px 10px; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 480px) { .outside-bar { top: auto; bottom: 64px; font-size: .8rem; } }
@media (prefers-color-scheme: dark) { .outside-bar { background: #3a3420; color: #f3e9c9; border-color: #6b5d2e; } }

.fit-check { display: flex; gap: 6px; align-items: center; font-size: .88rem; font-weight: 400; margin: 8px 0 2px; }
#work2More { display: grid; gap: 4px; margin-top: 4px; }
#work2More[hidden] { display: none; }

/* Land Report orders (specs/report-orders.md) */
.order-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--accent-soft, #eef6ef); }
.order-box.building { background: #fff8e1; border-color: #f1c40f; color: #4a3b00; }
.order-box.ready { border-color: var(--accent); }
.order-steps { margin: 4px 0 6px 18px; padding: 0; }
.order-steps li { margin: 1px 0; }
.order-box.warn { background: #fdecea; border-color: #e6b0aa; color: #641e16; }
.order-box p { margin: 6px 0; }
.order-form { display: grid; gap: 6px; margin-top: 6px; }
.order-form input[type=email] { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
.order-form .hp { position: absolute; left: -9999px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.lr-building { color: #8a6d00; font-weight: 600; }
.lf-toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2000; background: #1f4a2a; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); font-size: .92rem; }
.lf-toast a { color: #fff; font-weight: 700; } .lf-toast button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; margin-left: 6px; }
/* Your score (owner, Oct 20, 2026): the family's score first, deal-breakers front and center */
.total.your { align-items: baseline; flex-wrap: wrap; }
.total .your-l { display: block; width: 100%; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5d6b5d); }
.land-l { margin: 2px 0 8px; }
.dealbreak { background: #fdecea; border: 2px solid #c0392b; border-radius: 10px; padding: 10px 12px; margin: 8px 0 10px; color: #641e16; }
.dealbreak b { font-size: 16px; }
.dealbreak ul { margin: 6px 0 4px 18px; padding: 0; }
.dealbreak li { margin: 2px 0; font-weight: 600; }
.fs-miss { background: #fff8e1; border-radius: 8px; padding: 6px 10px; }
.report-btn.quiet { background: #fff; color: var(--accent); border: 1px solid var(--accent); }

/* Listing card (owner, Oct 21, 2026) */
.listing-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.lc-price { font-size: 1.5rem; font-weight: 800; }
.lc-head { font-weight: 600; margin-bottom: 6px; }
.lc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lc-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.lc-row span { color: var(--muted); }
.lc-hist summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin-top: 8px; color: var(--accent); }
.lc-agent { margin: 8px 0 2px; }
@media (max-width: 560px) { .lc-grid { grid-template-columns: 1fr; } }
/* "Top for you" joined the bar (Oct 21, 2026): a little tighter on narrow phones so Sign in still fits at 375 px */
@media (max-width: 420px) {
  .topbar .ghost, .topbar .acct-btn { padding: 5px 5px; }
  .topbar a.ghost { margin-right: 0 !important; }
  .topbar { gap: 3px; padding: 0 6px; }
  .topbar .brand { font-size: .76rem; }   /* room for "My profile" and a saved count */
}
/* A property opened from the list covers the list, with a pinned way back (Oct 21, 2026) */
.back-to-list { display: none; }
.panel.detail-over > #fitResult, .panel.detail-over > #savedCard, .panel.detail-over > #areaCard { display: none; }
.panel.detail-over > .back-to-list { display: block; position: sticky; top: -34px; z-index: 3; margin: -34px -14px 4px; width: calc(100% + 28px); padding: 12px 48px 10px 14px; text-align: left;
  font: inherit; font-weight: 700; color: var(--accent); background: var(--panel); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.panel.detail-over > #scoreResult { animation: lc-slide .18s ease-out; }
@keyframes lc-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* What holds it back: every reason a property scores lower, in a few words (Oct 21, 2026) */
.held { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf2; }
.held > b { display: block; margin-bottom: 4px; }
.held ul { margin: 0; padding-left: 18px; }
.held li { margin: 3px 0; font-size: .88rem; line-height: 1.35; overflow-wrap: anywhere; }
.held li.h-crit { color: #a32020; font-weight: 700; }
.held li.h-warn { color: #7a4a00; }
.held .h-tag { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 0 5px; background: var(--accent-soft); color: var(--accent); }
.held li.h-cat .h-tag { background: #f3e1c4; color: #7a4a00; }
.held p { margin: 6px 0 0; }
/* Email first: the welcome window (Oct 21, 2026) */
dialog.email-gate { border: 0; border-radius: 14px; padding: 0; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
dialog.email-gate::backdrop { background: rgba(20, 30, 20, .55); }
.eg-form { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 16px; }
.eg-form h2 { margin: 0; font-size: 1.25rem; }
.eg-form p { margin: 0; }
.eg-form input:not(.hp) { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 1rem; }
.eg-form .hp { position: absolute; left: -9999px; }
.eg-go { padding: 12px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
/* Preferences v2 (specs/preferences-v2.md): details, top 3, live count, one question per screen on phones */
.fit-adv > summary { cursor: pointer; list-style-position: outside; }
.fit-adv[open] > summary { margin-bottom: 6px; }
.fit-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fit-chips label { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 18px; padding: 5px 10px; font-size: .88rem; cursor: pointer; background: #fff; }
.fit-chips label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.fit-count { margin: 10px 0; padding: 9px 12px; border-radius: 9px; background: var(--accent-soft); font-size: .9rem; line-height: 1.35; }
.fit-count:empty { display: none; }
.fit-count.few { background: #fdf0dc; }
.fit-steps { display: none; }
@media (max-width: 640px) {
  #fitForm.stepper > .fit-q:not(.fs-on), #fitForm.stepper > .fit-section, #fitForm.stepper > .fit-need { display: none; }
  #fitForm.stepper:not(.fs-last) > .fit-submit { display: none; }
  #fitForm.stepper .fit-steps { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; bottom: 0; background: var(--panel, #fff); padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 12px; }
  #fitForm.stepper .fit-steps button { min-width: 96px; padding: 10px 14px; font-size: 1rem; }
  #fitForm.stepper .fs-n { font-size: .85rem; color: var(--muted, #666); }
  #fitForm.stepper > .fit-q.fs-on { min-height: 40vh; }
}
#fitForm.stepper .fit-steps [data-go="1"] { background: var(--accent); color: #fff; border: 0; border-radius: 9px; font-weight: 700; }
#fitForm.stepper .fit-steps [data-go="-1"]:disabled { visibility: hidden; }
.fit-sub-q { margin: 10px 0; }
.fit-sub-q .fit-row { flex-wrap: wrap; }
