:root,
:host {
  --ol-background-color: white;
  --ol-accent-background-color: #F5F5F5;
  --ol-subtle-background-color: rgba(128, 128, 128, 0.25);
  --ol-partial-background-color: rgba(255, 255, 255, 0.75);
  --ol-foreground-color: #333333;
  --ol-subtle-foreground-color: #666666;
  --ol-brand-color: #00AAFF;
}

.ol-box {
  box-sizing: border-box;
  border-radius: 2px;
  border: 1.5px solid var(--ol-background-color);
  background-color: var(--ol-partial-background-color);
}

.ol-mouse-position {
  top: 8px;
  right: 8px;
  position: absolute;
}

.ol-scale-line {
  background: var(--ol-partial-background-color);
  border-radius: 4px;
  bottom: 8px;
  left: 8px;
  padding: 2px;
  position: absolute;
}

.ol-scale-line-inner {
  border: 1px solid var(--ol-subtle-foreground-color);
  border-top: none;
  color: var(--ol-foreground-color);
  font-size: 10px;
  text-align: center;
  margin: 1px;
  will-change: contents, width;
  transition: all 0.25s;
}

.ol-scale-bar {
  position: absolute;
  bottom: 8px;
  left: 8px;
}

.ol-scale-bar-inner {
  display: flex;
}

.ol-scale-step-marker {
  width: 1px;
  height: 15px;
  background-color: var(--ol-foreground-color);
  float: right;
  z-index: 10;
}

.ol-scale-step-text {
  position: absolute;
  bottom: -5px;
  font-size: 10px;
  z-index: 11;
  color: var(--ol-foreground-color);
  text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);
}

.ol-scale-text {
  position: absolute;
  font-size: 12px;
  text-align: center;
  bottom: 25px;
  color: var(--ol-foreground-color);
  text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);
}

.ol-scale-singlebar {
  position: relative;
  height: 10px;
  z-index: 9;
  box-sizing: border-box;
  border: 1px solid var(--ol-foreground-color);
}

.ol-scale-singlebar-even {
  background-color: var(--ol-subtle-foreground-color);
}

.ol-scale-singlebar-odd {
  background-color: var(--ol-background-color);
}

.ol-unsupported {
  display: none;
}

.ol-viewport,
.ol-unselectable {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ol-viewport canvas {
  all: unset;
  overflow: hidden;
}

.ol-viewport {
  touch-action: none;
}

.ol-selectable {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

.ol-grabbing {
  cursor: -webkit-grabbing;
  cursor: -moz-grabbing;
  cursor: grabbing;
}

.ol-grab {
  cursor: move;
  cursor: -webkit-grab;
  cursor: -moz-grab;
  cursor: grab;
}

.ol-control {
  position: absolute;
  background-color: var(--ol-subtle-background-color);
  border-radius: 4px;
}

.ol-zoom {
  top: .5em;
  left: .5em;
}

.ol-rotate {
  top: .5em;
  right: .5em;
  transition: opacity .25s linear, visibility 0s linear;
}

.ol-rotate.ol-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s linear, visibility 0s linear .25s;
}

.ol-zoom-extent {
  top: 4.643em;
  left: .5em;
}

.ol-full-screen {
  right: .5em;
  top: .5em;
}

.ol-control button {
  display: block;
  margin: 1px;
  padding: 0;
  color: var(--ol-subtle-foreground-color);
  font-weight: bold;
  text-decoration: none;
  font-size: inherit;
  text-align: center;
  height: 1.375em;
  width: 1.375em;
  line-height: .4em;
  background-color: var(--ol-background-color);
  border: none;
  border-radius: 2px;
}

.ol-control button::-moz-focus-inner {
  border: none;
  padding: 0;
}

.ol-zoom-extent button {
  line-height: 1.4em;
}

.ol-compass {
  display: block;
  font-weight: normal;
  will-change: transform;
}

.ol-touch .ol-control button {
  font-size: 1.5em;
}

.ol-touch .ol-zoom-extent {
  top: 5.5em;
}

.ol-control button:hover,
.ol-control button:focus {
  text-decoration: none;
  outline: 1px solid var(--ol-subtle-foreground-color);
  color: var(--ol-foreground-color);
}

.ol-zoom .ol-zoom-in {
  border-radius: 2px 2px 0 0;
}

.ol-zoom .ol-zoom-out {
  border-radius: 0 0 2px 2px;
}

.ol-attribution {
  text-align: right;
  bottom: .5em;
  right: .5em;
  max-width: calc(100% - 1.3em);
  display: flex;
  flex-flow: row-reverse;
  align-items: center;
}

.ol-attribution a {
  color: var(--ol-subtle-foreground-color);
  text-decoration: none;
}

.ol-attribution ul {
  margin: 0;
  padding: 1px .5em;
  color: var(--ol-foreground-color);
  text-shadow: 0 0 2px var(--ol-background-color);
  font-size: 12px;
}

.ol-attribution li {
  display: inline;
  list-style: none;
}

.ol-attribution li:not(:last-child):after {
  content: " ";
}

.ol-attribution img {
  max-height: 2em;
  max-width: inherit;
  vertical-align: middle;
}

.ol-attribution button {
  flex-shrink: 0;
}

.ol-attribution.ol-collapsed ul {
  display: none;
}

.ol-attribution:not(.ol-collapsed) {
  background: var(--ol-partial-background-color);
}

.ol-attribution.ol-uncollapsible {
  bottom: 0;
  right: 0;
  border-radius: 4px 0 0;
}

.ol-attribution.ol-uncollapsible img {
  margin-top: -.2em;
  max-height: 1.6em;
}

.ol-attribution.ol-uncollapsible button {
  display: none;
}

.ol-zoomslider {
  top: 4.5em;
  left: .5em;
  height: 200px;
}

.ol-zoomslider button {
  position: relative;
  height: 10px;
}

.ol-touch .ol-zoomslider {
  top: 5.5em;
}

.ol-overviewmap {
  left: 0.5em;
  bottom: 0.5em;
}

.ol-overviewmap.ol-uncollapsible {
  bottom: 0;
  left: 0;
  border-radius: 0 4px 0 0;
}

.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
  display: block;
}

