:root {
  --bg: #0f1216;
  --panel: #171c23;
  --panel2: #1e252e;
  --border: #2a333f;
  --text: #e6ebf2;
  --muted: #8b97a7;
  --accent: #4f8cff;
  --accent2: #2f6fe0;
  --green: #35c07f;
  --amber: #f0a93b;
  --red: #ef5b6b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--red); min-height: 18px; margin: 6px 0 0; }
button { cursor: pointer; font: inherit; }
a { color: var(--accent); }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; width: 360px; max-width: 100%;
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
#auth-form { display: grid; gap: 10px; margin-top: 14px; }
input, select, textarea {
  background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 9px 11px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }

button.primary { background: var(--accent2); color: #fff; border: none; border-radius: 8px; padding: 9px 14px; }
button.primary:hover { background: var(--accent); }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 12px; }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
a.ghost { text-decoration: none; display: inline-block; }

/* Tabs */
.tabs { display: flex; gap: 4px; }
.tabs.small { margin: 12px 0; }
.tab {
  background: transparent; border: none; color: var(--muted);
  padding: 8px 12px; border-radius: 8px;
}
.tab.active { background: var(--panel2); color: var(--text); }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; }
.topbar nav { flex: 1; }
/* User dropdown menu */
.user-menu-wrap { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 10px; cursor: pointer; color: var(--text); font-size: 13px;
  transition: border-color .12s;
}
.user-trigger:hover { border-color: var(--accent); }
.user-trigger .badge { font-size: 10px; }
#user-email { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chevron { color: var(--muted); font-size: 10px; }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  min-width: 200px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.30);
  padding: 5px 0; overflow: hidden;
}
.udrop-item {
  display: flex; align-items: center; width: 100%;
  padding: 7px 14px; background: transparent; border: none;
  text-align: left; font-size: 13px; color: var(--text); cursor: pointer; gap: 8px;
  white-space: nowrap;
}
.udrop-item:hover { background: var(--panel2); }
.udrop-logout { color: var(--red); }
.udrop-sep { height: 1px; background: var(--border); margin: 4px 0; }
.udrop-ws-cur { color: var(--accent); font-weight: 600; }
.udrop-ws { font-size: 12px; padding: 5px 14px; color: var(--muted); }
.udrop-ws.udrop-ws-cur { color: var(--accent); }
.pw-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pw-form input { max-width: 220px; }

main { padding: 18px 24px; max-width: 100%; margin: 0 auto; }
.view { display: grid; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel h2 { margin: 0 0 8px; font-size: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; margin-top: 12px; transition: border-color .15s;
}
.dropzone.drag { border-color: var(--accent); background: rgba(79,140,255,.06); }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 130px; flex: 0 0 auto; }
.filters #f-q { flex: 1; min-width: 180px; }
.filters .f-num { width: 110px; min-width: 90px; }
#f-clear { align-self: center; }
.viewtoggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.viewtoggle button { border: none; border-radius: 0; padding: 6px 12px; background: transparent; }
.viewtoggle button.active { background: var(--panel2); color: var(--accent); }

