:root {
  --bg: #07090c;
  --bg-panel: #0e1116;
  --bg-elev: #141820;
  --border: rgba(197, 208, 224, 0.35);
  --line: rgba(197, 208, 224, 0.35);
  --text: #e8ecf2;
  --text-dim: #9aa3b2;
  --text-mute: #6b7382;
  --accent: #e8a838;
  --accent-dim: rgba(232, 168, 56, 0.2);
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 8px;
  --radius-sm: 4px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --wo-css: 67;
  --pwa-fill-h: 100%;
  --pwa-extra-b: 0px;
  --christian: #ffd58a;
  --jewish: #7eb6ff;
  --muslim: #3dffa3;
  --hindu: #ff7a3a;
  --buddhist: #ffe566;
  --sikh: #ffb020;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

html.pwa-standalone,
html.pwa-standalone body {
  position: static;
  height: calc(var(--pwa-fill-h, 100%) + var(--pwa-extra-b, 0px));
  min-height: calc(var(--pwa-fill-h, 100%) + var(--pwa-extra-b, 0px));
  max-height: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--accent);
  color: #111;
  padding: 8px 16px;
  font-weight: 600;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

.hidden {
  display: none !important;
}

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-panel);
  touch-action: manipulation;
}

html.pwa-standalone .app {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  height: calc(var(--pwa-fill-h, 100%) + var(--pwa-extra-b, 0px));
  min-height: calc(var(--pwa-fill-h, 100%) + var(--pwa-extra-b, 0px));
}

.topbar {
  position: relative;
  flex: 0 0 auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: calc(4px + var(--safe-t))
    calc(16px + var(--safe-r)) 8px
    calc(16px + var(--safe-l));
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.topbar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: Michroma, "IBM Plex Sans", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 26px;
  white-space: nowrap;
}

.brand-info {
  position: absolute;
  top: calc(4px + var(--safe-t));
  right: calc(16px + var(--safe-r));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text-mute);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}
.brand-info[aria-expanded="true"],
.brand-info[aria-expanded="true"]:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.topbar-chrome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.totals {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.tot {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.tot .k {
  display: inline;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3b82f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.tot .v {
  display: inline;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 18px;
  color: var(--text);
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 3px;
  width: 100%;
}

.mode-toggle {
  display: inline-flex;
  justify-content: center;
  align-self: center;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(16, 22, 32, 0.72);
}

.mode-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 4px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-mute);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  cursor: pointer;
}

.mode-btn + .mode-btn {
  border-left: 1px solid var(--line);
}

.mode-btn[aria-pressed="true"] {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.22);
}

@media (hover: hover) {
  .mode-btn:hover:not([aria-pressed="true"]) {
    color: var(--text-dim);
    background: rgba(24, 32, 44, 0.7);
  }
}

.chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  min-height: 0;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(16, 22, 32, 0.92);
  color: var(--text-dim);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  color: var(--chip, var(--accent));
  background: var(--chip-dim, var(--accent-dim));
  border-color: var(--chip, var(--line));
}

@media (hover: hover) {
  .chip:hover:not([aria-pressed="true"]) {
    color: var(--text);
    background: rgba(24, 32, 44, 0.96);
  }
  .brand-info:hover:not([aria-expanded="true"]) {
    color: var(--text);
    border-color: rgba(197, 208, 224, 0.55);
  }
}

.map-pane {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  background: var(--bg-panel);
}

.map {
  position: absolute;
  inset: 0;
  background: var(--bg-panel);
}

.status {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(14, 17, 22, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-dim);
  pointer-events: none;
}
.status.is-off {
  display: none;
}

.sheet,
.about {
  position: fixed;
  z-index: 20;
  bottom: max(12px, var(--safe-b));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.about {
  left: 12px;
  right: 12px;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 12px;
  padding: 16px 16px 18px;
}

.sheet {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  margin: 0;
  border-radius: 6px;
  padding: 7px 9px 8px;
}

.sheet-close {
  position: absolute;
  top: 2px;
  right: 4px;
  appearance: none;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  padding: 2px 3px;
  cursor: pointer;
}

.about .sheet-close {
  top: 8px;
  right: 10px;
  font-size: 22px;
}

.sheet h2 {
  margin: 0 18px 1px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.about h2 {
  margin: 0 28px 6px 0;
  font-size: 18px;
}

.sheet-rel {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.sheet-where {
  margin: 1px 0 6px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.25;
}

.sheet-maps {
  display: inline-block;
  color: #0b0d10;
  background: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 10px;
  line-height: 1.15;
  padding: 2px 6px;
  border-radius: 3px;
}

.about p {
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 13px;
}

.maplibregl-map {
  font-family: var(--font);
  background: var(--bg-panel);
}

.maplibregl-ctrl-attrib {
  font-size: 10px !important;
  background: rgba(14, 17, 22, 0.7) !important;
  color: var(--text-mute) !important;
  max-width: 55%;
}
.maplibregl-ctrl-attrib a {
  color: var(--text-dim) !important;
}

.maplibregl-ctrl-bottom-left .maplibregl-ctrl,
.maplibregl-ctrl-bottom-right .maplibregl-ctrl {
  margin: 0 8px 8px 0;
}

.wo-dots {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

@media (orientation: landscape) and (max-height: 430px) {
  .tot .v {
    font-size: 14px;
    line-height: 16px;
  }
  .topbar {
    gap: 4px;
    padding-bottom: 6px;
  }
}
