/* Web version: a full page instead of an overlay window, so no window
   handles, pinning, hotkeys, cache or logs. */
html.web body { background: #141614; }
html.web #panel { border: 0; border-radius: 0; background: #141614; }
html.web #move, html.web #resize, html.web #pin-toggle, html.web #hint,
html.web #settings-panel h3:first-of-type,
html.web #settings-panel .settings-row:has(.hotkey),
html.web #settings-panel .settings-row:has(#cache-size),
html.web #open-logs,
html.web #settings-panel .settings-row:has(#telemetry-on) { display: none; }

/* Phones (web/overlay.js adds .phone): search, map and style on top, a bottom
   bar with big buttons, panels as sheets above it. */
html.phone { --bar: calc(58px + env(safe-area-inset-bottom)); }
html.phone body { font-size: 15px; -webkit-text-size-adjust: 100%; }
html.phone #topbar { top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; gap: 6px; }
html.phone #search-box { flex: 1 1 100%; max-width: none; }
html.phone #search { font-size: 16px; padding: 10px 12px; } /* 16px: iOS doesn't zoom in on focus */
html.phone #toolbar { display: none; }
html.phone #phone-top { display: flex; gap: 6px; width: 100%; }
html.phone #phone-top select, html.phone #phone-top button {
  font-size: 15px; min-height: 40px; padding: 0 10px; border-radius: 8px;
  background: rgba(15, 16, 15, 0.9); color: inherit; border: 1px solid #444;
}
html.phone #phone-top #map-select { flex: 1; min-width: 0; }
html.phone #phone-bar {
  position: absolute; z-index: 1002; left: 0; right: 0; bottom: 0; height: var(--bar);
  padding: 4px 4px env(safe-area-inset-bottom); box-sizing: border-box;
  display: flex; align-items: center; gap: 2px;
  background: rgba(15, 16, 15, 0.96); border-top: 1px solid #333;
}
html.phone #phone-bar > button, html.phone .phone-place button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 48px; padding: 0 2px; font-size: 18px; line-height: 1;
  background: none; border: 0; border-radius: 8px; color: inherit;
}
html.phone #phone-bar span { font-size: 10px; opacity: 0.85; }
html.phone #phone-bar > button[aria-expanded="true"] { background: #3a3d38; }
html.phone .phone-place { display: flex; flex: 3; gap: 2px; margin-right: 4px; padding: 2px; border-radius: 10px; background: #222; }
html.phone .phone-place button.active { background: #ffd27a; color: #141614; }
html.phone .phone-place button.active span { opacity: 1; font-weight: 600; }
html.phone #layers-panel, html.phone #routes-panel, html.phone #settings-panel, html.phone #squad-panel, html.phone #challenges-panel {
  position: absolute; top: auto !important; left: 0; right: 0; bottom: var(--bar);
  width: auto; max-width: none; max-height: 62vh; overflow-y: auto; box-sizing: border-box;
  border-radius: 14px 14px 0 0; padding: 12px 16px 16px; font-size: 15px;
}
html.phone #layers-panel label { padding: 7px 0; }
html.phone #layers-panel input { width: 20px; height: 20px; }
html.phone #settings-panel button, html.phone #layers-panel button, html.phone #routes-panel button,
html.phone #squad-panel button, html.phone #challenges-panel button { min-height: 40px; font-size: 14px; }
html.phone .phone-clear { width: 100%; margin-bottom: 8px; }
html.phone #status {
  bottom: calc(var(--bar) + 8px); left: 8px; right: 8px; flex-wrap: wrap; gap: 6px 10px; font-size: 13px;
}
html.phone #help, html.phone .leaflet-control-zoom { display: none; }
html.phone #route-card { left: 8px; right: 8px; bottom: calc(var(--bar) + 52px); max-width: none; }
html.phone #notice { left: 8px; right: 8px; }
html.phone .welcome-card { width: auto; margin: 0 16px; font-size: 15px; }
html.phone #coords { display: none; } /* follows the mouse; no mouse on a phone */
html.phone .squad-colors { gap: 10px; flex-wrap: wrap; }
html.phone #squad-panel .squad-color { width: 34px; height: 34px; min-height: 34px; flex: none; border-width: 3px; }
html.phone #squad-panel .squad-row:has(.squad-colors) { flex-wrap: wrap; }
html.phone #squad-panel .squad-row:has(.squad-colors) input[type=text] { flex: 1 1 100%; min-height: 40px; font-size: 16px; }
