/* style.css */
:root {
  --bg: #fff;
  --fg: #000;
  --brd: #00000014;
  --f-m: grayscale(1) contrast(1.2);
  --pad: 1rem;
  --h-size: 2.25rem;
}

body.dark {
  --bg: #000;
  --fg: #fff;
  --brd: #ffffff1f;
  --f-m: grayscale(1) invert(.9) contrast(1.2);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  overflow: hidden;
  color: var(--fg);
  height: 100vh;
  transition: background .3s;
  font-family: -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

#app {
  display: flex;
  position: relative;
  flex-direction: column;
  max-width: 32rem;
  height: 100%;
  margin: 0 auto;
}

header {
  padding: calc(.75rem + env(safe-area-inset-top)) var(--pad) .5rem;
  display: flex;
  z-index: 2000;
  position: relative;
  align-items:  center;
  gap: .5rem;
}

#theme-btn {
  width: var(--h-size);
  height: var(--h-size);
  border: .0625rem solid var(--brd);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  background: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
}

#q {
  height: var(--h-size);
  border: none;
  border-bottom: .0625rem solid var(--brd);
  color: var(--fg);
  outline: 0;
  background: none;
  flex: 1;
  padding: 0 .25rem;
  font-size: 1rem;
}

#gps {
  height: var(--h-size);
  border: .0625rem solid var(--brd);
  border-radius: calc(var(--h-size) / 2);
  opacity: .7;
  white-space: nowrap;
  display: flex;
  cursor: pointer;
  flex-shrink: 0;
  align-items:  center;
  padding: 0 .75rem;
  font-family: monospace;
  font-size: .75rem;
}

#res {
  position: absolute;
  top: 100%;
  left: var(--pad);
  right: var(--pad);
  background: var(--bg);
  border: .0625rem solid var(--brd);
  z-index: 3001;
  overflow-y: auto;
  display: none;
  border-radius: .5rem;
  max-height: 15rem;
}

.item {
  border-bottom: .0625rem solid var(--brd);
  cursor: pointer;
  padding: .75rem 1rem;
  font-size: .9rem;
}

.item:last-child {
  border: none;
}

main {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  flex: 1;
}

#cmp {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items:  center;
  min-height: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}

#arrow {
  fill: var(--fg);
  width: 50vw;
  max-width: 15rem;
  transition: transform .1s linear;
}

#map-box {
  overflow: hidden;
  border-top: 0 solid var(--fg);
  flex: 0;
  height: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}

#map {
  width: 100%;
  height: 100%;
}

.leaflet-layer {
  filter: var(--f-m);
}

.u-loc {
  background: var(--fg);
  border: .125rem solid var(--bg);
  border-radius: 50%;
  width: .75rem;
  height: .75rem;
}

footer {
  padding: 1.25rem var(--pad) calc(1.25rem + env(safe-area-inset-bottom));
  text-align: center;
  border-top: .0625rem solid var(--brd);
  cursor: pointer;
  background: var(--bg);
  flex-shrink: 0;
}

#inst {
  margin-bottom: .25rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

#dist {
  opacity: .6;
  letter-spacing: .02em;
  font-size: .875rem;
}

.map-up #cmp {
  opacity: .8;
  flex: 0 0 15vh;
  transform: scale(.4);
}

.map-up #map-box {
  border-top-width: .0625rem;
  flex: 1;
}
