/* Deal Run v2 — dark-first, Deal Run look: DM Serif Display headings, Inter body, #5266eb accent. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/fonts/inter-latin.woff2) format("woff2"); }
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/dm-serif-display-400.woff2) format("woff2"); }

:root {
  --bg: #0f0f0f; --bg-card: #1b1b1d; --bg-raised: #242428; --text: #e5e7eb; --text-2: #c4c7cf; --text-3: #9ca3af; --muted: #6b7280;
  --accent: #6b7dff; --accent-strong: #5266eb; --accent-bg: rgba(82,102,235,0.18); --border: #2c2c30; --border-light: #232326;
  --green: #4ade80; --green-bg: rgba(22,163,74,0.18); --amber: #fbbf24; --amber-bg: rgba(217,119,6,0.18); --red: #f87171; --red-bg: rgba(220,38,38,0.18);
  --blue: #60a5fa; --blue-bg: rgba(37,99,235,0.18); --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 3px rgba(0,0,0,0.4);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { html[data-theme="auto"] {
  --bg: #f8f9fb; --bg-card: #ffffff; --bg-raised: #f3f4f6; --text: #272735; --text-2: #535461; --text-3: #6b7280; --muted: #8b8d9a;
  --accent: #5266eb; --accent-strong: #4254d4; --accent-bg: rgba(82,102,235,0.08); --border: #e2e5ea; --border-light: #f0f2f5;
  --green: #166534; --green-bg: #dcfce7; --amber: #92400e; --amber-bg: #fef3c7; --red: #991b1b; --red-bg: #fee2e2; --blue: #1e40af; --blue-bg: #dbeafe;
  --shadow: 0 1px 3px rgba(0,0,0,0.06); color-scheme: light; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font: 15px/1.45 "Inter", -apple-system, system-ui, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
main { padding: 10px 16px 64px; max-width: 760px; margin: 0 auto; }
h1, h2, .brand { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; letter-spacing: 0; }
h1 { font-size: 1.45rem; line-height: 1.15; margin: 8px 0 6px; }
h2 { font-size: 1.08rem; margin: 18px 0 6px; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.tiny { font-size: .74rem; }
.sub { font-size: .84rem; color: var(--text-3); margin: 2px 0 8px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(15,15,15,.92); backdrop-filter: blur(10px); z-index: 5; }
.top .brand { font-size: 1.25rem; color: var(--text); }
.top nav { display: flex; gap: 16px; align-items: center; }
.top nav a { color: var(--text-3); font-weight: 500; font-size: .95rem; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0; background: var(--bg-card); box-shadow: var(--shadow); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.kv div:nth-child(odd) { color: var(--text-3); }
.kv div:nth-child(even) { font-weight: 500; text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--bg-raised); color: var(--text-2); white-space: nowrap; }
.pill.new { background: var(--blue-bg); color: var(--blue); } .pill.initial_take { background: var(--amber-bg); color: var(--amber); }
.pill.underwritten { background: rgba(139,92,246,.18); color: #c4b5fd; } .pill.priced { background: var(--green-bg); color: var(--green); }
.pill.buy_contract, .pill.sell_contract { background: var(--amber-bg); color: var(--amber); }
.pill.sold, .pill.listed, .pill.closed { background: var(--green-bg); color: var(--green); } .pill.dead { background: var(--red-bg); color: var(--red); } .pill.archived { background: var(--bg-raised); color: var(--text-3); }
.list a.item, .list .item { display: block; padding: 10px 2px; border-bottom: 1px solid var(--border-light); color: inherit; }
.list a.item:hover { text-decoration: none; background: rgba(255,255,255,.02); }
.list a.item .addr { font-weight: 600; font-size: .98rem; }
.list .meta { font-size: .8rem; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=tel], input[type=number], input[type=email], input[type=search], input[type=url], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 60px; }
label { display: block; font-size: .78rem; color: var(--text-3); margin: 8px 0 3px; font-weight: 500; }
button, .btn { padding: 8px 13px; border-radius: var(--radius-sm); font-size: .9rem; line-height: 1.3; border: 1px solid var(--accent-strong); background: var(--accent-strong); color: #fff; cursor: pointer; display: inline-block; font-weight: 600; }
button:hover, .btn:hover { background: var(--accent); text-decoration: none; }
/* a tap on a button's words is a tap on the button (Nov 5: iPhone Safari caught the address in "Add … as a new deal" and offered another app) */
button, .btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button * { pointer-events: none; }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); border-color: var(--border); }
button.secondary:hover, .btn.secondary:hover { background: var(--accent-bg); }
button.link { background: none; border: none; color: var(--text-3); padding: 0; font-weight: 500; }
button.danger { background: transparent; color: var(--red); border-color: var(--border); }
form.inline { display: inline; }
.error { color: var(--red); }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.card.warn { border-color: rgba(217,119,6,.5); background: var(--amber-bg); color: var(--text); }
img.sv { width: 100%; border-radius: var(--radius); display: block; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); display: block; background: var(--bg-raised); }
.photos .flag { position: absolute; top: 5px; left: 5px; font-size: .68rem; font-weight: 600; background: rgba(220,38,38,.92); color: #fff; padding: 2px 7px; border-radius: 6px; }
.photos .mms { background: rgba(217,119,6,.92); }
.photos .tools { display: flex; gap: 4px; margin-top: 3px; }
.photos .tools button { padding: 3px 7px; font-size: .7rem; }
.photos figcaption { font-size: .72rem; color: var(--text-3); margin-top: 2px; }
.photos a.nothumb { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--text-3); font-size: .78rem; text-align: center; padding: 4px; }
.msg { padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.msg .who { font-size: .78rem; color: var(--text-3); margin-bottom: 2px; }
.msg.out .who::before { content: "→ "; }
.big { font-size: 1.6rem; letter-spacing: .25em; text-align: center; font-weight: 600; }
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px 14px; text-align: center; color: var(--text-3); background: var(--bg-raised); }
.drop.active { border-color: var(--accent); color: var(--accent); }
.drop strong { color: var(--text); font-size: 1.05rem; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
ul.files { list-style: none; padding: 0; margin: 8px 0; font-size: .86rem; }
ul.files li { padding: 5px 0; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; gap: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .84rem; }
td, th { text-align: left; padding: 6px 5px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
th { color: var(--text-3); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.hero-number { font-family: "DM Serif Display", Georgia, serif; font-size: 1.6rem; }
.stat { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-raised); min-width: 90px; }
.stat .v { font-weight: 600; font-size: 1.05rem; } .stat .k { color: var(--text-3); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.comp.selected { background: var(--accent-bg); border-radius: var(--radius-sm); }
.btn.active { background: var(--accent-bg); border-color: var(--accent); }

/* comps page */
.sticky-map { position: sticky; top: 46px; z-index: 4; background: var(--bg); padding-bottom: 4px; margin: 6px -16px 0; padding-left: 16px; padding-right: 16px; }
#map { height: 38vh; min-height: 220px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.selbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; padding: 6px 2px 0; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.selbar > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.small-btn { padding: 5px 11px; font-size: .82rem; }
.filters { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; margin: 6px -16px 2px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters > * { flex: none; }
.filters select { width: auto; padding: 4px 24px 4px 8px; font-size: .8rem; border-radius: 999px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; font-size: .78rem; color: var(--text-2); background: var(--bg-card); cursor: pointer; white-space: nowrap; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); color: var(--text); }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip .dot { margin-right: 0; }
.chip input { margin: 0; accent-color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.active { background: #16a34a; } .dot.pending { background: #f59e0b; } .dot.sold { background: #dc2626; }
.ghead { font-size: .95rem; margin: 12px 0 4px; font-family: Inter, system-ui, sans-serif; font-weight: 600; }
.ccard { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; margin: 4px 0; background: var(--bg-card); cursor: pointer; font-size: .9rem; }
.ccard .l2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.ccard .l2 .small { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }   /* one line, scroll sideways for the rest */
.ccard .l2 .small::-webkit-scrollbar { display: none; }
.ccard .l2 > a { flex: none; white-space: nowrap; margin-left: 8px; }
.ccard input.pick { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.pagehead .tiny { line-height: 1.25; }
.ccard.selected { border-color: var(--accent); background: var(--accent-bg); }
.ccard.focus { outline: 2px solid var(--accent); }
.gm-card { color: #111; font: 13px/1.4 Inter, system-ui, sans-serif; max-width: 260px; }
.gm-card .ccard { border: none; background: transparent; padding: 0; margin: 0; cursor: default; }
.gm-card .muted { color: #555; } .gm-card strong { color: #111; }
.popover { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.popover[hidden] { display: none; }
.popover-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.popover iframe { flex: 1; border: 0; background: #fff; }
.xbtn { font-size: 1.6rem; line-height: 1; padding: 4px 12px; background: transparent; border: 1px solid var(--border); color: var(--text); }
/* upload rows */
ul.files li { display: block; }
.frow { display: flex; justify-content: space-between; gap: 8px; }
.fbar { height: 4px; background: var(--border-light); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.fbar div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.factors { display: grid; gap: 4px; }
.factor { display: grid; grid-template-columns: 100px 1fr auto; gap: 8px; align-items: center; font-size: .82rem; }
.factor .segs i { display: inline-block; width: 16px; height: 8px; margin-right: 2px; border-radius: 2px; background: var(--border); }
.factor .segs i.on { background: var(--accent); }
.presets { display: grid; gap: 6px; margin-bottom: 10px; }
.preset-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preset-row .pl { font-size: .9rem; }
.assume label { margin-top: 8px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* deal page: pinned one-line address + section nav, tighter vertical rhythm */
.deal-head { position: sticky; top: 46px; z-index: 6; background: var(--bg); margin: 0 -16px; padding: 6px 16px 0; border-bottom: 1px solid var(--border); }
.deal-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.deal-title .back { color: var(--text-3); font-size: 1.1rem; flex: none; }
.deal-title .addr1 { font-family: Inter, system-ui, sans-serif; font-weight: 600; font-size: 1.02rem; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.deal-title .pill { flex: none; }
.secnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 6px 0 0; }
.secnav::-webkit-scrollbar { display: none; }
.secnav a { flex: none; padding: 6px 10px; border-radius: 8px 8px 0 0; color: var(--text-3); font-size: .86rem; font-weight: 500; border-bottom: 2px solid transparent; }
.secnav a.on { color: var(--text); border-bottom-color: var(--accent); }
.secnav a:hover { text-decoration: none; color: var(--text); }
.top { padding: 8px 16px; }
h2 { margin: 16px 0 6px; font-size: 1.1rem; scroll-margin-top: 110px; }
.card { padding: 10px 12px; margin: 6px 0; }
.kv { gap: 4px 12px; }
label { margin: 8px 0 3px; }
img.sv { max-height: 42vh; object-fit: cover; }
main { padding-top: 6px; }
.msg { padding: 6px 0; }

/* deal page: one-line action row, right-aligned refresh icon, section headers with a right-side action */
.actrow { display: flex; gap: 8px; align-items: center; margin: 8px 0 2px; }
.actrow .btn { padding: 7px 12px; font-size: .86rem; flex: none; }
.actrow form.inline { margin-left: auto; }
.iconbtn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); color: var(--accent); border-radius: 10px; }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn:hover { background: var(--accent-bg); }
h2.h2row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
h2.h2row .small { font-weight: 500; }
.kv .one { white-space: nowrap; }
/* Adam's take: compact form */
.take label { margin: 6px 0 2px; font-size: .78rem; }
.take input[type=text], .take select, .take textarea { padding: 7px 10px; }
.take textarea { min-height: 38px; height: 38px; resize: none; overflow: hidden; line-height: 1.4; }
.take .grid2 { gap: 0 10px; }
.take .save { margin-top: 10px; }
/* paste-a-link box */
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.linkbox input { flex: 1; min-width: 0; padding: 8px 10px; }
.linkbox button { padding: 8px 12px; font-size: .86rem; flex: none; }

/* segmented pill control (Sale | Rent, etc.) */
.seg { display: inline-flex; background: var(--bg-raised); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 5px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--text-3); border: 0; background: transparent; line-height: 1.3; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg .on { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow); }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 2px; }
.pagehead h1 { margin: 0; }
.backlink { font-size: .8rem; color: var(--text-3); display: block; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oneline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 1; }
.search input { padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.notice { font-size: .84rem; padding: 7px 11px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); margin: 4px 0 8px; }
.notice a { color: inherit; text-decoration: underline; }
details.roles summary { cursor: pointer; font-size: .84rem; color: var(--text-3); padding: 4px 0; }
.cell-nowrap { white-space: nowrap; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ---- round 7: one font family for headings and body (brand wordmark keeps the serif) */
h1, h2 { font-family: Inter, system-ui, sans-serif; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1rem; margin: 18px 0 6px; }
.ghead { font-size: .92rem; }
/* top bar: hamburger menu, address in the bar on deal pages */
.top .bar-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.top .bar-title .back { color: var(--text-3); font-size: 1.1rem; flex: none; }
.top .bar-title .addr1 { font-weight: 600; font-size: .95rem; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.menu { position: relative; flex: none; }
.menu summary { list-style: none; cursor: pointer; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--text-2); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: var(--bg-raised); }
.menu summary svg { width: 20px; height: 20px; }
.menu-list { position: absolute; right: 0; top: 40px; min-width: 170px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.45); padding: 6px; z-index: 20; display: grid; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .92rem; background: none; border: 0; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg-raised); text-decoration: none; }
.menu-list .sep { border-top: 1px solid var(--border-light); margin: 4px 0; }
.menu-list .hint { font-size: .72rem; color: var(--muted); padding: 2px 12px 6px; }
.deal-head { padding-top: 0; }
.deal-head .deal-title { display: none; }
.secnav { padding-top: 2px; }
/* popups (flood map, owner history) and the photo viewer */
.pop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.pop[hidden] { display: none; }
.pop-card { width: 100%; max-width: 760px; max-height: 92vh; background: var(--bg); border-radius: 16px 16px 0 0; border: 1px solid var(--border); display: flex; flex-direction: column; }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.pop-body { padding: 12px 14px 20px; overflow: auto; }
.flood-map { height: 62vh; min-height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #111; }
.viewer { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; color: #eee; }
.viewer[hidden] { display: none; }
.viewer-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; }
.viewer-head .oneline { flex: 1; }
.viewer-head .xbtn { color: #fff; border-color: #333; }
.viewer-track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track .slide { flex: none; width: 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.viewer-track img, .viewer-track video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-foot { display: flex; justify-content: center; gap: 22px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.viewer-foot .link { color: #bbb; } .viewer-foot .danger-text { color: var(--red); }
.photos figure a.ph { display: block; }
/* analyze progress */
.progress-box { margin-top: 8px; }
.progress-box progress { height: 6px; }
.progress-box .msg { font-size: .84rem; color: var(--text-3); margin-top: 4px; }
/* owner / mortgage popup tables */
.pop-body table td, .pop-body table th { padding: 5px 4px; }
.pop-body .reason { font-size: .84rem; color: var(--text-2); margin: 6px 0 10px; }

/* exits rows */
.xrows { display: grid; gap: 6px; margin-top: 10px; }
.xrow { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-raised); align-items: baseline; }
.xrow .xv { font-weight: 600; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.xrow .xd { grid-column: 1 / -1; font-size: .78rem; color: var(--text-3); margin-top: 1px; }
.assume label output { float: right; color: var(--text); font-weight: 600; }
.assume input[type=range] { margin: 2px 0 4px; }

/* spec rows: labels never wrap; long values wrap on the right */
.kv { grid-template-columns: max-content minmax(0, 1fr); }
.kv div:nth-child(even) { overflow-wrap: anywhere; }

/* ---- marketing package (Clarity port) */
.pubgrid { display: grid; gap: 8px; }
.fields { display: grid; gap: 6px; }
.field { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; cursor: pointer; background: var(--bg-raised); }
.field:hover { border-color: var(--accent); }
.field.copied { border-color: var(--green); }
.field .fl { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.field .fv { font-size: .88rem; white-space: pre-wrap; max-height: 5.5em; overflow: hidden; text-overflow: ellipsis; word-break: break-word; }
.photos.gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.photos.gallery figure img { aspect-ratio: 4 / 3; }

/* ---- desktop: the same pages, wider, with side-by-side sections where it helps (Adam: "guys on a full browser too") */
@media (min-width: 900px) {
  main { max-width: 1120px; padding: 16px 28px 72px; }
  .top { padding: 10px 28px; }
  .top .addr1 { font-size: 1.05rem; }
  .deal-head { margin: 0 -28px; padding: 0 28px; }
  .secnav a { font-size: .9rem; padding: 8px 14px; }
  /* deal page: two columns from Specs down to Exits; photos, repairs and thread span the full width */
  .deal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .deal-cols > .col { min-width: 0; }
  img.sv { max-height: 46vh; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .photos.gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .viewer-foot { gap: 32px; }
  .pop { align-items: center; }
  .pop-card { border-radius: 16px; max-width: 920px; max-height: 88vh; }
  .flood-map { height: 64vh; }
  /* comps: map on the left stays put, list scrolls on the right */
  .comps-cols { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; gap: 20px; align-items: start; }
  .comps-cols .sticky-map { position: sticky; top: 70px; margin: 0; padding: 0; }
  .comps-cols #map { height: calc(100vh - 170px); min-height: 420px; }
  .filters { margin: 6px 0 2px; padding: 0; flex-wrap: wrap; overflow: visible; }
  /* marketing: the two platform columns side by side; description boxes taller */
  .pubgrid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .field .fv { max-height: 7em; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .list a.item { padding: 12px 6px; }
  .list a.item .addr { font-size: 1.05rem; }
  .xrow { padding: 10px 14px; }
  .take .grid2, .assume .grid2 { grid-template-columns: repeat(4, 1fr); }
  .kv { font-size: .95rem; }
  .menu-list { min-width: 200px; }
  table { font-size: .9rem; }
}
@media (min-width: 1200px) {
  main { max-width: 1240px; }
}

.take textarea.tall { height: auto; min-height: 260px; overflow: auto; resize: vertical; }
.take textarea.tall.short { min-height: 120px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }

/* ---- deal hero: swipeable cover + photos, upload button on the image */
.hero { position: relative; margin: 6px 0 8px; border-radius: var(--radius); overflow: hidden; background: var(--bg-raised); }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; height: min(46vh, 75vw); }
.hero-track::-webkit-scrollbar { display: none; }
.hslide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; position: relative; cursor: pointer; overflow: hidden; }
.hslide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hslide.sv { cursor: default; }
.hslide.empty { display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.hbadge { position: absolute; left: 10px; bottom: 10px; font-size: .7rem; font-weight: 600; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 6px; }
.hnav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 1.6rem; line-height: 1; padding: 0 0 3px; display: none; }
.hnav.prev { left: 8px; } .hnav.next { right: 8px; }
.hero:hover .hnav { display: block; }
@media (hover: none) { .hnav { display: none !important; } }
.hcount { position: absolute; right: 10px; bottom: 10px; font-size: .72rem; font-weight: 600; background: rgba(0,0,0,.55); color: #fff; padding: 2px 8px; border-radius: 999px; }
.hero-upload { position: absolute; top: 10px; right: 10px; padding: 6px 11px; font-size: .82rem; background: rgba(15,15,15,.75); border-color: rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(6px); }
.hero-upload:hover { background: var(--accent-strong); }
.secnav .navright { margin-left: auto; align-self: center; }
.iconbtn.sm { width: 30px; height: 30px; border-radius: 8px; }
.iconbtn.sm svg { width: 15px; height: 15px; }
@media (min-width: 900px) { .hero-track { height: min(52vh, 560px); } }

/* ---- comps page (round 13) */
.ctoolbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ctoolbar::-webkit-scrollbar { display: none; }
.ctoolbar > * { flex: none; }
.ctl { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: .78rem; color: var(--text-3); }
.ctl select { width: auto; padding: 4px 22px 4px 8px; font-size: .8rem; border-radius: 999px; }
.maptools { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.maptools .tool { width: 34px; height: 34px; padding: 0; border-radius: 9px; background: rgba(15,15,15,.82); border: 1px solid rgba(255,255,255,.2); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.maptools .tool svg { width: 18px; height: 18px; }
.maptools .tool.on { background: var(--accent-strong); border-color: var(--accent-strong); }
.sticky-map { position: relative; top: auto; }
.sticky-map #map { position: relative; }
.arvbar { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; padding: 6px 2px 2px; }
.arvbar label { margin: 0; font-size: .78rem; }
.arvbar input, .arvbar textarea { padding: 7px 10px; font-size: .9rem; }
.arvbar textarea { min-height: 38px; resize: none; overflow: hidden; }
.arvbar .tiny { grid-column: 1 / -1; min-height: 1em; }
.ccard { display: flex; gap: 10px; align-items: flex-start; }
.ccard .cthumb { flex: none; width: 72px; height: 54px; border-radius: 7px; overflow: hidden; background: var(--bg-raised); display: flex; align-items: center; justify-content: center; }
.ccard .cthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard .cthumb { position: relative; }
.poolb { position: absolute; left: 3px; bottom: 3px; width: 17px; height: 17px; border-radius: 50%; background: #0ea5e9; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35); pointer-events: none; z-index: 1; }
.mappop .poolb { left: 8px; bottom: 8px; width: 22px; height: 22px; }
.mappop .poolb svg { width: 14px; height: 14px; }
.ccard .cbody { flex: 1; min-width: 0; }
.ccard input.pick { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.gm-card { max-width: 240px; }
.gm-card .gm-photo { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; display: block; }

.cmini { display: block; color: inherit; background: var(--bg-raised); border-radius: var(--radius-sm); padding: 6px; }
.cmini:hover { text-decoration: none; outline: 1px solid var(--accent); }
.cmini .cthumb { width: 100%; height: 86px; border-radius: 6px; overflow: hidden; background: var(--bg-card); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.cmini .cthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmini .cm1 { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
@media (min-width: 900px) { .ctoolbar { flex-wrap: wrap; overflow: visible; } .sticky-map { position: sticky; top: 64px; } }

/* ---- repairs: one row per section, uniform controls, inline amounts */
.rtable { display: grid; gap: 4px; }
.rrow { display: grid; grid-template-columns: minmax(84px, 1.1fr) minmax(104px, 1fr) 100px 22px; gap: 6px; align-items: center; }
.rrow .rl { font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .rlabel { padding: 6px 8px; font-size: .88rem; }
.rrow select.rscope { width: 100%; padding: 6px 20px 6px 7px; font-size: .82rem; }
.rrow .ramt { width: 100%; padding: 6px 7px; text-align: right; font-size: .88rem; }
.rrow .ra { text-align: right; }
.rrow .rx { background: none; border: 0; color: var(--text-3); font-size: 1.1rem; padding: 0; width: 24px; height: 28px; }
.rrow .rx:hover { color: var(--red); }
.rrow.rtotal { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }
.assume-details summary { cursor: pointer; padding: 6px 0; list-style: none; }
.assume-details summary::-webkit-details-marker { display: none; }
.assume-details summary::before { content: "▸ "; color: var(--text-3); }
.assume-details[open] summary::before { content: "▾ "; }
@media (min-width: 900px) { .rrow { grid-template-columns: 1.4fr 1fr 130px 28px; } }

/* ---- round 14: no iOS zoom on inputs (16px minimum on phones), tighter comps bar, collapsible groups */
@media (max-width: 899px) { input, select, textarea { font-size: 16px !important; } .rrow .ramt, .rrow select.rscope, .arvbar input, .arvbar textarea { font-size: 16px !important; } }
.arvbar { padding: 4px 2px 0; gap: 4px 8px; }
.arvbar .tiny { grid-column: 2; min-height: 0; margin-top: -2px; }
.sticky-map { padding-bottom: 0; }
.list-col .filters { margin-top: 4px; }
.ghead { cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none; }
.ghead .caret { margin-left: auto; color: var(--text-3); font-size: .9rem; }
.ghead.off { opacity: .75; }
a.dom { color: inherit; text-decoration: underline dotted; }

.maptools .tool[hidden] { display: none; }
.maptools .tool.done { width: auto; padding: 0 12px; font-size: .84rem; font-weight: 600; background: var(--accent-strong); border-color: var(--accent-strong); }

/* photo strips (deal page picked comps + the map popup): swipe sideways, × and counter over the picture */
.pwrap { position: relative; display: block; color: inherit; }
.pwrap:hover { text-decoration: none; }
.pstrip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--bg-raised); height: 150px; -webkit-overflow-scrolling: touch; }
.pstrip::-webkit-scrollbar { display: none; }
.pstrip img, .pstrip .pmiss { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; display: block; }
.pstrip .pmiss::after { content: ''; display: block; width: 12px; height: 12px; border-radius: 50%; background: #dc2626; margin: 69px auto 0; }
.pcount { position: absolute; right: 8px; bottom: 8px; font-size: .7rem; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; pointer-events: none; }
.pcount[hidden] { display: none; }
.pclose { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 1.15rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.crow { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -6px; padding: 0 6px 4px; }
.crow::-webkit-scrollbar { display: none; }
.crow .cmini { flex: none; width: min(78vw, 300px); scroll-snap-align: start; padding: 0 0 8px; overflow: hidden; }
.crow .cmini .pstrip { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.crow .cmini .cm1, .crow .cmini .tiny { padding: 0 8px; }
.crow .cmini .cm1 { margin-top: 6px; }
.mapwrap { position: relative; }
.mappop { position: absolute; left: 10px; right: 10px; bottom: 10px; max-width: 320px; z-index: 3; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.mappop[hidden] { display: none; }
.mappop .pstrip { height: 124px; }
.mappop .mp-body { padding: 8px 10px 10px; font-size: .84rem; line-height: 1.35; }
.mappop .mp-body .muted { color: var(--text-2); }
@media (min-width: 900px) { .crow .cmini { width: 240px; } .mappop { max-width: 300px; } }

.xmath { margin-top: 4px; font-size: .78rem; } .xmath summary { color: var(--accent); cursor: pointer; } .xmath table { margin-top: 4px; border-collapse: collapse; width: 100%; max-width: 360px; } .xmath td { padding: 2px 0; color: var(--text-2); } .xmath td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .xmath tr.sum td { border-top: 1px solid var(--border); font-weight: 600; color: var(--text); padding-top: 4px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 0 16px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: none; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2); font-size: .82rem; }
.chips .chip.on { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.chips .chip:hover { text-decoration: none; }
.intake textarea { max-height: 170px; overflow: auto !important; resize: none; }

.editrow td { border-bottom: 1px solid var(--border-light); padding: 0 5px 8px; }
.editrow:has(+ tr:not(.editrow)) td { }
.pedit { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.pedit input, .pedit select { padding: 5px 8px; font-size: .8rem; min-height: 0; width: auto; flex: 1 1 110px; }
.pedit select { flex: 0 1 auto; }
.pedit > span { display: flex; gap: 2px 8px; align-items: center; flex: 0 0 auto; }
.pedit .small-btn { padding: 4px 9px; font-size: .78rem; }
tr:has(+ .editrow) td { border-bottom: none; padding-bottom: 2px; }

/* comps: the subject's facts stay pinned under the top bar while the list scrolls */
.subjbar { position: sticky; top: 46px; z-index: 6; display: flex; align-items: center; gap: 8px; margin: 0 -16px 6px; padding: 6px 16px; background: rgba(15,15,15,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); font-size: .82rem; color: var(--text-2); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.subjbar::-webkit-scrollbar { display: none; }
.subjbar .sl { color: var(--accent); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; flex: none; }
.subjbar .sf strong { color: var(--text); font-weight: 600; }
.subjbar .sa { margin-left: auto; flex: none; color: var(--text); font-weight: 600; }
@media (min-width: 900px) { .subjbar { margin: 0 0 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); } }

.hlook { position: absolute; right: 10px; bottom: 10px; padding: 6px 11px; font-size: .82rem; font-weight: 600; line-height: 1.3; font-family: inherit; border-radius: var(--radius-sm); background: rgba(15,15,15,.75); border: 1px solid rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(6px); }   /* same look as Upload photos */
.hlook:hover { background: var(--accent-strong); }
.svpop { display: flex; flex-direction: column; gap: 6px; }
.sv-pano { height: 52vh; min-height: 260px; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.sv-map { height: 26vh; min-height: 160px; border-radius: var(--radius-sm); overflow: hidden; }
.maplink { color: inherit; } .maplink:hover { text-decoration: underline; }
@media (min-width: 900px) { .sv-pano { height: 56vh; } .sv-map { height: 24vh; } }

.share textarea { width: 100%; min-height: 96px; resize: vertical; }
.sharelist { display: grid; gap: 4px; margin-top: 4px; }
.shareitem { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-raised); font-size: .9rem; cursor: pointer; }
.shareitem input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.secnav .navright + form { margin-left: 4px; }

/* deal page head: the nav scrolls, the share/refresh icons stay pinned at the right */
.headrow { display: flex; align-items: stretch; gap: 6px; }
.headrow .secnav { flex: 1 1 auto; min-width: 0; }
.navicons { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 0 4px 8px; background: linear-gradient(90deg, transparent, var(--bg) 25%); }
.navicons form { margin: 0; }

.viewer-foot button[hidden] { display: none; }

/* specs: the short facts in two columns, the long rows below full width */
.specgrid { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 6px 12px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.specgrid .sc { display: flex; flex-direction: column; gap: 1px; }
.specgrid .k { font-size: .72rem; color: var(--text-3); }
.specgrid .v { font-weight: 600; }
.inline-select { width: auto; height: 30px; min-height: 0; padding: 0 24px 0 8px; font-size: .9rem; line-height: 28px; }

.ask { display: inline; padding: 0 2px; margin: 0; border: 0; background: none; color: var(--amber); font-weight: 700; font-size: 1em; line-height: 1; cursor: pointer; vertical-align: top; }
.asknote { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--amber-bg); color: var(--amber); font-size: .72rem; font-weight: 500; vertical-align: middle; white-space: nowrap; }

/* a picture that is still arriving: spinner over the strip, instead of a blank or a broken-image icon */
.pwrap.loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: drspin .8s linear infinite; pointer-events: none; z-index: 1; }
@keyframes drspin { to { transform: rotate(360deg); } }

.specgrid.edit .sc input, .specgrid.edit .sc select { padding: 6px 8px; min-height: 0; font-size: 1rem; width: 100%; }
.specgrid.edit { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
