/* Full-screen map workspace, using the shared GeeksPR theme. */
.page-map {
  --map-header-height: 80px;
  --map-sidebar-width: 304px;
  --map-chat-height: 76px;
  margin: 0;
  overflow: hidden;
  background: var(--gpr-bg, #0b1117);
  color: var(--gpr-text, #f2f5f6);
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-map *, .page-map *::before, .page-map *::after { box-sizing: border-box; }
.page-map [hidden] { display: none !important; }
.page-map .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.page-map #topbar.geekspr-header {
  position: absolute;
  z-index: 1300;
  inset: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: none;
  height: var(--map-header-height);
  min-height: 0;
  margin: 0;
  padding: 16px 40px;
  border-bottom: 1px solid var(--gpr-line, #27323d);
  background: var(--gpr-bg, #0b1117);
}

.page-map #topbar > .brand { flex: 0 0 auto; }
.page-map #topbar > .site-links {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #527245 transparent;
}
.page-map #topbar > .site-links a { min-height: 40px; padding: 8px 12px; font-size: 12px; }

#mainarea {
  position: absolute;
  inset: var(--map-header-height) var(--map-sidebar-width) 0 0;
  min-width: 0;
  background: #101a21;
}
#map { height: 100%; width: 100%; }

#chatpanel {
  position: absolute;
  z-index: 1200;
  inset: var(--map-header-height) 0 0 auto;
  width: var(--map-sidebar-width);
  padding: 24px 20px;
  border-left: 1px solid var(--gpr-line, #27323d);
  background: var(--gpr-panel, #121b24);
  color: var(--gpr-muted, #97a6b4);
}
#chatpaneltitle { margin-bottom: 12px; color: var(--gpr-text, #f2f5f6); font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
#chatpanel > a { display: block; color: var(--gpr-accent, #b6f36a); font-size: 12px; line-height: 1.7; text-decoration: none; }
#chatpanel > a:hover { text-decoration: underline; }
#chatpanel > a:focus-visible { outline: 2px solid var(--gpr-accent, #b6f36a); outline-offset: 4px; }

#popup { position: relative; width: min(340px, calc(100vw - 32px)); color: var(--gpr-text, #f2f5f6); }
.player-dialog {
  max-height: calc(100vh - var(--map-header-height) - 28px);
  max-height: calc(100dvh - var(--map-header-height) - 28px);
  overflow: auto;
  border: 1px solid #415950;
  border-radius: 12px;
  background: var(--gpr-panel, #121b24);
  box-shadow: 0 18px 48px #0007;
  scrollbar-width: thin;
}
.player-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--gpr-line, #27323d); }
.player-dialog__title { min-width: 0; font-size: 16px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.player-dialog__body { padding: 14px 16px 16px; }
.popup-close { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; min-height: 32px; padding: 0; border: 1px solid var(--gpr-line, #27323d); border-radius: 8px; background: #182832; color: var(--gpr-accent, #b6f36a); cursor: pointer; font: 22px/1 system-ui, sans-serif; }
.popup-close:hover { background: #314641; }
.popup-close:focus-visible { outline: 2px solid var(--gpr-accent, #b6f36a); outline-offset: 3px; }
.popup-title { padding-bottom: 6px; font-size: 14px; }
.popup-details { display: grid; gap: 9px; font-size: 12px; line-height: 1.5; }
.popup-details div { display: grid; grid-template-columns: minmax(76px, auto) minmax(0, 1fr); align-items: baseline; gap: 12px; }
.popup-details span { color: var(--gpr-muted, #97a6b4); }
.popup-details strong { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.popup-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gpr-line, #27323d); font-size: 12px; }
.popup-actions label { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 32px; cursor: pointer; }
.page-map #popup .popup-actions input { min-height: 0; width: auto; height: auto; accent-color: var(--gpr-accent, #b6f36a); }

/* Keep map controls legible against either map style. */
.page-map .ol-control { padding: 3px; border: 1px solid #445863; border-radius: 8px; background: #15232ce6; }
.page-map .ol-control > button { width: 32px; height: 32px; min-height: 32px; margin: 1px; border: 0; border-radius: 5px; background-color: #182832; color: var(--gpr-text, #f2f5f6); cursor: pointer; }
.page-map .ol-control > button:hover, .page-map .ol-control > button:focus { background-color: #314641; }
.page-map .ol-control > button:focus-visible { outline: 2px solid var(--gpr-accent, #b6f36a); outline-offset: 2px; }
.page-map .layer-switcher { top: 12px; right: 12px; }
.page-map .layer-switcher .panel { padding: 14px 12px; border: 0; border-radius: 7px; background: var(--gpr-panel, #121b24); color: var(--gpr-text, #f2f5f6); box-shadow: 0 10px 28px #0005; }
.page-map .layer-switcher li { margin-top: 8px; }
.page-map .layer-switcher label { font-size: 12px; }
.page-map .layer-switcher .group button { min-height: 0; background-color: transparent; }
.page-map .layer-switcher li input { min-height: 0; accent-color: var(--gpr-accent, #b6f36a); }
.page-map .ol-mouse-position { top: auto; right: 12px; bottom: 12px; padding: 5px 8px; border: 1px solid #445863; border-radius: 5px; background: #0b1117d9; color: var(--gpr-muted, #97a6b4); font-size: 11px; font-variant-numeric: tabular-nums; }

@media (max-width: 1200px) {
  .page-map { --map-header-height: 112px; --map-sidebar-width: 240px; }
  .page-map #topbar.geekspr-header { flex-wrap: wrap; justify-content: flex-start; align-content: center; gap: 8px; padding: 8px 24px 10px; }
  .page-map #topbar > .brand { height: 42px; }
  .page-map #topbar > .site-links { flex: 1 0 100%; order: 3; width: 100%; }
}
@media (max-width: 760px) {
  .page-map { --map-sidebar-width: 0px; }
  .page-map #topbar.geekspr-header { padding-right: 16px; padding-left: 16px; }
  .page-map #topbar > .site-links a { min-height: 40px; padding: 8px 10px; font-size: 12px; }
  #mainarea { bottom: var(--map-chat-height); }
  #chatpanel { inset: auto 0 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; height: var(--map-chat-height); padding: 10px 16px; border-top: 1px solid var(--gpr-line, #27323d); border-left: 0; }
  #chatpaneltitle { margin: 0; font-size: 12px; }
  #chatpanel > a { font-size: 11px; line-height: 1.5; }
  .player-dialog { max-height: calc(100vh - var(--map-header-height) - var(--map-chat-height) - 24px); max-height: calc(100dvh - var(--map-header-height) - var(--map-chat-height) - 24px); }
}