/* AI job queue (admin) */
.jdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.jdot.run { background: var(--green); box-shadow: 0 0 6px var(--green); }
.jdot.paused { background: var(--muted); }
.jstatus { font-size: 12px; padding: 1px 8px; border-radius: 999px; text-transform: capitalize; }
.jstatus.s-queued { color: var(--muted); background: var(--panel2); }
.jstatus.s-running { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.jstatus.s-done { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.jstatus.s-failed { color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.jstatus.s-canceled { color: var(--muted); background: var(--panel2); }

/* Duplicate-APN banner */
.dupes-banner { margin: 0 0 10px; padding: 7px 10px; font-size: 12px; color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); border-radius: var(--radius); }

/* Alerts bell */
.bell-wrap { position: relative; margin-right: 8px; }
.bell-trigger { position: relative; background: transparent; border: none; font-size: 18px; cursor: pointer; padding: 4px 6px; line-height: 1; }
.bell-count { position: absolute; top: -2px; right: -4px; background: var(--red, #e5484d); color: #fff; font-size: 10px; font-weight: 700; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.bell-dropdown { position: absolute; right: 0; top: 34px; width: 320px; max-height: 400px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 50; padding: 8px; }
.bell-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bell-item { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.bell-item:hover { background: var(--panel2); }
.bell-item.unseen { border-left: 2px solid var(--accent); }

/* Auction calendar rows */
.auction-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px solid var(--border); }
.auction-row:last-child { border-bottom: none; }
.auction-row.soon .auction-date { color: var(--amber); font-weight: 600; }
.auction-row.muted { opacity: 0.55; }
.auction-date { min-width: 150px; }
.auction-file { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auction-date-inp { font-size: 12px; padding: 2px 4px; }

/* Bid tracking form */
.bid-form input, .bid-form select, .bid-form textarea { width: 100%; }
.bid-form textarea { min-height: 48px; resize: vertical; }

/* Comps market-anchor line */
.anchor-line { margin: 2px 0 8px; padding: 6px 9px; font-size: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); border-left: 2px solid var(--accent); border-radius: 4px; }
.anchor-line b { color: var(--text); }

/* Encumbrance/legal disclaimer callout */
.disclaimer { margin: 10px 0 2px; padding: 8px 10px; font-size: 12px; line-height: 1.4; color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); border-radius: var(--radius); }

/* Estimated-cost note under a key field (informational; prices are approximate) */
.keycost { font-size: 11px; color: var(--fg-muted); font-style: italic; margin-top: -2px; }
.keycost.pricey { color: var(--amber); font-style: normal; font-weight: 600; }

/* Map API key active/inactive indicator */
.keystate { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.keystate.on { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.keystate.off { color: var(--muted); background: var(--panel2); }

/* Detail investment-signal strip */
.signal-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sig { font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; }
.sig.pos { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.sig.neg { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); border-color: color-mix(in srgb, var(--amber) 32%, transparent); }

/* Map legend */
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 8px; font-size: 12px; color: var(--muted); }
.map-legend:empty { display: none; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1.5px rgba(255,255,255,.25); }
#map-colorby { margin-left: 4px; }

/* Import enrichment status */
.enrich-prog { display: inline-flex; align-items: center; gap: 6px; }
.enrich-bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.enrich-bar > span { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.epill { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.epill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.epill.bad { color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); }

/* List-view column chooser */
.colchooser { position: relative; display: inline-block; }
.colchooser-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 520px; max-width: 94vw; max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.32); padding: 10px 10px 6px;
  display: flex; flex-direction: column; gap: 0;
}
.colgroup { margin-bottom: 8px; }
.colgroup-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 2px 4px 4px; }
.colgroup { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-start; }
.colgroup-label { flex: 0 0 100%; }
.colchooser-menu .colopt { display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; border: 1px solid var(--border); background: var(--panel2); }
.colchooser-menu .colopt:hover { border-color: var(--accent); }
.colchooser-menu .colopt input { accent-color: var(--accent); }
.colchooser-menu .colopt-actions { border-top: 1px solid var(--border); margin-top: 6px; padding: 6px 4px 2px; text-align: right; }

/* Parcels list/table view */
.parcels.as-table { display: block; }
.ptable-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.plist { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
table.plist th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 7px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 2; }
table.plist th.sortable { cursor: pointer; user-select: none; }
table.plist th.sortable:hover { color: var(--text); }
table.plist td { padding: 5px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.plist tr:last-child td { border-bottom: none; }
table.plist tr.prow { cursor: pointer; }
table.plist tr.prow:hover td { background: var(--panel2); }
table.plist td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.plist td.mono { font-family: ui-monospace, monospace; font-size: 11px; }
table.plist td.dim { color: var(--muted); }
table.plist td.score { font-weight: 700; padding: 4px 8px; }
table.plist td.addrcell { white-space: normal; max-width: 160px; color: var(--muted); line-height: 1.3; }
table.plist td.tagcell { white-space: normal; max-width: 180px; }
table.plist .cbcell { width: 24px; padding: 5px 4px; }
table.plist .badge.sm { font-size: 9px; padding: 1px 5px; }
.score-pill { display: inline-block; min-width: 28px; text-align: center; font-size: 12px; font-weight: 700; padding: 1px 5px; border-radius: 5px; }
.score-pill.hi  { color: var(--green);  background: color-mix(in srgb, var(--green)  14%, transparent); }
.score-pill.mid { color: var(--amber);  background: color-mix(in srgb, var(--amber)  14%, transparent); }
.score-pill.lo  { color: var(--muted);  background: var(--panel2); }
.score-pill.nil { color: var(--muted);  background: transparent; }

/* Opportunity grade pill (A best … F worst) */
.grade-pill { display: inline-block; min-width: 22px; text-align: center; font-size: 12px; font-weight: 800; padding: 1px 6px; border-radius: 5px; letter-spacing: .3px; }
.grade-pill.grade-a { color: #fff; background: var(--green); }
.grade-pill.grade-b { color: var(--green);  background: color-mix(in srgb, var(--green) 16%, transparent); }
.grade-pill.grade-c { color: var(--amber);  background: color-mix(in srgb, var(--amber) 16%, transparent); }
.grade-pill.grade-d { color: var(--amber);  background: color-mix(in srgb, var(--amber) 10%, transparent); }
.grade-pill.grade-f { color: var(--muted);  background: var(--panel2); }
.grade-pill.grade-nil { color: var(--muted); background: transparent; }
.deal-head { display: flex; align-items: center; gap: 12px; }
.deal-nums { line-height: 1.35; }
.deal-nums b { font-size: 15px; }

/* Deals view */
.deals-f { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.deals-f select, .deals-f input { margin-left: 2px; }
.deal-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--panel); cursor: pointer; transition: border-color .12s, transform .12s; }
.deal-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.deal-grade { flex: 0 0 auto; }
.deal-body { flex: 1 1 auto; min-width: 0; }
.deal-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-econ { flex: 0 0 auto; text-align: right; }
.deal-equity { font-size: 18px; font-weight: 800; color: var(--green); }
.deals-mode button { border-radius: 0; }
.deals-mode button:first-child { border-radius: 7px 0 0 7px; }
.deals-mode button:last-child { border-radius: 0 7px 7px 0; border-left: none; }
.deals-mode button.active { background: var(--accent); color: #fff; }
.owner-card { border-left: 3px solid var(--accent); }
.county-card { border-left: 3px solid var(--amber); }
/* County snapshot-history timeline */
/* Owner portfolio KPI row */
.owner-kpis { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
.owner-kpis .qstat { min-width: 92px; }
.owner-kpis .qv { font-size: 18px; font-weight: 650; }
.county-history { margin-top: 8px; }
.chist-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.chist-table th, .chist-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.chist-table th.num, .chist-table td.num { text-align: right; }
.chist-table .chist-narr td { border-bottom: 1px solid var(--border); padding-top: 2px; line-height: 1.4; }

/* Parcel cards */
.parcels { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer; transition: border-color .12s;
}
.card:hover { border-color: var(--accent); }
.card { position: relative; }
.card-check { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.card .score { margin-right: 22px; }
#bulk-bar button.ghost { padding: 4px 8px; }
.card .apn { font-weight: 600; font-family: ui-monospace, monospace; }
.card .loc { color: var(--muted); font-size: 12px; }
.card .metrics { display: flex; gap: 14px; margin: 8px 0; font-size: 13px; }
.card .metrics b { color: var(--text); }
.enrich-line { margin: -2px 0 6px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.badge.cat { color: var(--accent); border-color: var(--accent); }
.badge.risk { color: var(--red); border-color: var(--red); }
.badge.tag { color: var(--green); border-color: var(--green); }
.score { float: right; font-weight: 700; }
.score.hi { color: var(--green); } .score.mid { color: var(--amber); } .score.lo { color: var(--muted); }

.flag-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.flag-investigate { background: rgba(240,169,59,.15); color: var(--amber); }
.flag-not_worth_it { background: rgba(239,91,107,.15); color: var(--red); }
.flag-cleared { background: rgba(53,192,127,.15); color: var(--green); }

/* Detail page */
.maps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 820px) { .maps-row { grid-template-columns: 1fr; } }
.map-pane { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.map-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
iframe.map { width: 100%; height: 200px; border: 0; display: block; }
#detail-map { height: 220px; width: 100%; }
.map.placeholder { height: 220px; }

/* Tabbed detail map */
.mapbox { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.maptabs { display: flex; flex-wrap: wrap; background: var(--panel2); border-bottom: 1px solid var(--border); }
.maptabs button { border: none; background: transparent; color: var(--muted); padding: 8px 14px; cursor: pointer; font-size: 13px; }
.maptabs button:hover { color: var(--text); }
.maptabs button.active { background: var(--panel); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.mapstage { height: 360px; }
.map-note { padding: 6px 10px; background: var(--panel2); border-top: 1px solid var(--border); }
.mapstage iframe.map, .mapstage #detail-map { height: 360px; }
#map { height: 70vh; min-height: 420px; border-radius: var(--radius); margin-top: 10px; }
.leaflet-popup-content { font: inherit; }
.leaflet-popup-content a { color: var(--accent2); }
.map.placeholder { display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 20px; height: 280px; }
.maps-row { margin-bottom: 12px; }
.map-pane { border-radius: var(--radius); }
.map-label { padding: 6px 10px 3px; }

/* Compact detail layout */
.detail-head-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.dh-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dh-left .apn { font-family: ui-monospace, monospace; font-weight: 700; font-size: 16px; }
.dh-right { display: flex; align-items: center; gap: 12px; }
.score-inline { font-weight: 700; }
.score-inline.hi { color: var(--green); } .score-inline.mid { color: var(--amber); } .score-inline.lo { color: var(--muted); }
.flag-icons { display: flex; gap: 6px; }
.flag-icons button { padding: 5px 10px; font-size: 15px; line-height: 1; }
.rationale-bar { margin: -4px 0 12px; padding: 0 2px; line-height: 1.5; }
/* Detail: grid of independently-tabbed boxes */
.detail-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .detail-boxes { grid-template-columns: 1fr; } }
.tbox { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; overflow: hidden; }
.tbox-maps { grid-column: 1 / -1; }
.tbox-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tbox-title { font-size: 13px; font-weight: 600; }
.tbox-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.tbox-tabs button { border: none; background: transparent; color: var(--muted); padding: 4px 9px; font-size: 12px; cursor: pointer; border-radius: 6px; }
.tbox-tabs button:hover { color: var(--text); }
.tbox-tabs button.active { background: var(--panel2); color: var(--accent); }
.tbox-panel { display: none; }
.tbox-panel.active { display: block; }
.tbox .kv.compact { grid-template-columns: 150px 1fr; }
.tbox-maps .mapbox { margin-bottom: 0; }
.tbox-maps .mapstage { height: 380px; }
.tbox-maps .mapstage iframe.map, .tbox-maps .mapstage #detail-map { height: 380px; }
.detail-main .kv.compact { grid-template-columns: 120px 1fr; gap: 3px 10px; font-size: 12.5px; margin: 8px 0; }
.detail-main .badges { margin-bottom: 8px; }
/* Draggable tabs — affordance & DnD states */
button[data-tb][draggable="true"] { cursor: grab; }
button[data-tb][draggable="true"]:active { cursor: grabbing; }
button[data-tb].tab-dragging { opacity: 0.3; pointer-events: none; }
.tbox.dnd-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: border-color .1s, box-shadow .1s;
}
/* "New box" drop zone */
.new-box-zone {
  border: 2px dashed var(--border); background: transparent; padding: 0 !important;
  display: flex; align-items: center; justify-content: center; min-height: 72px;
  opacity: 0.55; transition: opacity .15s, border-color .15s;
}
.new-box-zone.dnd-target { border-color: var(--accent); opacity: 1; }
.new-box-label { font-size: 12px; color: var(--muted); pointer-events: none; }
/* Grab hint on tab hover */
.tbox-tabs button[draggable="true"]:not(.active)::before { content: '⠿'; font-size: 9px; opacity: 0; margin-right: 3px; transition: opacity .15s; }
.tbox-tabs button[draggable="true"]:hover::before { opacity: 0.45; }

/* Research links bar — full-width box at bottom of detail grid */
.tbox-links { grid-column: 1 / -1; }
.links-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-start; padding: 2px 0; }
.links-group { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.links-group-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 2px; white-space: nowrap; }
.links-group::after { content: ''; display: block; width: 1px; height: 18px; background: var(--border); margin-left: 8px; align-self: center; }
.links-group:last-child::after { display: none; }
.grp { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.grp-ic { font-size: 13px; opacity: .85; }
.chip { display: inline-flex; align-items: center; padding: 3px 9px; font-size: 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); background: var(--panel2); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
#note-body { min-height: 46px; }
.eval-assignee { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.eval-assignee select { width: auto; flex: 1; }
.checklist { margin-bottom: 12px; }
.cl-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.dd-cloud { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; line-height: 1.5; }
.dd-word { cursor: pointer; font-weight: 700; color: var(--muted); opacity: .4; user-select: none; transition: opacity .12s, color .12s; }
.dd-word:hover { opacity: .75; }
.dd-word.on { opacity: 1; color: var(--w); }
.detail-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.detail-topbar .spacer { flex: 1; }
.detail-topbar button:disabled { opacity: .4; cursor: default; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head .apn { font-family: ui-monospace, monospace; margin: 0; }
.score-big { font-size: 34px; font-weight: 800; line-height: 1; text-align: center; }
.score-big span { display: block; font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.score-big.hi { color: var(--green); } .score-big.mid { color: var(--amber); } .score-big.lo { color: var(--muted); }
.rationale { margin: 10px 0; line-height: 1.5; }
.cur-status { margin-bottom: 4px; }
.flag-buttons.vertical { flex-direction: column; }
.flag-buttons.vertical button { width: 100%; }
.flag-none { background: var(--panel2); color: var(--muted); }
.linklist { display: grid; gap: 6px; margin: 10px 0; }
.linklist a { display: block; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; }
.linklist a:hover { border-color: var(--accent); }
.linkgroup-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 12px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; margin: 10px 0; font-size: 13px; }
.kv .k { color: var(--muted); }
.flag-buttons { display: flex; gap: 8px; margin: 12px 0; }
.flag-buttons button { flex: 1; }
textarea { min-height: 64px; resize: vertical; }
.attach-add { display: inline-block; cursor: pointer; color: var(--accent); font-size: 13px; padding: 6px 0; }
.attach-add:hover { text-decoration: underline; }
#attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.att { width: 96px; }
.att-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.att-file { display: block; font-size: 12px; word-break: break-word; }
.att-meta { font-size: 10px; margin-top: 2px; }
.note { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.note .meta { font-size: 11px; color: var(--muted); }
.report-body { white-space: pre-wrap; margin-top: 12px; line-height: 1.6; }
/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile-val { font-size: 30px; font-weight: 700; line-height: 1; }
.tile-label { color: var(--muted); font-size: 12px; margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }
.tile-sub { color: var(--accent); font-size: 12px; margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 10px; }
.bar-key { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--panel2); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; min-width: 2px; }
.bar-val { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.act-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.act-apn { font-family: ui-monospace, monospace; text-decoration: none; }
.act-ts { margin-left: auto; }
.hist-item { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.hist-item b { color: var(--text); }
.hist-ts { margin-left: auto; color: var(--muted); white-space: nowrap; }
.county-card { margin-bottom: 14px; }
.feature-list { margin: 2px 0 6px; padding-left: 16px; list-style: disc; }
.feature-list li { margin: 2px 0; font-size: 12.5px; }
.county-assess { line-height: 1.55; margin: 8px 0; }
.county-hl { margin: 4px 0 8px; padding-left: 18px; }
.county-hl li { margin: 2px 0; color: var(--secondary, var(--text)); font-size: 13px; }
.county-comments { margin-top: 8px; }
.cc-form textarea { min-height: 46px; }
.stats { margin: 2px 0 4px; }
.stats b { color: var(--text); }
.source-row { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.source-row summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.source-row .kv { grid-template-columns: 200px 1fr; margin-top: 8px; }
.kbd-hint b { color: var(--text); }

/* Overlay (compare) */
.overlay { position: fixed; inset: 0; z-index: 60; }
.overlay-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.overlay-panel { position: absolute; inset: 4% 4%; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; overflow: auto; }
.compare-table td, .compare-table th { white-space: nowrap; }
.compare-table .cmp-label { color: var(--muted); font-weight: 500; position: sticky; left: 0; background: var(--panel); }
.compare-table .cmp-best { color: var(--green); font-weight: 700; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 8px; z-index: 100;
}
table.imports { width: 100%; border-collapse: collapse; }
table.imports th, table.imports td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
table.imports th { color: var(--muted); font-weight: 500; }
td.nowrap { white-space: nowrap; }
td.nowrap .link { margin-right: 8px; }

/* Comparable parcels table (Property > Comps tab) */
table.comp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.comp-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 5px 8px; border-bottom: 1px solid var(--border); }
table.comp-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
table.comp-table td.num, table.comp-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.comp-table tr.comp-row:hover td { background: var(--panel2); }

/* ============ Streamlined parcel detail ============ */
/* Denser boxes / less whitespace */
.signal-strip { margin-bottom: 8px; gap: 6px; }
.detail-head-bar { padding: 7px 12px; margin-bottom: 8px; }
.rationale-bar { margin: 2px 0 8px; }
.detail-boxes { gap: 12px; }
.tbox { padding: 10px 12px; }
.tbox-head { margin-bottom: 7px; }
.tbox .kv.compact { grid-template-columns: 132px 1fr; gap: 3px 10px; font-size: 12px; margin: 0; }
.tbox .kv.compact .k { color: var(--muted); }

/* Shorthand KPI strip */
.qstats { display: flex; flex-wrap: wrap; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.qstat { flex: 1 1 0; min-width: 76px; background: var(--panel); padding: 5px 10px; display: flex; flex-direction: column; gap: 1px; }
.qstat .qk { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.qstat .qv { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* Map full-screen expand */
.maptabs { align-items: stretch; }
.map-expand { margin-left: auto; background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 6px 12px; line-height: 1; }
.map-expand:hover { color: var(--accent); }
.mapbox--full { position: fixed; inset: 0; z-index: 3000; margin: 0; border-radius: 0; display: flex; flex-direction: column; background: var(--bg); }
.mapbox--full .mapstage { flex: 1 1 auto; height: auto !important; }
.mapbox--full .mapstage iframe.map,
.mapbox--full .mapstage #detail-map,
.mapbox--full .mapstage video,
.mapbox--full .mapstage .map.placeholder { height: 100% !important; }
.map-full-open { overflow: hidden; }

/* Sleek detail topbar: back/pos float left, nav floats right, minimal height */
.detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.detail-topbar .dt-left, .detail-topbar .dt-right { display: flex; align-items: center; gap: 6px; }
.ghost.sm { padding: 3px 9px; font-size: 12px; line-height: 1.4; }
.detail-topbar .kbd-hint { cursor: help; }


/* Parcels view sub-tabs: Process / Watching / All */
.ptabs { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.ptab { border: none; background: transparent; color: var(--muted); padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ptab-hint { margin-left: 6px; }
.ptab-export { margin-left: auto; text-decoration: none; }

/* Admin tabbed view: compact overview + sleeker panels */
.admin-overview { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; margin-bottom: 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius); }
.admin-overview b { color: var(--text); }
#view-admin .asub { display: grid; gap: 14px; }
#view-admin .panel.compact { padding: 14px 16px; margin: 0; }
#view-admin .panel.compact h2 { margin: 0; font-size: .98rem; }
#view-admin .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
#view-admin .hint { margin: -4px 0 10px; }
#view-admin .subhead { margin: 0 0 8px; font-size: .9rem; color: var(--fg-muted); }
#view-admin .fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
#view-admin .fhint { font-size: 11px; opacity: .75; max-width: 250px; line-height: 1.35; font-weight: normal; }
#view-admin .fld.tm-only[hidden], #view-admin .fld.cli-only[hidden] { display: none; }
#view-admin .fldnote { font-weight: normal; color: var(--fg-muted); }
/* Streamlined Process/Watching hide the heavy filter + saved-views bars */
#view-parcels[data-mode="process"] .views-bar,
#view-parcels[data-mode="process"] .filters,
#view-parcels[data-mode="watching"] .views-bar,
#view-parcels[data-mode="watching"] .filters { display: none; }

/* ============ Flagship detail view — polished layout ============ */
/* One compact header panel: identity row + chips + rationale (no stacked strips) */
.detail-head-bar { display: block; padding: 8px 12px; margin-bottom: 8px; }
.detail-head-bar .dh-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head-bar .dh-left, .detail-head-bar .dh-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-head-bar .dh-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.detail-head-bar .dh-chips .signal-strip { display: contents; }
.detail-head-bar .dh-chips .badges.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.detail-head-bar .dh-rationale { margin-top: 6px; line-height: 1.45; }
.detail-head-bar .flag-icons { display: inline-flex; gap: 4px; }

/* KPI strip: muted empties keep positions stable without shouting */
.qstats { margin-bottom: 8px; }
.qstat.empty .qv { color: var(--muted); font-weight: 400; }

/* Map is the hero: edge-to-edge in its box, full width, own tab bar is its header */
.tbox-maps { padding: 0; grid-column: 1 / -1; }
.tbox-maps .mapbox { border: none; border-radius: 0; margin: 0; }
.tbox-maps .mapstage { height: 400px; }
.tbox-maps .mapstage iframe.map, .tbox-maps .mapstage #detail-map { height: 400px; }

/* Responsive box grid: fills width on wide screens, boxes in a row match height */
.detail-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 10px; align-items: stretch; }
@media (max-width: 720px) { .detail-boxes { grid-template-columns: 1fr; } }
.tbox { padding: 10px 12px; }
.tbox-head { margin-bottom: 6px; }
.tbox-tabs button { padding: 3px 8px; font-size: 12px; }
.tbox .kv.compact { grid-template-columns: 124px 1fr; gap: 2px 10px; font-size: 12px; margin: 0; }
.detail-freshness { margin: 6px 0 0; }

/* Parcels ptabs action cluster (right side): Export + Import Parcels */
.ptab-export { margin-left: 0; }
.ptabs-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.primary.sm { padding: 4px 10px; font-size: 12px; }

/* Account sub-tabs container spacing */
.asub { margin-top: 4px; }

/* Import modal reuses .overlay; keep its panel from getting too wide on big screens */
#import-modal .overlay-panel { inset: 4% 8%; max-width: 1100px; margin: 0 auto; }
.modal-open { overflow: hidden; }

/* Tabs are the box header — hide box titles on tabbed boxes (keep the links
   box label since it has no tabs). Draggable tabs are draggable; the cursor hints it. */
.tbox:not(.tbox-links) .tbox-title { display: none; }
.tbox-head { display: flex; align-items: center; gap: 8px; }
.tbox-head .tbox-tabs { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 2px; }
.tbox-tabs button[data-tb] { cursor: grab; }
.tbox-tabs button[data-tb]:active { cursor: grabbing; }

/* Pointer-based tab drag: floating ghost + drag cursor + drop highlight */
.tab-drag-ghost { position: fixed; z-index: 9999; pointer-events: none; transform: translate(8px, 8px);
  background: var(--accent); color: #0b0f14; font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.4); white-space: nowrap; }
.tab-dragging-active, .tab-dragging-active * { cursor: grabbing !important; user-select: none !important; }
.tbox-tabs button[data-tb] { cursor: grab; }
.tbox.dnd-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.tab-dragging { opacity: .5; }
/* Box reorder: grip handle drags the whole box; target shows an insertion cue */
.box-grip { flex: 0 0 auto; cursor: grab; color: var(--muted); font-size: 13px; line-height: 1;
  padding: 2px 2px; opacity: .5; transition: opacity .12s, color .12s; user-select: none; }
.box-grip:hover { opacity: 1; color: var(--accent); }
.box-grip:active { cursor: grabbing; }
.tbox.box-dragging { opacity: .4; }
.tbox.dnd-box-target { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* Brand-colored research-link chips (color + icon per site for scanability) */
.chip.brandchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px;
  font-size: 12px; text-decoration: none; color: var(--text); white-space: nowrap;
  background: color-mix(in srgb, var(--bc) 13%, var(--panel2));
  border: 1px solid color-mix(in srgb, var(--bc) 34%, transparent); transition: background .12s, border-color .12s; }
.chip.brandchip:hover { background: color-mix(in srgb, var(--bc) 24%, var(--panel2)); border-color: var(--bc); }
.chip.brandchip .chip-ic { font-size: 12px; line-height: 1; }

/* Detail nav folded into the header (no standalone topbar row anymore) */
.detail-head-bar #detail-pos { white-space: nowrap; }
.detail-head-bar #detail-back { margin-right: 2px; }
.detail-head-bar .dh-right button.ghost.sm { padding: 3px 8px; }
.detail-head-bar #detail-prev, .detail-head-bar #detail-next { min-width: 30px; }
.detail-head-bar button:disabled { opacity: .4; cursor: default; }
.detail-head-bar .kbd-hint { cursor: help; align-self: center; }

/* ===== Brighter, larger, more readable text (per request) ===== */
:root { --text: #f3f6fa; --muted: #c2ccd8; }
body { font-size: 15px; color: var(--text); }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.tbox .kv.compact { font-size: 13px; }
.tbox .kv.compact .k { color: var(--muted); }
.tbox-tabs button[data-tb] { font-size: 13px; }
.qstat .qk { font-size: 10.5px; color: var(--muted); }
.qstat .qv { font-size: 15px; }
.chip.brandchip { font-size: 12.5px; }
.sig { font-size: 13px; }
.maptabs button { font-size: 13px; }

/* ===== Split map panes (max 2, side by side; each its own map + tabs) ===== */
.map-panes { display: flex; gap: 8px; width: 100%; }
.map-panes[data-panes="2"] .map-pane { flex: 1 1 50%; min-width: 0; }
.map-panes[data-panes="1"] .map-pane { flex: 1 1 100%; }
.map-pane { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.map-pane .maptabs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.map-pane .maptabs-ctl { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.map-split { background: transparent; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 8px; white-space: nowrap; }
.map-split:hover { color: var(--accent); }
.map-pane .mapstage { height: 400px; }
.map-pane .mapstage iframe.map, .map-pane .mapstage .leaflet-host, .map-pane .mapstage video, .map-pane .mapstage .map.placeholder { height: 100%; width: 100%; }
.map-pane.dnd-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.map-panes[data-panes="2"] .map-pane .mapstage { height: 340px; }
@media (max-width: 700px) { .map-panes { flex-direction: column; } .map-panes[data-panes="2"] .map-pane .mapstage { height: 300px; } }
/* Full-screen a single pane */
.map-pane.mapbox--full { position: fixed; inset: 0; z-index: 3000; border-radius: 0; }
.map-pane.mapbox--full .mapstage { height: calc(100vh - 42px) !important; }

/* Visible basemap switcher overlaid on the detail Leaflet map (one-click sources) */
.basemap-switch { display: flex; gap: 3px; max-width: calc(100% - 16px); overflow-x: auto;
  background: rgba(15,18,22,.82); border: 1px solid var(--border); border-radius: 8px;
  padding: 3px; backdrop-filter: blur(2px); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.basemap-switch::-webkit-scrollbar { height: 5px; }
.basemap-switch::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.bm-btn { flex: 0 0 auto; background: transparent; border: none; color: var(--muted);
  font-size: 12px; padding: 4px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.bm-btn:hover { color: var(--text); background: var(--panel2); }
.bm-btn.active { color: #fff; background: var(--accent2); font-weight: 600; }

/* Map tabs scroll horizontally (many basemap tabs); split/expand stay pinned */
.map-pane .maptabs { flex-wrap: nowrap; }
.maptabs-scroll { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: thin; }
.maptabs-scroll::-webkit-scrollbar { height: 5px; }
.maptabs-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.maptabs-scroll button { flex: 0 0 auto; white-space: nowrap; }
.maptabs-ctl { flex: 0 0 auto; }

/* Admin activity log */
table.log-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.log-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.log-ts { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-msg { color: var(--text); }
.log-type { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--border); }
.log-type.log-import { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.log-type.log-monitor { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.log-type.log-error { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.log-type.log-enrich { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }

/* Parcel detail: condensed "Enrich & analyze" actions menu */
.dh-actions { position: relative; display: inline-block; }
.dh-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 250px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.3); padding: 5px; display: flex; flex-direction: column; gap: 2px; }
.dh-menu.hidden { display: none; }
.dh-mitem { text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 12px;
  background: transparent; border: none; color: var(--text); cursor: pointer; white-space: nowrap; }
.dh-mitem:hover { background: var(--panel2); }
.dh-mitem:disabled { opacity: .6; cursor: default; }

/* Admin crawl monitor */
#crawl-summary { margin: 10px 0 14px; }
#crawl-summary .tile { padding: 12px 14px; }
#crawl-summary .tile-val { font-size: 24px; }
.tile-val.tv-ok { color: var(--green); }
.tile-val.tv-warn { color: var(--amber); }
.tile-val.tv-bad { color: var(--red); }
.crawl-table { width: 100%; }
.crawl-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 8px; }
.crawl-table td { padding: 4px 8px; border-top: 1px solid var(--border); }
.crawl-table td.num, .crawl-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ckind { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.ckind.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.ckind.bad { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.ckind.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.ckind.dim { color: var(--muted); background: var(--panel2); }

/* Objects view (non-parcel auction lots) */
.obj-table { width: 100%; }
.obj-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 5px 8px; }
.obj-table td { padding: 6px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.obj-table td.num, .obj-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.obj-desc { max-width: 520px; }
.okind { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.okind.veh { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.okind.equ { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.okind.per { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.okind.oth { color: var(--muted); background: var(--panel2); }

/* Admin coverage view */
#cov-summary { margin: 10px 0; }
#cov-summary .tile { padding: 12px 14px; }
#cov-summary .tile-val { font-size: 24px; }
.cov-table { width: 100%; }
.cov-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 5px 8px; }
.cov-table td { padding: 5px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.cov-url { max-width: 360px; word-break: break-word; }
.cov-pl { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.cov-pl.dr { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.cov-pl.tp { color: var(--muted); background: var(--panel2); }
.cov-st { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.cov-st-live { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.cov-st-known { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cov-st-todo { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.cov-st-no_online_info { color: var(--muted); background: var(--panel2); }

/* Top-bar Upload File action */
.tab-upload { margin-left: auto; color: var(--accent); font-weight: 600; }
.tab-upload:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Crawl queue status badges */
.tstat { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.tstat-done { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.tstat-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tstat-queued { color: var(--muted); background: var(--panel2); }
.tstat-empty { color: var(--muted); background: var(--panel2); }
.tstat-failed { color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); }
.tstat-blocked, .tstat-dead { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.tstat-paused { color: var(--amber); background: color-mix(in srgb, var(--amber) 15%, transparent); }

/* Parcel provenance / data-history log (Source panel) */
.parcel-history { margin-bottom: 10px; }
.parcel-log { max-height: 160px; overflow-y: auto; line-height: 1.5; border-left: 2px solid var(--border); padding-left: 8px; }
.parcel-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Compact AI admin sub-tabs (Jobs / Orders / Engine / Analytics) */
.ptabs.sub { margin: 4px 0 12px; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.ptabs.sub .ptab { font-size: 13px; padding: 5px 12px; border-radius: 8px; }
.ptabs.sub .ptab.active { background: var(--panel2); color: var(--accent); }
.ptabs.sub .ptabs-actions { margin-left: auto; }
.ai-pane { animation: fadein .12s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* AI-generated prose (assessments, rationale, report) rendered from markdown */
.ai-prose { line-height: 1.5; }
.ai-prose strong { color: var(--text); }
.ai-prose code { background: var(--panel2); padding: 0 4px; border-radius: 4px; font-size: 12px; }
.county-assess { line-height: 1.5; }
.code-block { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre; line-height: 1.5; }
.getting-started { margin-bottom: 14px; border-left: 3px solid var(--accent); }
.gs-list { list-style: none; margin: 10px 0 0; padding: 0; }
.gs-list li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; }
.gs-list li.gs-done { opacity: 0.6; }
.gs-check { flex: 0 0 auto; }
#api-docs code { background: var(--panel2); padding: 0 4px; border-radius: 4px; font-size: 12px; }

/* County knowledge panel */
.county-knowledge { margin-top: 8px; }
.know-sec { margin: 8px 0; }
.know-dom { font-weight: 650; font-size: 13px; margin-bottom: 4px; }
.ai-prose.small { font-size: 13px; }

/* Process drill-down (state → county) */
/* #parcels-list is itself a card grid; the drill wrapper must span all its
   columns, otherwise the state/county grids get squeezed into one 300px cell
   (reads as a single tall column on wide screens). */
.parcels > .process-drill { grid-column: 1 / -1; }
.process-drill { padding: 6px 2px; }
.drill-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.county-tile { text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); cursor: pointer; transition: border-color .12s, transform .12s; }
.county-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.ct-name { font-weight: 650; }
.ct-stat { font-size: 15px; margin: 2px 0; }
.drill-crumb { color: var(--text); }

/* State-selection grid: same tile language as counties, tighter columns */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.state-tile { text-align: center; }
.state-tile .ct-name { font-size: 17px; letter-spacing: .02em; }

/* Location breadcrumb — All states › NE › County; earlier segments are links */
.loc-crumb { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; margin-bottom: 10px; }
.loc-crumb .crumb-seg { font-weight: 600; }
.loc-crumb button.crumb-seg { font-weight: 600; }
.loc-crumb .crumb-seg.cur { color: var(--text); }
.loc-crumb .crumb-sep { color: var(--muted); }
.drill-note { margin-left: 4px; }
.stat-chips { color: var(--muted); }
#parcels-stats .loc-crumb { margin-bottom: 4px; margin-right: 8px; }

/* Yes/no decision buttons */
.flag-icons .decide-yes:hover { border-color: var(--green); color: var(--green); }
.flag-icons .decide-no:hover { border-color: var(--amber); color: var(--amber); }

/* Marketing landing (auth card) */
.pitch { font-size: 15px; line-height: 1.5; margin: 4px 0 12px; }
.pitch-points { list-style: none; padding: 0; margin: 0 0 12px; font-size: 13px; line-height: 1.9; }
.price-line { background: var(--panel2); border-radius: 8px; padding: 8px 10px; font-size: 13px; text-align: center; margin-bottom: 10px; }

/* Auction source link (parcel detail header) */
.auction-src { font-size: 12px; color: var(--accent); font-weight: 600; text-decoration: none; padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; }
.auction-src:hover { border-color: var(--accent); }

/* County watch star */
.watch-star { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--muted); flex: 0 0 auto; padding: 0 2px; }
.watch-star.on { color: var(--amber); }
.watch-star:hover { color: var(--amber); }

/* Map popup quick-decide */
.map-decide { margin: 6px 0; display: flex; gap: 6px; }
.map-decide button { font-size: 11px; padding: 2px 6px; cursor: pointer; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); }

/* Process drill searchable inputs */
.drill-head input { min-width: 200px; padding: 6px 8px; }
.drill-head label { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Day mode (bespoke light theme, toggled via theme.js) ------------------
   The app defaults to night (the :root dark palette above). html[data-theme="day"]
   overrides the same CSS variables with the light "Auction Property Hunter" palette
   used on the public parcel pages, so the whole site flips with one attribute. */
html[data-theme="day"] {
  --bg: #f4f7fa;
  --panel: #ffffff;
  --panel2: #eef2f6;
  --border: #dfe4ea;
  --text: #1c2530;
  --muted: #5f6b7a;
  --accent: #2f6f4f;
  --accent2: #245a3f;
  --green: #1f9d63;
  --amber: #b9760a;
  --red: #d24b53;
}
body { transition: background-color .2s ease, color .2s ease; }
/* Day-mode spot fixes for the handful of hardcoded dark values. */
html[data-theme="day"] .bell-dropdown,
html[data-theme="day"] .udrop,
html[data-theme="day"] .colchooser-menu { box-shadow: 0 8px 24px rgba(20,30,45,.14); }
/* Theme toggle button (injected into the topbar by theme.js). */
#theme-toggle {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 15px; line-height: 1;
}
#theme-toggle:hover { border-color: var(--accent); }

/* ---- Public demo parcel page (anon /parcel/:id) ---------------------------
   The real detail page shown to anon: location/map are real, the rest is sample
   data. We keep the sample data fully VISIBLE (the point is to show what the
   platform offers) and mark it — a banner + a small "SAMPLE" badge on gated boxes. */
.demo-banner {
  background: #fff4e5; border: 1px solid #f0c98a; color: #8a5a1e;
  border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; font-size: 13px;
}
.demo-banner a { color: #8a5a1e; font-weight: 700; }
/* Anon demo: every data box holds believable FAKE values (server-side demoRow),
   shown READABLE but stamped with a repeating diagonal grey "SAMPLE" watermark so
   it's unmistakably a demo. Only the satellite/Street-View map (.tbox-maps) is clean. */
body.demo-parcel .tbox:not(.tbox-maps) { position: relative; }
body.demo-parcel .tbox:not(.tbox-maps) .tbox-panel *,
body.demo-parcel .tbox:not(.tbox-maps) .links-bar * {
  pointer-events: none; user-select: none; /* demo values aren't interactive; tab switching still works via the head */
}
body.demo-parcel .tbox:not(.tbox-maps)::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27420%27%20height%3D%27150%27%3E%3Ctext%20x%3D%27210%27%20y%3D%2780%27%20fill%3D%27%231c2530%27%20fill-opacity%3D%270.13%27%20font-family%3D%27Segoe%20UI%2CRoboto%2CHelvetica%2CArial%2Csans-serif%27%20font-size%3D%2726%27%20font-weight%3D%27800%27%20letter-spacing%3D%271.5%27%20text-anchor%3D%27middle%27%20transform%3D%27rotate%28-30%20210%2075%29%27%3ESAMPLE%20%E2%80%94%20CREATE%20ACCOUNT%3C%2Ftext%3E%3C%2Fsvg%3E");
  background-repeat: repeat;
}
/* Watermark the fake AI score + rationale in the header the same way. */
body.demo-parcel .detail-head-bar .score-inline,
body.demo-parcel .detail-head-bar .dh-rationale { position: relative; user-select: none; }
body.demo-parcel .detail-head-bar .score-inline::after,
body.demo-parcel .detail-head-bar .dh-rationale::after {
  content: "SAMPLE"; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; color: rgba(28,37,48,0.35);
  transform: rotate(-8deg);
}
/* In public mode, hide the app chrome that isn't part of the parcel page (the
   demo banner carries the log-in call to action), plus the per-parcel action
   buttons (enrich/analyze, investigate, decisions, layout reset, nav) — the
   sample view is read-only. */
body.public-mode .topbar .tabs,
body.public-mode #bell-wrap,
body.public-mode #user-menu-wrap,
body.public-mode #detail-actions-wrap,
body.public-mode .flag-icons,
body.public-mode #layout-reset,
body.public-mode .kbd-hint,
body.public-mode #detail-prev,
body.public-mode #detail-next,
body.public-mode #detail-pos { display: none; }

/* ================= Crawl-pipeline dashboard (admin → Pipeline) ================= */
/* Funnel: crawl4me → parse → AI → parcels → archived, with drop-offs visible */
.pl-funnel { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.pl-step { min-width: 96px; }
.pl-step-n { font-size: 20px; font-weight: 680; line-height: 1.1; }
.pl-step-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pl-step-bar { height: 4px; background: var(--panel2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.pl-step-bar span { display: block; height: 100%; background: var(--accent); }
.pl-arrow { color: var(--muted); padding: 0 2px 14px; }
.pl-step-side { margin-left: auto; display: flex; gap: 6px; align-items: flex-end; padding-bottom: 12px; }

/* Storage economics */
.pl-storage { display: flex; flex-wrap: wrap; gap: 20px; padding: 10px 12px; background: var(--panel2); border-radius: 8px; }
.pl-stat-v { font-size: 17px; font-weight: 650; }
.pl-stat-l { font-size: 11px; color: var(--muted); }

.pl-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.pl-pill.ok { background: rgba(53,192,127,.16); color: var(--green); }
.pl-pill.warn { background: rgba(240,169,59,.16); color: var(--amber); }
.pl-pill.bad { background: rgba(214,69,69,.18); color: #e06666; }
.pl-pill.idle { background: var(--panel2); color: var(--muted); }

.pl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pl-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pl-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pl-table th.num, .pl-table td.num { text-align: right; }
.pl-row { cursor: pointer; }
.pl-row:hover { background: var(--panel2); }

/* Score + quality bars */
.pl-score { display: inline-flex; align-items: center; gap: 5px; width: 74px; }
.pl-score-bar { height: 6px; border-radius: 3px; display: inline-block; min-width: 2px; }
.pl-score-bar.ok { background: var(--green); } .pl-score-bar.warn { background: var(--amber); } .pl-score-bar.bad { background: #e06666; }
.pl-score i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: auto; }
.pl-q { display: inline-block; width: 26px; height: 5px; background: var(--panel2); border-radius: 3px; margin-right: 3px; overflow: hidden; vertical-align: middle; }
.pl-q span { display: block; height: 100%; background: var(--accent); }

/* Per-capture lineage strip: one dot per stage */
.pl-lin { display: inline-flex; gap: 3px; }
.pl-lin i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.pl-lin i.ok { background: var(--green); } .pl-lin i.idle { background: var(--panel2); } .pl-lin i.bad { background: #e06666; }
.pl-fmt { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

/* Heatmap: day × source — thousands of crawls on one screen */
.pl-hm-wrap { overflow-x: auto; padding-bottom: 4px; }
.pl-hm { border-collapse: collapse; font-size: 11px; }
.pl-hm th, .pl-hm td { padding: 1px 2px; }
.pl-hm .pl-hm-key { text-align: left; color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; position: sticky; left: 0; background: var(--panel); }
.pl-hm .pl-hm-day { font-weight: 400; color: var(--muted); font-size: 9px; }
.pl-hm .pl-hm-day span { display: inline-block; transform: rotate(-60deg); transform-origin: bottom left; white-space: nowrap; }
.pl-hm td.num, .pl-hm th.num { text-align: right; padding-left: 8px; color: var(--muted); }
.pl-cell { display: inline-block; width: 11px; height: 11px; border-radius: 2px; cursor: pointer; }
.pl-cell.ok { background: var(--green); } .pl-cell.warn { background: var(--amber); }
.pl-cell.bad { background: #e06666; } .pl-cell.none { background: var(--panel2); cursor: default; opacity: .5; }
.pl-legend { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pl-legend .pl-cell { cursor: default; }

.pl-chip { display: inline-block; font-size: 11px; background: var(--panel2); border-radius: 10px; padding: 1px 8px; margin: 2px 3px 2px 0; }
.pl-map { max-height: 120px; overflow-y: auto; margin: 4px 0 8px; }

/* Lineage / county drawer */
.pl-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 900; }
.pl-scrim.open { opacity: 1; pointer-events: auto; }
.pl-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 94vw); background: var(--panel);
  border-left: 1px solid var(--border); box-shadow: -8px 0 28px rgba(0,0,0,.35); overflow-y: auto;
  padding: 14px 16px 40px; transform: translateX(100%); transition: transform .18s ease; z-index: 901; }
.pl-drawer.open { transform: translateX(0); }
.pl-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.pl-h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pl-kv { display: grid; grid-template-columns: 130px 1fr; gap: 3px 10px; font-size: 12px; }
.pl-kv .k { color: var(--muted); }
.pl-pre { background: var(--panel2); border-radius: 6px; padding: 8px 10px; font-size: 11px; max-height: 190px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
#pl-art-bad.active { background: var(--panel2); color: var(--accent); }

/* ---- Deals: loading state + upcoming day groups ---- */
.deals-loading { display: flex; align-items: center; gap: 8px; padding: 20px 2px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upcoming-day { margin: 0 0 6px; }
.upcoming-day-h { position: sticky; top: 0; z-index: 1; background: var(--bg);
  font-weight: 700; font-size: 13px; padding: 8px 2px 4px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

/* Upcoming-by-county cards: soonest sale date leads, later dates summarised */
.upcoming-counties { display: grid; gap: 8px; }
.upc-card { align-items: center; }
.upc-when { min-width: 92px; text-align: center; padding-right: 10px; border-right: 1px solid var(--border); margin-right: 12px; }
.upc-date { font-weight: 680; font-size: 14px; }
.upc-card.hot .upc-date { color: var(--amber); }
.upc-card.hot { border-left: 3px solid var(--amber); }
.upc-card.soon { border-left: 3px solid var(--accent); }
.upc-more { color: var(--accent); margin-top: 2px; }

/* Inline county deals (county detail page) */
.cd-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.cd-bar label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.cd-bar input { width: 84px; }

/* Hard links inside cards: real, copyable URLs that don't look like links */
a.hardlink { color: inherit; text-decoration: none; }
a.hardlink:hover { text-decoration: underline; }

/* ---- Parcel grid pagination ---- */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager button { min-width: 34px; }
.pager button.pg.active { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.pager button.pg.active:hover { background: var(--accent); }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-info { margin-left: 8px; }
.state-tile .ct-sub { letter-spacing: .08em; margin-top: 1px; }
.pl-bands { margin-bottom: 8px; }
.pl-share { display: inline-block; width: 120px; height: 7px; background: var(--panel2); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.pl-share span { display: block; height: 100%; background: var(--accent); }

/* ================= Polish pass: auth + account (compact, sleek) ================= */
.auth-card { width: 404px; padding: 30px 30px 26px; border-radius: 16px; box-shadow: 0 20px 54px rgba(28,37,48,0.12); }
.auth-card h1 { font-size: 21px; margin: 0 0 12px; letter-spacing: -0.01em; line-height: 1.15; }
.auth-card .pitch { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; }
.auth-card .pitch-points { display: grid; gap: 7px; font-size: 12.5px; line-height: 1.4; margin: 0 0 14px; }
.auth-card .pitch-points li { padding: 0; }
.auth-card .price-line { margin: 0 0 14px; border: 1px solid var(--border); font-weight: 500; }
#auth-tabs { display: flex; width: 100%; gap: 0; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin: 0 0 14px; }
#auth-tabs .tab { flex: 1; text-align: center; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
#auth-tabs .tab:hover { color: var(--text); }
#auth-tabs .tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(28,37,48,0.14); }
#auth-form { gap: 11px; margin-top: 0; }
#auth-form input { padding: 11px 13px; border-radius: 10px; font-size: 14.5px; }
#auth-form input:focus { outline: 2px solid rgba(47,111,63,0.28); border-color: var(--accent); }
#auth-form .primary { padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 650; }

/* Account view: tighter panels + refined tiles */
#view-account .panel { padding: 18px 20px; margin-bottom: 12px; border-radius: 12px; }
#view-account .panel h2 { font-size: 16px; }
#view-account .tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
#view-account .tile { padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); }
#view-account .tile-val { font-size: 22px; font-weight: 650; line-height: 1.1; }
#view-account .tile-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

@media (max-width: 560px) {
  .auth { padding: 14px; }
  .auth-card { padding: 22px 20px; border-radius: 14px; }
  .auth-card h1 { font-size: 19px; }
  #view-account .panel { padding: 15px 16px; }
  #view-account .tiles { grid-template-columns: repeat(2, 1fr); }
  #view-account .ptabs { overflow-x: auto; }
  #view-account .panel .row { flex-wrap: wrap; gap: 6px; row-gap: 8px; }
}

/* ================= Polish: app topbar on mobile ================= */
@media (max-width: 720px) {
  .topbar { gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
  .brand { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .topbar nav.tabs { order: 5; flex-basis: 100%; overflow-x: auto; gap: 2px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .topbar nav.tabs::-webkit-scrollbar { height: 0; }
  .tab { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .tab-upload { font-weight: 600; }
  #user-workspace { display: none; }            /* workspace label eats width — the dropdown still shows it */
  .user-trigger { max-width: 46vw; overflow: hidden; }
  #user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38vw; display: inline-block; vertical-align: middle; font-size: 13px; }
  .bell-dropdown, .udrop { max-width: 92vw; }
}

/* ---- Maps: shorter + static on phones (so a swipe scrolls the page) ---- */
@media (max-width: 720px) {
  .mapstage, .tbox-maps .mapstage, .map-pane .mapstage { height: 240px; }
  .mapstage iframe.map, .mapstage #detail-map,
  .tbox-maps .mapstage iframe.map, .tbox-maps .mapstage #detail-map { height: 240px; }
  #hero-map { height: 300px; }
  /* Leaflet maps are static on mobile — soften the grab cursor affordance. */
  .leaflet-container.leaflet-drag-target { cursor: default; }
}

/* ---- Source health panel (research/29) ---- */
.sh-rollups { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.sh-roll { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--border); background: var(--panel2); color: var(--muted); }
.sh-roll.alert { color: var(--red); border-color: rgba(210,59,83,.4); }
.sh-roll.backlog { color: var(--amber); border-color: rgba(185,118,10,.4); }
.sh-roll.ok { color: var(--green); border-color: rgba(31,157,99,.4); }
.sh-roll.code { font-family: ui-monospace, Menlo, monospace; }
.sh-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.sh-tbl th { text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.sh-tbl th.num, .sh-tbl td.num { text-align: right; }
.sh-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sh-row { cursor: pointer; }
.sh-row:hover { background: var(--panel2); }
.sh-tbl td.sh-warn { color: var(--red); font-weight: 700; }
.sh-chip { display: inline-block; white-space: nowrap; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 7px; border: 1px solid var(--border); background: var(--panel2); }
.sh-chip.sh-live, .sh-chip.sh-ok { color: var(--green); border-color: rgba(31,157,99,.4); }
.sh-chip.sh-degraded, .sh-chip.sh-waf { color: var(--amber); border-color: rgba(185,118,10,.4); }
.sh-chip.sh-stale { color: #b9760a; }
.sh-chip.sh-tls_quirk { color: var(--accent); border-color: rgba(47,111,79,.4); }
.sh-chip.sh-endpoint_moved, .sh-chip.sh-needs_attention { color: var(--red); border-color: rgba(210,59,83,.4); }
.sh-chip.sh-headless { color: #8a5cd6; }
@media (max-width: 720px) { .sh-tbl { font-size: 12px; } .sh-tbl th:nth-child(3), .sh-tbl td:nth-child(3), .sh-tbl th:nth-child(4), .sh-tbl td:nth-child(4) { display: none; } }

/* "cannot value" — a parcel with no assessment, no market value and no county comps. Shown
   in place of a grade so an empty cell cannot be misread as a missing number. */
.cannot-value {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: none;
  white-space: nowrap;
  color: var(--muted);
  background: var(--panel2);
  border-radius: 5px;
  padding: 1px 6px;
}
