/* A table and a map. The table is the thing you scan; the map is the thing that tells you whether a street
   is anywhere you would live. On a phone they stack, map first, because at that size the map is the answer. */
:root {
  --bg: #fbfaf8; --card: #fff; --ink: #1b1a18; --faint: #6b6762; --line: #e6e2dc; --hover: #f4f1ec;
  --accent: #8a5a2b; --good: #2f6b45; --bad: #9b3a2f; --star: #c8871f; --pick: #fdf4e6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#16151a; --card:#1e1d23; --ink:#eceaf0; --faint:#a09ba8; --line:#33313b; --hover:#26252d;
          --accent:#d9a066; --good:#6fbf8e; --bad:#e08a7d; --star:#e0b357; --pick:#2c2620; }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 14px/1.45 system-ui, -apple-system, sans-serif; display: flex; flex-direction: column; }
h1 { font-size: 16px; margin: 0; letter-spacing: .02em; white-space: nowrap; }

.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
       padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.filters input[type=search], .filters select {
  font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); min-height: 36px; }
.filters input[type=search] { flex: 0 1 220px; }
.check { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 13px; }
.count { color: var(--faint); font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.who form { margin: 0; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0;
              text-decoration: underline; }

.split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.tablewrap { overflow: auto; min-height: 0; }
.mapwrap { border-left: 1px solid var(--line); min-height: 0; }
#map { height: 100%; width: 100%; background: var(--hover); }
/* A minimum so the map still has a box to measure if the grid row has not resolved yet. */
.mapwrap { min-height: 240px; }
.tilewarn { position: absolute; inset: auto 8px 8px; z-index: 500; background: var(--card); color: var(--bad);
            border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .mapwrap { border-left: 0; border-bottom: 1px solid var(--line); height: 260px; order: -1; }
}

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
thead th { position: sticky; top: 0; z-index: 2; background: var(--card); text-align: left;
           font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
           padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
thead th:hover { color: var(--ink); }
thead th .dir { color: var(--accent); }
tbody td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--hover); }
tbody tr.picked { background: var(--pick); }
td.num { text-align: right; }
td.addr { white-space: normal; min-width: 180px; }
td.addr a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
td.addr a:hover { border-color: var(--accent); }
.town { color: var(--faint); font-size: 12px; }
.thumb { width: 74px; height: 52px; object-fit: cover; border-radius: 5px; background: var(--hover);
         display: block; }
.none { color: var(--good); }
.dues { color: var(--bad); }
.tag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
       color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.stars { display: inline-flex; gap: 1px; white-space: nowrap; }
.stars button, .stars span { background: none; border: 0; padding: 0 1px; font-size: 15px; line-height: 1;
                             color: var(--line); cursor: default; }
.stars button { cursor: pointer; }
.stars .on { color: var(--star); }
.note { font: inherit; font-size: 13px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px;
        background: var(--bg); color: var(--ink); width: 170px; }
.said { color: var(--faint); font-size: 12px; max-width: 200px; white-space: normal; }

.leaflet-popup-content { margin: 8px 10px; font: 13px/1.4 system-ui, sans-serif; }
.leaflet-popup-content b { display: block; }
.leaflet-popup-content img { width: 100%; border-radius: 4px; margin-top: 5px; }

.centred { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.login { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px;
         width: 100%; max-width: 330px; display: grid; gap: 10px; }
.login form { display: grid; gap: 8px; margin: 0; }
.login label { font-size: 12px; color: var(--faint); }
.login .hint { font-size: 12px; color: var(--faint); margin: 0; }
.rule { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 4px 0; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login input { font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
               background: var(--bg); color: var(--ink); }
.login button { margin-top: 4px; font: inherit; padding: 11px; border: 0; border-radius: 8px;
                background: var(--accent); color: #fff; cursor: pointer; }
.error { color: var(--bad); font-size: 13px; margin: 0; }
