@font-face {
  font-family: 'Jost';
  src: url('/fonts/Jost.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
html, body { background: #000; overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; }
body * { font-family: 'Jost', system-ui, sans-serif !important; }
#map { height: 100vh; height: 100dvh; }

.leaflet-touch .leaflet-control-zoom { display: none; }
.leaflet-top { top: env(safe-area-inset-top, 0px); }
.leaflet-left { left: env(safe-area-inset-left, 0px); }
.leaflet-right { right: env(safe-area-inset-right, 0px); }
.leaflet-top.leaflet-left { right: env(safe-area-inset-right, 0px); }
.leaflet-control-search { width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
.leaflet-control-search input {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  font-size: 16px !important;
  border-radius: 24px;
  padding: 0 18px;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
#status { top: calc(66px + env(safe-area-inset-top, 0px)); }
#geo-note { top: calc(92px + env(safe-area-inset-top, 0px)); }
body.session-on #status { top: calc(98px + env(safe-area-inset-top, 0px)); }
body.session-on #geo-note { top: calc(124px + env(safe-area-inset-top, 0px)); }

#start-session { background: #000; color: #fff; padding: 16px 28px; }

#layers-btn {
  position: absolute;
  z-index: 1100;
  left: calc(12px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}
#layers-btn.is-on { background: #000; color: #fff; }

#layer-sheet {
  position: absolute;
  z-index: 1150;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  color: #000;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
  padding: 8px calc(16px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}
#layer-sheet[hidden] { display: none; }
#layer-sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #ccc;
  margin: 0 auto 8px;
}
.ls-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ls-head span { font-weight: 500; font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; }
#ls-done {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: #000;
  color: #fff;
  font-size: 16px;
}
.ls-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: #555; margin: 14px 0 8px; }
.ls-items { display: flex; flex-wrap: wrap; gap: 8px; }
#layer-sheet .leaflet-control {
  float: none;
  clear: none;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: none;
  display: contents;
}
#layer-sheet .leaflet-control a,
#layer-sheet .leaflet-control-basemap button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  width: auto;
  height: auto;
  line-height: 1.2;
  padding: 0 16px;
  border: 1px solid #000;
  border-radius: 22px;
  background: #fff;
  color: #000;
  font-size: 15px !important;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}
#layer-sheet .leaflet-control a.is-on,
#layer-sheet .leaflet-control-basemap button.is-on { background: #000; color: #fff; }
#layer-sheet .exp-swatch { width: 12px; height: 12px; }
#layer-sheet .leaflet-control-layers { display: block; width: 100%; }
#layer-sheet .leaflet-control-layers-list,
#layer-sheet .leaflet-control-layers-overlays { display: flex; flex-wrap: wrap; gap: 8px; }
#layer-sheet .leaflet-control-layers-separator,
#layer-sheet .leaflet-control-layers-base:empty { display: none; }
#layer-sheet .leaflet-control-layers label {
  margin: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid #000;
  border-radius: 22px;
  font-size: 15px;
}
#layer-sheet .leaflet-control-layers label span { display: inline-flex; align-items: center; gap: 8px; }
#layer-sheet .leaflet-control-layers input { width: 18px; height: 18px; margin: 0; accent-color: #000; }

.leaflet-right .leaflet-control-follow { margin: 0 12px 12px 0; border: 0; background: none; }
.leaflet-control-follow a {
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 10px !important;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}
.leaflet-control-follow a.is-on { background: #000; color: #fff; }

#gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: env(safe-area-inset-top, 0px) 24px env(safe-area-inset-bottom, 0px);
  text-align: center;
}
#gate[hidden] { display: none; }
#gate .gate-title { font-weight: 500; font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
#gate .gate-text { font-size: 16px; max-width: 280px; }
#gate button {
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #000;
  font-size: 16px;
}
#layer-sheet .leaflet-control a.leaflet-control-layers-toggle { display: none; }
#layer-sheet .leaflet-control-layers-expanded { padding: 0; }
