@font-face {
  font-family: "Helvetica Neue";
  font-display: swap;
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/HelveticaNeue-Roman.otf") format("opentype");
}

@font-face {
  font-family: "Helvetica Neue";
  font-display: swap;
  font-style: normal;
  font-weight: 700;
  src: url("assets/fonts/HelveticaNeue-Bold.otf") format("opentype");
}

:root {
  color-scheme: light;
  --bg: #f7faf7;
  --clear: #12a43a;
  --danger: #ef2f2f;
  --ink: #14211f;
  --panel: rgba(255, 255, 255, 0.94);
  --top-offset: calc(112px + env(safe-area-inset-top));
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  width: 100%;
}

body {
  background: var(--bg);
  font-family:
    "Helvetica Neue",
    Arial,
    ui-sans-serif,
    system-ui,
    sans-serif;
  margin: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  inset: 0;
  overflow: hidden;
  position: fixed;
}

.map-stage {
  background: #f7faf7;
  bottom: 0;
  cursor: grab;
  isolation: isolate;
  left: 0;
  overflow: hidden;
  position: fixed;
  right: 0;
  touch-action: none;
  top: var(--top-offset);
  user-select: none;
}

.map-stage:active {
  cursor: grabbing;
}

.map-content {
  left: 0;
  position: absolute;
  top: 0;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 0 0;
  z-index: 1;
}

.map-svg {
  display: block;
  height: 100%;
  width: 100%;
  z-index: 1;
}

.map-svg path[stroke] {
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    stroke 0.2s ease,
    stroke-width 0.2s ease;
}

.map-svg .road-clear {
  stroke: var(--clear);
}

.map-svg .road-busy {
  stroke: var(--danger);
  stroke-width: 12;
}

.map-svg .city-clear {
  fill: var(--clear);
}

.map-svg .city-busy {
  fill: var(--danger);
}

.brand-bar {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(0, 126, 70, 0.15), rgba(0, 56, 35, 0.18)),
    url("assets/ui/top-bar-bg.jpg") center / cover;
  box-shadow: 0 8px 28px rgba(0, 53, 36, 0.2);
  display: flex;
  height: var(--top-offset);
  left: 0;
  padding: calc(18px + env(safe-area-inset-top)) 18px 18px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 8;
}

.brand-bar img {
  display: block;
  height: auto;
  max-height: 54px;
  max-width: min(520px, calc(100vw - 36px));
  width: 100%;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 18px;
  left: 24px;
  max-width: calc(100vw - 48px);
  position: fixed;
  top: calc(var(--top-offset) + 20px);
  z-index: 6;
}

.alerts-button {
  background: transparent;
  border: 0;
  display: block;
  height: 64px;
  padding: 0;
  width: 119px;
}

.alerts-button img {
  display: block;
  height: 100%;
  width: 100%;
}

.emergency-widget {
  aspect-ratio: 135 / 53;
  max-width: min(310px, 42vw);
  position: fixed;
  right: 24px;
  top: calc(var(--top-offset) + 20px);
  width: 310px;
  z-index: 6;
}

.emergency-panel {
  display: block;
  height: 100%;
  width: 100%;
}

.emergency-call {
  display: block;
  height: 35.85%;
  left: 6%;
  position: absolute;
  width: 14.07%;
}

.emergency-call img {
  display: block;
  height: 100%;
  width: 100%;
}

.emergency-call-109 {
  top: 11%;
}

.emergency-call-112 {
  top: 55%;
}

.alerts-panel {
  background: var(--panel);
  border: 1px solid rgba(20, 33, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(21, 49, 52, 0.2);
  color: var(--ink);
  left: 0;
  max-height: min(360px, calc(100dvh - var(--top-offset) - 118px));
  overflow: auto;
  position: absolute;
  top: 76px;
  width: min(340px, calc(100vw - 48px));
}

.alerts-header {
  align-items: center;
  border-bottom: 1px solid rgba(20, 33, 31, 0.1);
  display: flex;
  font-size: 14px;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 14px;
}

.alerts-header span {
  color: #66736f;
  font-size: 12px;
  font-weight: 700;
}

.alerts-list {
  display: grid;
  gap: 1px;
}

.alert-item {
  background: rgba(239, 47, 47, 0.06);
  display: grid;
  gap: 5px;
  padding: 12px 14px;
}

.alert-item strong {
  font-size: 14px;
}

.alert-item span {
  color: #65716c;
  font-size: 12px;
}

.alert-empty {
  color: #65716c;
  font-size: 14px;
  margin: 0;
  padding: 16px 14px;
}

.alert-warning {
  background: #fff4d6;
  color: #765b00;
  font-size: 13px;
  margin: 0;
  padding: 12px 14px;
}

.notify-button {
  background: transparent;
  border: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: block;
  height: 66px;
  left: 24px;
  padding: 0;
  position: fixed;
  right: 24px;
  z-index: 6;
}

.notify-button:disabled {
  opacity: 0.82;
}

.notify-button img {
  display: block;
  height: 100%;
  object-fit: fill;
  width: 100%;
}

@media (max-width: 640px) {
  :root {
    --top-offset: calc(82px + env(safe-area-inset-top));
  }

  .brand-bar {
    padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
  }

  .brand-bar img {
    max-height: 42px;
  }

  .top-actions {
    gap: 14px;
    left: 18px;
    max-width: calc(100vw - 36px);
    top: calc(var(--top-offset) + 18px);
  }

  .alerts-button {
    height: 54px;
    width: 101px;
  }

  .emergency-widget {
    max-width: 45vw;
    right: 18px;
    top: calc(var(--top-offset) + 18px);
    width: 210px;
  }

  .alerts-panel {
    top: 66px;
  }

  .notify-button {
    bottom: calc(18px + env(safe-area-inset-bottom));
    height: 58px;
    left: 18px;
    right: 18px;
  }

}
@media (hover: hover) and (pointer: fine) {
  .emergency-widget {
    display: none;
  }
}
