:root {
  color-scheme: light dark;
  --bg: #fbf6ee;
  --panel: #fffdfa;
  --ink: #2a211a;
  --muted: #7c6a5b;
  --line: #e7dacb;
  --accent: #c8552b;
  --good: #2f7d4f;
  --warn: #c98a13;
  --bad: #b23a2c;
  --shadow: 0 1px 2px rgba(60, 35, 10, .06), 0 10px 26px rgba(90, 55, 20, .08);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f;
    --panel: #221c17;
    --ink: #f3ece3;
    --muted: #ac9c8b;
    --line: #382e25;
    --accent: #ef7b4d;
    --good: #5fbf85;
    --warn: #d9a63c;
    --bad: #e2776a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.top {
  position: sticky;
  top: 0;
  z-index: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px clamp(14px, 3vw, 34px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .goat { font-size: 34px; line-height: 1; }
h1 { margin: 0; font-size: clamp(20px, 3vw, 27px); letter-spacing: -.015em; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.pill[data-state="live"] .dot { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 20%, transparent); }
.pill[data-state="quiet"] .dot { background: var(--warn); }
.pill[data-state="none"] .dot { background: var(--bad); }

.wrap {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(14px, 3vw, 34px);
}
@media (min-width: 980px) {
  .wrap { grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); }
}

.map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #dfe6dc;
  box-shadow: var(--shadow);
}
#map { height: clamp(320px, 60vh, 780px); width: 100%; }
#map.no-map {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.leaflet-container { font: inherit; background: #dfe6dc; }

.goat-pin, .pin-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35));
}

.range {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}
.range button { padding: 6px 11px; border-radius: 999px; background: transparent; color: var(--ink); font-size: 13px; }
.range button.on { background: var(--accent); color: #fff; }

.map-hint {
  position: absolute;
  left: 10px;
  bottom: 24px;
  z-index: 500;
  max-width: 74%;
  margin: 0;
  padding: 8px 13px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.panel { display: grid; gap: clamp(12px, 2vw, 16px); }
.card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 10px;
  font-size: 12.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.card h3 { margin: 18px 0 8px; font-size: 14px; }
.big { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 14px 0 0;
}
.facts dt { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

button {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.07); }
button:disabled { opacity: .5; cursor: default; filter: none; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.go { background: var(--good); }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); cursor: pointer; }
.field { display: block; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.status { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.status.good { color: var(--good); }
.status.bad { color: var(--bad); }

.hangouts { display: grid; gap: 6px; }
.hangouts button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.hangouts .count { color: var(--accent); font-weight: 700; white-space: nowrap; }

pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 12.5px;
}
code {
  padding: .1em .35em;
  border-radius: .3em;
  background: color-mix(in srgb, currentColor 10%, transparent);
  font-size: .93em;
}
pre code { background: none; padding: 0; }

.foot { padding: 0 clamp(14px, 3vw, 34px) 30px; color: var(--muted); font-size: 13px; }
