:root {
  --bg: #f6f5fb;
  --panel: #ffffff;
  --ink: #16142b;
  --ink-2: #4a4762;
  --muted: #5b5873;
  --line: #e7e5f0;
  --line-2: #dad7e8;
  --soft: #f0eff7;
  --accent: #5046e5;
  --accent-ink: #ffffff;
  --link: #4338ca;
  --warm: #ffb547;
  --warm-ink: #2a1a00;
  --ok: #0f766e;
  --radius: 20px;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--link); }
a:hover { color: #312e81; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons */
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink);
  font-weight: 600; cursor: pointer; }
.btn:hover { border-color: #c4c0d8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.warm { background: var(--warm); border-color: var(--warm); color: var(--warm-ink); font-weight: 700; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: .6; cursor: default; }
.linkbtn { font: inherit; border: 0; background: none; padding: 6px 0; color: var(--link); font-weight: 600; font-size: 14px; cursor: pointer; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.logo { width: 40px; height: 40px; display: block; flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.brand-tag { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 3px 9px; border-radius: 999px; }
.nav { display: flex; gap: 22px; font-weight: 500; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

/* hero */
.hero { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 44px; padding-bottom: 32px; align-items: stretch; }
.hero-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.updated { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ok); }
.updated .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex: none; }
.updated.busy { color: #9a4a06; }
.updated.busy .dot { background: var(--warm); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.04;
  letter-spacing: -0.03em; max-width: 680px; }
.lede { margin: 0; font-size: 18px; color: var(--ink-2); max-width: 600px; }
.searchbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 10px 30px rgba(22, 20, 43, .06); max-width: 720px; }
.searchbar label { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 52px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.sb-q { flex: 999 1 260px; }
.sb-county { flex: 1 1 160px; }
.searchbar input, .searchbar select { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 16px; color: var(--ink); padding: 0; }
.searchbar select { font-weight: 500; font-size: 15px; }
.searchbar .btn { min-height: 52px; padding: 0 26px; font-size: 16px; }

.glance { flex: 1 1 340px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 24px;
  display: flex; flex-direction: column; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; }
.stats b.warm { color: #b45309; }
.stats span { font-size: 13px; color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 14px; }
.bar .name { font-weight: 500; }
.bar .track { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 999px; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.banner { margin-bottom: 18px; }
.banner:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #ecebff; border: 1px solid #cfccff;
  border-radius: 16px; padding: 12px 16px; max-width: 1192px; }

/* layout */
.layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-bottom: 40px; }
.side { flex: 1 1 260px; max-width: 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.results { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.filters { padding: 20px; }
.filters-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.filters-head h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; }
.field { display: block; border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-2); margin-bottom: 10px; padding: 0; }
input[type=email], input[type=date], input:not([type]), dialog select, .sort select {
  font: inherit; width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--line-2); border-radius: 999px;
  font-size: 14px; font-weight: 600; background: #fff; }
.chips label:hover span { border-color: #b9b4d4; }
.chips input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks label, .check { display: flex; gap: 10px; align-items: center; min-height: 40px; font-weight: 500; }
.checks input, .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.checks .cdot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.checks .n { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.checks.inline { display: flex; flex-wrap: wrap; gap: 0 18px; }
.check { font-size: 14px; }
.dates { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dates span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.promo { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.promo-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--warm); color: var(--warm-ink); display: flex; align-items: center; justify-content: center; }
.promo h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.15; }
.promo p { margin: 0; font-size: 14px; color: #d6d3e8; }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #eae8f3; border-radius: 14px; }
.tabs button { font: inherit; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 11px;
  background: transparent; color: var(--ink); font-weight: 600; cursor: pointer; }
.tabs button[aria-selected=true] { background: #fff; box-shadow: 0 1px 3px rgba(22, 20, 43, .12); }
.tabs b { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line-2); }
.tabs b:empty { display: none; }
.tabs button[data-view=all][aria-selected=true] b { background: var(--accent); color: #fff; }
.tabs button[data-view=new][aria-selected=true] b { background: var(--warm); color: var(--warm-ink); }
.sort { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 14px; }
.sort select { width: auto; font-weight: 500; }
.summary { color: var(--ink-2); font-size: 14px; margin: 0; min-height: 1.5em; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(22, 20, 43, .10); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card.inactive { opacity: .65; }
.photo { position: relative; display: block; aspect-ratio: 4 / 3; background: #ecebff; color: #4338ca; overflow: hidden; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .ph { display: none; }
.photo.nophoto img { display: none; }
.photo.nophoto .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.photo.nophoto .ph::after { content: "No photo listed"; position: absolute; left: 12px; bottom: 10px; font-size: 11px; font-weight: 600; }
.photo.t1 { background: #fff1e0; color: #9a4a06; }
.photo.t2 { background: #e3f6f1; color: #0f6b63; }
.photo.t3 { background: #fde8f1; color: #a3154f; }
.chips-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 6px; align-items: center; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge.new { background: var(--warm); color: var(--warm-ink); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.badge.gone { background: var(--ink); color: #fff; }
.badge.days { background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 600; }
.badge.days:empty { display: none; }
.body { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.title { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title small { color: var(--muted); font-family: Inter, system-ui, sans-serif; font-weight: 500; font-size: 13px; }
.meta { margin: 0; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 14px; }
.details:empty { display: none; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.sparse { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.foot-row { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--soft); }
.county { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.cdot { width: 9px; height: 9px; border-radius: 3px; background: #8b88a3; }
.link { font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; min-height: 36px; display: flex; align-items: center; }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--muted); background: var(--panel);
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); }
.more { text-align: center; margin: 8px 0; }

/* how it works */
.how { padding-bottom: 48px; }
.how-inner { padding: 32px; border-radius: 24px; }
.how h2 { margin: 0 0 22px; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.steps li { display: flex; gap: 14px; }
.steps .n { flex: none; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.n1 { background: #ecebff; color: #4338ca; } .n2 { background: #fff1e0; color: #b45309; } .n3 { background: #e3f6f1; color: #0f766e; }
.steps h3 { margin: 0 0 4px; font-size: 16px; }
.steps p { margin: 0; font-size: 14px; color: var(--ink-2); }

.foot { border-top: 1px solid var(--line); background: var(--panel); }
.foot-inner { padding-top: 24px; padding-bottom: 24px; font-size: 13px; color: var(--muted); }

/* phone */
.show-sm { display: none !important; }
.alert-bar { position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 5; background: var(--ink); color: #fff; border-radius: 18px;
  padding: 12px 12px 12px 18px; align-items: center; gap: 12px; box-shadow: 0 12px 30px rgba(22, 20, 43, .25); }
.alert-bar div { flex: 1; display: flex; flex-direction: column; }
.alert-bar span { font-size: 13px; color: #d6d3e8; }
@media (max-width: 820px) {
  .wrap { padding: 0 16px; }
  .nav, .hide-sm, .promo, .glance .bars { display: none; }
  .top-inner { gap: 12px; }
  .top .btn.dark { width: 44px; padding: 0; background: #fff; color: var(--ink); border-color: var(--line); }
  .show-sm { display: inline-flex !important; }
  .alert-bar.show-sm { display: flex !important; }
  .hero { padding-top: 22px; gap: 16px; }
  .lede { font-size: 16px; }
  .glance { padding: 16px; }
  .stats b { font-size: 26px; }
  .side { max-width: none; flex-basis: 100%; order: 2; }
  .results { order: 1; flex-basis: 100%; }
  .layout { flex-direction: column; align-items: stretch; }
  #filters-panel { display: none; }
  #filters-panel.open { display: block; }
  .side:has(#filters-panel.open) { order: 0; }
  .tabs { flex: 1 1 100%; }
  .tabs button { flex: 1; justify-content: center; padding: 0 8px; }
  body { padding-bottom: 96px; }
}

/* dialog */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(640px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(22, 20, 43, .3); color: var(--ink); }
dialog::backdrop { background: rgba(22, 20, 43, .5); }
dialog form { padding: 26px 28px; }
dialog h2 { margin: 0 0 6px; font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.15; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 16px; }
.grid2 .field { margin-bottom: 14px; }
.grid2 .field > span { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.msg { min-height: 1.3em; margin: 4px 0; font-size: 14px; }
.msg.error { color: #b02a2a; }
.msg.ok { color: var(--ok); }

.notice { max-width: 560px; margin: 80px auto; background: var(--panel); padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); }