.ol-overviewmap .ol-overviewmap-map {
  border: 1px solid var(--ol-subtle-foreground-color);
  height: 150px;
  width: 150px;
}

.ol-overviewmap:not(.ol-collapsed) button {
  bottom: 0;
  left: 0;
  position: absolute;
}

.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
  display: none;
}

.ol-overviewmap:not(.ol-collapsed) {
  background: var(--ol-subtle-background-color);
}

.ol-overviewmap-box {
  border: 1.5px dotted var(--ol-subtle-foreground-color);
}

.ol-overviewmap .ol-overviewmap-box:hover {
  cursor: move;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

input,
select {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 16px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

#pdf-map, #pdf-chart {
  opacity: 0;
  width: 0;
  height: 0;
  z-index: -1;
}

#map {
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ol-zoom {
  margin: env(safe-area-inset-top) 0 0 env(safe-area-inset-left);
}

.controls {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 0;
  list-style: none;
  text-align: right;
}

.controls li {
  background-color: var(--ol-background-color);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.controls a {
  display: block;
  line-height: 48px;
  width: 48px;
  text-align: center;
  border: none;
  font-size: 22px;
}

.controls a + a {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.controls svg {
  vertical-align: middle;
  padding-bottom: 4px;
  opacity: 0.6;
}

.controls li:hover svg,
.controls .active svg {
  opacity: 1;
}

.controls .active {
  background-color: var(--ol-subtle-foreground-color);
  overflow: hidden;
}

.controls .active svg {
  opacity: 1;
}

.controls .active path {
  fill: var(--ol-accent-background-color);
}

#measure-point {
  display: none;
}

#tool-header {
  position: absolute;
  left: 64px;
  right: 64px;
  top: 8px;
  z-index: 11;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

#tool-header.hidden {
  display: none;
}

#tool-header p {
  display: flex;
  position: relative;
  text-align: center;
  max-width: 240px;
  font-size: 14px;
  margin: auto;
  border-radius: 8px;
  background-color: var(--ol-background-color);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

#tool-header span {
  display: block;
  flex-grow: 1;
  padding: 8px 16px;
}

#tool-header .close {
  display: block;
  padding-top: 2px;
  padding: 6px 12px;
  opacity: 0.6;
}

#tool-header .close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

#tool-header svg {
  vertical-align: middle;
}

.tabs {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 0;
  list-style: none;
  text-align: right;
  pointer-events: none;
}

.tabs > li:first-child {
  display: none;
}

.tabs button,
.tabs label,
.tabs a {
  pointer-events: all;
}

.tabs button {
  position: relative;
  background-color: var(--ol-background-color);
  line-height: 48px;
  width: 48px;
  text-align: center;
  border-radius: 24px;
  border: none;
  font-size: 22px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  margin: 0 0 24px 0;
  padding: 0;
  text-decoration: none;
  transition: 0.3s;
}

.tabs button span {
  position: absolute;
  font-size: 12px;
  line-height: 16px;
  bottom: -24px;
  right: 0;
  min-width: 48px;
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff, 0 0 8px #fff;
  font-weight: 600;
  color: var(--ol-subtle-foreground-color);
  transition: 0.3s;
}

.tabs button svg {
  vertical-align: middle;
  opacity: 0.6;
  transition: 0.3s;
}

