#im-map,
.im-map-shell,
.im-map-card,
.im-legend,
.im-popup-card {
  box-sizing: border-box;
}

.im-map-shell {
  width: 100%;
  margin: 24px 0;
  color: #14233b;
  font-family: Arial, Helvetica, sans-serif;
}

.im-map-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 14px;
}

.im-kicker {
  margin: 0 0 4px;
  color: #0032A0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.im-title {
  margin: 0;
  color: #0f2545;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.im-map-note {
  max-width: 300px;
  color: #5a6b82;
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
}

.im-map-card {
  position: relative;
  padding: 8px;
  border: 1px solid rgba(147, 163, 184, 0.20);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(0, 169, 224, 0.10), transparent 36%),
    radial-gradient(circle at 78% 80%, rgba(0, 50, 160, 0.06), transparent 30%),
    #ffffff;
  box-shadow: 0 18px 45px rgba(8, 31, 61, 0.10);
}

#im-map {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(147, 163, 184, 0.14);
}

#im-map .mapboxgl-canvas {
  outline: none;
}

.im-map-ticker {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 31, 61, 0.94);
  box-shadow: 0 10px 28px rgba(8, 31, 61, 0.20);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  backdrop-filter: blur(10px);
}

.im-map-ticker__label {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #00A9E0;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.im-map-ticker__items {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #d9e7f7;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.im-map-ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: im-scroll-left linear infinite;
}

.im-map-ticker:hover .im-map-ticker__track {
  animation-play-state: paused;
}

.im-map-ticker__track a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-right: 48px;
  color: #f8fbff;
  text-decoration: none;
}

.im-map-ticker__track a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.im-map-ticker__track span {
  color: #66CBEC;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.im-map-ticker__track strong {
  font-weight: 750;
}

.im-map-search {
  position: absolute;
  top: 68px;
  left: 18px;
  z-index: 4;
  width: min(360px, calc(100% - 36px));
  font-family: Arial, Helvetica, sans-serif;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.im-map-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid rgba(147, 163, 184, 0.28);
  border-radius: 999px;
  outline: none;
  background:
    url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%235a6b82' d='M6.7 12.1a5.4 5.4 0 1 1 3.35-1.17l3.01 3.01-1.06 1.06-3.01-3.01a5.38 5.38 0 0 1-2.29.11Zm0-1.5a3.9 3.9 0 1 0 0-7.8 3.9 3.9 0 0 0 0 7.8Z'/%3E%3C/svg%3E") 14px center / 16px 16px no-repeat,
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(8, 31, 61, 0.12);
  color: #14233b;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.im-map-search input:focus {
  border-color: rgba(0, 169, 224, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 169, 224, 0.18), 0 8px 22px rgba(8, 31, 61, 0.12);
}

.im-map-search__results {
  margin-top: 6px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(8, 31, 61, 0.16);
}

.im-map-search__result {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(147, 163, 184, 0.18);
  background: transparent;
  color: #14233b;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.im-map-search__result:hover,
.im-map-search__result:focus {
  background: #f1f7ff;
}

.im-map-search__result span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.im-map-search__result em,
.im-map-search__empty {
  display: block;
  margin-top: 3px;
  color: #5a6b82;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.im-map-search__empty {
  margin: 0;
  padding: 10px 12px;
}

@keyframes im-scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.im-legend {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  width: min(260px, calc(100% - 36px));
  padding: 12px 14px;
  color: #14233b;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(147, 163, 184, 0.24);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(8, 31, 61, 0.10);
  font-family: Arial, Helvetica, sans-serif;
  backdrop-filter: blur(10px);
}

.im-legend__title {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.im-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.25;
}

.im-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(8, 31, 61, 0.18);
}

.im-dot--new {
  background: #00A9E0;
}

.im-dot--expansion {
  background: #43B02A;
}

.im-dot--construction {
  background: #FF8200;
}

.im-dot--completed {
  background: #2CCCD3;
}

.im-dot--other {
  background: #9fb0c2;
}

.im-legend__scale {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(147, 163, 184, 0.25);
  color: #5a6b82;
  font-size: 11px;
}

.im-scale-dot {
  display: inline-block;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #00A9E0;
  box-shadow: 0 0 0 1px rgba(8, 31, 61, 0.18);
}

.im-scale-dot--sm {
  width: 7px;
  height: 7px;
}

.im-scale-dot--md {
  width: 10px;
  height: 10px;
}

.im-scale-dot--lg {
  width: 13px;
  height: 13px;
}

.im-scale-label {
  margin-left: 2px;
}

#im-map .mapboxgl-popup-content {
  padding: 0;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(8, 31, 61, 0.22);
  overflow: hidden;
}

#im-map .mapboxgl-popup-close-button {
  top: 6px;
  right: 8px;
  color: #64748b;
  font-size: 20px;
}

.im-popup-card {
  min-width: 280px;
  max-width: 360px;
  padding: 18px 20px 17px;
  border-top: 5px solid #007bff;
  color: #14233b;
  font-family: Arial, Helvetica, sans-serif;
}

.im-popup-card__eyebrow {
  margin-bottom: 7px;
  color: #0032A0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.im-popup-card__title {
  display: block;
  color: #14233b;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.im-popup-card__title:hover {
  color: #0032A0;
}

.im-popup-card__meta {
  margin-top: 8px;
  color: #5a6b82;
  font-size: 13px;
  line-height: 1.35;
}

.im-popup-card__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.im-popup-card__stats span {
  min-width: 92px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f1f6fc;
}

.im-popup-card__stats strong {
  display: block;
  color: #14233b;
  font-size: 17px;
  line-height: 1;
}

.im-popup-card__stats em {
  display: block;
  margin-top: 3px;
  color: #68788f;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.im-popup-card__link {
  display: inline-block;
  margin-top: 14px;
  color: #0032A0;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.im-popup-card__link:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .im-map-shell {
    margin: 18px 0;
  }

  .im-map-header {
    display: block;
  }

  .im-map-note {
    margin-top: 8px;
    max-width: none;
    text-align: left;
  }

  .im-map-card {
    padding: 6px;
    border-radius: 20px;
  }

  .im-map-ticker {
    top: 12px;
    left: 12px;
    right: 12px;
    min-height: 34px;
    border-radius: 14px;
  }

  .im-map-ticker__label {
    padding: 0 10px;
    font-size: 10px;
  }

  .im-map-ticker__items {
    font-size: 12px;
  }

  .im-map-ticker__track a {
    gap: 12px;
    margin-right: 34px;
  }

  .im-map-search {
    top: 54px;
    left: 12px;
    width: min(320px, calc(100% - 24px));
  }

  .im-map-search input {
    height: 34px;
    font-size: 12px;
  }

  #im-map {
    aspect-ratio: 4 / 3;
    border-radius: 16px;
  }

  .im-legend {
    left: 12px;
    bottom: 12px;
    padding: 12px;
  }
}
