.locations-page .container {
  max-width: min(99vw, 2200px);
}

.locations-page__intro {
  max-width: 760px;
}

.locations-page__eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.locations-page__title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.locations-page__subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

#map-container.locations-map-card,
.locations-map-card {
  width: min(92vw, 1780px);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-elevated);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.main-layout,
.locations-map-layout {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: stretch;
}

.locations-map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.locations-side-panel {
  display: flex;
  flex-direction: column;
  flex: 0 0 300px;
  width: 300px;
  gap: 16px;
  padding: 18px 18px 18px 0;
  border-left: 1px solid var(--border);
  background: var(--surface-elevated);
}

.locations-side-panel__card {
  position: static;
  width: 100%;
  min-width: 0;
  transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.locations-map {
  height: 88vh;
  width: 100%;
  min-height: 980px;
}

.locations-map .mapboxgl-control-container {
  font-family: var(--font-primary);
}

.locations-map .mapboxgl-ctrl-top-left {
  top: 16px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  z-index: 4;
}

.locations-map .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
  margin: 0;
}

.locations-map .mapboxgl-ctrl-geocoder {
  width: 100%;
  max-width: none;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  font-family: var(--font-primary);
}

.locations-map .mapboxgl-ctrl-geocoder--input {
  height: 48px;
  padding-left: 46px;
  color: #0f172a;
  font-family: var(--font-primary);
  font-size: 15px;
}

.locations-map .mapboxgl-ctrl-geocoder--icon-search {
  top: 50%;
  transform: translateY(-50%);
}

.locations-map .mapboxgl-ctrl-geocoder--input::placeholder {
  color: #64748b;
}

