/* One stylesheet, system fonts, dark by preference. No framework. */
:root {
  --bg: #fff;
  --fg: #16181d;
  --muted: #6a7280;
  --line: #dde1e7;
  --accent: #1d6fd8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161a; --fg: #e6e8ec; --muted: #949aa5; --line: #2a2e36; }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.45 system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
}
button, input {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
}
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { cursor: default; opacity: 0.6; }
button.active { border-color: var(--accent); color: var(--accent); }
a { color: var(--accent); }

/* The nav is <a> now that routes are real URLs, so it has to look like the
   buttons it replaced: middle-click and "copy link" only work on an anchor. */
header nav a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: inherit;
  text-decoration: none;
}
header nav a:hover { border-color: var(--accent); }
header nav a.active { border-color: var(--accent); color: var(--accent); }

.center { min-height: 100dvh; display: grid; place-content: center; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.login { width: min(320px, 90vw); }
.login h1 { margin: 0 0 4px; font-size: 18px; }
.error { color: #d8461d; margin: 0; }
.muted { color: var(--muted); }
.banner { padding: 6px 12px; background: #d8461d22; border-bottom: 1px solid var(--line); }

.shell { display: flex; flex-direction: column; height: 100dvh; }
header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
header nav { display: flex; gap: 6px; }
header .who { margin-left: auto; color: var(--muted); }

.split { flex: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
aside { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; display: grid; gap: 6px; align-content: start; }
.map { height: 100%; }

.person { display: grid; gap: 2px; text-align: left; width: 100%; }
.person .name { font-weight: 600; }
.person .meta { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.fresh { background: #2e9e4f; }
.dot.stale { background: #d8a11d; }
.dot.old { background: #d8461d; }

.settings { padding: 16px; display: grid; gap: 16px; max-width: 640px; }
.settings h2 { margin: 0 0 8px; font-size: 15px; }
.token { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.password { display: grid; gap: 8px; margin-top: 12px; }

/* Shares reuse the token row's shape: same list, same border, same stop button. */
.share { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.share-form { display: grid; gap: 8px; margin-top: 12px; justify-items: start; }
.share-form input:not([type="checkbox"]) { width: 100%; }
.share-form label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.share-form p { margin: 0; font-size: 12px; }
/* Only the share form has selects; matching the button/input rule keeps the
   native dropdown behaviour and still looks like the rest of the form. */
select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
}

/* Leaflet's own attribution must stay legible in dark mode; it is not optional. */
.leaflet-container { background: var(--bg); }
.leaflet-control-attribution { background: #ffffffcc !important; color: #16181d !important; }
.leaflet-control-attribution a { color: #1d6fd8 !important; }