.tabs li.active button {
  margin-bottom: 28px;
}

.tabs li.active button span {
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 20px;
  bottom: -28px;
}

.tabs li.active button svg {
  opacity: 0.8;
}

.tabs li.active .tabs-content {
  height: inherit;
  opacity: 1;
  transform: scale(1, 1);
}

.tabs-content {
  height: 0;
  opacity: 0;
  transform: scale(0, 0);
  transform-origin: 100% 14px;
  transition: 0.3s;
}

#layers ul,
#locations ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
  list-style: none;
}

#layers label,
#layers a,
#locations label,
#locations a {
  display: block;
  line-height: 40px;
  text-align: center;
  padding: 0 24px;
  color: var(--ol-subtle-foreground-color);
  background-color: var(--ol-background-color);
  border-radius: 20px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

#layers li[data-radio=bg] + [data-radio=bg],
#layers li[data-radio=type] + [data-radio=type],
#locations li[data-radio=bg] + [data-radio=bg],
#locations li[data-radio=type] + [data-radio=type] {
  position: relative;
  margin-top: -12px;
}

#layers li[data-radio=bg] + [data-radio=bg]::before,
#layers li[data-radio=type] + [data-radio=type]::before,
#locations li[data-radio=bg] + [data-radio=bg]::before,
#locations li[data-radio=type] + [data-radio=type]::before {
  content: "";
  display: block;
  position: absolute;
  width: 4px;
  height: 4px;
  left: 34px;
  top: -4px;
  background-color: var(--ol-subtle-foreground-color);
  opacity: 0.5;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

#layers label {
  text-align: left;
  cursor: pointer;
  padding: 0 24px 0 12px;
}

#layers label i {
  display: inline-block;
  width: 48px;
  height: 24px;
  border-radius: 12px;
  vertical-align: middle;
  transition: 0.25s 0.09s;
  position: relative;
  background-color: var(--ol-subtle-background-color);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
  margin-right: 8px;
}

#layers label em {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 8px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
}

#layers label span {
  opacity: 0.7;
  transition: 0.1s;
}

#layers label i:after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--ol-background-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  position: absolute;
  top: 2px;
  left: 26px;
  transition: 0.15s;
}

#layers label > input {
  display: none;
}

#layers label > input:checked + i {
  background-color: var(--ol-brand-color);
}

#layers label > input:checked + i + span {
  opacity: 1;
}

#layers label > input:checked + i:after {
  transform: translateX(-24px);
}

#dates a {
  display: block;
  line-height: 40px;
  text-align: center;
  padding: 0 24px;
  color: var(--ol-subtle-foreground-color);
  background-color: var(--ol-background-color);
  border-radius: 20px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  margin: 16px 0 12px;
}

#dates ul {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

#dates li {
  display: block;
  line-height: 24px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--ol-subtle-foreground-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  color: var(--ol-background-color);
  padding: 0 16px;
}

nav {
  position: absolute;
  z-index: 10;
  bottom: 0;
  left: 0;
  right: 0;
  color: var(--ol-subtle-foreground-color);
  padding: 8px 0;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  background-color: var(--ol-background-color);
}

nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

nav li {
  flex-grow: 1;
  flex: 1;
  text-align: center;
}

nav a {
  display: block;
  text-decoration: none;
  padding: 0 4px;
  font-size: 14px;
}

nav dl {
  margin: 0;
  padding: 8px 0;
}

nav dt {
  font-size: 12px;
  line-height: 20px;
  color: var(--ol-subtle-foreground-color);
  margin-bottom: 4px;
}

nav dd {
  font-size: 16px;
  line-height: 20px;
  color: var(--ol-subtle-foreground-color);
  margin: 0;
  padding: 0;
}

#toast {
  position: absolute;
  z-index: 100;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-down) env(safe-area-inset-left);
  left: 8px;
  right: 8px;
  bottom: 8px;
}

#toast.hidden {
  display: none;
}

#toast p {
  padding: 8px 16px;
  text-align: center;
  background-color: var(--ol-brand-color);
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  color: var(--ol-background-color);
  max-width: 320px;
  margin: auto;
  font-size: 16px;
}

#toast.info p {
  background-color: var(--ol-brand-color);
}

#toast.error p {
  background-color: rgb(255, 94, 0);
}

#popup {
  position: absolute;
  left: -50px;
  bottom: 12px;
  background-color: var(--ol-background-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  min-width: 240px;
  max-width: 300px;
}

#popup h2 {
  margin: 0;
  padding: 8px 16px;
  line-height: 32px;
  font-size: 16px;
  font-weight: 600;
}

#popup dl {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  line-height: 24px;
  font-size: 14px;
  margin: 0;
  padding: 0;
  padding: 0 16px;
}

