:root {
  color-scheme: light;
  --map-ink: #161616;
  --map-muted: #626262;
  --map-line: #dedede;
  --map-paper: #ffffff;
  --map-soft: #f5f4f2;
  --map-accent: #a52222;
  --map-shadow: 0 20px 50px rgba(20, 20, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--map-soft);
  color: var(--map-ink);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.map-header {
  align-items: center;
  background: var(--map-paper);
  border-top: 3px solid var(--map-ink);
  border-bottom: 1px solid var(--map-line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 52px);
}

.map-brand {
  display: inline-flex;
  line-height: 0;
}

.map-brand img {
  display: block;
  height: 43px;
  max-width: min(240px, 60vw);
  object-fit: contain;
  object-position: left center;
  width: auto;
}

.map-back {
  border: 1px solid var(--map-line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 15px;
  text-decoration: none;
}

.map-back:hover,
.map-back:focus-visible {
  border-color: var(--map-ink);
}

.map-page {
  margin: 0 auto;
  max-width: 1500px;
  padding: clamp(18px, 3vw, 42px);
}

.map-card {
  background: var(--map-paper);
  border: 1px solid var(--map-line);
  border-radius: 18px;
  box-shadow: var(--map-shadow);
  overflow: hidden;
}

.map-intro {
  align-items: flex-end;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 34px);
}

.map-intro h1 {
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 4px 0 12px;
}

.map-intro p {
  color: var(--map-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 780px;
}

.map-kicker {
  color: var(--map-accent) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-source-state {
  background: #f0f0ee;
  border-radius: 999px;
  color: var(--map-muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
}

.map-source-state.is-ready {
  background: #e7f3e6;
  color: #275b2a;
}

.map-source-state.is-error {
  background: #f8e5e5;
  color: #7d1717;
}

.map-company-search {
  border-top: 1px solid var(--map-line);
  padding: 18px clamp(20px, 3vw, 34px);
}

.map-company-search label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.map-company-search div {
  display: flex;
  gap: 8px;
}

.map-company-search input {
  border: 1px solid #bbb;
  border-radius: 9px;
  flex: 1;
  font: inherit;
  min-width: 0;
  padding: 11px 13px;
}

.map-company-search button {
  background: var(--map-ink);
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 16px;
}

.map-company-search p {
  color: var(--map-muted);
  font-size: 12px;
  margin: 7px 0 0;
}

.map-stage {
  background: #e7e9e5;
  border-top: 1px solid var(--map-line);
  min-height: 520px;
  position: relative;
}

.peoplecheck-map {
  height: min(72vh, 820px);
  min-height: 520px;
  width: 100%;
}

.map-loading {
  align-items: center;
  background: rgba(248, 248, 246, 0.94);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 12px;
  inset: 0;
  justify-content: center;
  position: absolute;
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 3;
}

.map-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-loading.is-error {
  color: #7d1717;
  padding: 24px;
  text-align: center;
}

.map-loading-spinner {
  animation: map-spin 850ms linear infinite;
  border: 3px solid #d1d1cc;
  border-radius: 50%;
  border-top-color: var(--map-accent);
  height: 24px;
  width: 24px;
}

.map-loading.is-error .map-loading-spinner {
  display: none;
}

@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}

.map-noscript {
  background: #fff4d8;
  inset: auto 20px 20px;
  padding: 12px;
  position: absolute;
  z-index: 4;
}

.map-attribution-note {
  color: var(--map-muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 13px 4px 0;
}

.map-attribution-note a:hover,
.map-attribution-note a:focus-visible {
  color: var(--map-accent);
}

.maplibregl-ctrl-group {
  border-radius: 9px;
  overflow: hidden;
}

.maplibregl-popup-content {
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  max-width: 290px;
  padding: 14px 16px;
}

.peoplecheck-map-popup h2 {
  font-size: 16px;
  line-height: 1.25;
  margin: 0 0 7px;
}

.peoplecheck-map-popup p {
  color: var(--map-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 8px;
}

.peoplecheck-map-popup a {
  color: var(--map-accent);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .map-header {
    min-height: 62px;
  }

  .map-brand img {
    height: 36px;
  }

  .map-page {
    padding: 12px;
  }

  .map-card {
    border-radius: 12px;
  }

  .map-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .map-stage,
  .peoplecheck-map {
    height: calc(100vh - 270px);
    min-height: 420px;
  }

  .map-company-search div {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-loading,
  .map-loading-spinner {
    animation: none;
    transition: none;
  }
}
