/* raymap UI styles */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, system-ui, sans-serif; }

.topbar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: #1c2333; color: #fff; gap: 12px;
}
.topbar h1 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.controls { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.controls label { display: flex; align-items: center; gap: 6px; }
.controls select, .controls button {
  padding: 4px 8px; border-radius: 4px; border: 1px solid #555; background: #2b3450; color: #fff;
}
.search input {
  width: 190px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid #555; background: #2b3450; color: #fff;
}
.search input::placeholder { color: #9aa3af; }
@media (max-width: 720px) { .search input { width: 130px; } }

.status { color: #9fe3a6; }
.status.err { color: #ff9f9f; }
.badge {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: #2b3450; border: 1px solid #555; color: #cfd6e4;
}

#map { position: absolute; inset: 44px 0 0 0; }

.legend {
  position: absolute; z-index: 10; left: 12px; bottom: 24px;
  background: rgba(255,255,255,0.94); padding: 8px 12px; border-radius: 8px;
  font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.3); max-width: 320px;
}
.legend .swatch {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px;
  vertical-align: middle; border-radius: 2px;
}
/* solid = corroborated by 2+ devices; hollow = a single device (unconfirmed) */
.swatch.solid.red   { background: #e0393e; }
.swatch.solid.green { background: #2e9e4f; }
/* keep in sync with GREY in app.js (#7d8794 = 125,135,148) */
.swatch.solid.grey  { background: rgba(125,135,148,0.45); border: 1px solid rgba(125,135,148,1); }
.swatch.hollow.red  { border: 2.5px solid #e0393e; background: transparent; }
.swatch.hollow.green{ border: 2.5px solid #2e9e4f; background: transparent; }
.legend .note { margin-top: 6px; color: #444; font-style: italic; }
.legend em { font-style: italic; }

.maplibregl-popup-content { font-size: 12px; line-height: 1.45; }
.maplibregl-popup-content strong { display: block; margin-bottom: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #666; font-size: 11px; }

/* --- site menu (About / Downloads) --------------------------------------- */
/* <details> is used as-is: it is keyboard accessible and needs no JS to open.
   Sits beside the wordmark; margin-right:auto keeps .controls pinned right. */
.topbar .menu { position: relative; margin-right: auto; }
.menu summary {
  list-style: none; cursor: pointer; padding: 5px 12px; border-radius: 6px;
  border: 1px solid #8b9cbe; background: #3a4a6b; color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
}
.menu summary:hover, .menu summary:focus-visible {
  background: #4a5d85; border-color: #b9c8e2;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: 11px; color: #dde5f3; }
.menu[open] summary { background: #4a5d85; border-color: #b9c8e2; }
.menu[open] summary::after { content: " ▴"; }
.menu nav {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 20;
  display: flex; flex-direction: column; min-width: 170px;
  background: #1b2233; border: 1px solid #8b9cbe; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.55); overflow: hidden;
}
.menu nav a {
  padding: 11px 15px; color: #ffffff; text-decoration: none;
  font-size: 14px; font-weight: 600;
}
.menu nav a + a { border-top: 1px solid #33405c; }
.menu nav a:hover, .menu nav a:focus {
  background: #33405c; text-decoration: underline; color: #fff;
}
@media (max-width: 720px) {
  .menu summary { padding: 4px 8px; font-size: 12px; }
  .menu nav { min-width: 145px; }
}

/* --- static pages (/about, /downloads) ----------------------------------- */
body.page { background: #f6f7f9; color: #1b2230; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .navlink {
  color: #e8eefb; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(232,238,251,0.45); font-size: 13px; font-weight: 600;
}
.topbar .navlink:hover, .topbar .navlink:focus {
  color: #fff; text-decoration-color: #fff;
}
.prose {
  max-width: 720px; margin: 28px auto 64px; padding: 0 20px;
  font-size: 15px; line-height: 1.6;
}
.prose h2 { font-size: 17px; margin-top: 32px; }
.prose h3 { font-size: 14px; margin-top: 22px; }
.prose p, .prose li { color: #2b3444; }
.prose a { color: #1a4fa0; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; background: #eceef2; padding: 1px 4px; border-radius: 3px;
}
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #dfe3ea; }
.prose .callout {
  border-left: 3px solid #e0393e; background: #fdf0f0;
  padding: 10px 14px; margin: 18px 0; border-radius: 0 6px 6px 0;
}
.prose .muted { color: #5b6675; font-size: 13px; }
.prose pre {
  background: #eceef2; padding: 10px 12px; border-radius: 6px;
  overflow-x: auto; font-size: 13px;
}
.prose .card {
  border: 1px solid #dfe3ea; background: #fff; border-radius: 8px;
  padding: 12px 14px; margin: 12px 0;
}
.prose .card h3 { margin: 0 0 6px; font-size: 14px; }
.prose .card p { margin: 4px 0; }
.prose .card .download { font-weight: 600; font-size: 15px; }
.prose .card code { font-size: 12px; word-break: break-all; }
.swatch-inline {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px;
  vertical-align: middle; border-radius: 2px;
}
