:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #16202b; --muted: #64748b;
  --line: #e2e8f0; --accent: #0f4c81; --accent-ink: #ffffff;
  --good: #0a7d4f; --bad: #b42318; --warn: #b54708; --chip: #eef2f7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
header { background: var(--accent); color: var(--accent-ink); padding: 14px 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 20px; letter-spacing: .2px; }
header h1 a { color: inherit; }
header .sub { opacity: .75; font-size: 13px; }
header nav { margin-left: auto; display: flex; gap: 6px; }
header nav a { color: #fff; opacity: .8; padding: 6px 14px; border-radius: 8px; font-size: 14px; }
header nav a.active, header nav a:hover { opacity: 1; background: rgba(255,255,255,.16); }
main { max-width: 1220px; margin: 0 auto; padding: 24px 28px 60px; }
main.full { max-width: none; padding: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.chip { background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--ink); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.stats { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; min-width: 130px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12.5px; }
.saleday { margin: 26px 0 10px; font-size: 15px; font-weight: 650; color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tablewrap { overflow-x: auto; border-radius: 10px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfcfd; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.addr { font-weight: 600; }
.muni { color: var(--muted); font-weight: 400; font-size: 12.5px; display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--good); font-weight: 650; }
.neg { color: var(--bad); font-weight: 650; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .4px; }
.badge.scheduled { background: #e8f0fa; color: var(--accent); }
.badge.postponed { background: #fef0e6; color: var(--warn); }
.badge.stayed, .badge.cancelled { background: #f1f5f9; color: var(--muted); }
.badge.sold { background: #e6f4ee; color: var(--good); }
.badge.county { background: var(--chip); color: var(--muted); text-transform: none; letter-spacing: 0; }
.tpos { display: inline-block; min-width: 34px; text-align: center; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 6px; }
.t-first { background: #e6f4ee; color: var(--good); }
.t-junior { background: #fdecea; color: var(--bad); }
.t-tax { background: #fef0e6; color: var(--warn); }
.t-unknown { background: #f1f5f9; color: var(--muted); }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.panel h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.src { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); opacity: .85; }
.src a { color: inherit; text-decoration: underline; text-decoration-style: dotted; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 550; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.hero h2 { margin: 0 0 4px; font-size: 24px; }
.hero .meta { color: var(--muted); font-size: 14px; }
.bignum { font-size: 26px; font-weight: 700; }
.empty { color: var(--muted); padding: 40px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.invest { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.invest .cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.invest .cell .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: block; margin-bottom: 4px; }
.invest .cell .v { font-size: 21px; font-weight: 700; }
.invest .cell .s { font-size: 12px; color: var(--muted); display: block; margin-top: 3px; }
.invest .cell.hl { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sv img { width: 100%; max-width: 640px; border-radius: 12px; border: 1px solid var(--line); display: block; }
#map { height: calc(100vh - 53px); }
.leaflet-popup-content { font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.leaflet-popup-content b { font-size: 14px; }