.locations-map .mapboxgl-ctrl-geocoder .suggestions {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.locations-map .mapboxgl-ctrl-group {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.locations-map .mapboxgl-popup-content {
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-primary);
  color: #000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.locations-map__popup-title {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
}

.locations-map__popup-type {
  margin: 0;
  font-size: 0.88rem;
  color: #000;
}

.locations-map__marker {
  width: 14px;
  height: 14px;
  padding: 0;
  appearance: none;
  border: 2px solid #fff;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.18);
}

.locations-map__marker--hq {
  width: 18px;
  height: 18px;
}

.legend-box {
  position: static;
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  color: #000;
  display: grid;
  gap: 8px;
  min-width: 204px;
  z-index: 2;
}

.locations-layer-panel {
  display: grid;
  gap: 14px;
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.locations-layer-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.locations-layer-panel__text {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.locations-layer-panel__text.is-error {
  color: #b42318;
}

.locations-layer-toggle {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.locations-layer-toggle.is-active {
  background: #eef5fb;
  border-color: rgba(47, 110, 165, 0.35);
  color: #1f4f7b;
}

.locations-layer-toggle__state {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.locations-climate-panel {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.locations-climate-panel__header,
.locations-climate-panel__list {
  display: grid;
  gap: 10px;
}

.locations-climate-panel__button {
  box-shadow: none;
}

.locations-climate-panel__field {
  display: grid;
  gap: 6px;
}

.locations-climate-panel__field.is-hidden {
  display: none;
}

.locations-climate-panel__label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.locations-climate-panel__select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  outline: none;
}

.locations-climate-panel__select:focus {
  border-color: rgba(47, 110, 165, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 110, 165, 0.12);
}

.locations-climate-slider {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.locations-climate-slider__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.locations-climate-slider__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #334155;
}

.locations-climate-slider__helper {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.locations-climate-slider__value {
  min-width: 44px;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.locations-climate-slider__input {
  width: 100%;
}

.locations-climate-slider__ticks {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  font-size: 10px;
  color: #64748b;
  text-align: center;
}

.locations-climate-legend {
  position: absolute;
  left: 24px;
  bottom: 146px;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: 148px;
  padding: 15px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
}

.locations-climate-legend__header {
  display: grid;
  gap: 3px;
}

.locations-climate-legend__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.locations-climate-legend__subtitle {
  font-size: 11px;
  color: #64748b;
}

.locations-climate-legend__scale {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: stretch;
  gap: 12px;
}

.locations-climate-legend__gradient {
  width: 22px;
  height: 178px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.locations-climate-legend__labels {
  display: grid;
  align-items: stretch;
  height: 178px;
}

.locations-climate-legend__label {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.locations-climate-legend__label.is-top {
  align-items: flex-start;
}

.locations-climate-legend__label.is-middle {
  align-items: center;
}

.locations-climate-legend__label.is-bottom {
  align-items: flex-end;
}

.locations-climate-legend__value,
.locations-climate-legend__unit {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.locations-climate-data-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  max-height: calc(100% - 48px);
  z-index: 2;
  width: min(860px, calc(100% - 48px));
  display: grid;
  grid-template-rows: auto auto auto minmax(300px, auto) minmax(300px, auto);
  align-content: start;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.locations-climate-data-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.locations-climate-data-panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.locations-climate-data-panel__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.locations-climate-data-panel__title {
  padding-right: 36px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.locations-climate-data-panel__meta {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.locations-climate-data-panel__chart-block {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 0;
}

.locations-climate-data-panel__chart-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.locations-climate-data-panel__chart-wrap {
  min-height: 0;
  height: 300px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
}

.locations-climate-data-panel__chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.locations-map__overlay-legend {
  position: static;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  min-width: 180px;
}

.locations-map__overlay-legend-list {
  display: grid;
  gap: 8px;
}

.locations-map__overlay-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #334155;
}

.locations-map__overlay-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.locations-map__overlay-legend-swatch.is-extremely-high {
  background: #f07c3e;
}

.locations-map__overlay-legend-swatch.is-high {
  background: #7366c6;
}

.locations-map__overlay-legend-swatch.is-medium-high {
  background: #4f8fd6;
}

.locations-map__overlay-legend-swatch.is-low-medium {
  background: #77d0ea;
}

.locations-map__overlay-legend-swatch.is-low {
  background: #d8f2f6;
}

.locations-map__overlay-legend-swatch.is-arid {
  background: #ead9c8;
}

.locations-map__overlay-legend-swatch.is-no-data {
  background: #d7d7d7;
}

.locations-map__overlay-legend-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 10px;
}

.locations-map__overlay-legend-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d8f0df 0%, #7cc8bb 50%, #2f6ea5 100%);
}

.locations-map__overlay-legend-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #475569;
}

.locations-map__overlay-popup {
  min-width: 220px;
}

.locations-map__overlay-popup-title {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.locations-map__overlay-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0;
  font-size: 12px;
}

.locations-map__overlay-popup-row span {
  color: #64748b;
}

.locations-map__overlay-popup-row strong {
  color: #0f172a;
  text-align: right;
}

.legend-box__title {
  font-weight: 600;
  margin-bottom: 2px;
}

.legend-box__item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-box__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-box__swatch--hq {
  background: #0b3b8f;
}

.legend-box__swatch--office {
  background: #1f77ff;
}

.legend-box__swatch--production {
  background: #18a957;
}

.locations-map__notice {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: #000;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.6;
  z-index: 3;
}

body.dark-mode .locations-map-card {
  background: var(--surface-elevated);
  border-color: var(--border);
}

body.dark-mode .legend-box,
body.dark-mode .locations-map .mapboxgl-popup-content,
body.dark-mode .locations-map__overlay-legend,
body.dark-mode .locations-layer-panel {
  background: #111;
  color: #f5f5f5;
}

body.dark-mode .locations-side-panel {
  border-left-color: var(--border);
}

body.dark-mode .locations-layer-toggle {
  border-color: rgba(255, 255, 255, 0.1);
  background: #111;
  color: #f8fafc;
}

body.dark-mode .locations-map .mapboxgl-ctrl-geocoder,
body.dark-mode .locations-map .mapboxgl-ctrl-geocoder .suggestions,
body.dark-mode .locations-map .mapboxgl-ctrl-geocoder .suggestions > li > a {
  background: #111;
  color: #f8fafc;
}

body.dark-mode .locations-map .mapboxgl-ctrl-geocoder {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.dark-mode .locations-map .mapboxgl-ctrl-geocoder--input {
  background: #111;
  color: #f8fafc;
}

body.dark-mode .locations-map .mapboxgl-ctrl-geocoder--input::placeholder,
body.dark-mode .locations-map .mapboxgl-ctrl-geocoder .suggestions .mapboxgl-ctrl-geocoder--suggestion-address {
  color: #cbd5e1;
}

body.dark-mode .locations-map .mapboxgl-ctrl-geocoder .suggestions > .active > a,
body.dark-mode .locations-map .mapboxgl-ctrl-geocoder .suggestions > li > a:hover {
  background: rgba(47, 110, 165, 0.28);
}

body.dark-mode .locations-climate-panel {
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .locations-layer-toggle.is-active {
  background: rgba(47, 110, 165, 0.2);
  border-color: rgba(124, 200, 187, 0.4);
  color: #d8f0df;
}

body.dark-mode .locations-climate-panel__select,
body.dark-mode .locations-climate-slider,
body.dark-mode .locations-climate-legend,
body.dark-mode .locations-climate-data-panel {
  background: rgba(17, 17, 17, 0.94);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .locations-climate-panel__label,
body.dark-mode .locations-climate-slider__label,
body.dark-mode .locations-climate-slider__value,
body.dark-mode .locations-climate-legend__title,
body.dark-mode .locations-climate-data-panel__title,
body.dark-mode .locations-climate-data-panel__chart-title {
  color: #f8fafc;
}

body.dark-mode .locations-climate-legend__gradient,
body.dark-mode .locations-climate-data-panel__chart-wrap,
body.dark-mode .locations-climate-data-panel__close {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .locations-climate-data-panel__close,
body.dark-mode .locations-climate-data-panel__chart-wrap {
  background: rgba(30, 41, 59, 0.58);
  color: #f8fafc;
}

body.dark-mode .locations-map__overlay-legend-title,
body.dark-mode .locations-map__overlay-popup-title,
body.dark-mode .locations-map__overlay-popup-row strong,
body.dark-mode .locations-layer-panel__title {
  color: #f8fafc;
}

body.dark-mode .locations-map__overlay-legend-scale,
body.dark-mode .locations-map__overlay-legend-item,
body.dark-mode .locations-map__overlay-popup-row span,
body.dark-mode .locations-layer-panel__text,
body.dark-mode .locations-layer-toggle__state,
body.dark-mode .locations-climate-slider__helper,
body.dark-mode .locations-climate-slider__ticks,
body.dark-mode .locations-climate-legend__subtitle,
body.dark-mode .locations-climate-legend__value,
body.dark-mode .locations-climate-legend__label,
body.dark-mode .locations-climate-legend__unit,
body.dark-mode .locations-climate-data-panel__meta,
body.dark-mode .locations-climate-data-panel__eyebrow {
  color: #cbd5e1;
}

body.dark-mode .locations-map__popup-type,
body.dark-mode .locations-map__notice {
  color: #f5f5f5;
}

body.dark-mode .locations-map__notice {
  background: rgba(17, 17, 17, 0.94);
}

@media (max-width: 1280px) {
  .locations-map {
    height: 82vh;
    min-height: 760px;
  }
}

@media (max-width: 767.98px) {
  .locations-map-layout {
    flex-direction: column;
  }

  .locations-side-panel {
    width: 100%;
    flex-basis: auto;
    padding: 18px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .locations-map {
    height: 60vh;
    min-height: 420px;
  }

  .locations-climate-slider {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px;
  }

  .locations-climate-legend {
    left: 12px;
    bottom: 120px;
    width: 118px;
    padding: 12px;
  }

  .locations-climate-legend__gradient {
    height: 140px;
  }

  .locations-climate-data-panel {
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(340px, calc(100% - 24px));
    padding: 16px;
  }

  .locations-climate-slider__top {
    flex-direction: column;
  }

  .locations-climate-slider__value {
    min-width: 0;
    text-align: left;
  }

  .locations-climate-slider__ticks {
    gap: 4px;
    font-size: 9px;
  }

  .legend-box {
    width: 100%;
  }
}
