:root {
  --bg: #f4f5f7; --card: #fff; --text: #15181d; --muted: #6b7280; --line: #e3e5e9;
  --accent: #2563eb; --accent-text: #fff; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --card: #1a1e24; --text: #e8eaed; --muted: #9aa1ab; --line: #2a2f37;
    --accent: #3b82f6; --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 8px; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
main { padding: 0 16px 24px; max-width: 640px; margin: 0 auto; }
#map { height: 42vh; min-height: 240px; background: var(--line); }

.pill { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--card); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.stats div { background: var(--card); border-radius: 12px; padding: 10px; }
.stats small { display: block; color: var(--muted); font-size: 12px; }
.stats b { font-size: 15px; }

.actions { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; margin-top: 16px; }
button {
  font: inherit; font-weight: 600; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); padding: 14px; cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.ghost { background: transparent; }
button.small { padding: 8px 12px; font-size: 14px; margin-top: 24px; }
button:disabled { opacity: .5; }
.note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }

.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.list li:first-child { border-top: 0; }
.list li span:last-child { color: var(--muted); white-space: nowrap; }
.list .empty { color: var(--muted); }

.login { max-width: 320px; margin: 20vh auto 0; padding: 0 16px; text-align: center; }
.login form { display: grid; gap: 10px; margin-top: 20px; }
.login input {
  font: inherit; padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text);
}
.login button { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.err { color: var(--bad); font-size: 14px; }

@media (max-width: 380px) { .stats { grid-template-columns: repeat(2, 1fr); } }