#popup dl + dl {
  margin-top: 4px;
}

#popup dt {
  font-weight: 600;
  width: 96px;
  opacity: 0.8;
  font-size: 10px;
}

#popup dd {
  margin: 0;
  padding: 0;
  font-size: 12px;
  text-wrap: nowrap;
}

#popup footer {
  text-align: right;
  padding: 8px 16px 16px;
  font-size: 14px;
}

#popup:before, #popup:after {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

#popup:after {
  border-top-color: var(--ol-background-color);
  border-width: 10px;
  left: 48px;
  margin-left: -10px;
}

#popup:before {
  border-top-color: rgba(0, 0, 0, 0.2);
  border-width: 11px;
  left: 48px;
  margin-left: -11px;
}

#popup .close {
  display: block;
  position: absolute;
  top: 2px;
  right: 8px;
  line-height: 30px;
  padding: 0 8px;
  opacity: 0.6;
  cursor: pointer;
}

#popup .close svg {
  vertical-align: middle;
}

.modal {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.modal h2 {
  margin: 0;
  padding: 16px 16px 8px;
  line-height: 32px;
  font-size: 20px;
  font-weight: 600;
}

.modal-content {
  position: relative;
  background-color: var(--ol-background-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.modal-close {
  position: absolute;
  right: 8px;
  top: 12px;
  font-size: 18px;
  line-height: 40px;
  width: 40px;
  text-align: center;
}

#report .modal-content {
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  margin: 8px auto;
}

#report .modal-content:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
  background-color: rgba(255, 255, 255, 0);
  border-radius: 8px;
  transition: background-color 0.3s;
}

#report[data-status=loading] .modal-content:after {
  background-color: rgba(255, 255, 255, 0.9);
  pointer-events: all;
}

#report main {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

@media (min-aspect-ratio: 6/4) {
  #report main {
    flex-direction: row;
  }
}

#report form {
  padding: 0 16px 16px;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

@media (max-width: 540px) {
  #report form {
    gap: 8px;
    justify-content: flex-end;
    flex-direction: column;
    align-items: flex-end;
  }
}

#report label {
  margin-right: 8px;
}

#report .select {
  position: relative;
  display: inline-block;
}

#report .select svg {
  position: absolute;
  right: 8px;
  top: 10px;
  fill: var(--ol-subtle-foreground-color);
  pointer-events: none;
}

#report select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 80px;
  font-size: 16px;
  line-height: 24px;
  height: 32px;
  padding: 4px 32px 4px 8px;
  border: 1px solid var(--ol-subtle-foreground-color);
  border-radius: 8px;
  background-color: var(--ol-accent-background-color);
}

#report-print {
  position: absolute;
  right: 48px;
  top: 12px;
  font-size: 18px;
  line-height: 40px;
  width: 40px;
  text-align: center;
}

#report-map {
  pointer-events: none;
  flex-grow: 1;
  padding: 16px;
}

#report-chart {
  flex-grow: 1;
  position: relative;
}

#report-chart canvas {
  position: absolute;
  top: 0;
  left: 0;
}

#dates-modal {
  padding: 8px;
}

#dates-modal .modal-content {
  max-width: 400px;
  max-height: 640px;
  margin: 32px auto;
  padding-bottom: 8px;
}

#dates-modal .modal-content > ul {
  overflow: auto;
}

#dates-modal .modal-content > ul > li .current {
  background-color: rgba(0, 0, 0, 0.1);
}

#dates-modal .modal-content > ul > li ul {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

#dates-modal .modal-content > ul > li li {
  line-height: 20px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--ol-subtle-foreground-color);
  color: var(--ol-background-color);
  padding: 0 12px;
}

#dates-modal .modal-content > ul > li + li {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#dates-modal ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#dates-modal a {
  display: block;
  text-decoration: none;
  color: var(--ol-primary-color);
  padding: 4px 16px 10px;
}

#dates-modal a span {
  display: block;
  line-height: 32px;
  font-size: 18px;
}

.legend {
  display: none;
  position: absolute;
  z-index: 10;
  right: 8px;
  bottom: 8px;
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff, 0 0 8px #fff;
  font-weight: 600;
  color: var(--ol-subtle-foreground-color);
}

.legend h2 {
  font-size: 16px;
  line-height: 20px;
  margin: 0 0 4px;
  padding: 0;
}

.legend ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  margin: 0;
  padding: 0;
}

.legend li {
  width: 32px;
  height: 24px;
  margin-bottom: 20px;
  position: relative;
}

.legend li:after {
  position: absolute;
  content: attr(data-label);
  font-size: 12px;
  bottom: -20px;
  text-wrap: nowrap;
}
