:root {
  --coverage-bg: #183d6d;
  --call: #183d6d;
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --red: #e30613;
  --red-dark: #c10510;
  --wa: #1f8a3b;
  --wa-bg: #a4e8bd;
  --line: #e6e6e6;
  --bg: #f4f4f4;
  --paper: #ffffff;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: #fff;
  padding: 8px 12px;
}

/* Page */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.coverage {
  background: var(--coverage-bg);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.coverage-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin: 0 0 4px;
}

.coverage h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.coverage p {
  margin: 0;
  color: #d8d8d8;
  max-width: 62ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 14px;
  border: 0;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn svg circle {
  fill: currentColor;
  stroke: none;
}

.btn.btn-call,
.leaflet-container a.btn-call,
.gm-style a.btn-call {
  background: var(--call);
  color: #fff;
}

.btn.btn-call:hover,
.leaflet-container a.btn-call:hover,
.gm-style a.btn-call:hover {
  background: #0e294d;
  color: #fff;
}

.btn.btn-wa,
.leaflet-container a.btn-wa,
.gm-style a.btn-wa {
  background: var(--wa-bg);
  color: #083514;
}

.btn.btn-wa:hover,
.leaflet-container a.btn-wa:hover,
.gm-style a.btn-wa:hover {
  background: #1ebe5a;
  color: #083514;
}

.btn.btn-mail,
.leaflet-container a.btn-mail,
.gm-style a.btn-mail {
  background: #ececec;
  color: var(--ink);
}

.btn.btn-mail:hover,
.leaflet-container a.btn-mail:hover,
.gm-style a.btn-mail:hover {
  background: #dedede;
  color: var(--ink);
}

.btn-maps,
.leaflet-container a.btn-maps,
.gm-style a.btn-maps {
  display: inline-block;
  margin-top: 10px;
  background: none;
  color: var(--red);
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0;
}

.btn-maps:hover,
.leaflet-container a.btn-maps:hover,
.gm-style a.btn-maps:hover {
  color: var(--red);
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 400px);
  gap: 18px;
  align-items: start;
}

.map-wrap {
  position: relative;
  background: #ddd;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 680px;
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 680px;
  background: #d9d9d9;
}

.map-caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
}

.map-caption.is-google {
  display: none;
}

.cards-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 680px;
  max-height: 680px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.cards-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 12px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field select {
  appearance: none;
  width: 100%;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path fill='%23111' d='M0 0l6 8 6-8z'/></svg>") no-repeat right 14px center;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 12px 40px 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
}

.field select:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cards-head {
  padding: 4px 16px 12px;
}

.cards-head h2 {
  margin: 0;
  font-size: 15px;
}

.cards-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.cards {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.card.is-active {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.card-top {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
}

.card-photo {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
}

.card-photo.is-logo {
  object-fit: contain;
  padding: 8px;
  background: #fafafa;
}

.card-body h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.card-role {
  margin: 3px 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.card-meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.card-actions .btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 6px;
  font-size: 12px;
}

.empty {
  padding: 24px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* InfoWindow / Leaflet popup */
.iw {
  font-family: var(--font);
  min-width: 240px;
  max-width: 280px;
  color: var(--ink);
}

.iw h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.iw .role {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.35;
}

.iw p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.iw .hours,
.iw-phone {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.iw-phone {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 10px;
}

.iw-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.iw-actions .btn {
  width: 100%;
  min-height: 38px;
  padding: 8px 4px;
  font-size: 11px;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.leaflet-bottom.leaflet-right {
  display: none !important;
}

.leaflet-popup-content {
  margin: 14px 14px 12px;
  min-width: 250px;
}

.gm-style .gm-style-iw-c {
  border-radius: 12px !important;
  padding: 12px !important;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .map-wrap,
  .cards-panel,
  #map {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  #map {
    height: 360px;
  }

  .map-wrap {
    min-height: 360px;
  }

  .coverage h1 {
    font-size: 22px;
  }

  .iw {
    min-width: 0;
    max-width: 280px;
  }

  .iw h3 {
    font-size: 13px;
    padding-right: 16px;
  }

  .iw .role {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .iw p {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .iw-phone {
    margin-bottom: 6px;
  }

  .iw-actions {
    gap: 6px;
  }

  .iw-actions .btn {
    min-height: 38px;
    padding: 8px 6px;
    font-size: 12px;
    gap: 4px;
    border-radius: 8px;
  }

  .iw-actions .btn svg {
    width: 14px;
    height: 14px;
  }

  .leaflet-popup-content-wrapper {
    border-radius: 10px;
  }

  .leaflet-popup-content {
    margin: 10px 12px 10px;
    min-width: 240px !important;
    width: auto !important;
  }

  .leaflet-container a.leaflet-popup-close-button {
    width: 18px;
    height: 18px;
    font-size: 16px;
    top: 2px;
    right: 4px;
  }

  .card {
    gap: 8px;
    padding: 10px;
  }

  .card-body h3 {
    font-size: 14px;
  }

  .card-role,
  .card-meta {
    margin-bottom: 4px;
  }

  .card-actions {
    gap: 8px;
  }

  .card-actions .btn {
    min-height: 46px;
    padding: 12px 8px;
    font-size: 13px;
    gap: 6px;
  }

  .card-actions .btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 16px 14px 36px;
  }

  .card-top {
    grid-template-columns: 64px 1fr;
  }

  .card-photo {
    width: 64px;
    height: 64px;
  }

  .card-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .card-actions .btn {
    min-height: 48px;
    font-size: 15px;
    padding: 12px 14px;
    gap: 8px;
  }
}
