:root {
  --paper: #f4f0e6;
  --ink: #1c1914;
  --muted: #5e584e;
  --line: #d9d1c3;
  --rust: #8f2d16;
  --amber: #8a5a12;
  --pine: #1d5c45;
  --card: #fbf8f2;
  --mark: #f3e2c4;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.mast {
  padding: 40px 28px 8px;
  max-width: 1180px;
  margin: 0 auto;
}
.kicker {
  margin: 0 0 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}
h1 {
  margin: 0;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.lede {
  max-width: 68ch;
  color: var(--muted);
  margin: 14px 0 0;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 28px 64px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 28px 0 8px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--ink);
}
.stat .value {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat .value.rust { color: var(--rust); }
.stat .value.pine { color: var(--pine); }
.stat .label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar { margin: 18px 0 14px; }
.horizon { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.horizon-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.filters button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.filters button .count { color: inherit; opacity: 0.7; margin-left: 4px; }
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  margin-top: 12px;
}
.search { flex: 1 1 240px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.search input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font: inherit;
  padding: 8px 0;
  color: var(--ink);
}
.search input:focus { outline: 2px solid var(--pine); outline-offset: 3px; }
.check { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.map-block { margin: 6px 0 8px; }
#map {
  height: 480px;
  border: 1px solid var(--ink);
  background: #e7e2d6;
}
.leaflet-container { font: inherit; }
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.legend .dark { margin-left: 10px; }
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--ink);
}
.swatch.light { background: #f3e2c4; }
.swatch.dark { background: #8f2d16; width: 18px; height: 18px; }
.map-note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chips button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.list-head[hidden] { display: none; }
.list-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin: 18px 0 0;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 28px;
}
.list-head button {
  appearance: none;
  border: none;
  background: none;
  color: var(--pine);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
}
.area-name { font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 8px; vertical-align: top; border-bottom: 1px solid var(--line); }
td.place { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.num { white-space: nowrap; }
th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num .sub { text-align: right; }
th[aria-sort="descending"]::after { content: " ↓"; }
th[aria-sort="ascending"]::after { content: " ↑"; }
tbody tr.project { cursor: pointer; }
tbody tr.project:hover { background: rgba(255, 255, 255, 0.55); }
tbody tr.project.open { background: var(--card); }
.name { font-weight: 600; }
.promoter, .sub, .handover { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.handover.late { color: var(--rust); }
.mark {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rust);
}
td.unsold, td.late { color: var(--rust); font-weight: 650; }
td.money, .money, .buyer-line { font-weight: 650; }
.money.green, .buyer-line.green { color: var(--pine); }
.money.yellow, .buyer-line.yellow { color: var(--amber); }
.money.red, .buyer-line.red { color: var(--rust); }
.buyer-line { display: none; }
.buyer-counts { color: var(--muted); font-weight: 600; }
td.gap { color: var(--rust); font-weight: 650; }
.buyer-label {
  margin: 12px 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.nocs, .units, .missing { margin: 0 0 8px; padding-left: 18px; }
.nocs .yes { color: var(--pine); }
.nocs .no { color: var(--rust); }
.buyer-span { grid-column: 1 / -1; }
.read-progress { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
td.late { font-weight: 600; }
.detail td { background: var(--card); padding: 8px 10px 18px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px 32px;
  font-size: 14px;
}
.detail-grid p { margin: 0 0 8px; }
.detail-grid a { color: var(--pine); }
.flag {
  background: var(--mark);
  padding: 8px 10px;
  margin: 0 0 8px;
}
.empty { color: var(--muted); }
.note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
  max-width: 78ch;
}
.note a { color: var(--pine); }

@media (max-width: 800px) {
  .mast, main { padding-left: 16px; padding-right: 16px; }
  .hero { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stat .value { font-size: 32px; }
  #map { height: 320px; }
  .list-head { font-size: 24px; }
  table { table-layout: fixed; }
  .wide-only { display: none; }
  th, td { padding: 8px 4px; }
  th { letter-spacing: 0; font-size: 11px; }
  th.num { text-align: left; }
  .buyer-line { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
  th:nth-child(5), td:nth-child(5),
  th:nth-child(6), td:nth-child(6),
  th:nth-child(7), td:nth-child(7),
  th:nth-child(8), td:nth-child(8),
  th:nth-child(9), td:nth-child(9),
  th:nth-child(10), td:nth-child(10),
  th:nth-child(11), td:nth-child(11),
  th:nth-child(12), td:nth-child(12),
  th:nth-child(13), td:nth-child(13) { display: none; }
  td.num .sub, td.late .sub { display: none; }
  th:nth-child(1) { width: auto; }
  th:nth-child(2) { width: 3.4rem; }
  th:nth-child(3) { width: 4.6rem; }
  th:nth-child(4) { width: 4.4rem; }
  .name, .promoter { overflow-wrap: anywhere; }
}
