@font-face{
  font-family: "UAF Sans";
  src: url("./fonts/UAFSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "UAF Sans";
  src: url("./fonts/UAFSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "UAF Sans";
  src: url("./fonts/UAFSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "UAF Sans";
  src: url("./fonts/UAFSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root{
  --pad: 16px;
  --gap: 12px;
  --max: 1100px;

  --accent: #ffd54a;
  --bg: #0b0d10;
  --card: #12151a;
  --text: #e8eef6;
  --muted: #a9b4c2;
  --ring: rgba(255, 213, 74, 0.35);
}

.select-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 420px;
}

.select-wrap select {
  width: 100%;
  padding: 12px 48px 12px 14px;
  font-size: 16px;
  line-height: 1.3;
  border: 1px solid #888;
  border-radius: 10px;
  background: #fff;
  color: #111;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.select-wrap::after {
  content: "▼";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  color: #111;
  pointer-events: none;
}


*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: "UAF Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

input,
select,
button,
textarea{
  font-family: inherit;
}

#wrap{
  max-width: var(--max);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    var(--pad)
    calc(var(--pad) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

header.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px;
  margin: calc(-1 * (var(--pad) + env(safe-area-inset-top))) calc(-1 * var(--pad)) 0;
  background: rgba(11, 13, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-slot{
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-slot img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.title{
  font-family: "UAF Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel{
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

label.controls{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls span{
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.pick-row{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#pickSearch{
  width: 100%;
  font-size: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
}

#pickSearch::placeholder{
  color: rgba(169,180,194,0.75);
}

#pickSearch:focus{
  border-color: rgba(255,213,74,0.55);
  box-shadow: 0 0 0 4px var(--ring);
}

select#pick{
  width: 100%;
  font-size: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  outline: none;
}

select#pick:focus{
  border-color: rgba(255,213,74,0.55);
  box-shadow: 0 0 0 4px var(--ring);
}

#mapViewport{
  position: relative;
  flex: 1 1 auto;
  min-height: 360px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  touch-action: none;
  user-select: none;
  isolation: isolate;
}

#mapInner{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 1;
}

#svgObj{
  width: 100%;
  height: 100%;
  display: block;
}

#gestureLayer{
  position: absolute;
  inset: 0;
  z-index: 15;
  background: transparent;
  touch-action: none;
  cursor: grab;
}

#gestureLayer.dragging{
  cursor: grabbing;
}

.zoom-ui{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zoom-ui button{
  min-width: 56px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color .12s ease, transform .06s ease;
}

.zoom-ui button:hover{
  background: rgba(255,255,255,0.12);
}

.zoom-ui button:active{
  transform: translateY(1px);
}

.zoom-ui button:focus-visible{
  outline: none;
  border-color: rgba(255,213,74,0.55);
  box-shadow: 0 0 0 4px var(--ring);
}

.zoom-ui button:disabled{
  opacity: 0.45;
  cursor: default;
}

.combo{
  position: relative;
  width: 100%;
}

.combo #pickSearch{
  width: 100%;
  padding-right: 44px;
}

.combo-btn{
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 10px;
}

.combo-menu{
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  max-height: 280px;
  overflow: auto;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.combo.open .combo-menu{
  display: block;
}

.combo-item{
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.combo-item:hover,
.combo-item.active{
  background: rgba(255,213,74,0.14);
}

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px){
  #wrap{ gap: 16px; }
  header.topbar{ border-radius: 0 0 18px 18px; }
  .title{ font-size: 20px; }
  .panel{ padding: 14px; }
}

@media (max-width: 768px){
  #mapViewport{
    min-height: 320px;
  }

  .zoom-ui{
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    flex-direction: row;
    gap: 12px;

    padding: 8px;
    border-radius: 18px;
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.10);
  }

  .zoom-ui button{
    min-width: 78px;
    height: 64px;
    padding: 0;
    border-radius: 14px;
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
  }

  /* make symbols visually centered */
  #zoomIn,
  #zoomOut{
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 380px){
  .title{
    font-size: 16px;
  }

  .logo-slot{
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .zoom-ui button{
    min-width: 50px;
    height: 38px;
    font-size: 14px;
  }
}